startPushSingleStream method
@detail api
@hiddensdk(audiosdk)
@author liujingchao
@brief Creates a new task of pushing a single media stream to CDN.
@param taskId Task ID.
You may want to start more than one task to push streams to CDN. When you do that, use different IDs for corresponding tasks; if you will start only one task, use an empty string.
@param singleStream Configurations for pushing a single stream to CDN. See PushByteRTCPushSingleStreamParam{@link #ByteRTCPushSingleStreamParam}.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- Before calling this API,you need to enable Push to CDN on the console.
- After calling this API, you will be informed of the result and errors during the pushing process with rtcEngine:onSingleStreamEvent:withTaskId:withErrorCode:{@link #ByteRTCEngineDelegate#rtcEngine:onSingleStreamEvent:withTaskId:withErrorCode}.
- Call stopPushSingleStream:{@link #ByteRTCEngine#stopPushSingleStream} to stop the task.
- Since this API does not perform encoding and decoding, the video stream pushed to RTMP will change according to the resolution, encoding method, and turning off the camera of the end of pushing streams.
Implementation
FutureOr<int> startPushSingleStream(
NSString taskId, ByteRTCPushSingleStreamParam singleStream) async {
return await nativeCall(
'startPushSingleStream:singleStream:', [taskId, singleStream]);
}