startPushMixedStream method
- required String taskId,
- required MixedStreamPushTargetConfig pushTargetConfig,
- required MixedStreamConfig mixedConfig,
@hidden(Linux)
@valid since 3.60. Since version 3.60, this interface replaces the startPushMixedStreamToCDN and startPushPublicStream methods for the functions described below. If you have upgraded to version 3.60 or later and are still using these two methods, please migrate to this interface.
@detail api
@author lizheng
@brief Specify the streams to be mixed and initiates the task to push the mixed stream to CDN or WTN.
@param taskId Task ID. The length should not exceed 127 bytes.
You may want to push more than one mixed stream to CDN from the same room. When you do that, use different ID for corresponding tasks; if you will start only one task, use an empty string.
When PushTargetType = 1 (WTN stream), this parameter is invalid. Pass an empty string.
@param pushTargetConfig Push target config, such as the push URL and WTN stream ID. See MixedStreamPushTargetConfig{@link #MixedStreamPushTargetConfig}.
@param mixedConfig Configurations to be set when pushing streams to CDN or WTN. See MixedStreamConfig{@link #MixedStreamConfig}.
@return
- 0: Success. You can get notified the result of the task and the events in the process of pushing the stream to CDN via onMixedStreamEvent{@link #IRTCEngineEventHandler#onMixedStreamEvent}.
- !0: Fail. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- Subscribe to the Push-to-CDN and the WTN stream notifications in the console to receive notifications about task status changes. When calling this API repeatedly, subsequent calls to this API will trigger both TranscodeStarted and TranscodeUpdated callbacks.
- Call stopPushMixedStream{@link #RTCEngine#stopPushMixedStream} to stop pushing streams to CDN.
- Call updatePushMixedStream{@link #RTCEngine#updatePushMixedStream} to update part of the configurations of the task.
- Call startPushSingleStream{@link #RTCEngine#startPushSingleStream} to push a single stream to CDN.
Implementation
Future<int?> startPushMixedStream(
{required String taskId,
required MixedStreamPushTargetConfig pushTargetConfig,
required MixedStreamConfig mixedConfig}) {
mixedConfig.pushTargetType = pushTargetConfig.pushTargetType;
return byteRTCHelper.startPushMixedStream(
taskId: taskId,
pushTargetConfig: pushTargetConfig,
mixedConfig: mixedConfig);
}