mutePlayStreamAudio method
Whether the pull stream can receive the specified audio data.
Available since: 1.1.0 Description: In the process of real-time audio and video interaction, local users can use this function to control whether to receive audio data from designated remote users when pulling streams as needed. When the developer does not receive the audio receipt, the hardware and network overhead can be reduced. Use cases: Call this function when developers need to quickly close and restore remote audio. Compared to re-flow, it can greatly reduce the time and improve the interactive experience. When to call: This function can be called after calling createEngine. Caution:
- When used together with muteAllPlayAudioStreams, they can override each other's configurations.
- When used together with muteAllPlayStreamAudio, this function only works when the muteAllPlayStreamAudio function is set to
false
. - After stopping streaming, any properties previously set for this stream such as setPlayVolume, mutePlayStreamAudio, mutePlayStreamVideo and other streaming-related configurations will become invalid and need to be reset before the next stream is pulled.
Related APIs: You can call the muteAllPlayStreamAudio function to control whether to receive all audio data. When the two functions muteAllPlayStreamAudio and mutePlayStreamAudio are set to
false
at the same time, the local user can receive the audio data of the remote user when the stream is pulled: 1. When the muteAllPlayStreamAudio(true) function is called, it is globally effective, that is, local users will be prohibited from receiving all remote users' audio data. At this time, the mutePlayStreamAudio function will not take effect whether it is called before or after muteAllPlayStreamAudio.2. When the muteAllPlayStreamAudio(false) function is called, the local user can receive the audio data of all remote users. At this time, the mutePlayStreamAudio function can be used to control whether to receive a single audio data. Calling the mutePlayStreamAudio(true, streamID) function allows the local user to receive audio data other than thestreamID
; calling the mutePlayStreamAudio(false, streamID) function allows the local user to receive all audio data.
streamID
Stream ID.mute
Whether it can receive the audio data of the specified remote user when streaming, "true" means prohibition, "false" means receiving, the default value is "false".
Implementation
Future<void> mutePlayStreamAudio(String streamID, bool mute) async {
return await ZegoExpressImpl.instance.mutePlayStreamAudio(streamID, mute);
}