VideoKitCameraManager
class VideoKit.VideoKitCameraManager : VideoKitDeviceManager<CameraDevice>
This components manages camera streaming in a scene. The component can be added to any game object in the scene.
Configuring the Manager
The manager uses top-level properties to control which camera is used, the preview resolution, and whether to start streaming the preview immediately the scene is opened:
Specifying the Preview Resolution
The resolution
determines the preview resolution of the camera stream. The following resolution presets are supported:
The resolution
is always specified in landscape format, meaning that the width is always greater than the height
.
Specifying the Camera Capabilities
The capabilities
are used to configure the camera session to provide certain types of data while streaming. The following capabilities are supported:
On WebGL, the MachineLearning
capability is always enabled.
Starting the Camera on Awake
The playOnAwake
property determines whether to start the camera preview as soon as the component awakes.
Configuring the Camera
The manager provides some camera control properties:
Specifying the Streaming Camera
The device
used for streaming can be set. If the device is set while the preview is running, the manager will switch the camera to stream from the device that is set.
See Using Cameras for more information on working with camera devices.
Specifying the Focus Mode
The focusMode
property can be used to set the camera focus mode when starting the preview.
See CameraDevice.FocusMode
for the supported focus modes.
Specifying the Exposure Mode
The exposureMode
property can be used to set the camera exposure mode when starting the preview.
See CameraDevice.ExposureMode
for the supported exposure modes.
Checking the Preview State
The running
property reports whether the camera preview is currently running.
Because starting the camera preview is asynchronous, the value of this property is not guaranteed to be the same as cameraDevice.running
. Use this property instead.
Starting the Camera Preview
The camera preview is started with the StartRunning
method.
Stopping the Camera Preview
The camera preview is stopped with the StopRunning
method.
Handling Camera Frames
The OnCameraFrame
event is raised with camera frames as they are streamed from the camera. This event can be used to implement video filters.
Last updated