start method

Future<void> start(
  1. double position
)

Implementation

Future<void> start(double position) async {
  _isPlaying = true;
  if (_currentUrl == null) {
    return; // nothing to play yet
  }
  if (player == null) {
    recreateNode();
  }

  // Safari requires explicit resume after user gesture
  if (_audioContext != null && _audioContext!.state == 'suspended') {
    await _audioContext!.resume().toDart;
  }

  player?.currentTime = position;
  await player?.play().toDart;
}