With the new update, the startVideo call fails when passing in a canvas element in the startVideo call.
Example:
let startVideoOptions = {
videoElement: element, // canvas OR video element reference
hd: true,
mirrored: true,
virtualBackground,
cameraId
};
if (stream.isRenderSelfViewWithVideoElement()) {
await stream.startVideo(startVideoOptions);
} else {
await stream.startVideo(startVideoOptions); // This promise never resolves because we're passing in a `videoElement` property
await stream.renderVideo(element, client.getCurrentUserInfo().userId, 640, 360, 0, 0, VideoQuality.Video_720P);
}
Previously, this wasn’t the case. So, updating to the new version broke the application.
The fix for this is to avoid passing in the videoElement when stream.isRenderSelfViewWithVideoElement() is false.
Perhaps the VideoSDK should provide some kind of error/warning for this situation.
P.S.
Starting from Video SDK Web 1.10.5, there’s no need to consider whether a videoElement is required when calling stream.startVideo method. We’ve improved the timing for this decision, allowing it to be made when calling stream.renderVideo instead, and the parameter also supports passing in a video tag.
if (stream.isRenderSelfViewWithVideoElement()) {
await stream.startVideo({
videoElement: document.querySelector('#my-self-view-video')
})
// video successfully started and rendered
} else {
await stream.startVideo()
await stream.renderVideo(
document.querySelector('#my-self-view-canvas'),
client.getCurrentUserInfo().userId, 1920, 1080, 0, 0, 3)
// video successfully started and rendered
}