seekTo method

void seekTo(
  1. Duration position, {
  2. bool allowSeekAhead = true,
})

Seeks to a specified time in the video.

If the player is paused when the function is called, it will remain paused. If the function is called from another state (playing, video cued, etc.), the player will play the video.

allowSeekAhead determines whether the player will make a new request to the server if the seconds parameter specifies a time outside of the currently buffered video data.

Default allowSeekAhead = true

Implementation

void seekTo(Duration position, {bool allowSeekAhead = true}) {
  invokeJavascript('seekTo(${position.inSeconds},$allowSeekAhead)');
  play();
  add(_value.copyWith(position: position));
}