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

**URL:** <https://devforum.zoom.us/t/web-video-sdk-screen-share-view-not-displaying-when-joining-a-session-after-share-has-started/68559>\
**Category:** Web\
**Created:** [May 5, 2022, 2:58pm UTC](https://devforum.zoom.us/t/web-video-sdk-screen-share-view-not-displaying-when-joining-a-session-after-share-has-started/68559 "2022-05-05T14:58:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyle.wrenn](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/kyle.wrenn/32/37444_2.png) [@kyle.wrenn](https://devforum.zoom.us/u/kyle.wrenn)\
**Post date:** [May 5, 2022, 2:58pm UTC](https://devforum.zoom.us/t/web-video-sdk-screen-share-view-not-displaying-when-joining-a-session-after-share-has-started/68559/1 "2022-05-05T14:58:14Z")

</div>

**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**

```auto
/**
   * 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)

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [May 6, 2022, 6:25am UTC](https://devforum.zoom.us/t/web-video-sdk-screen-share-view-not-displaying-when-joining-a-session-after-share-has-started/68559/2 "2022-05-06T06:25:36Z")

</div>

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](https://github.com/zoom/sample-app-videosdk/tree/master/react-demo) is a good reference.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 5, 2022, 4:26pm UTC](https://devforum.zoom.us/t/web-video-sdk-screen-share-view-not-displaying-when-joining-a-session-after-share-has-started/68559/3 "2022-06-05T16:26:35Z")

</div>

Closed on June 5, 2022, 4:26pm UTC

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