> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# VICameraVideoSource

Class that provides the API to manage camera devices.

@objc final class VICameraVideoSource

## Properties

### currentDevice

@objc var currentDevice: [VICameraDevice](/api-reference/iossdk/calls/vicameradevice)? \{ get }

Default or selected camera device.

### delegate

@objc weak var delegate: [VICameraVideoSourceDelegate](/api-reference/iossdk/calls/vicameravideosourcedelegate)?

Camera video source delegate.

### devices

@objc var devices: \[[VICameraDevice](/api-reference/iossdk/calls/vicameradevice)] \{ get }

Array of available camera devices.

### preferredResolution

@objc var preferredResolution: CGSize \{ get }

Preferred camera resolution.

The default value is 640x480.

### shared

@objc static let shared: [VICameraVideoSource](/api-reference/iossdk/calls/vicameravideosource)

Shared instance.

### type

let type: [VISourceType](/api-reference/iossdk/calls/visourcetype)

Local video source type — camera.

## Methods

### changePreferredResolution(to:)

@objc func changePreferredResolution(to size: CGSize)

Changes the preferrred camera resolution.

**Parameters**

**size** CGSize

Camera resolution

### changePreferredResolution(to:)

@objc(changePreferredResolutiontoToQualityPreset:) func changePreferredResolution(\
    to qualityPreset: [VIQualityPreset](/api-reference/iossdk/calls/viqualitypreset)\
)

Changes the preferrred camera resolution with a quality preset.

**Parameters**

**qualityPreset** [VIQualityPreset](/api-reference/iossdk/calls/viqualitypreset)

Quality preset

### selectCameraDevice(\_:completion:)

@objc func selectCameraDevice(\
    \_ selectedDevice: [VICameraDevice](/api-reference/iossdk/calls/vicameradevice),\
    completion: @escaping ([VIVideoSourceError](/api-reference/iossdk/calls/vivideosourceerror)?) -> Void\
)

Selects a camera device.

**Parameters**

**selectedDevice** [VICameraDevice](/api-reference/iossdk/calls/vicameradevice)

Camera device

**completion** @escaping ([VIVideoSourceError](/api-reference/iossdk/calls/vivideosourceerror)?) -> Void

Completion handler to call when the operation is complete. This handler is executed on the delegate queue. The SDK passes the [VIVideoSourceError](/api-reference/iossdk/calls/vivideosourceerror) object if the operation has failed.

If a capture session is running with another camera device, the method stops the capture session with that device and starts the capturer session with a selected camera device.

## Relationships

**Inherits From:** NSObject

**Conforms To:** ObjectiveC.NSObjectProtocol, Swift.CVarArg, Swift.CustomDebugStringConvertible, Swift.CustomStringConvertible, Swift.Equatable, Swift.Hashable, [VILocalVideoSource](/api-reference/iossdk/calls/vilocalvideosource)