Web Video SDK Screen Share View not displaying when joining a session after share has started

Description
When joining a screen share session from the web, the participant has to join the session prior to the share beginning to see the share view. If the share has already begun and then the participant joins, I’m not seeing any events coming through that would indicate that there’s an ongoing share.

While testing (since I know there’s an active screen share session going on) I’ve tried to force the start client.startShareView(canvas, userId) but I get an error in the console saying that the parameters are invalid.

Browser Console Error
There’s no error when joining. Nothing is showing up after joining the session (i.e. no events being logged or indication of a screen share).

Which Web Video SDK version?
"@zoom/videosdk": "^1.2.5"

Video SDK Code Snippets

/**
   * First check the browser compatibility.
   * Assuming the browser is fine, retrieve the query params that contain the
   * zoom topic and signature used to join the session.
   * Initialize the zoom client and join the session while watching for
   * a change in the screen share state.
   */
  joinSession() {
    this.compatible = this.isSupportWebCodecs();
    if (this.compatible) {
      this.route.queryParams.subscribe(async (params) => {
        this.signature = params['signature'];
        this.topic = params['topic'] || 'support';
        await this.zoomClient.init('en-US', 'Global');
        await this.zoomClient.join(this.topic, this.signature, this.profile?.givenName || 'Rep', this.topic);
        this.stream = this.zoomClient.getMediaStream();
        console.log(this.stream.getActiveShareUserId());
        this.zoomClient.on('active-share-change', (payload => this.shareStateChange(payload)));
        this.zoomClient.on('peer-share-state-change', payload => {
          console.log('peer state', payload);
        });
        this.zoomClient.on('connection-change', payload => {
          console.log('connection-change', payload);
        })
      });
    }
  }

  /**
   * On state change, hide or show the screen share.
   * @param payload The active video state
   */
  shareStateChange(payload): void {
    console.log(payload);
    if (payload.state === VideoActiveState.Active) {
      this.stream.startShareView(this.canvas, payload.userId);
    } else if (payload.state === VideoActiveState.Inactive) {
      this.stream.stopShareView();
    }
  }

To Reproduce
Steps to reproduce the behavior:

  1. Create a join a session as a host from the web
  2. Start the screen share
  3. As a participant in another browser, join the session using the appropriate signature and topic

Device (please complete the following information):

  • Device: Macbook Pro
  • OS: macOD 12.3
  • Browser: Chrome
  • Browser Version 100.0.4896.127 (Official Build) (x86_64)

Hey @kyle.wrenn

Thanks for your feedback.

For the case you mentioned, joining the session after the share has started, in Video SDK we provide an API stream.getActiveShareUserId(), if the return value is not 0, then you can use stream.startShareView(canvas,activeUserId) to render the shared content. If you are familiar with react, maybe our sample app is a good reference.

Thanks
Vic

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