startVideoCapture method
@detail api
@hiddensdk(audiosdk)
@author zhangzhenyu.samuel
@brief Enables internal video capture immediately. The default setting is off.
Internal video capture refers to: capturing video using the built-in module.
The local client will be informed via rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error:{@link #ByteRTCEngineDelegate#rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error} after starting video capture by calling this API.
The remote clients in the room will be informed of the state change via rtcEngine:onUserStartVideoCapture:info:{@link #ByteRTCEngineDelegate#rtcEngine:onUserStartVideoCapture:info} after the visible client starts video capture by calling this API.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- Call stopVideoCapture{@link #ByteRTCEngine#stopVideoCapture} to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.
- Once you create the engine instance, you can start internal video capture regardless of the video publishing state. The video stream will start publishing only after the video capture starts.
- To switch from custom to internal video capture, stop publishing before disabling the custom video capture module and then call this API to enable the internal video capture.
- Call switchCamera:{@link #ByteRTCEngine#switchCamera} to switch the camera used by the internal video capture module. You cannot switch camera on macOS.
- Since the upgrade in v3.37.0, to start capture by calling this API, you need to request the capture permission in your App.
Implementation
FutureOr<int> startVideoCapture() async {
return await nativeCall('startVideoCapture', []);
}