# Best Practice - Arranging User Videos in Container

**URL:** <https://devforum.zoom.us/t/best-practice-arranging-user-videos-in-container/50307>\
**Category:** Windows\
**Created:** [May 15, 2021, 12:26am UTC](https://devforum.zoom.us/t/best-practice-arranging-user-videos-in-container/50307 "2021-05-15T00:26:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brook.ballard](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/brook.ballard/32/27140_2.png) [@brook.ballard](https://devforum.zoom.us/u/brook.ballard)\
**Post date:** [May 15, 2021, 12:26am UTC](https://devforum.zoom.us/t/best-practice-arranging-user-videos-in-container/50307/1 "2021-05-15T00:26:27Z")

</div>

Looking for insight into best practice/approach to handling multiple user videos in a meeting. We are using CustomizedUI and currently create a handle of VideoContainers each of which holds a VideoRenderElement. As users join/leave the meeting, we subscribe these users to the available VideoRenderElements. When a new user needs to take over the spot, we subscribe the new users data.

It appears we do **not** need to call unsubscribe first - the new subscription seems to take over - but is this advisable? We have noticed that if unsubscribe is called, the users data is unsubscribed from **every** render element, so if we are swapping two user videos, we need to perform the unsub for both first before setting up a new sub, else the new sub gets cleared out when that users original element is cleared.

However, we have noticed that some times user videos get aligned with the wrong user data on our end, so wondering if the missing unsubscribe is an issue.

Also, from SDK doc - it seems like we could change our design to use a single VideoContainer and this could hold multiple VideoRenderElements… basically have the main meeting view act as the top level VideoContainer and just position the VideoRenderElements all within this container, to limit the amount of Create/Destroy calls.

Lastly - we occaisonally see users whos video is blank - no stream as well as no username/static image when the camera is off. In a meeting with 100 users, this happens for ~10 users, seemingly randomly. Any ideas as to cause here? We do not have any errors in our log - all SDK calls return success.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [May 17, 2021, 6:55pm UTC](https://devforum.zoom.us/t/best-practice-arranging-user-videos-in-container/50307/2 "2021-05-17T18:55:28Z")

</div>

Hey @brook.ballard,

Thanks for using the dev forum!

We do advise that you call unsubscribe first, as subscribing to a user tells the SDK where/who to send video data.

> [@brook.ballard](#):
>
> However, we have noticed that some times user videos get aligned with the wrong user data on our end, so wondering if the missing unsubscribe is an issue.

That would be guess as well.

> [@brook.ballard](#):
>
> Also, from SDK doc - it seems like we could change our design to use a single VideoContainer and this could hold multiple VideoRenderElements… basically have the main meeting view act as the top level VideoContainer and just position the VideoRenderElements all within this container, to limit the amount of Create/Destroy calls.

This should be possible.

> [@brook.ballard](#):
>
> Lastly - we occaisonally see users whos video is blank - no stream as well as no username/static image when the camera is off. In a meeting with 100 users, this happens for ~10 users, seemingly randomly. Any ideas as to cause here? We do not have any errors in our log - all SDK calls return success.

Hmm that is indeed strange. To investigate this one, we would need the SDK logs from an instance where this happened. If it is possible to obtain this in your environment please let me know and I will explain the next steps.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![brook.ballard](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/brook.ballard/32/27140_2.png) [@brook.ballard](https://devforum.zoom.us/u/brook.ballard)\
**Post date:** [May 18, 2021, 1:46pm UTC](https://devforum.zoom.us/t/best-practice-arranging-user-videos-in-container/50307/3 "2021-05-18T13:46:59Z")

</div>

Thanks Michael! If the issue occurs again I will capture and post SDK logs.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [May 18, 2021, 7:36pm UTC](https://devforum.zoom.us/t/best-practice-arranging-user-videos-in-container/50307/4 "2021-05-18T19:36:08Z")

</div>

Hey @brook.ballard,

Sounds good! I will keep a look out 🙂

Thanks!  
Michael

---

<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 18, 2021, 5:36am UTC](https://devforum.zoom.us/t/best-practice-arranging-user-videos-in-container/50307/5 "2021-06-18T05:36:31Z")

</div>

Closed on June 18, 2021, 5:36am UTC

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