play method

  1. @override
Future<void> play()
override

Plays the underlying audio source.

Implementation

@override
Future<void> play() async {
  if (_completer != null) return;
  _completer = Completer<ClipInterruptReason>();
  _audioElement.currentTime = _resumePos!;
  await _playPauseQueue.play();
  ClipInterruptReason reason;
  while ((reason = await _completer!.future) == ClipInterruptReason.seek) {
    _completer = Completer<ClipInterruptReason>();
  }
  if (reason == ClipInterruptReason.end) {
    html5AudioPlayer.onEnded();
  }
  _completer = null;
}