play method

Future<void> play()

Starts or resumes playback.

If the video has completed, seeks to the beginning first.

Implementation

Future<void> play() async {
  final id = _playerId;
  if (id == null) return;
  if (value.isCompleted) {
    await _platform.seekTo(id, Duration.zero);
    value = value.copyWith(position: Duration.zero);
  }
  await _platform.play(id);
  value = value.copyWith(isPlaying: true, isCompleted: false);
}