addPublishStreamUrl method
Publishes the local stream to the CDN.
The addPublishStreamUrl method call triggers the RtcEngineEventHandler.rtmpStreamingStateChanged callback on the local client to report the state of adding a local stream to the CDN.
Note
- Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN.
- This method applies to LiveBroadcasting only.
- Ensure that the user joins a channel before calling this method.
- This method adds only one stream HTTP/HTTPS URL address each time it is called.
Parameter url
The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters.
Parameter transcodingEnabled
Sets whether transcoding is enabled/disabled. If you set this parameter as true, ensure that you call the setLiveTranscoding method before this method.
See RtcEngine.setLiveTranscoding
true
: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live.false
: Disable transcoding.
Implementation
@override
Future<void> addPublishStreamUrl(String url, bool transcodingEnabled) {
return _invokeMethod('addPublishStreamUrl',
{'url': url, 'transcodingEnabled': transcodingEnabled});
}