stopPublishingStream method

Future<void> stopPublishingStream(
  1. {ZegoPublishChannel? channel}
)

Stops publishing a stream (for the specified channel).

Available since: 1.1.0 Description: The user stops sending local audio and video streams, and other users in the room will receive a stream deletion notification. Use cases: It can be used to stop publish streams in real-time connecting wheat, live broadcast and other scenarios. When to call: After startPublishingStream. Restrictions: None. Caution:

  1. After stopping the streaming, other users in the same room can receive the delete notification of the stream by listening to the onRoomStreamUpdate callback.
  2. If the user has initiated publish flow, this function must be called to stop the publish of the current stream before publishing the new stream (new streamID), otherwise the new stream publish will return a failure.
  3. After stopping streaming, the developer should stop the local preview based on whether the business situation requires it.
  • channel Publish stream channel.

Implementation

Future<void> stopPublishingStream({ZegoPublishChannel? channel}) async {
  return await ZegoExpressImpl.instance
      .stopPublishingStream(channel: channel);
}