setRemoteVideoSubscriptionOptions abstract method

Future<void> setRemoteVideoSubscriptionOptions({
  1. required int uid,
  2. required VideoSubscriptionOptions options,
})

Options for subscribing to remote video streams.

When a remote user has enabled dual-stream mode, you can call this method to choose the option for subscribing to the video streams sent by the remote user. If you only register one VideoFrameObserver object, the SDK subscribes to the raw video data and encoded video data by default (the effect is equivalent to setting encodedFrameOnly to false). If you only register one VideoEncodedFrameObserver object, the SDK only subscribes to the encoded video data by default (the effect is equivalent to setting encodedFrameOnly to true). If you register one VideoFrameObserver object and one VideoEncodedFrameObserver object successively, the SDK subscribes to the encoded video data by default (the effect is equivalent to setting encodedFrameOnly to false). If you call this method first with the options parameter set, and then register one VideoFrameObserver or VideoEncodedFrameObserver object, you need to call this method again and set the options parameter as described in the above two items to get the desired results. Agora recommends the following steps: Set autoSubscribeVideo to false when calling joinChannel to join a channel. Call this method after receiving the onUserJoined callback to set the subscription options for the specified remote user's video stream. Call the muteRemoteVideoStream method to resume subscribing to the video stream of the specified remote user. If you set encodedFrameOnly to true in the previous step, the SDK triggers the onEncodedVideoFrameReceived callback locally to report the received encoded video frame information.

  • uid The user ID of the remote user.
  • options The video subscription options. See VideoSubscriptionOptions.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> setRemoteVideoSubscriptionOptions(
    {required int uid, required VideoSubscriptionOptions options});