setUserPlaybackVolume method

Future<bool> setUserPlaybackVolume(
  1. String userId,
  2. num volume,
  3. bool isSharingAudio
)

Set the user's local playback volume. This does not affect how other participants hear the user.
userId the identify of the user
volume the volume value, must be in 0, 10. 0 mutes the related audio.
isSharingAudio true to set the volume of shared audio (such as shared computer audio); false to set the microphone volume.
Return true if the call succeeds, otherwise false.

Implementation

Future<bool> setUserPlaybackVolume(
    String userId, num volume, bool isSharingAudio) async {
  var params = <String, dynamic>{};
  params.putIfAbsent("userId", () => userId);
  params.putIfAbsent("volume", () => volume);
  params.putIfAbsent("isSharingAudio", () => isSharingAudio);

  return await methodChannel
      .invokeMethod<bool>('setUserPlaybackVolume', params)
      .then<bool>((bool? value) => value ?? false);
}