Hi,
I’m currently transitioning my video chat application from Twilio to Zoom, utilizing the Zoom Video SDK. We occasionally encounter the following error when attempting to connect a video call:
Uncaught TypeError: Cannot set properties of undefined (setting ‘canvasId’) at webGLContextLostProtect at b.Get_Display.
However, we are not using any canvas elements in our video call connection implementation, and we’re unable to pinpoint where this error originates in the code.
Here’s our video connection implementation:
const videoPlayerListRef = useRef<Record<string, VideoPlayer>>({});
const mediaStream = zmClient?.getMediaStream();
const attachment = videoPlayerListRef.current[`${userId}`];
mediaStream?.attachVideo(userId, VideoQuality.Video_720P, attachment);
<video-player-container class="video-container-wrap">
<div className="">
{zoomLocalParticipant?.map((user: any) => {
return (
<div
className="video-cell"
key={user.userId}
style={"aspectRatio": "16/9" }
>
<div key={user.userGuid}>
<video-player
class="video-player"
ref={(element) => {
setVideoPlayerRef(user.userId, element);
}}
/>
<span>{audioDisable ? <i className="bi bi-mic-mute mute-icon"></i> : <></>} </span>
</div>
</div>
);
})}
</div>
</video-player-container>
This error is causing delays in our work. We would appreciate your help in identifying the root cause and suggesting effective ways to resolve it.
Thank you in advance for your assistance.