canSetUserPlaybackVolume method

Future<bool> canSetUserPlaybackVolume(
  1. String userId,
  2. bool isSharingAudio
)

Determine whether the user's playback volume can be set.
userId the identify of the user
isSharingAudio true to check whether shared audio playback volume can be set; false to check microphone playback volume.
Return true if the playback volume can be set, otherwise false.

Implementation

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

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