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
fun selectCameraDevice(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
cameraDevice:
Camera device from CameraVideoSource.cameraDevices to select
Returns
type:
Unit
fun setPreferredResolution(resolution: ): 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
resolution:
Preferred camera resolution for camera capture
Returns
type:
Unit
Props
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
type:
List<CameraDevice>
var 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
type:
var currentCameraDevice: 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
type:
var preferredResolution: 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
type: