Screen Share Video Lagging Even with enableOptimizeForSharedVideo Enabled

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.

Hey @devtesting492

Thanks for your feedback.

Could you share some problematic session IDs with us for troubleshooting purposes?

Thanks
Vic

Hi @vic.yang

Here are the session IDs — really appreciate your help in taking a look at these:

  • NHXyHb2lSYWR9hmnHpZXyA==
  • deZPL3XPQGurfXi5YYprOA==
  • hFD4Wz2UTwixCshpgVzSMw==

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.

Hey @devtesting492

  • NHXyHb2lSYWR9hmnHpZXyA==
  • deZPL3XPQGurfXi5YYprOA==
  • hFD4Wz2UTwixCshpgVzSMw==

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
Vic

Hi @vic.yang

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?

Hey @devtesting492

Sorry for the mistake, it’s 0 instead of 2.

Thanks
Vic

Hi @vic.yang

I did set SharePrivilege to 0 before calling stream.enableOptimizeForSharedVideo(true), but I still notice the shared video can be quite laggy at times.

Is there anything we can do to make it smoother?

Hey @devtesting492

Could you share the latest session IDs with us for troubleshooting ?

Thanks
Vic

Hi @vic.yang

You can check this session IDs:

  • A+NUoPuJSHGm9tWwkd5gwA==
  • uVaYdu0xQqm9UKVC9LzO4Q==

The video quality is fine at first, but after a while it drops — becoming laggy and blurry — before returning to normal again.

Hi @vic.yang

I have a question. When I share a Window and enable “Also share system audio”, I get this error when I turn on my mic:

{
    "type": "INVALID_OPERATION",
    "reason": "Cannot unmute audio during sharing with audio",
    "errorCode": 6014
}

Is this the expected behavior?

Hi @devtesting492

It’s by design.

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.

Thanks
Vic

Hi @vic.yang

I’d really appreciate your help in checking these sessions.

Please let me know if there’s any way to make the optimization more stable.

Hey @devtesting492

  • A+NUoPuJSHGm9tWwkd5gwA==
  • uVaYdu0xQqm9UKVC9LzO4Q==

We are analyzing the logs and will keep you updated if we find the cause.

Thanks
Vic