stopPublishingStream method
- {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:
- After stopping the streaming, other users in the same room can receive the delete notification of the stream by listening to the onRoomStreamUpdate callback.
- 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.
- 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);
}