# Camera controls The Video SDK for Android lets you control the _local_ user's camera during a session: switch, mirror, rotate, and toggle the flashlight. These per-device operations run through `ZoomVideoSDKVideoHelper`. For using two cameras at the same time, see [Multiple camera support](/docs/video-sdk/android/video/multiple-cameras/). ## Get the camera list To enumerate the cameras available on the device, call `getCameraList` on the `VideoHelper`. Each entry carries the `deviceId` you'll need for `switchCamera` and the multi-camera APIs. ```kotlin val cameras = ZoomVideoSDK.getInstance().videoHelper.cameraList for (camera in cameras) { // Each device exposes deviceId, deviceName, isSelectDevice, isSelectedAsMultiCamera, isRunningAsMultiCamera } ``` ```java List cameras = ZoomVideoSDK.getInstance().getVideoHelper().getCameraList(); for (ZoomVideoSDKCameraDevice camera : cameras) { // Each device exposes deviceId, deviceName, isSelectDevice, isSelectedAsMultiCamera, isRunningAsMultiCamera } ``` To check the number of available cameras without enumerating, use `getNumberOfCameras()`. ## Switch camera Call `switchCamera()` with no arguments to cycle to the next available camera. On most phones this toggles between the front and back camera. ```kotlin ZoomVideoSDK.getInstance().videoHelper.switchCamera() ``` ```java ZoomVideoSDK.getInstance().getVideoHelper().switchCamera(); ``` To switch to a specific camera, pass a `ZoomVideoSDKCameraDevice` from `getCameraList()`. ```kotlin val videoHelper = ZoomVideoSDK.getInstance().videoHelper val cameras = videoHelper.cameraList videoHelper.switchCamera(cameras[1]) ``` ```java ZoomVideoSDKVideoHelper videoHelper = ZoomVideoSDK.getInstance().getVideoHelper(); List cameras = videoHelper.getCameraList(); videoHelper.switchCamera(cameras.get(1)); ``` ## Mirror the local video Mirroring is a common convention for the front-facing camera, so the user sees themselves the way they would in a mirror. Use `mirrorMyVideo(true)` to enable and `mirrorMyVideo(false)` to disable. Use `isMyVideoMirrored()` to read the current state. ```kotlin val videoHelper = ZoomVideoSDK.getInstance().videoHelper videoHelper.mirrorMyVideo(true) val isMirrored = videoHelper.isMyVideoMirrored ``` ```java ZoomVideoSDKVideoHelper videoHelper = ZoomVideoSDK.getInstance().getVideoHelper(); videoHelper.mirrorMyVideo(true); boolean isMirrored = videoHelper.isMyVideoMirrored(); ``` ## Rotate the local video When the device orientation changes, call `rotateMyVideo` to update the orientation of the locally captured video, passing the new rotation angle. ```kotlin ZoomVideoSDK.getInstance().videoHelper.rotateMyVideo(rotation) ``` ```java ZoomVideoSDK.getInstance().getVideoHelper().rotateMyVideo(rotation); ``` A common pattern is to listen for orientation changes (for example, via the Android `OrientationEventListener` or by overriding `onConfigurationChanged`) and call `rotateMyVideo` with the new value. ## Flashlight You can control the device flashlight from the SDK on devices that support it. Check support before calling the toggle. ```kotlin val videoHelper = ZoomVideoSDK.getInstance().videoHelper if (videoHelper.isSupportFlashlight) { videoHelper.turnOnOrOffFlashlight(true) } val isOn = videoHelper.isFlashlightOn ``` ```java ZoomVideoSDKVideoHelper videoHelper = ZoomVideoSDK.getInstance().getVideoHelper(); if (videoHelper.isSupportFlashlight()) { videoHelper.turnOnOrOffFlashlight(true); } boolean isOn = videoHelper.isFlashlightOn(); ``` ## Aspect ratio of the local video By default, the SDK renders video at the source aspect ratio. To force a fixed aspect, use `enableOriginalAspectRatio(boolean)`. Check the current setting with `isOriginalAspectRatioEnabled()`. ```kotlin ZoomVideoSDK.getInstance().videoHelper.enableOriginalAspectRatio(true) ``` ```java ZoomVideoSDK.getInstance().getVideoHelper().enableOriginalAspectRatio(true); ``` ## Alpha channel mode Alpha channel mode lets the SDK render video with a transparent background, useful for compositing a user's video over other UI content (for example, a presenter video overlaid on a slide deck). Both the device hardware and the current session state gate this feature, so capability-check before enabling. - `isDeviceSupportAlphaChannelMode()`: does the device hardware support it? Check once. - `canEnableAlphaChannelMode()`: can the mode be toggled in the current session state? Check before each enable call. - `enableAlphaChannelMode(boolean)`: turn the mode on or off. - `isAlphaChannelModeEnabled()`: read the current state. ```kotlin val videoHelper = ZoomVideoSDK.getInstance().videoHelper if (videoHelper.isDeviceSupportAlphaChannelMode && videoHelper.canEnableAlphaChannelMode()) { videoHelper.enableAlphaChannelMode(true) } val isOn = videoHelper.isAlphaChannelModeEnabled ``` ```java ZoomVideoSDKVideoHelper videoHelper = ZoomVideoSDK.getInstance().getVideoHelper(); if (videoHelper.isDeviceSupportAlphaChannelMode() && videoHelper.canEnableAlphaChannelMode()) { videoHelper.enableAlphaChannelMode(true); } boolean isOn = videoHelper.isAlphaChannelModeEnabled(); ``` The SDK fires [`onVideoAlphaChannelStatusChanged`](/docs/video-sdk/android/video/video-events/#alpha-channel-mode) whenever the mode is toggled.