SubsessionClient.closeAllSubsessions() Stops screen sharing

Description
I observed that when ever I close all the subsessions, the screen sharing is also stopped automatically. I don’t know if this is internally intended, but it doesn’t work well for us.

In my implementation, I am simply calling the ssClient.closeAllSubsessions(), as shown in the snippet below, but it stops the screen sharing and the content I was sharing.

Browser Console Error
There is no console error

Which Web Video SDK version?
1.9.5

Video SDK Code Snippets

const closeAllSubSessions = useCallback(async () => {
    if (ssClient) {
      setRetryOpeningSubsessions(false);
      await ssClient.closeAllSubsessions()
        .catch((err) => {
          console.log(err);

          if (err.reason === 'only host can do the operation') {
            message.error('Nur der Host kann den Vorgang ausführen');
          } else {
            message.error(err.reason)
          }
        });

      console.log('Done');
      console.log('retry-subs', retryOpeningSubsessions);
    }
  }, [ssClient, retryOpeningSubsessions]);

To Reproduce(If applicable)
Steps to reproduce the behavior:

  1. Open subsessions
  2. Host remains in the main session
  3. Host starts sharing screen
  4. Host closes all subsessions
  5. See error

Not to worry. I have found the issue. It was an internal call to stop screen share for participants leaving the sub-sessions to the main session.

I just removed that internal call to mediaStream.stopShareScreen() and it solved the issue. Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.