Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/video_player/video_player/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
_applyPlayPause();
break;
case VideoEventType.completed:
value = value.copyWith(isPlaying: false, position: value.duration);
_timer?.cancel();
pause().then((void pauseResult) => seekTo(value.duration));
break;
case VideoEventType.bufferingUpdate:
value = value.copyWith(buffered: event.buffered);
Expand Down Expand Up @@ -375,6 +374,9 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
/// has been sent to the platform, not when playback itself is totally
/// finished.
Future<void> play() async {
if (value.position == value.duration) {
await seekTo(const Duration());
}
value = value.copyWith(isPlaying: true);
await _applyPlayPause();
}
Expand Down