Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
990decf
video_player Fix pause loop on completed
ToddZeil Jan 18, 2024
cccf9d3
video_player Fix pause infinite loop on completed (fix typo)
ToddZeil Jan 18, 2024
546e37f
Fix test calling twice when not needed
ToddZeil Jan 18, 2024
05d8479
Update version
ToddZeil Jan 18, 2024
3d71c14
Update changelog
ToddZeil Jan 18, 2024
5842263
Update changelog after review
ToddZeil Jan 18, 2024
d02d031
Fix logic after review
ToddZeil Jan 18, 2024
7de2626
Update broken test and add new test as requested
ToddZeil Jan 24, 2024
1abfd73
Merge branch 'main' into video_player_fix_pause_loop_on_completed
ToddZeil Feb 1, 2024
b65c9dc
Remove un needed test
ToddZeil Feb 14, 2024
47de4f9
Remove fix that could cause regression
ToddZeil Feb 14, 2024
5b54f4b
Update change logs and versions
ToddZeil Feb 14, 2024
0da37df
Don't seek if already at the position
ToddZeil Feb 14, 2024
5ea0689
Update packages/video_player/video_player_web/lib/src/video_player.dart
ToddZeil Feb 14, 2024
73077fd
Don't seek if already in the end position
ToddZeil Feb 14, 2024
b2b9748
Don't update video_player package
ToddZeil Feb 14, 2024
5a82692
Update comments and add private helper for milliseconds
ToddZeil Feb 14, 2024
c4a5c9d
Add extra comments, update function to a get
ToddZeil Feb 16, 2024
e9d6fbe
Remove changes to video_player
ToddZeil Feb 19, 2024
4f7466e
Merge branch 'main' into video_player_fix_pause_loop_on_completed
ToddZeil Feb 19, 2024
30162ec
Updates after review
ToddZeil Feb 20, 2024
af527eb
Update version and changelog
ToddZeil Feb 20, 2024
50ee253
Merge branch 'main' into video_player_fix_pause_loop_on_completed
ToddZeil Feb 20, 2024
dda2702
Update packages/video_player/video_player_web/lib/src/video_player.dart
ToddZeil Feb 20, 2024
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
5 changes: 5 additions & 0 deletions packages/video_player/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## NEXT

* Description of the change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed

## 2.8.3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this package should be reverted; we don't artificially constrain allowed versions in the app-facing packages.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been addressed.


* Updates support matrix in README to indicate that iOS 11 is no longer supported.
* Clients on versions of Flutter that still support iOS 11 can continue to use this
package with iOS 11, but will not receive any further updates to the iOS implementation.
* Fix infinite pause loop caused by on completed to call pause even when video is pause.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes infinite pause loop caused by call to pause even when video is already paused.


## 2.8.2

Expand Down
4 changes: 3 additions & 1 deletion packages/video_player/video_player/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,9 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
// position=value.duration. Instead of setting the values directly,
// we use pause() and seekTo() to ensure the platform stops playing
// and seeks to the last frame of the video.
pause().then((void pauseResult) => seekTo(value.duration));
if (value.isPlaying) {
pause().then((void pauseResult) => seekTo(value.duration));
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changed logic would definitely not be guaranteed to actually do what this code is supposed to be doing; if the native side reported reaching the end as:

  • playback stopped
  • video completed

then the seek code would never run.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartmorgan have updated the logic to account for this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I believe this infinite loop issue is only seen on web for some reason

value = value.copyWith(isCompleted: true);
case VideoEventType.bufferingUpdate:
value = value.copyWith(buffered: event.buffered);
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter
widgets on Android, iOS, and web.
repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
version: 2.8.2
version: 2.8.3

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ void main() {

bool currentIsCompleted = controller.value.isCompleted;

final void Function() isCompletedTest = expectAsync0(() {}, count: 2);
final void Function() isCompletedTest = expectAsync0(() {});
Comment thread
ToddZeil marked this conversation as resolved.
Outdated
final void Function() isNoLongerCompletedTest = expectAsync0(() {});
bool hasLooped = false;

Expand Down