Screen share view not reverting to previous sharer after another user stops sharing, just showing the black screen

We’re experiencing an issue with Zoom Video SDK (Web) where the screen share view does not correctly revert back to a previously active sharer when multiple users share sequentially.

Steps to Reproduce

  1. User A starts screen sharing — everything works correctly (A’s share visible).
  2. User B starts screen sharing — the view switches correctly to B’s share.
  3. User B stops sharing — the SDK triggers peer-share-state-change with action: "Stop".
  4. Expected: The view should automatically revert to User A’s still-active share.
  5. Actual: The view area becomes blank, even though getAllUser() still reports User A as sharing.

Expected Behavior

After User B stops sharing, the Video SDK should automatically (or via a consistent event) allow the client to re-attach to the remaining active sharer (User A) without showing a blank view.

Actual Behavior

  • The peer-share-state-change event fires with { userId: B, action: "Stop" }.
  • zmClient.getAllUser() still shows User A as sharing: true.
  • However, the rendered stream object for A’s share becomes invalid until the share is manually restarted or the client reconnects.

Environment

Property Value
SDK Zoom Video SDK – Web
Version (^2.2.12)
Browser Chrome specific, works on firefox
OS Ubuntu / macOS 13
Framework React (using functional hooks)
Reproduction Code Snippet Provided below

Code Snippet (Simplified)

useEffect(() => {
  const handleUserShareStatus = ({ userId, action }) => {
    console.log('[peer-share-state-change]', userId, action);
    if (action === 'Stop') {
      const sharers = zmClient.getAllUser()?.filter(u => u.sharing);
      console.log('Still sharing users:', sharers);
    }
  };

  zmClient.on('peer-share-state-change', handleUserShareStatus);
  return () => zmClient.off('peer-share-state-change', handleUserShareStatus);
}, []);

Even though getAllUser() shows the previous sharer (A) as sharing, there’s no visual stream shown in the ShareView.


Questions / Clarification Needed

  1. Is there a reliable event or state update that fires when another user’s share remains active after someone else stops sharing?
  2. Do we need to manually call any stream.subscribeShare(userId) or re-render logic after a Stop event?
  3. Could this be a known issue in the current Web SDK version when switching between sequential sharers?

1 Like

Hey @Bhavesh2

Thanks for your feedback.

I’m not sure which method you’re using to render the share view — stream.startShareView or stream.attachShareView. These two handle share view switching differently. If your scenario only requires rendering one active share view, you can listen to the active-share-change event, where the payload will indicate whether the state is Active or Inactive. You can refer to the example at Video SDK - web - Core features for handling share view rendering.

Additionally, if you want to know whether there are other users currently sharing their screens, you can use stream.getActiveShareUserId() or stream.getShareUserList() to retrieve that information.

Thanks
Vic

Hi Vic,

Thanks for the guidance!

  • We listen to the active-share-change event to track which share is active
  • We use stream.attachShareView() for video-player mode and stream.startShareView() for canvas mode
  • We use mediaStream.getActiveShareUserId() and client.getAllUser() with user.sharerOn to identify sharing users

Your reply was very helpful in confirming our approach is correct.

Appreciate the quick response and documentation reference!

Thanks,
Bhavesh

1 Like

Yes this is a known issue in the Zoom Video SDK (Web v2.2.12). After one sharer stops, the SDK doesn’t auto-restore the previous stream. You need to manually call stream.subscribeShare(activeUserId) again when you detect another user is still sharing.

1 Like