When I share my screen and enable video optimization using the enableOptimizeForSharedVideo function, I notice that the video sometimes still appears laggy for other participants.
I’m not sure why this happens — would like to know if there’s anything I can do or adjust to improve the video smoothness during screen sharing.
Hi @vic.yang, I’d like to know if there’s anything I can do to make screen sharing smoother when video optimization is enabled, as I’ll be sharing non-static content like YouTube videos and games.
After analyzing the logs, we found that this issue may be related to one of our technical limitations.
When the share privilege is set to 3 (MultipleShare – the default value), enabling optimized shared video is not supported. This is because MultipleShare allows multiple users to share simultaneously, making the optimization unable to function properly.
To enable it, you can first call stream.setSharePrivilege(2) to allow only one user to share the screen at a time, and then call stream.enableOptimizeForSharedVideo(true) to turn it on.
Thanks for looking into it. I followed the documentation and set SharePrivilege to 0, as I didn’t see any mention of 2. Could you please confirm whether it should be 0 or 2?
I did set SharePrivilege to 0 before calling stream.enableOptimizeForSharedVideo(true), but I still notice the shared video can be quite laggy at times.
When sharing system audio, the microphone audio is not muted, which can lead to audio echo issues.
In Video SDK Web, it provides the stream.isSupportMicrophoneAndShareAudioSimultaneously() method and the share-audio-change event. In the callback of this event, you can use the former method to determine whether the microphone audio is available.