# Cannot switch camera

**URL:** <https://devforum.zoom.us/t/cannot-switch-camera/78034>\
**Category:** Web\
**Created:** [October 28, 2022, 9:55am UTC](https://devforum.zoom.us/t/cannot-switch-camera/78034 "2022-10-28T09:55:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![thanh.huynh](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@thanh.huynh](https://devforum.zoom.us/u/thanh.huynh)\
**Post date:** [October 28, 2022, 9:55am UTC](https://devforum.zoom.us/t/cannot-switch-camera/78034/1 "2022-10-28T09:55:38Z")

</div>

Hello,

I hosted the reactjs sample app (web) on my domain and open it on chrome android  
I cannot switch to back camera. It alway show front camera

Here is the screen capture video:

```auto
https://3cxcloudonline-my.sharepoint.com/:v:/g/personal/nicolas_idb_com_vn/EZHYyi3oafxDoWUNa7cCcgYBtkXz-T8ukmUwbYOMpsV4sg?e=yFhAjm

```

Please help!

Web Video SDK: 1.5.1  
Device: Chrome 106 on Android 8.1

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [October 28, 2022, 9:58am UTC](https://devforum.zoom.us/t/cannot-switch-camera/78034/2 "2022-10-28T09:58:54Z")

</div>

Hey @thanh.huynh

Thanks for your feedback.

On mobile devices, we suggest using the FacingMode as the camera ID. [MobileVideoFacingMode | Zoom Video SDK for Web - 1.5.1](https://marketplacefront.zoom.us/sdk/custom/web/enums/MobileVideoFacingMode.html)

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![thanh.huynh](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@thanh.huynh](https://devforum.zoom.us/u/thanh.huynh)\
**Post date:** [October 28, 2022, 10:00am UTC](https://devforum.zoom.us/t/cannot-switch-camera/78034/3 "2022-10-28T10:00:33Z")

</div>

So how can I switch to back camera?  
Can you give me the code?  
Because the code in the sample app doesn’t work

---

<div class="post-metadata">

**Author:** ![thanh.huynh](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@thanh.huynh](https://devforum.zoom.us/u/thanh.huynh)\
**Post date:** [October 28, 2022, 10:02am UTC](https://devforum.zoom.us/t/cannot-switch-camera/78034/4 "2022-10-28T10:02:25Z")

</div>

Will this work?  
stream.switchCamera(“environment”)

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [October 28, 2022, 10:13am UTC](https://devforum.zoom.us/t/cannot-switch-camera/78034/5 "2022-10-28T10:13:51Z")

</div>

Hey @thanh.huynh

Yes. That’s right. Also, you can use the exported object `MobileVideoFacingMode.Environment`.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![thanh.huynh](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@thanh.huynh](https://devforum.zoom.us/u/thanh.huynh)\
**Post date:** [October 28, 2022, 10:22am UTC](https://devforum.zoom.us/t/cannot-switch-camera/78034/6 "2022-10-28T10:22:14Z")

</div>

Ok it works now  
Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [November 27, 2022, 8:23pm UTC](https://devforum.zoom.us/t/cannot-switch-camera/78034/7 "2022-11-27T20:23:13Z")

</div>

Closed on November 27, 2022, 8:23pm UTC

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