startChannelMediaRelay method
Future<void>
startChannelMediaRelay(
- ChannelMediaRelayConfiguration channelMediaRelayConfiguration
Starts to relay media streams across channels.
After a successful method call, the SDK triggers the RtcChannelEventHandler.channelMediaRelayStateChanged and RtcChannelEventHandler.channelMediaRelayEvent callbacks, and these callbacks report the state and events of the media stream relay.
- If the RtcChannelEventHandler.channelMediaRelayStateChanged callback reports ChannelMediaRelayState.Running and ChannelMediaRelayError.None, and the RtcChannelEventHandler.channelMediaRelayEvent callback reports ChannelMediaRelayEvent.SentToDestinationChannel, the SDK starts relaying media streams between the original and the destination channel.
- If the RtcChannelEventHandler.channelMediaRelayStateChanged callback returns Failure(3), an exception occurs during the media stream relay.
See ChannelMediaRelayState.Failure
Note
- Call this method after joining the channel.
- This method can only be called by a broadcaster in a ChannelProfile.LiveBroadcasting channel .
- After a successful method call, if you want to call this method again, ensure that you call the RtcChannel.stopChannelMediaRelay method to quit the current relay.
Parameter channelMediaRelayConfiguration
The configuration of the media stream relay.
Implementation
@override
Future<void> startChannelMediaRelay(
ChannelMediaRelayConfiguration channelMediaRelayConfiguration) {
return _invokeMethod('startChannelMediaRelay', {
'channelMediaRelayConfiguration': channelMediaRelayConfiguration.toJson()
});
}