publish method Null safety

Future<void> publish()

Publishes the local stream to the channel.

You must keep the following restrictions in mind when calling this method. Otherwise, the SDK returns ErrorCode.Refused

  • This method publishes one stream only to the channel corresponding to the current RtcChannel instance.
  • In a LiveBroadcasting channel, only a broadcaster can call this method. To switch the client role, call RtcChannel.setClientRole of the current RtcChannel instance.
  • You can publish a stream to only one channel at a time. For details, see the advanced guide Join Multiple Channels.


Future<void> publish() {
  return _invokeMethod('publish');