I need a way to change the video position programmatically without scrubbing or using the default scrubber. However, the position value is not a setter so how would I be able to do this?
Assuming you're using the VideoPlayerController
from the video_player package you can seek to the position you want programmatically by using the seekTo()
method.
controller.seekTo(Duration(seconds: /*any second you want*/ ));
To start video where you left off earlier try below code:
controller..initialize().then((_){
setState(() {
controller.play();
controller.seekTo(controller.value.position + lastduration);
});
});
It works for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With