play method

Future<void> play()

Starts playing the video.

If the video is at the end, this method starts playing from the beginning.

This method returns a future that completes as soon as the "play" command has been sent to the platform, not when playback itself is totally finished.

Implementation

Future<void> play() async {
  if (value.position == value.duration.end) {
    await seekTo(Duration.zero);
  }
  value = value.copyWith(isPlaying: true);
  await _applyPlayPause();
}