-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[video_player_android] isBuffering flag always return true after calling seekTo method - fixed #9198
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
base: main
Are you sure you want to change the base?
[video_player_android] isBuffering flag always return true after calling seekTo method - fixed #9198
Conversation
…ing seekTo method - fixed
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
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.
Overall this change seems reasonable, but I want to ensure that this fixes the root cause of the issue.
Can you update the description to include a justification? Then, I think we should try re-enabling the integration test mentioned in flutter/flutter#165149 (comment):
.* Fixes a [bug](https://github.com/flutter/flutter/issues/165149) where isBuffering flag always | ||
* return true after seekTo any position |
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.
Nit:
* Fixes a [bug](https://github.com/flutter/flutter/issues/165149) where isBuffering flag always | |
* return true after seekTo any position | |
* Fixes a [bug](https://github.com/flutter/flutter/issues/165149) where the `isBuffering` flag always | |
* returns true after seeking to any position. |
return; | ||
if (!isInitialized) { | ||
isInitialized = true; | ||
sendInitialized(); |
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.
This changes in theory seems reasonable to me! Can you please add a test for this change?
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.
Sure, will add test case.
[List which issues are fixed by this PR. You must list at least one issue.
Issue #165149
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or I have commented below to indicate which [version change exemption] this PR falls under[^1].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style], or I have commented below to indicate which [CHANGELOG exemption] this PR falls under[^1].Root Cause
The issue stems from the
onPlaybackStateChanged
callback. After callingseekTo
, the player transitions toPlayer.STATE_BUFFERING
, setting the buffering flag totrue
. Shortly after, it transitions toPlayer.STATE_READY
. However, if the player was already initialized, the method returned early due to:prevented
setBuffering(false)
from being called in the shared logic below the switch