Video SDK Type and Version zoom/videosdk 2.1.0
Description
Switching camera for the first time in mobile browsers resulting to black preview video but subsequent switching works as expected. No such problem for desktop browsers
Error?
No error log in console
How To Reproduce
- Start with a
LocalVideoTrack
which has already started - When the user switches from the front camera to the back camera (or vice versa) the following code is triggered:
//this.videoTrack is an instance of LocalVideoTrack
const promise = this.videoTrack.isVideoStarted ?
this.videoTrack.stop() : Promise.resolve();
//Additional context:
//For desktop browsers, the actual deviceId is passed to switchCamera()
//For mobile browsers, MobileVideoFacingMode is passed to switchCamera()
promise
.then(() => this.videoTrack.switchCamera(value))
.then(() => this.videoTrack.start(domElement))
.catch(logError)
- Above code-snippet works as expected in desktop browsers. For mobile browsers, executing it for the first time results in a black preview video. Any subsequent execution of that snippet in mobile browsers then work as expected.