setPlaybackVolume method

Future<int?> setPlaybackVolume(
  1. int volume
)

@detail api @author huangshouqin @brief Adjusts the locally playing volume after mixing sounds of all remote users. You can call this API before or during the playback. @param volume Ratio(%) of playback volume to original volume, in the range 0, 400, with overflow protection.
To ensure the audio quality, we recommend setting the volume to 100.
- 0: mute - 100: original volume - 400: Four times the original volume with signal-clipping protection. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details @note Suppose a remote user A is always within the range of the target user whose playback volume will be adjusted, if you use both this method and setRemoteAudioPlaybackVolume{@link #RTCEngine#setRemoteAudioPlaybackVolume}/setRemoteRoomAudioPlaybackVolume{@link #RTCRoom#setRemoteRoomAudioPlaybackVolume}, the volume that the local user hears from user A is the overlay of both settings.

Implementation

Future<int?> setPlaybackVolume(int volume) async {
  $a() => ($instance as $p_a.RTCEngine).setPlaybackVolume(volume);
  $i() => ($instance as $p_i.ByteRTCEngine).setPlaybackVolume(volume);

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