Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions packages/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.0+6

* Android: Fix missing call to `event.put("event", "completed");` which makes it possible to detect when the video is over.

## 0.10.0+5

* Fixed iOS build warnings about implicit retains.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,15 @@ public void onPlayerStateChanged(final boolean playWhenReady, final int playback
// iOS supports a list of buffered ranges, so here is a list with a single range.
event.put("values", Collections.singletonList(range));
eventSink.success(event);
} else if (playbackState == Player.STATE_READY && !isInitialized) {
isInitialized = true;
sendInitialized();
} else if (playbackState == Player.STATE_READY) {
if (!isInitialized) {
isInitialized = true;
sendInitialized();
}
} else if (playbackState == Player.STATE_ENDED) {
Map<String, Object> event = new HashMap<>();
event.put("event", "completed");
eventSink.success(event);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
_applyPlayPause();
break;
case 'completed':
value = value.copyWith(isPlaying: false);
value = value.copyWith(isPlaying: false, position: value.duration);
_timer?.cancel();
break;
case 'bufferingUpdate':
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player
description: Flutter plugin for displaying inline video with other Flutter
widgets on Android and iOS.
author: Flutter Team <flutter-dev@googlegroups.com>
version: 0.10.0+5
version: 0.10.0+6
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player

flutter:
Expand Down