dispose method

Future<void> dispose()

Optional cleanup for consumers

Implementation

Future<void> dispose() async {
  try {
    await _audioPlayer.stop();
  } catch (_) {}
  try {
    await _audioPlayerCompleteSubscription?.cancel();
  } catch (_) {}
  _audioPlayerCompleteSubscription = null;
  try {
    await _audioPlayer.dispose();
  } catch (_) {}
  try {
    await _audioSubscription?.cancel();
  } catch (_) {}
  try {
    _httpClient?.close();
  } catch (_) {}
}