Hi,
(We are using Ionic VueJS)
We are struggling how to make the renderVideo stable.
On first session (video call), it will work perfectly. But after repeated calls, we encounter this error and then one side of the call; Peer video render will be blank and black.
Any help or suggestion is appreciated
Regards,
Neil Oswald
=== RENDER VIDEO ===
c56504b9-3903-45cd-8e4e-0b6305eb1e86:1 Uncaught TypeError: Cannot read properties of undefined (reading 'width')
at f.JsMediaSDK_VideoRender_interval (c56504b9-3903-45cd-8e4e-0b6305eb1e86:1:181982)
f.JsMediaSDK_VideoRender_interval @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
setInterval (async)
f.Start_Draw @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
(anonymous) @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
c56504b9-3903-45cd-8e4e-0b6305eb1e86:1 Uncaught TypeError: Cannot read properties of undefined (reading 'width')
at f.JsMediaSDK_VideoRender_interval (c56504b9-3903-45cd-8e4e-0b6305eb1e86:1:181982)
f.JsMediaSDK_VideoRender_interval @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
setInterval (async)
f.Start_Draw @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
(anonymous) @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
c56504b9-3903-45cd-8e4e-0b6305eb1e86:1 Uncaught TypeError: Cannot read properties of undefined (reading 'width')
at f.JsMediaSDK_VideoRender_interval (c56504b9-3903-45cd-8e4e-0b6305eb1e86:1:181982)
f.JsMediaSDK_VideoRender_interval @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
setInterval (async)
f.Start_Draw @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
(anonymous) @ c56504b9-3903-45cd-8e4e-0b6305eb1e86:1
c56504b9-3903-45cd-8e4e-0b6305eb1e86:1 Uncaught TypeError: Cannot read properties of undefined (reading 'width')
This is our render code:
zoomClient.on(“peer-video-state-change”, async (payload) => {
const { action, userId } = payload;
console.log(
“=== PEER VIDEO STATE CHANGE (action,peer,self)===“,
action,
userId,
zoomClient.getCurrentUserInfo().userId,
JSON.stringify(payload)
);
// default
const width = 640;
const height = 360;
if (userId != zoomClient.getCurrentUserInfo().userId) {
if (action === “Start”) {
// this.toggleVideo(true, this.videoCanvas, userId, 1080, 540);
console.log(“=== START RENDER VIDEO ===“, userId);
// set video on from other party to ON
this.isPeerVideoOn = true;
try {
console.log(“=== STARTING VIDEO ===“);
if (!zoomStream.isCapturingVideo()) {
// await zoomStream.startVideo({ videoElement: this.partyVideo });
await zoomStream.startVideo({ videoElement: this.selfVideo });
}
} catch (e) {
await zoomStream.startVideo();
console.log(“=== START VIDEO ERROR ===“, e);
}
try {
console.log(“=== RENDER VIDEO ===“);
zoomStream.renderVideo(
this.videoCanvas,
userId,
360,
180,
0,
0,
VideoQuality.Video_360P
);
} catch (e) {
console.log(“=== RENDER VIDEO ERROR ===“, e);
}
} else if (action === “Stop”) {
// this.toggleVideo(false, this.videoCanvas, userId, 1080, 540);
console.log(
“=== STOP RENDER VIDEO ===“,
userId
);
// set video on from other party to ON
this.isPeerVideoOn = false;
try {
zoomStream.stopRenderVideo(this.videoCanvas, userId);
// await zoomStream.clearVideoCanvas(this.videoCanvas, “blue”);
// await zoomStream.stopVideo()
} catch (e) {
console.log(
“=== STOP RENDER VIDEO ERRROR === “,
JSON.stringify(e)
);
}
}
}
});