stopPlayAudio method

dynamic stopPlayAudio()

function for stop playing audio

Implementation

stopPlayAudio() async {
  try {
    if (player?.state == PlayerState.playing) {
      _audioPlayInfo = null;
      _currentPlayAudioInfo = null;
      await player?.stop();
    } else {
      console(logs: "no audio playing. ignore. current state is ${player?.state.name}");
    }
  } catch (e) {
    if (kDebugMode) {
      print(e.toString());
    }
  }
}