-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[video_player_avfoundation] Fix playback speed doesn't get persisted on iOS after reinitializing with new VideoPlayerController #3720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit e107320.
This reverts commit 910c797.
…com/simpleclub-extended/packages into fix/video-player-fix-playback-speed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
carrying over the stamp from previous PR
Seems that this pr is failing some critical tests (video assets can be played). I will be happy to provide a second review once those tests are passing. |
I've just checked which tests have been failed and they seem to be unrelated to the contents of this PR. Any chance that someone could restart the Thanks! |
I've already re-ran in a couple times to make sure. You're certain the changes you made couldn't have affected those tests? |
Sorry, I can't invest time now to investigate the reason behind the failing tests. |
anybody have context on the updated status of this fix? thank you for putting this work in so far |
Note: this PR replaces accidentally closed #3515.
This PR fixes the flutter/flutter#100351 by using the
playImmediately(atRate:)
instead ofplay()
because callingplay()
has an effect of setting back therate
to 1.0 which is unwanted in case ofVideoPlayerController
's reinitialization.Using
playImmediately(atRate:)
is safe even with slower internet connections because AVPlayer automatically compensates eventual lack of media in the buffer by simply behaving as if it has encountered a stall during playback.Considering that
updatePlayingState()
function which, in turn, invokes theplayImmediately(atRate:)
, is only called when handling "pause" or "play" events or inAVPlayerItemStatusReadyToPlay
state, it's safe for user experience to use theplayImmediately(atRate:)
instead ofplay()
.Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.