startChannelMediaRelay method
Future<void>
startChannelMediaRelay(
- ChannelMediaRelayConfiguration channelMediaRelayConfiguration
Starts to relay media streams across channels.
After a successful method call, the SDK triggers the RtcEngineEventHandler.channelMediaRelayStateChanged and RtcEngineEventHandler.channelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay.
- If the RtcEngineEventHandler.channelMediaRelayStateChanged callback returns ChannelMediaRelayState.Running and ChannelMediaRelayError.None, and the RtcEngineEventHandler.channelMediaRelayEvent callback returns ChannelMediaRelayEvent.SentToDestinationChannel, the SDK starts relaying media streams between the original and the destination channel.
- If the RtcEngineEventHandler.channelMediaRelayStateChanged callback returns ChannelMediaRelayState.Failure, an exception occurs during the media stream relay.
Note
- Contact hi@dync.cc before implementing this function.
- We do not support string user accounts in this API.
- Call this method after the RtcEngine.joinChannel method.
- This method takes effect only when you are a ClientRole.Broadcaster in a ChannelProfile.LiveBroadcasting channel.
- After a successful method call, if you want to call this method again, ensure that you call the RtcEngine.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()
});
}