subscribeAllStreamsAudio method
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the subscribeAllStreams and unsubscribeAllStreams methods for the below functions. If you have upgraded to version 3.60 or later and are still using these methods, please migrate to this interface.
@author yejing.luna
@brief Subscribes to or unsubscribes from all remote audio streams.
@param subscribe Whether to subscribe to all remote audio streams:
- true: Subscribe.
- false: Unsubscribe.
@return API call result:
- 0: Success.
- < 0: Failure. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- If the subscription options conflict with the previous ones, they are subject to the configurations in the last call.
- With the Audio selection enabled, if the number of media streams exceeds the limit, we recommend you subscribe each target media stream with the API follows: subscribeStreamVideo{@link #RTCRoom#subscribeStreamVideo}, subscribeStreamAudio{@link #RTCRoom#subscribeStreamAudio}.
- After calling this API, you will be informed of the calling result with onVideoSubscribeStateChanged{@link #IRTCRoomEventHandler#onVideoSubscribeStateChanged}, onAudioSubscribeStateChanged{@link #IRTCRoomEventHandler#onAudioSubscribeStateChanged}. You can also find exceptions cause from the callbacks above.
- Once the local user subscribes to the stream of a remote user, the subscription to the remote user will sustain until the local user leaves the room or unsubscribe from it by calling subscribeStreamVideo{@link #RTCRoom#subscribeStreamVideo}, subscribeStreamAudio{@link #RTCRoom#subscribeStreamAudio}.
Implementation
Future<int?> subscribeAllStreamsAudio(bool subscribe) async {
$a() => ($instance as $p_a.RTCRoom).subscribeAllStreamsAudio(subscribe);
$i() => ($instance as $p_i.ByteRTCRoom).subscribeAllStreamsAudio(subscribe);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}