Unable to render more than 4 videos with SAB enabled on Chrome

Video SDK Type and Version
Video SDK 1.10.8 for Web

Description
I am unable to render more than 4 videos in my Chrome (123.0.6312.106) browser.
It works fine for Firefox 124.0.2

I have enabled SAB like the below in my SvelteKit server

response.headers.set('Cross-Origin-Embedder-Policy', 'require-corp');
response.headers.set('Cross-Origin-Opener-Policy', 'same-origin');

SAB Verification:

self.crossOriginIsolated is true in the console

Still, I am unable to subscribe to more than 4 videos. I have also set enforceMultipleVideos: false.

Error?
subscribe video counts greater than maximum size (4)

Troubleshooting Routes
Referencing sample app (GitHub - zoom/videosdk-web-sample: Zoom Video SDK web sample) ,
I am using the same headers method for enabling SAB. And using the same canvas to render all videos. I don’t see what am I missing here.

How To Reproduce

Windows, Chrome 123.0.6312.106

  1. Enable SAB like this
export async function handle({ event, resolve }) {
	const cookieString = event.request.headers.get('cookie');
	const user = await getAPIClient(fetch).getUser(cookieString);
	event.locals = { user, token: getTokenFromCookie(cookieString) };
	if (!canAccessEndpoint(user, event.url.pathname)) {
		error(403, 'Unauthorized access for server endpoint');
	}

	const response = await resolve(event);

	setCMIdCookie(event, response);

	response.headers.set('Cross-Origin-Embedder-Policy', 'require-corp');
	response.headers.set('Cross-Origin-Opener-Policy', 'same-origin');

	return response;
}
  1. Create a canvas to paint all videos
<canvas id="participant-videos-canvas" width="1692" height="1285"></canvas>

<style>
	#participant-videos-canvas {
		width: 100%;
		height: auto;
	}
</style>
  1. Init zoom using this function
async init() {
		await this.client.init('en-US', 'Global', { patchJsMedia: true, enforceMultipleVideos: false });
	}
  1. Render all videos on an event
attachEventListeners() {
		this.client.on('peer-video-state-change', async () => {
			function sleep(ms) {
				return new Promise((resolve) => setTimeout(resolve, ms));
			}

			await sleep(5000); // Sleep for 5 seconds

			const participants = this.client.getAllUser();
			const layout = getVideoLayout(1692, 1285, participants.length);

			layout.forEach((cell, index) => {
				this.stream.renderVideo(
					document.querySelector('#participant-videos-canvas'),
					participants[index].userId,
					cell.width,
					cell.height,
					cell.x,
					cell.y,
					cell.quality
				);
			});
		});
  1. Error on console “subscribe video counts greater than maximum size (4)”

Just checked that I am able to render more than 4 videos on Firefox 124.0.2.

Hey @harshit.bhatt

Thanks for your feedback.

Could you share some problematic session ID with us for troubleshooting purposes?

Thanks
Vic

Where do I find the session ID? @vic.yang

Hey @harshit.bhatt

You can locate it in your web account dashboard. Alternatively, if the session is ongoing, you can retrieve it by calling client.getSessionInfo().sessionId .

Thanks
Vic

1 Like

6WZqakvFS3KANqv22zT3Vg==
@vic.yang

Hey @harshit.bhatt

6WZqakvFS3KANqv22zT3Vg==

Are you experiencing this issue while using Android Chrome?

For performance reasons, we limit the maximum number of videos to 4 on mobile devices.

In the next release, we’ll include an option in the client.init method to remove this limit.

Thanks
Vic

No, the issue is on Google Chrome DESKTOP. @vic.yang

@vic.yang need your help here. It is becoming urgent now.

Hey @harshit.bhatt

I have checked all the logs, and only found the error related to video rendering on desktop Chrome.

‘INVALID_PARAMETERS, reason: user is not sending video’

The error message typically indicates that the user being rendered either hasn’t started their video or is not present in the session.

This situation often arises when a user experiences a disconnection and reconnection or performs a page refresh, resulting in a change in the userId . To address this, please ensure that you listen for the peer-video-state-change or user-updated events to obtain the latest user who is currently sending video. This will help ensure the accuracy of the user’s video state.

Thanks
Vic

It seems to be working now. I’m able to render more than 4 videos on a page.

Session ID: +rWnRXfuTzKBhLhX57c3DQ==
Browser: Chrome 123.0.6312.106 (Desktop)

To prevent same error from coming again, can you please check for subscribe video counts greater than maximum size (4) error log across all my sessions (including past sessions)?

@vic.yang

Hey @harshit.bhatt

I apologize, but we don’t have permission to query your sessions or view logs from your past sessions.

If you encounter any issues, please record the Session ID, and we can analyze them individually.

Thanks
Vic

1 Like

My headers were not being set on client side routing (CSR) and hence SAB was not getting enabled.

Thanks for the support anyways @vic.yang