# Problem with obtaining self-video stream

**URL:** <https://devforum.zoom.us/t/problem-with-obtaining-self-video-stream/55947>\
**Category:** Web\
**Created:** [August 17, 2021, 4:03pm UTC](https://devforum.zoom.us/t/problem-with-obtaining-self-video-stream/55947 "2021-08-17T16:03:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/seth/32/30679_2.png) [@seth](https://devforum.zoom.us/u/seth)\
**Post date:** [August 17, 2021, 4:03pm UTC](https://devforum.zoom.us/t/problem-with-obtaining-self-video-stream/55947/1 "2021-08-17T16:03:30Z")

</div>

**Description**  
Zoom documentation says that proper way to render participant video is after ‘peer-video-state-change’ event is fired to call method "stream.renderVideo(…)

This works fine for other participants except for your own user/self. We would like to show local user video as well.

Our question is: Is there a zoom recommended way to do this, how should we render local-users video stream properly?

**Which Web Video SDK version?**  
1.1.3

**Additional context**

- Previously, before upgrading to 1.1.3, we used a workaround that worked until recently, presumably from restrictions introduced in Chrome 92, but we’re not entirely sure.
- We ended up with finding a different workaround by rendering local user camera directly from “navigator.mediaDevices.getUserMedia()”, but again, not sure if this is the preferred method.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 17, 2021, 4:24pm UTC](https://devforum.zoom.us/t/problem-with-obtaining-self-video-stream/55947/2 "2021-08-17T16:24:52Z")

</div>

Hey @seth ,

> [@seth](#):
>
> Zoom documentation says that proper way to render participant video is after ‘peer-video-state-change’ event is fired to call method "stream.renderVideo(…)
> 
> This works fine for other participants except for your own user/self. We would like to show local user video as well.

Make sure you are passing in the right userId to render the self video.

We also have local video and audio functions that can help: [https://marketplace.zoom.us/docs/sdk/video/web/essential/test#preview-media-devices](https://marketplace.zoom.us/docs/sdk/video/web/essential/test#preview-media-devices)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![ian-at-cadence](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ian-at-cadence/32/19735_2.png) [@ian-at-cadence](https://devforum.zoom.us/u/ian-at-cadence)\
**Post date:** [August 17, 2021, 5:06pm UTC](https://devforum.zoom.us/t/problem-with-obtaining-self-video-stream/55947/3 "2021-08-17T17:06:15Z")

</div>

Thanks for the quick reply @tommy. Jumping in real quick on Seth’s behalf…

stream.renderVideo(…) with self-userid is exactly what we did before 1.1.3. It stopped working with the update, presumably due to restrictions introduced in Chrome 92, but not sure.  
Are you saying it actually is supposed to work and we should investigate why it isn’t for us? Or are you recommending that we use localVideoTrack.start not only during preview but during the actual session as well?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 19, 2021, 9:21pm UTC](https://devforum.zoom.us/t/problem-with-obtaining-self-video-stream/55947/4 "2021-08-19T21:21:08Z")

</div>

Hey @ian-at-cadence ,

> [@ian-at-cadence](#):
>
> presumably due to restrictions introduced in Chrome 92

For Chrome 92, you can resolve the issue by enabling the Shared Array Buffer origin trial:

[https://marketplace.zoom.us/docs/sdk/native-sdks/web/advanced/web-isolation](https://marketplace.zoom.us/docs/sdk/native-sdks/web/advanced/web-isolation)

> [@ian-at-cadence](#):
>
> Are you saying it actually is supposed to work and we should investigate why it isn’t for us? Or are you recommending that we use localVideoTrack.start not only during preview but during the actual session as well?

Both should work. 🙂

Thanks,  
Tommy

---

<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:** [August 20, 2021, 3:37am UTC](https://devforum.zoom.us/t/problem-with-obtaining-self-video-stream/55947/5 "2021-08-20T03:37:50Z")

</div>

Hey @seth , @ian-at-cadence

Thanks for your feedback.

` localVideoTrack` is a wrapper of `navigator.mediaDevices`. It only renders video on the local side. If the peer side needs to receive the video stream. `stream.startVideo` is the correct way. The method returns a promise, once it is resolved, you can call the `stream.renderVideo` method. Following is the pseudocode：

```auto
async function startVideo(){
  await stream.startVideo();
  await stream.renderVideo(canvas,currentUserId,width,height,...)
}

```

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:** [September 19, 2021, 1:38pm UTC](https://devforum.zoom.us/t/problem-with-obtaining-self-video-stream/55947/6 "2021-09-19T13:38:00Z")

</div>

Closed on September 19, 2021, 1:38pm UTC

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