subscribeStreamVideo method

FutureOr<int> subscribeStreamVideo(
  1. NSString streamId,
  2. BOOL subscribe
)

@detail api @valid since 3.60. Since version 3.60, this interface replaces the subscribeStream:mediaStreamType: and unsubscribeStream:mediaStreamType: 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. @brief Subscribes to or unsubscribes from specific remote video streams captured by the local camera. @param streamId The ID of the target remote video stream. @param subscribe Whether to subscribe to the video stream.
- true: Subscribe. - false: Unsubscribe. @return API call result:
- 0: Success. - <0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for specific reasons. @note - Calling this API to update the subscribe configuration when the user has subscribed the remote user either by calling this API or by auto-subscribe. - You must first get the remote stream information through rtcRoom:onUserPublishStreamVideo:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamVideo:info:isPublish} before calling this API to subscribe to streams accordingly. - After calling this API, you will be informed of the calling result with rtcRoom:onVideoSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoSubscribeStateChanged:info:state:reason}. - 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 this method to cancel. - Any other exceptions will be included in rtcRoom:onVideoSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoSubscribeStateChanged:info:state:reason}, see ByteRTCSubscribeStateChangeReason{@link #ByteRTCSubscribeStateChangeReason} for the reasons.

Implementation

FutureOr<int> subscribeStreamVideo(NSString streamId, BOOL subscribe) async {
  return await nativeCall(
      'subscribeStreamVideo:subscribe:', [streamId, subscribe]);
}