Black video in active video unit (Custom UI)

Description

We’re encountering an issue when removing and re-adding the active video unit to the default video view in the Zoom Android Meeting SDK.

We modified the sample app provided in the SDK ZIP to match our use case, and the issue is reproducible with the sample app as well.

Issue Summary

By default, the app displays the active speaker view in the default video view.

  • When a user taps on another participant’s video, we pin that user’s video to the default video view using addAttendeeVideoUnit(userId, info).

  • When the user taps the same participant’s video again, it should unpin and switch back to the active speaker view by calling removeAllVideoUnits() followed by addActiveVideoUnit().

  • After switching back to the active video unit, the video turns black, but the audio and participant name update correctly.

Which Android Meeting SDK version?
Meeting SDK for android - 6.6.5

To Reproduce
Steps to reproduce the behavior:

  1. Use the Zoom Meeting SDK for Android (v6.6.5) sample app.
  2. Modify the default video view’s click listener to toggle between pinned user video (addAttendeeVideoUnit) and active speaker view (addActiveVideoUnit).
  3. Join a meeting with at least 4 participants.
  4. Tap a user’s video to pin them, then tap again to unpin and revert to the active speaker view.
  5. The default video view becomes black, though audio and name labels continue to update correctly.

Device Info:

  • Device: Android phone/device
  • OS: Android 11

Modifications

MyMeetingActivity.java
AttenderVideoAdapter.ItemClickListener pinVideoListener = new AttenderVideoAdapter.ItemClickListener() {
@Override
public void onItemClick(View view, int position, long userId) {
if (currentLayoutType == LAYOUT_TYPE_VIEW_SHARE) {
return;
}
mDefaultVideoViewMgr.removeAllVideoUnits();
MobileRTCVideoUnitRenderInfo renderInfo = new MobileRTCVideoUnitRenderInfo(0, 0, 100, 100);
if (currentPinUser == userId) {
mDefaultVideoViewMgr.addActiveVideoUnit(renderInfo);
currentPinUser = 0;
} else {
mDefaultVideoViewMgr.addAttendeeVideoUnit(userId, renderInfo);
currentPinUser = userId;
}
}
};

AttenderVideoAdapter.java
private View.OnClickListener onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Long userId = (Long) view.getTag();
int position = userList.indexOf(userId);
if (userId == getSelectedUserId()) {
listener.onItemClick(view, position, userId);
selected = -1;
return;
}
if (null != listener) {
if (position >= userList.size()) {
return;
}
listener.onItemClick(view, position, userId);
if (null != selectedView) {
selectedView.setBackgroundResource(0);
}
view.setBackgroundResource(R.drawable.video_bg);
selectedView = view;
selected = position;
}
}
};