User videos not rendering sometimes in Gallery mode (video component)

In gallery mode (video component)… there are times where someone’s video doesn’t get rendered. It’s very hit or miss and random… it does seem to happen more often after someone shares their screen.

We’re using mostly the default code. Is there any advice on what I can do to prevent this from happening? We really want to use this for our production site but it’s been buggy in that aspect despite the code below and the screen shots showing that it is indeed rendering each user.

useEffect(() => {
    if (
      // previousIsVideoDecodeReady === false &&
      isVideoDecodeReady === true &&
      subscribedVideos.length > 0
    ) {
      console.group("client all users");
      zmClient.getAllUser().forEach((user) => {
        console.log(user);
      })
      console.groupEnd();
      subscribedVideos.forEach(async (userId) => {
        const index = participants.findIndex((user) => user.userId === userId);
        const cellDimension = layout[index];
        if (cellDimension &&(!isSkipSelfVideo ||(isSkipSelfVideo&&userId!==currentUserId))) {
          const { width, height, x, y, quality } = cellDimension;
          console.log("3333", userId, width, height, x, y);
          await mediaStream?.renderVideo(
            videoRef.current as HTMLCanvasElement,
            userId,
            width,
            height,
            x,
            y,
            quality,
          );
        }
      });
    }
  }, [
    zmClient,
    mediaStream,
    videoRef,
    layout,
    participants,
    subscribedVideos,
    isVideoDecodeReady,
    previousIsVideoDecodeReady,
    isSkipSelfVideo,
    currentUserId,
  ]);


Hey @DaleAtMarvin

Thanks for your feedback.

Did you do anything before the issue occurred?

Was the video rendered eventually if you waited a little longer?

Are there any errors on the console when the issue occurs?

Thanks
Vic

yes it’s usually after or during a shared screen session.

no the video never gets rendered eventually.

no errors in the console unfortunately.

Hey @DaleAtMarvin

Did you enable SharedArrayBuffer on your site?

Could you try it on our sample app?

Thanks
Vic

hey vic. SharedArrayBuffer is enabled and we’re using most of the base code from the sample app… it’s hard to replicate but it happens enough… i’ll see if i can get the team to play around with the exact default app and get it to happen again

Hey @DaleAtMarvin

Thanks for sharing the information with us.

We tried several times on the sample app but failed to reproduce. So it’s very helpful to get the reproduce steps for investigating the issue.

Thanks
Vic