startPushMixedStream method

FutureOr<int> startPushMixedStream(
  1. NSString taskId,
  2. ByteRTCMixedStreamPushTargetConfig pushTargetConfig,
  3. ByteRTCMixedStreamConfig config
)

@valid since 3.60. Since version 3.60, this interface replaces the startPushMixedStreamToCDN:mixedConfig:observer: and startPushPublicStream:withLayout: 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 @hiddensdk(audiosdk) @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 126 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. @param pushTargetConfig Push target config, such as the push url and WTN stream ID. See ByteRTCMixedStreamPushTargetConfig{@link #ByteRTCMixedStreamPushTargetConfig}. @param config Configurations to be set when pushing streams to CDN. See ByteRTCMixedStreamConfig{@link #ByteRTCMixedStreamConfig}. @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 rtcEngine:onMixedStreamEvent:withMixedStreamInfo:withErrorCode:{@link #ByteRTCEngineDelegate#rtcEngine:onMixedStreamEvent:withMixedStreamInfo:withErrorCode}. - !0: Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details. @note - After calling this API, you will be informed of the result and errors during the pushing process via the rtcEngine:onMixedStreamEvent:withMixedStreamInfo:withErrorCode:{@link #ByteRTCEngineDelegate#rtcEngine:onMixedStreamEvent:withMixedStreamInfo:withErrorCode} callback. - 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:withPushTargetType:{@link #ByteRTCEngine#stopPushMixedStream:withPushTargetType} to stop pushing streams to CDN. - Call updatePushMixedStream:withPushTargetConfig:withMixedConfig:{@link #ByteRTCEngine#updatePushMixedStream:withPushTargetConfig:withMixedConfig} to update part of the configurations of the task. - Call startPushSingleStream:singleStream:{@link #ByteRTCEngine#startPushSingleStream:singleStream} to push a single stream to CDN. @order 0

Implementation

FutureOr<int> startPushMixedStream(
    NSString taskId,
    ByteRTCMixedStreamPushTargetConfig pushTargetConfig,
    ByteRTCMixedStreamConfig config) async {
  return await nativeCall(
      'startPushMixedStream:withPushTargetConfig:withMixedConfig:',
      [taskId, pushTargetConfig, config]);
}