stop method

  1. @override
void stop()
override

Implementation

@override
void stop() {
  if (_audioElement != null) {
    _position = position;
    _audioElement!.pause();
    _audioElement!.currentTime = 0;
    _audioElementSound._releaseAudioElement(_audioElement!);
    _audioElement = null;
  }
  if (_volumeChangedSubscription != null) {
    _volumeChangedSubscription!.cancel();
    _volumeChangedSubscription = null;
  }
  if (_stopped == false) {
    _stopped = true;
    _paused = true;
    _stopCompleteTimer();
    dispatchEvent(Event(Event.COMPLETE));
  }
}