Video SDK Type and Version
Web / ^1.10.1
Description
ZoomVideo.createLocalVideoTrack
does not respect deviceId
parameter.
In our preview workflow, we are attempting to take the first device from ZoomVideo.getDevices()
and apply that to our view. I can already see in this case that the first device in the list as well as the deviceId
being passed is correct, but a different camera stream is being rendered.
Error?
No errors reported.
Troubleshooting Routes
We are using Angular, so, I originally wrote this logic using Observables rather than async/await or promises. I’ve since removed all of that and copy pasted the example code (found here), but that also does not work. Furthermore, I attempted manually entering the deviceId
into the ZoomVideo.createLocalVideoTrack
and that still results in the wrong video being rendered.
Example code
ngOnInit() {
ZoomVideo.getDevices().then((devices: MediaDeviceInfo[]) => {
this.videoDevices = devices.filter((device: MediaDeviceInfo) => device.kind === 'videoinput');
console.log('devices: ', this.videoDevices);
console.log('first device: ', this.videoDevices[0].deviceId);
this.localVideoTrack = ZoomVideo.createLocalVideoTrack(this.videoDevices[0].deviceId);
console.log('localVideoTrack:', this.localVideoTrack);
});
}
startCamera() {
this.localVideoTrack.start(document.getElementById('preview-video') as HTMLVideoElement);
}
In this case, the “first device” is my laptops embedded webcam. I have a second webcam attached to my laptop via usb. Every time I run this and check which device is returned at the 0-index of the device array, it’s always the embedded camera, yet, the external camera’s stream is always rendered, even if instead of passing in this.videoDevices[0].deviceId
I pass the raw deviceId
, it still renders the external camera stream.
Please advise.