getCurrentOutputDevice method

  1. @override
Future<AudioOutputDevice?> getCurrentOutputDevice()
override

Returns the current output device used by the plugin, if known.

Implementation

@override
Future<AudioOutputDevice?> getCurrentOutputDevice() async {
  final device =
      await methodChannel.invokeMethod<dynamic>('getCurrentOutputDevice');
  if (device == null) {
    return null;
  }
  return AudioOutputDevice.fromMap(device as Map<dynamic, dynamic>);
}