startDirectCdnStreaming abstract method

Future<void> startDirectCdnStreaming({
  1. required DirectCdnStreamingEventHandler eventHandler,
  2. required String publishUrl,
  3. required DirectCdnStreamingMediaOptions options,
})

Starts pushing media streams to the CDN directly.

Aogra does not support pushing media streams to one URL repeatedly. Media options Agora does not support setting the value of publishCameraTrack and publishCustomVideoTrack as true, or the value of publishMicrophoneTrack and publishCustomAudioTrack as true at the same time. When choosing media setting options (DirectCdnStreamingMediaOptions), you can refer to the following examples: If you want to push audio and video streams published by the host to the CDN, the media setting options should be set as follows: publishCustomAudioTrack is set as true and call the pushAudioFrame method publishCustomVideoTrack is set as true and call the pushVideoFrame method publishCameraTrack is set as false (the default value) publishMicrophoneTrack is set as false (the default value) As of v4.2.0, Agora SDK supports audio-only live streaming. You can set publishCustomAudioTrack or publishMicrophoneTrack in DirectCdnStreamingMediaOptions as true and call pushAudioFrame to push audio streams. Agora only supports pushing one audio and video streams or one audio streams to CDN.

  • eventHandler See onDirectCdnStreamingStateChanged and onDirectCdnStreamingStats.
  • publishUrl The CDN live streaming URL.
  • options The media setting options for the host. See DirectCdnStreamingMediaOptions.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> startDirectCdnStreaming(
    {required DirectCdnStreamingEventHandler eventHandler,
    required String publishUrl,
    required DirectCdnStreamingMediaOptions options});