Hi @Sandeep Reddy Gomaram ,
I understand that you are facing multiple issues with screen sharing and video rendering in the GA version (1.31.2) of the @azure/communication-calling SDK in the Electron-based desktop application.
- In Beta versions, you can pass a
LocalVideoStream
to startScreenSharing(stream)
, but in the GA version, screen sharing is managed internally using SDK. Now, you need to call startScreenSharing()
without arguments.
await call.startScreenSharing();
This will prompt the user to select a screen or window for sharing.
- Using Electron, if you want to capture a custom
HTMLVideoElement
and attach it use this.
const mediaStream = await navigator.mediaDevices.getDisplayMedia({ video: true });
const screenVideoStream = new LocalVideoStream(mediaStream.getVideoTracks()[0]);
await call.startScreenSharing(); // No need to pass a stream manually
// Render preview in your app
const renderer = new VideoStreamRenderer(screenVideoStream);
const view = await renderer.createView();
document.getElementById('localScreenShareContainer').appendChild(view.target);
Error Message:
CallingCommunicationError: Failed to start video, error requesting media stream.
- On macOS, go to System Preferences > Security & Privacy > Screen Recording and allow the Electron app.
- On Windows, check Camera & Microphone permissions are enabled in Privacy Settings.
Check you are using Electron 19+ (earlier versions might not support getDisplayMedia()
). Run npx electron -v
If outdated, update with npm install electron@latest
.
If another app (Zoom, Teams, Google Meet) is already using screen capture, try closing it and retrying. Try Manually Capturing the Stream Before Calling startScreenSharing()
.
const mediaStream = await navigator.mediaDevices.getDisplayMedia({ video: true });
console.log('Screen share stream acquired:', mediaStream);
await call.startScreenSharing();
If this fails, the problem is system-level (permissions, browser compatibility).
Failed to render video stream, rendering timed out while waiting for video frames. Please try again, if issue persists, contact Azure Communication Services support. (code=408)
Check If the Remote Participant Is Sending Video. If isAvailable
is false
, the participant is not sending video.
if (!remoteVideoStream.isAvailable) {
console.error('Remote video stream is not available.');
}
Retry Rendering After a Delay Modify the createView()
call like this:
async function renderRemoteVideo(remoteVideoStream) {
try {
const videoStreamRenderer = new VideoStreamRenderer(remoteVideoStream);
const view = await videoStreamRenderer.createView();
remoteVideoContainer.hidden = false;
remoteVideoContainer.style.display = 'block';
remoteVideoContainer.appendChild(view.target);
} catch (error) {
console.error('Retrying video render after timeout...');
setTimeout(() => renderRemoteVideo(remoteVideoStream), 2000); // Retry after 2 seconds
}
}
Hope it helps!
Please do not forget to click "Accept the answer” and Yes
wherever the information provided helps you, this can be beneficial to other community members.

If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.