startDirectCdnStreaming

Starts pushing media streams to the CDN directly.

virtual int startDirectCdnStreaming(IDirectCdnStreamingEventHandler* eventHandler,
            const char* publishUrl, const DirectCdnStreamingMediaOptions& options) = 0;

Details

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.
Note: Agora only supports pushing one audio and video streams or one audio streams to CDN.

Parameters

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

Returns

  • 0: Success.
  • < 0: Failure.