# ActiveVideoUnit remains black (empty) the second time

**URL:** <https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538>\
**Category:** Android\
**Created:** [November 30, 2022, 1:47pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538 "2022-11-30T13:47:47Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [November 30, 2022, 1:47pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/1 "2022-11-30T13:47:47Z")

</div>

```auto
MobileRTCVideoView videoView

void showActiveUser() {
        MobileRTCVideoViewManager activeVideoViewManager = videoView.getVideoViewManager();
        if (activeVideoViewManager != null) {
            activeVideoViewManager.removeAllVideoUnits();
           MobileRTCVideoUnitRenderInfo renderInfo = new MobileRTCVideoUnitRenderInfo(0, 0, 100, 100);
            renderInfo.is_username_visible = true;
            renderInfo.is_show_audio_off = false;
            renderInfo.is_border_visible = false;
            boolean result = activeVideoViewManager.addActiveVideoUnit(renderInfo);
        }
}

void showSpecificUser(long userId) {
        MobileRTCVideoViewManager activeVideoViewManager = videoView.getVideoViewManager();
        if (activeVideoViewManager != null) {
            activeVideoViewManager.removeAllVideoUnits();
            MobileRTCVideoUnitRenderInfo renderInfo = new MobileRTCVideoUnitRenderInfo(0, 0, 100, 100);
            renderInfo.is_username_visible = true;
            renderInfo.is_show_audio_off = false;
            renderInfo.is_border_visible = false;
            booelan result = activeVideoViewManager.addAttendeeVideoUnit(userId, renderInfo);
        }
}

```

I am creating a custom UI using the Meeting SDK. The app has a single videoView and at startup the activeVideoUnit is displayed and the visibility of the video stream is related to the audio trigger.  
The user that has speaking is currently visible.

The users can also choose which meeting partcipant are interested to see using showSpecificUser function.  
The issue happens when they come back to the ActiveVideoUnit using the showActiveUser function.

The video remains black (empty), the user name is properly visible, and the audio of the active user is audible.

NOTE: the result value of addAttendeeVideoUnit or addActiveVideoUnit is always “true”

Android Meeting SDK version 5.12.8.9901

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [December 22, 2022, 9:19pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/2 "2022-12-22T21:19:37Z")

</div>

@criva,

Thank you for posting in the Zoom Developer, and sorry for the missed response. To better understand your pain points and what you want to accomplish, please share a screenshot of the custom UI using the Meeting SDK at startup and one when the user returns to the ActiveVideoUnit using the showActiveUser function. This context will help us diagnose what may be happening.

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [January 9, 2023, 4:25pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/3 "2023-01-09T16:25:39Z")

</div>

I prepared a video. I hope that it makes more clear what is happening.

> **[New video by Cristiano Riva](https://photos.app.goo.gl/ABAwEbn4meHz7toy9)**

on the left side you can see the iOS implementation with the expected pin/unpin behavior  
on the right side you can see the Android implementation with the active video unit that remains black after the unpin

The interesting thing is that when I turn off the camera on the iOS side the placeholder icon added by the Zoom SDK is properly visible, so I guess that the user is properly assigned to the video unit but the video streaming is not visualized.

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [January 20, 2023, 3:18pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/4 "2023-01-20T15:18:47Z")

</div>

I’ve just try using meeting SDK v5.13.5.11583 and the issue is still present

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [February 17, 2023, 8:40am UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/5 "2023-02-17T08:40:55Z")

</div>

Any news about it?  
Is the video provided useful?

---

<div class="post-metadata">

**Author:** ![elaine.ku](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elaine.ku/32/40026_2.png) [@elaine.ku](https://devforum.zoom.us/u/elaine.ku)\
**Post date:** [February 21, 2023, 10:16am UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/6 "2023-02-21T10:16:52Z")

</div>

Hi @criva ,

We’re not able to reproduce the issue from our side. Would you please provide the Zoom SDK log file to us for further investigation?  
Thank you!

Elaine

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [February 22, 2023, 1:54pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/7 "2023-02-22T13:54:39Z")

</div>

This is the log file while the app is showing the issue

[https://thinkerly-my.sharepoint.com/:u:/p/criva/EerEzjSnEI5JmyqAQKtGbyEBfHM64sL37o-OC-5QJXDjhQ?e=lmeItU](https://thinkerly-my.sharepoint.com/:u:/p/criva/EerEzjSnEI5JmyqAQKtGbyEBfHM64sL37o-OC-5QJXDjhQ?e=lmeItU)

Let me know if you need more info

---

<div class="post-metadata">

**Author:** ![elaine.ku](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elaine.ku/32/40026_2.png) [@elaine.ku](https://devforum.zoom.us/u/elaine.ku)\
**Post date:** [February 24, 2023, 7:59am UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/8 "2023-02-24T07:59:11Z")

</div>

Hi @criva ,

Have you also added the function `removeAllVideoUnits` when you unpin a user? It seems you’ve added it when pinning a user, wondering had you also add it when unpinning the user.  
Thank you

Elaine

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [February 24, 2023, 10:52am UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/9 "2023-02-24T10:52:33Z")

</div>

When I unpin the user the showActiveUser function gets called and it calls the removeAllVideoUnits

```auto
void showActiveUser() {
        MobileRTCVideoViewManager activeVideoViewManager = videoView.getVideoViewManager();
        if (activeVideoViewManager != null) {
            activeVideoViewManager.removeAllVideoUnits();
           MobileRTCVideoUnitRenderInfo renderInfo = new MobileRTCVideoUnitRenderInfo(0, 0, 100, 100);
            renderInfo.is_username_visible = true;
            renderInfo.is_show_audio_off = false;
            renderInfo.is_border_visible = false;
            boolean result = activeVideoViewManager.addActiveVideoUnit(renderInfo);
        }
}

```

---

<div class="post-metadata">

**Author:** ![elaine.ku](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elaine.ku/32/40026_2.png) [@elaine.ku](https://devforum.zoom.us/u/elaine.ku)\
**Post date:** [February 24, 2023, 6:50pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/10 "2023-02-24T18:50:51Z")

</div>

Hi @criva ,

I would like to clarify this with you. In your video, there are three steps to show different views.

1. Show gallery view → function `showActiveUser`
2. Double-click on a specific user → `showSpecificUser`
3. Double-click on the user that shows on the screen → What should be the function that triggers here? Is it also `showSpecificUser`?  
Thank you

Elaine

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [February 27, 2023, 12:54pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/11 "2023-02-27T12:54:28Z")

</div>

The sequence is the following:

At meeting startup display active user  
1st page of a ViewPager2

> **[ViewPager2  |  Android Developers](https://developer.android.com/jetpack/androidx/releases/viewpager2)**

showActiveUser (show who is speaking)

 ![Screenshot 2023-02-27 at 13-39-38 New video by Cristiano Riva](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/b/9/b930c807fc18d48b1f13c390fefe09802a28e070.png)

move in grid view for selecting the user that has to be pinned (2nd page of a ViewPager2)

 ![Screenshot 2023-02-27 at 13-40-26 New video by Cristiano Riva](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/7/675122ef86caafb9a03922543d38a572fafb202c.png)

double tap on it for pinning the user  
(switching back to the 1st page of the ViewPager2 )  
showSpecificUser (show the pinned user)

 ![Screenshot 2023-02-27 at 13-40-43 New video by Cristiano Riva](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/a/fa501bfc42715705d4d92f8c541981d65941db21.png)

Double tap on the pinned user for going back to the active user  
showActiveUser (come back to show who is speaking)

 ![Screenshot 2023-02-27 at 13-41-38 New video by Cristiano Riva](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/8/4/8499a786c053a09a9a87c3c378337daf16da8506.png)

The active user seems to be properly visualized (no errors) but the video area remains black.

So the sequence is:  
showActiveUser  
showSpecificUser  
showActiveUser

---

<div class="post-metadata">

**Author:** ![elaine.ku](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elaine.ku/32/40026_2.png) [@elaine.ku](https://devforum.zoom.us/u/elaine.ku)\
**Post date:** [March 2, 2023, 2:43am UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/12 "2023-03-02T02:43:56Z")

</div>

Hi @criva ,

When you switch from the gallery view back to the active user, you’ll need to use `removeAllVideoUnits` for each videoView that is present in the gallery view to make sure you’ve clean up all the videos.  
Please let me know is this issue still exists after adding the function.  
Thank you

Elaine

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [March 8, 2023, 1:22pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/13 "2023-03-08T13:22:33Z")

</div>

I am pretty confused.  
Are you say that I cannot see the active video user and a gallery with all users at the same time?

---

<div class="post-metadata">

**Author:** ![elaine.ku](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elaine.ku/32/40026_2.png) [@elaine.ku](https://devforum.zoom.us/u/elaine.ku)\
**Post date:** [March 14, 2023, 12:28am UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/14 "2023-03-14T00:28:44Z")

</div>

Hi @criva ,

I would like to know how did you implement the gallery view. Each user video in the gallery view is a MobileRTcVideoView. We’ll need to call `removeAllVideoUnits` for each MobileRTcVideoView when we switch from the gallery view to the active user or specific user view.

Elaine

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [March 15, 2023, 12:53pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/15 "2023-03-15T12:53:36Z")

</div>

I’ve modified my app adding removeAllVideoUnits to all other MobileRTcVideoView before pinning the user and it seems to fix the issue.

I’ll do some extra tests and I’ll let you know.

Thank you

---

<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:** [April 14, 2023, 10:54pm UTC](https://devforum.zoom.us/t/activevideounit-remains-black-empty-the-second-time/79538/16 "2023-04-14T22:54:30Z")

</div>

Closed on April 14, 2023, 10:54pm UTC

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