Troubleshooting Timeout Errors When Rendering Screen-Sharing Streams from an Electron App to Web Browsers Using the Azure Communication Services Calling SDK

Nguyen Van Tung 0 Reputation points
2025-11-12T08:20:10.8133333+00:00

On our Electron App, we handle screen sharing as follows: When the screen-sharing session starts, all users who are already present in the Room on Web Browsers receive the shared screen stream normally. The stream is rendered and displayed correctly using the VideoStreamRenderer API.

However, when a new user joins the Room or an existing user reloads the page, a timeout error occurs while rendering the screen-sharing stream. It appears that the Azure Communication Services (ACS) Calling SDK does not deliver the screen-sharing stream to these users in such cases.

We would like to ask the ACS development team for clarification on the root cause and recommended solutions or workarounds for this issue.

          const inputSources = await desktopCapturer.getSources({ types: ['screen'] });
          const constraints: any = {
            audio: false,
            video: {
              mandatory: {
                chromeMediaSource: 'desktop',
                chromeMediaSourceId: inputSources[0].id,
              }
            }
          };
          const stream = await navigator.mediaDevices.getUserMedia(constraints);
          this.call.startScreenSharing(new LocalVideoStream(stream));

/**Version SDK:
    "@azure/communication-calling": "^1.38.1",
    "@azure/communication-calling-effects": "^1.1.4",
    "@azure/communication-common": "^2.4.0",
    "@azure/communication-identity": "^1.3.1",
**/
Azure Communication Services
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-12T08:20:27.3233333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    When a new user joins the room or an existing user reloads the page, the timeout error while rendering the screen-sharing stream may be related to the createView timeout failures in the Azure Communication Services (ACS) Calling SDK. Here are some potential causes and recommended workarounds:

    1. Network Issues: If the video sender (the user sharing the screen) has network issues, it could lead to a failure in the video subscription for new users. Ensure that the sender has a stable network connection.
    2. Video Sender Dropped from Call: If the video sender unexpectedly drops from the call, other participants may not receive the video frames, leading to a timeout error. This can happen if the sender terminates the browser process instead of hanging up. Ensure that the sender properly ends the call.
    3. Retry Mechanism: Implement a retry mechanism for invoking the createView API. If a timeout occurs, continuously retry until it succeeds. This can help in scenarios where there are temporary network issues.
    4. User Interface Notifications: Consider implementing a mechanism to notify users when the sender's browser goes to the background or when there are network issues. This can help manage expectations and improve the user experience.
    5. Monitor Network Quality: Monitor the network quality and media status. If the network performance degrades, you might want to automatically turn off incoming video streams to maintain call quality.

    These strategies should help mitigate the timeout errors when rendering screen-sharing streams in your Electron app using the ACS Calling SDK.


    References:


  2. Nguyen Van Tung 0 Reputation points
    2025-11-12T08:31:31.05+00:00

    We would like to know if there are any specific solutions or workarounds for this issue. The problem only occurs when the screen is shared from the Electron App to Web Browser users. When the screen is shared from Web Browsers, it works correctly without any errors.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.