giveUpAudioFocus static method

Future<void> giveUpAudioFocus()

Implementation

static Future<void> giveUpAudioFocus() async {
  const channel = BasicMessageChannel<dynamic>('io.github.wangyng.simple_audio_player.giveUpAudioFocus', StandardMessageCodec());

  final Map<String, dynamic> requestMap = {};
  final reply = await channel.send(requestMap);

  if (!(reply is Map)) {
    _throwChannelException();
  }

  final replyMap = Map<String, dynamic>.from(reply);
  if (replyMap['error'] != null) {
    final error = Map<String, dynamic>.from(replyMap['error']);
    _throwException(error);

  } else {
    // noop
  }
}