speakerDevice property

MediaDeviceInfo? get speakerDevice

Implementation

MediaDeviceInfo? get speakerDevice {
  List<MediaDeviceInfo>? audioOutputDevices =
      mediaDevices[MediaDeviceType.audioOutput];
  if (audioOutputDevices != null) {
    MediaDeviceInfo? speaker = audioOutputDevices
        .where((element) => element.deviceId.toLowerCase() == 'speaker')
        .firstOrNull;

    return speaker;
  }
  return null;
}