setRemoteAudioPlaybackVolume method

Future<int?> setRemoteAudioPlaybackVolume({
  1. required string streamId,
  2. required int volume,
})

@detail api @author huanghao @brief Set the audio volume of playing the received remote stream. You must join the room before calling the API. The validity of the setting is not associated with the publishing status of the stream. @param streamId Stream ID, used to specify the remote stream whose volume is to be adjusted. @param volume The ratio between the playing volume of the original volume. The range is [0, 400] with overflow protection. The unit is %.
For better audio quality, you are recommended to set the value to [0, 100]. @return result
- 0: Success. - <0: Failure. See ReturnStatus{@link #ReturnStatus}. @note Assume that a remote user A is always within the scope of the adjusted target users:
- When this API is used together with setRemoteRoomAudioPlaybackVolume{@link #RTCRoom#setRemoteRoomAudioPlaybackVolume}, the volume of local listening user A is the volume set by the API called later; - When this API is used together with the setPlaybackVolume{@link #RTCEngine#setPlaybackVolume}, the volume of local listening user A will be the superposition of the two set volume effects. - When you call this API to set the remote stream volume, if the remote user leaves the room, the setting will be invalid.

Implementation

Future<int?> setRemoteAudioPlaybackVolume(
    {required string streamId, required int volume}) async {
  $a() => ($instance as $p_a.RTCEngine)
      .setRemoteAudioPlaybackVolume(streamId, volume);
  $i() => ($instance as $p_i.ByteRTCEngine)
      .setRemoteAudioPlaybackVolume(streamId, volume);

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}