addInjectStreamUrl method
Injects an online media stream to a ChannelProfile.LiveBroadcasting channel.
If this method call succeeds, the server pulls the voice or video stream and injects it into a live channel. This applies to scenarios where all audience members in the channel can watch a live show and interact with each other.
Note
- Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN.
- This method can only be called by a broadcaster in a ChannelProfile.LiveBroadcasting channel . Calling this method triggers the following callbacks:
- The local client:
- RtcChannelEventHandler.streamInjectedStatus, with the state of injecting the media stream.
- RtcChannelEventHandler.userJoined(uid: 666), if the method call succeeds and the online media stream is injected into the channel.
- The remote client:
- RtcChannelEventHandler.userJoined(uid: 666), if the method call succeeds and the online media stream is injected into the channel.
Parameter url
The URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV.
- Supported FLV audio codec type: AAC.
- Supported FLV video codec type: H264(AVC).
Parameter config
The LiveInjectStreamConfig object, which contains the configuration information for the added voice or video stream.
Implementation
@override
Future<void> addInjectStreamUrl(String url, LiveInjectStreamConfig config) {
return _invokeMethod(
'addInjectStreamUrl', {'url': url, 'config': config.toJson()});
}