Rate this page:

CameraVideoSource

Class that represents a video source that captures frames from the device's camera.

Requires VICalls.initialize and the CAMERA permission. Use VICalls.getMissingPermissions to check required permissions before starting video.

Use selectCameraDevice and setPreferredResolution to configure the camera before or during a call. Subscribe to capture lifecycle events via VideoSource.addListener.

Inherits from VideoSource.

Methods

selectCameraDevice
Copy URL
fun selectCameraDevice(cameraDevice: 

CameraDevice

):

Unit

Switches capture to the specified camera device.

Updates CameraVideoSource.currentCameraDevice. If capture is not running, the device gets selected and activated when capture starts.

Parameters

Returns

  • type:

    Unit

setPreferredResolution
Copy URL
fun setPreferredResolution(resolution: 

CameraResolution

):

Unit

Sets the preferred capture resolution for all camera devices.

Updates preferredResolution. The closest supported resolution from each device's CameraDevice.supportedResolutions is selected. If capture is already running, the new resolution is applied to currentCameraDevice.

Parameters

Returns

  • type:

    Unit

Props

cameraDevices
Copy URL
var cameraDevices: 

List<CameraDevice>

List of available camera devices on the Android device.

Pass an element from this list to selectCameraDevice to switch cameras.

Returns

cameraOrientation
Copy URL
var cameraOrientation: 

CameraOrientation

The orientation mode used when capturing video frames.

Set to CameraOrientation.Screen to follow screen orientation, or CameraOrientation.Device to follow device orientation.

The default value is CameraOrientation.Screen.

Returns

currentCameraDevice
Copy URL
var currentCameraDevice: 

CameraDevice?

The camera device used for capture.

Returns the active camera while capture is running, or the camera used when capture starts. Change it via selectCameraDevice.

You can configure device-specific options such as CameraDevice.flash on the returned CameraDevice.

Returns

preferredResolution
Copy URL
var preferredResolution: 

CameraResolution

Preferred camera resolution.

The closest supported resolution from CameraResolution is selected for each CameraDevice in CameraVideoSource.cameraDevices. You can change this value via CameraVideoSource.setPreferredResolution.

The default value is CameraResolution.Medium (640x480).

Returns

Rate this page: