switchCamera function never return on android web

Hello,

I’m calling the switchCamera but it never return after the camera was changed

Here is my code:

console.log("switchCamera Environment...");
await stream.switchCamera(MobileVideoFacingMode.Environment);
console.log("switchCamera Environment OK");

Steps:

  • Join a video session
  • Click a button to turn on camera
  • Click a button to switch the camera
  • After the camera was switched to back camera. The switchCamera didn’t return. No “OK” message in console

I can remove the await keyword but it is not a good practice right?

Video web sdk: 1.7.0
Device: Redmi 5A, Android 8.1, Chrome 112
User agent: Mozilla/5.0 (Linux; Android 8.1.0; Redmi 5A Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/112.0.5615.48 Mobile Safari/537.36

Hey @thanh.huynh

Thanks for your feedback.

It’s a bug introduced in version 1.7.0. It will be fixed in the upcoming version.

The workaround for this issue is as you mentioned above, remove the await keyword, but it’s indeed not a good practice.

Thanks
Vic

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.