Video SDK Type and Version
Video SDK web, 2.2.12
Description
Hi all - I’m hoping to understand the internal selection process that occurs in VideoSDK web for whether a canvas
vs multiple video
elements should be used. For the same webpage, I get different results depending on if I’m in Chrome (canvas) vs Safari (video elements).
Additionally, our implementation makes use of a shared source code via an internal NPM package that is docked in two different host apps. The canvas render in Chrome indicated previously is on a next.js app. The same source code on a Vite SPA uses multiple video
renders in Chrome.
This is causing some issues with unpredictability in our styles, and WebGL issues (I previously had too many video-player-containers) that only materialized when canvas was used as a render and we got above a certain number of concurrent videos. This was not detectable in the video
render strategy.
We are using the attachVideo
API in our app.
mediaStream
.attachVideo(
userId,
VideoQuality.Video_720P,
videoPlayerRef.current ?? undefined
)
.then((userVideo) => {
if (!("errorCode" in userVideo) && !videoPlayerRef.current)
videoPlayerRef.current =
document
.querySelector(`#stream-container-${userId}`)
?.appendChild<VideoPlayer>(userVideo) ?? null;
});
- What specifically determines which render strategy will be used?
- Is there any control over which method is used to render the video? What specific consequences would there be of using
video
vscanvas
in an environment where it would not have been selected? - Does the web SDK surface a check that we can use to detect how the video will be rendered for conditional styles, etc?
Thanks!