startOrUpdateChannelMediaRelay abstract method
Starts or updates cross-channel media stream relay.
The first successful call to this method starts the cross-channel media stream relay. To relay the stream to multiple destination channels or exit the current relay channels, you can call this method again to add or remove destination channels. This feature supports relaying media streams to up to 6 destination channels. After the method is successfully called, the SDK triggers the onChannelMediaRelayStateChanged callback to report the current state of the cross-channel media stream relay. Common states include: If the onChannelMediaRelayStateChanged callback reports relayStateRunning (2) and relayOk (0), it indicates that the SDK has started relaying media streams between the source and destination channels. If the onChannelMediaRelayStateChanged callback reports relayStateFailure (3), it indicates an exception occurred in the cross-channel media stream relay. Call this method after successfully joining a channel. In a live broadcast scenario, only users with the broadcaster role can call this method. The cross-channel media stream relay feature requires contacting technical support to enable. This feature does not support String-type UIDs.
configurationConfiguration for cross-channel media stream relay. See ChannelMediaRelayConfiguration.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions. < 0: Method call failed. See Error Codes for details and resolution suggestions. -1: General error (not specifically classified). -2: Invalid parameter. -8: Internal state error. Possibly because the user role is not broadcaster.
Implementation
Future<void> startOrUpdateChannelMediaRelay(
ChannelMediaRelayConfiguration configuration);