getAudioDeviceList method

  1. @override
Future<List<ZoomVideoSdkAudioDevice>?> getAudioDeviceList()

Get the audio device list.
The function is only available for Android platform.
Return List of the audio device if the function succeeds. Otherwise, NULL.

Implementation

@override
Future<List<ZoomVideoSdkAudioDevice>?> getAudioDeviceList() async {
  if (!Platform.isAndroid) {
    throw UnimplementedError('getAudioDeviceList() is only implemented for Android.');
  }
  var audioDeviceListString = await methodChannel
      .invokeMethod<String?>('getAudioDeviceList')
      .then<String?>((String? value) => value);

  var audioDeviceListJson = jsonDecode(audioDeviceListString!) as List;
  List<ZoomVideoSdkAudioDevice> audioDeviceList = audioDeviceListJson
      .map((languageJson) =>
      ZoomVideoSdkAudioDevice.fromJson(languageJson))
      .toList();

  return audioDeviceList;
}