I’m running a problem, i try to show video of active speaker it works but when I stop previous speaker’s video and start rendering current user canvas becomes empty for half second or so. Is there any solution to render next speaker’s video without gap between two video views?
client.on('active-speaker', async (payload) => {
let userId = payload[0].userId
if (userIdRef.current != userId && talkingRef.current != userId){
if(client.getAllUser().filter((user) => { return user.userId === payload[0].userId })[0].bVideoOn) {
let acrossVideoCanvas = document.querySelector('#videoFrameAcross')
await mediaStreamRef.current?.stopRenderVideo(acrossVideoCanvas, talkingRef.current)
mediaStreamRef.current?.clearVideoCanvas(acrossVideoCanvas)
await mediaStreamRef.current.renderVideo(acrossVideoCanvas, userId, 1280, 720, 0, 0, 2)
talkingRef.current = userId
}
}
})
I try to render video on an existing canvas without stopRenderVideo then I get “INVALID_OPERATION” error with message “subscribe video counts greater than maximum size (1)”