Wrong camera rendered during preview

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.

As an update, I tested this in Safari and Firefox, both of which appear to work correctly, while in Chrome this is not working.

My Chrome version: Version 120.0.6099.216 (Official Build) (arm64).

Hey @nicholas.calarco

Thanks for your feedback.

When you open the video, is there another application also using the camera?

We will fix the camera setting issue in the next version.

Thanks
Vic

Hi @vic.yang,

No other application is using either of my cameras while attempting this.

As another update, I ended up downloading the react web demo - this same issue occurs there in the preview demo. I tracked through the preview.tsx file and attempted to implement the same switchCamera logic in my Angular app, but again, no luck. It’s almost as if the videosdk is either doing it’s own device lookup or somehow getting locked onto a single video stream.

Thanks.