Hello Team,
We are building a Windows desktop application using Electron with an embedded web frontend powered by @zoom/videosdk (running in the Chromium renderer). To minimize startup latency before joining a session—especially given camera cold-start initialization times on Windows—we warm up the camera early in our pre-session flow, before the preview UI components have mounted, by calling LocalVideoTrack.start(target) against a detached (off-DOM) HTMLVideoElement.
Once our pre-session UI mounts or transitions between preview views (prior to joining the session), we want to bind that already-open camera capture to the newly mounted DOM element without re-acquiring the hardware device, as calling start() again triggers a full camera re-initialization and adds noticeable delay.
Current Limitation
Looking at LocalVideoTrack in the SDK typings (dist/types/preview.d.ts) and API reference, start() couples both camera acquisition and render-target binding into a single call. Unlike the in-session stream.attachVideo() and stream.detachVideo() APIs, LocalVideoTrack exposes no separate attach() / detach() or retargeting method.
Current Workaround
Currently, we transfer the underlying MediaStream directly (newElement.srcObject = detachedElement.srcObject), bypassing the SDK for the DOM rebinding. While this works for raw video in initial testing on Electron/Windows, we want to avoid relying on undocumented internals in production—especially since copying srcObject bypasses the video-player custom element / canvas rendering pipelines (which breaks virtual backgrounds and blur) and could interfere with the SDK’s internal cleanup lifecycle.
Questions / Feature Request
-
Is there a supported way to rebind a running
LocalVideoTrackto a different DOM element (HTMLVideoElementorvideo-playercustom element) without callingstart()and reacquiring the camera? -
Until a dedicated API exists, is there an officially recommended pattern for pre-warming
LocalVideoTrackahead of UI mount (e.g., creating and reparenting a single detachedvideo-player/HTMLVideoElementin the DOM vs. reassigningsrcObject)? -
Could decoupled
attach()/detach()methods be considered forLocalVideoTrackto match the pattern already available for in-session video tracks? Pre-warming media before SPA views mount is a common requirement, and first-class support would make pre-session track lifecycle management much cleaner.
We are on v2.4.0 right now.
Thanks!