# Camera controls The Video SDK for iOS lets you control the _local_ user's camera during a session: switch, mirror, rotate, and set the aspect ratio. These per-device operations run through `ZoomVideoSDKVideoHelper`. For using two cameras at the same time, see [Multiple camera support](/docs/video-sdk/ios/video/multiple-cameras/). ## Get the camera list To enumerate the cameras available on the device, call `getCameraDeviceList` on the `ZoomVideoSDKVideoHelper`. Each entry carries the `deviceId` you'll need for `switchCamera` and the multi-camera APIs, along with `deviceName`, `isSelectDevice`, `isSelectedAsMultiCamera`, and `isRunningAsMultiCamera`. ```swift if let cameraList = ZoomVideoSDK.shareInstance()?.getVideoHelper()?.getCameraDeviceList() { for camera in cameraList { // Each device exposes deviceId, deviceName, isSelectDevice, and more. } } ``` ```objectivec NSArray *cameraList = [[[ZoomVideoSDK shareInstance] getVideoHelper] getCameraDeviceList]; for (ZoomVideoSDKCameraDevice *camera in cameraList) { // Each device exposes deviceId, deviceName, isSelectDevice, and more. } ``` To read the currently selected camera, use `getSelectedCamera`. ## Switch camera Call `switchCamera` with no arguments to cycle to the next available camera. On most devices this toggles between the front and back camera. ```swift ZoomVideoSDK.shareInstance()?.getVideoHelper()?.switchCamera() ``` ```objectivec [[[ZoomVideoSDK shareInstance] getVideoHelper] switchCamera]; ``` To switch to a specific camera, pass a `deviceId` from `getCameraDeviceList`. ```swift let didSwitch = ZoomVideoSDK.shareInstance()?.getVideoHelper()?.switchCamera("cameraDeviceID") ``` ```objectivec BOOL didSwitch = [[[ZoomVideoSDK shareInstance] getVideoHelper] switchCamera:@"cameraDeviceID"]; ``` ## 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. ```swift let videoHelper = ZoomVideoSDK.shareInstance()?.getVideoHelper() videoHelper?.mirrorMyVideo(true) let isMirrored = videoHelper?.isMyVideoMirrored() ``` ```objectivec ZoomVideoSDKVideoHelper *videoHelper = [[ZoomVideoSDK shareInstance] getVideoHelper]; [videoHelper mirrorMyVideo:YES]; BOOL isMirrored = [videoHelper isMyVideoMirrored]; ``` ## Rotate the local video When the device orientation changes, call `rotateMyVideo` with the new `UIDeviceOrientation` to update the orientation of the locally captured video. ```swift ZoomVideoSDK.shareInstance()?.getVideoHelper()?.rotateMyVideo(UIDevice.current.orientation) ``` ```objectivec [[[ZoomVideoSDK shareInstance] getVideoHelper] rotateMyVideo:[UIDevice currentDevice].orientation]; ``` A common pattern is to observe `UIDevice.orientationDidChangeNotification` and call `rotateMyVideo` with the new value. ## Aspect ratio of the local video By default, the SDK renders video at the source aspect ratio. To force the original aspect ratio, use `enableOriginalAspectRatio`. Check the current setting with `isOriginalAspectRatioEnabled`. ```swift ZoomVideoSDK.shareInstance()?.getVideoHelper()?.enableOriginalAspectRatio(true) ``` ```objectivec [[[ZoomVideoSDK shareInstance] getVideoHelper] enableOriginalAspectRatio:YES]; ``` ## 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`: turn the mode on or off. - `isAlphaChannelModeEnabled`: read the current state. ```swift let videoHelper = ZoomVideoSDK.shareInstance()?.getVideoHelper() if videoHelper?.isDeviceSupportAlphaChannelMode() == true, videoHelper?.canEnableAlphaChannelMode() == true { videoHelper?.enableAlphaChannelMode(true) } let isOn = videoHelper?.isAlphaChannelModeEnabled() ``` ```objectivec ZoomVideoSDKVideoHelper *videoHelper = [[ZoomVideoSDK shareInstance] getVideoHelper]; if ([videoHelper isDeviceSupportAlphaChannelMode] && [videoHelper canEnableAlphaChannelMode]) { [videoHelper enableAlphaChannelMode:YES]; } BOOL isOn = [videoHelper isAlphaChannelModeEnabled]; ``` The SDK fires [`onVideoAlphaChannelStatusChanged`](/docs/video-sdk/ios/video/video-events/#alpha-channel-mode) whenever the mode is toggled. To read the per-pixel alpha mask from the raw video pipeline, see [Raw video with alpha channel](/docs/video-sdk/ios/raw-data/raw-video-alpha-channel/).