subscribeAllStreamsVideo method
@detail api
@valid since 3.60. 自 3.60 起,该接口替代了 subscribeAllStreams 和 unsubscribeAllStreams 方法来实现下述功能。如果你已升级至 3.60 及以上版本,且仍在使用这两个方法,请迁移至该接口。
@author yejing.luna
@brief 订阅/取消订阅房间内所有远端视频流(通过摄像头采集的)。
@param subscribe 是否订阅所有远端视频流。
- true: 订阅。
- false: 取消订阅。
@return
0: 方法调用成功
!0: 方法调用失败
@note
- 多次调用订阅接口时,将根据末次调用接口和传入的参数,更新订阅配置。
- 开启音频选路后,如果房间内的媒体流超过上限,建议通过调用 subscribeStreamVideo:subscribe:{@link #ByteRTCRoom#subscribeStreamVideo:subscribe} 接口逐一指定需要订阅的媒体流。
- 调用该方法后,你会收到 rtcRoom:onVideoSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoSubscribeStateChanged:info:state:reason} 通知方法调用结果。
- 成功调用本接口后,订阅关系将持续到调用 subscribeAllStreamsVideo:{@link #ByteRTCRoom#subscribeAllStreamsVideo} 取消订阅或本端用户退房。
- 关于其他调用异常,你会收到 rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo} 回调通知,具体异常原因参看 ByteRTCErrorCode{@link #ByteRTCErrorCode}。
Implementation
FutureOr<int> subscribeAllStreamsVideo(BOOL subscribe) async {
return await nativeCall('subscribeAllStreamsVideo:', [subscribe]);
}