# Self view and participant view in same canvas

**URL:** <https://devforum.zoom.us/t/self-view-and-participant-view-in-same-canvas/106227>\
**Category:** Video SDK\
**Created:** [March 21, 2024, 12:28pm UTC](https://devforum.zoom.us/t/self-view-and-participant-view-in-same-canvas/106227 "2024-03-21T12:28:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thoufic](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@thoufic](https://devforum.zoom.us/u/thoufic)\
**Post date:** [March 21, 2024, 12:28pm UTC](https://devforum.zoom.us/t/self-view-and-participant-view-in-same-canvas/106227/1 "2024-03-21T12:28:45Z")

</div>

We are trying to integrate the Zoom Video SDK (Version 1.10.7) into our application and are not able to resize or overlap the self view and participant view. The expected result, where the self-view is smaller and overlaps the remote view?

Zoom Video SDK Version (1.10.7) has a single canvas showing both the self and remote view due to which we are not able to separate and resize the self view and remote view.

**Code reference** : [GitHub - zoom/videosdk-web-sample: Zoom Video SDK web sample](https://github.com/zoom/videosdk-web-sample/tree/master)

---

<div class="post-metadata">

**Author:** ![ekaansh.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ekaansh.zoom/32/55004_2.png) [@ekaansh.zoom](https://devforum.zoom.us/u/ekaansh.zoom)\
**Post date:** [March 21, 2024, 1:59pm UTC](https://devforum.zoom.us/t/self-view-and-participant-view-in-same-canvas/106227/2 "2024-03-21T13:59:36Z")

</div>

Hey @thoufic  
Have you tried rendering the local video after you’ve rendered the remote videos?

Here’s a [gist](https://gist.github.com/EkaanshArora/5f4774f3b508150d93aae1701f52adcc) of how that would work:

```auto
await client.join(topic, token, username);
const mediaStream = client.getMediaStream();
await mediaStream.startVideo();

// render remote videos
const usersWithVideo = client.getAllUser().filter(e => e.bVideoOn);
const numberOfUser = usersWithVideo.length;
for await (const [index, user] of usersWithVideo.entries()) {
  const { x, y } = getVideoXandY(index, numberOfUser);
  // I'm using client.on("peer-video-state-change") event to call this block to check new/existing user you can use state
  if (event.userId === user.userId && user.bVideoOn) {
    // if it's a new user, render the video
    await mediaStream.renderVideo(videoCanvas, user.userId, vidWidth, vidHeight, x, y, 2);
  } else if (user.bVideoOn) {
    // if it's an existing user, adjust the position of the video
    await mediaStream.adjustRenderedVideoPosition(videoCanvas, user.userId, vidWidth, vidHeight, x, y).catch(e => console.log(e));
  }
}

// render self video at x:0, y:0
await mediaStream.renderVideo(videoCanvas, client.getCurrentUserInfo().userId, vidWidth, vidHeight, 0, 0, 2);
// or await mediaStream.adjustRenderedVideoPosition(videoCanvas, client.getCurrentUserInfo().userId, vidWidth, vidHeight, 0, 0);

```
