Fails to render the video of a user when another user leaves the meeting

Description
The BOT fails to render the video of a user when another user leaves the meeting.

Steps to Reproduce:
We have 2 users (A and B) in a meeting, and a BOT that displays the video streams of both users.

  • The BOT shows user A in a video player centered on the screen.
  • User B is shown in another video player next to it.

When user A leaves the meeting, the BOT detaches user B’s video and then attaches it to render user B in the center of the screen.

Issue:
After user A leaves the meeting, the BOT fails to display user B’s video in the center of the screen.

Could you please help check if there’s anything unusual in the following session ID: "qZpTB5v0SWeIFZChiNs1Ig=="?

We would like to confirm whether the BOT correctly called detach on user B’s video and then attach it again to render after user A left, or if there was any unexpected issue that prevented user B’s video from being displayed.

Thank you for your support!

Code:

        const videoPlayer = await state.mediaStream.attachVideo(userId, quality);
        videoPlayer.style.height = '100%';
        videoPlayer.style.width = '100%';
        videoPlayer.setAttribute('user-id', userId);
       ... 
      // Append to video-player-container
  async stopRenderVideo(userId, removeDOM) {
      const elements = document.querySelectorAll(`[user-id="${userId}"]`);
      if (!elements || elements.length == 0) return;
      const promises = Array.from(elements).map(async (element) => {
        const videoPlayers = await state.mediaStream.detachVideo(userId);
        if (removeDOM) {
          element.remove();
          if (Array.isArray(videoPlayers)) {
            videoPlayers.forEach(e => e.remove());
          } else if (videoPlayers) {
            videoPlayers.remove();
          }
        } else {
          element.setAttribute('user-id', userId);
        }
      });
      await Promise.all(promises);
  }

** Environment **

  • OS: VM
  • Browser: Chrome 134

Hey @lmtruong1512

Thanks for your feedback.

qZpTB5v0SWeIFZChiNs1Ig==

After analyzing the logs:

  • 08:18:41 User 16778240 left the session
  • 08:19:35 User 16780288 leftthe session

When User 16778240 left, the BOT did call attachVideo to render User 16780288.

  • 08:17:47 User 16780288’s video stream was muted

However, at 08:17:47, User 16780288’s video stream was muted and requires user interaction with the page to resume the video.

As a result, the video for User 16780288 was not rendered despite the attachVideo call.

Thanks
Vic

Hi @vic.yang ,
Based on our records, between 08:17:40 and 08:17:45, we switched from not using a virtual background to using one. Could this be the reason for the error “User 16780288’s video stream was muted”, or was it caused by something else?

Also, does the “video stream was muted” error correspond to error code 207 mentioned in this issue?

Thanks

Hi @lmtruong1512

Also, does the “video stream was muted” error correspond to error code 207 mentioned in this issue?

Yes.

Thanks
Vic

1 Like

@vic.yang Do you know or can you guess the possible cause of the “video stream was muted” error in this case?

Thank you for your help!

Hi @lmtruong1512

This is an event triggered by the browser, and we can’t determine the exact cause. Typically, mute events occur in situations such as:

  • The camera is disconnected or its resource is taken over by the system.
  • High device temperature or heavy CPU load causes the browser to proactively mute the video track.

Thanks
Vic

2 Likes