setDefaultStreamRecvMode method

Future<void> setDefaultStreamRecvMode(
  1. bool autoRecvAudio,
  2. bool autoRecvVideo
)

Set audio/video data reception mode, which must be set before room entry for it to take effect

To deliver an excellent instant streaming experience, the SDK automatically receives audio/video upon successful room entry by default, that is, you will immediately receive audio/video data from all remote users. If you use this API mainly in scenarios where automatic video data reception is not required, such as audio chat, you can select the reception mode based on your actual needs.

Parameters:

autoRecvAudio true: audio data will be automatically received; false: muteRemoteAudio needs to be called to send or cancel a request. Default value: true

autoRecvVideo true: video data will be automatically received; false: startRemoteView/stopRemoteView needs to be called to send or cancel a request. Default value: true

Note: this API takes effect only if it is set before room entry.

Not supported on:

  • web

Implementation

Future<void> setDefaultStreamRecvMode(
    bool
        autoRecvAudio, // true: audio data will be automatically received; false: `muteRemoteAudio` needs to be called to send or cancel a request. Default value: true
    bool
        autoRecvVideo // true: video data will be automatically received; false: `startRemoteView/stopRemoteView` needs to be called to send or cancel a request. Default value: true
    ) {
  return _cloudChannel!.invokeMethod('setDefaultStreamRecvMode', {
    "autoRecvAudio": autoRecvAudio,
    "autoRecvVideo": autoRecvVideo,
  });
}