On rejoining same session I am getting error: subscribe video counts greater than maximum size (1)

After leaving the zoom call, when I join the same sesssion again I am getting error: subscribe video counts greater than maximum size (1) for user who didn’t left the session and not able to see the video feed for the joining participant.

code for leaving call:

 const leaveSession = async () => {
    if (stream) {
      await client.getMediaStream().stopVideo();
      stream.stop();
    }
    await client.leave();
    navigate('/dashboard');
  };

for user how is still in call i am calling an event to clear canvas

client.on('user-removed', (payload) => {
    console.log('-- Here user-removed --', payload);
    stream?.stopRenderVideo('#participant-video-canvas', payload[0]?.userId);
  });

Device (please complete the following information):

  • Device: HP pavilion 15
  • OS: windows 11
  • Browser: brave

I see two things here -

  1. stream.stop() - I’m not sure if this is referencing the MediaStream object, but stop isn’t a method here - is this what you were wanting to call here?
  2. I’m not 100% sure that calling getMediaStream() here is getting the same stream you already have or creating a new one (again - not sure - but will test that out later)? If you already have the stream object referenced, use the same one and see if that helps.

Stopping the rendered video is not going to remove it - you would also need to redraw the screen without the removed video.

Let me know if this helps - this isn’t an error I’ve come across yet - but will try to reproduce it if I can.

1 Like

Hey @ashok.kumar

Usually, the issue arises because the page doesn’t enable SharedArrayBuffer, and the enforceMultipleVideos option is not specified in the client.init method.

In this situation, a canvas can only render one video. The simplest solution would be to set enforceMultipleVideos to true to address your issue.

Thanks
Vic

2 Likes

thanks @kellyjandrews for responding. I was looking for stream.detachVideo(userId) and end up calling stop() from nowhere.

1 Like

thanks @vic.yang,
enforceMultipleVideos: true resolved my issue.

client.init('en-US', 'Global', { patchJsMedia: true, enforceMultipleVideos: true })
1 Like