# How to switch camera while streaming?

**URL:** <https://community.wowza.com/t/how-to-switch-camera-while-streaming/53118>\
**Category:** Wowza Streaming Engine\
**Created:** [April 4, 2019, 3:37pm UTC](https://community.wowza.com/t/how-to-switch-camera-while-streaming/53118 "2019-04-04T15:37:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavnish\_Kumar\_Rana](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@Pavnish\_Kumar\_Rana](https://community.wowza.com/u/Pavnish_Kumar_Rana)\
**Post date:** [April 4, 2019, 3:37pm UTC](https://community.wowza.com/t/how-to-switch-camera-while-streaming/53118/1 "2019-04-04T15:37:32Z")

</div>

I want to switch Front/Back camera while having a live stream. How can this be accomplished?

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [April 4, 2019, 7:51pm UTC](https://community.wowza.com/t/how-to-switch-camera-while-streaming/53118/2 "2019-04-04T19:51:58Z")

</div>

I’m not sure if this is for iOS or Android SDK so I will provide both:

**1. Here is the SDK class for Android for initial view:**

[https://www.wowza.com/docs/how-to-use-the-camera-view-in-gocoder-sdk-for-android](https://www.wowza.com/docs/how-to-use-the-camera-view-in-gocoder-sdk-for-android)

**2. You can see how to switch camera views here with the switchCamera method.**

(See here on GitHub sample for switch camera)

**3. For the UI:**

mBtnSwitchCamera = (MultiStateButton) findViewById(R.id.ic\_switch\_camera);

[https://github.com/WowzaMediaSystems/gocoder-sdk-samples-android/blob/master/gocoder-sdk-sample-app/src/main/java/com/wowza/gocoder/sdk/sampleapp/CameraActivity.java](https://github.com/WowzaMediaSystems/gocoder-sdk-samples-android/blob/master/gocoder-sdk-sample-app/src/main/java/com/wowza/gocoder/sdk/sampleapp/CameraActivity.java)

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [April 4, 2019, 7:54pm UTC](https://community.wowza.com/t/how-to-switch-camera-while-streaming/53118/3 "2019-04-04T19:54:09Z")

</div>

And here is how you would change that in iOS SDK:

[https://www.wowza.com/docs/how-to-use-the-camera-view-in-gocoder-sdk-for-ios](https://www.wowza.com/docs/how-to-use-the-camera-view-in-gocoder-sdk-for-ios)

Please note that you will need to enable the switch camera method using “previewCamera”.

Here is the GitHub sample code for you. Please scroll through to see UI switch camera options as well in the code:

[https://github.com/WowzaMediaSystems/gocoder-sdk-samples-ios/blob/master/SDKSampleApp.swift/VideoViewController.swift](https://github.com/WowzaMediaSystems/gocoder-sdk-samples-ios/blob/master/SDKSampleApp.swift/VideoViewController.swift)
