Render multiple videos when `stream.isSupportMultipleVideos()` is false

Description

I want to render multiple videos as shown in the documentation like this:

let participants = client.getAllUser()

stream.attachVideo(participants[0].userId, 3).then((userVideo) => {
  document.querySelector('video-player-container').appendChild(userVideo);
})

stream.attachVideo(participants[1].userId, 3).then((userVideo) => {
  document.querySelector('video-player-container').appendChild(userVideo);
})

stream.attachVideo(participants[2].userId, 3).then((userVideo) => {
  document.querySelector('video-player-container').appendChild(userVideo);
})

stream.attachVideo(participants[3].userId, 3).then((userVideo) => {
  document.querySelector('video-player-container').appendChild(userVideo);
})

However, when stream.isSupportMultipleVideos() = false, only one video is displayed. One approach is to create multiple ‘video-player-container’ elements and append only one video to each container. How can I achieve this in a better way?

Which Web Video SDK version?
1.11.10

Device (please complete the following information):

  • Device: Mac Mini M1
  • OS: 14.5
  • Browser: Safari
  • Browser Version: Version 17.5 (19618.2.12.11.6)

Hey @lmtruong1512

Thanks for your feedback.

stream.isSupportMultipleVideos()

It depends on various factors such as SharedArrayBuffer and device performance.

If the current page does not support SharedArrayBuffer, you can enable this feature by specifying enforceMultipleVideos in the client.init method.

Thanks
Vic

1 Like

Thank you, Vic!
I tried and realized I had initialized the client the wrong way. I corrected it, and now it works

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