CameraManager
Methods
getInstance
getInstance():
Get CameraManager instance to control camera hardware settings
Returns
type:
off
off(eventType: , event: Function
): void
Remove a handler for the specified camera event.
Parameters
eventType:
event:
Function
OptionalHandler function. If not specified, all handlers for the event will be removed.
Returns
type:
void
on
on(eventType: , event: Function
): void
Register a handler for the specified camera event. One event can have more than one handler. Use the CameraManager.off method to delete a handler.
Parameters
eventType:
event:
Function
Returns
type:
void
setCameraResolution
setCameraResolution(width: number
, height: number
): void
Set a local camera resolution
Parameters
width:
number
Camera resolution width
height:
number
Camera resolution height
Returns
type:
void
switchCamera
switchCamera(cameraType: ): void
Select camera
Parameters
cameraType:
Preferred video camera
Returns
type:
void
useOrientationEventListener
useOrientationEventListener(use: boolean
): void
Use OrientationEventListener on Android to detect the device rotation and to rotate camera frames according to device orientation.By default, Display rotation is used to determine the device rotation.
The way how the device orientation is detected, affects camera frames rotation on local and remote side if auto-rotate is disabled on a mobile device:
- OrientationEventListener will detect landscape orientation
- Display rotation will always report portrait orientation
The method should be called in idle camera state, i.e. video is currently not sending in a call.
Parameters
use:
boolean
True, if OrientationEventListener should be used to detect the device orientation, otherwise Display rotation is used.
Returns
type:
void