Skip to content

Commit 28d63b2

Browse files
author
h.carnot
committed
fix: apply diegotori suggestion
1 parent 72ef34e commit 28d63b2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/src/progress_bar.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ class _VideoProgressBarState extends State<VideoProgressBar> {
8383
if (!controller.value.isInitialized) {
8484
return;
8585
}
86-
if (Platform.isAndroid) {
87-
// on android, we need to let the player buffer when scrolling
88-
// in order to let the player buffer. https://github.com/flutter/flutter/issues/101409
89-
if (!controller.value.isBuffering) {
90-
_seekToRelativePosition(details.globalPosition);
91-
}
92-
} else {
86+
// Should only seek if it's not running on Android, or if it is,
87+
// then the VideoPlayerController cannot be buffering.
88+
// On Android, we need to let the player buffer when scrolling
89+
// in order to let the player buffer. https://github.com/flutter/flutter/issues/101409
90+
final shouldSeekToRelativePosition =
91+
!Platform.isAndroid || !controller.value.isBuffering;
92+
if (shouldSeekToRelativePosition) {
9393
_seekToRelativePosition(details.globalPosition);
9494
}
9595

0 commit comments

Comments
 (0)