-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix the logic of the Center Play Button icon selection #828
Fix the logic of the Center Play Button icon selection #828
Conversation
Will this be merged soon? :) In the meantime for others, here is my fork: https://github.com/EmreDET/chewie chewie:
git:
url: https://github.com/EmreDET/chewie.git
ref: master |
@EmreDET Thank you for your contribution. Please confirm that this issue also applies to Cupertino as well. If it does, then apply the same fix there as well. The earliest I'll be able to deploy this will be on Monday. |
Hey @diegotori, thank you for your quick response. Please let me know if I did something wrong. Thank you. |
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.
LGTM.
@EmreDET published in version |
* commit 'f58a65003cb3650e7c85e7bc4907454d03bf68a3': chewie, version 1.8.3. Adds PR fluttercommunity#828. Updated workflows so that they now run tests as a result of this PR. format add small test for verification add fix for cupertino & desktop recreate ios project to make it runnable again Update material_controls.dart fix: isFinished is true only if initialized else false # Conflicts: # example/ios/Runner.xcodeproj/project.pbxproj
Hello, this is a small fix. We saw that the plugin has a logical error whenever we did not initialize the video, the icon for the play button would show the "reload"-icon. This happens because:
_latestValue.position >= _latestValue.duration
indicates, that if duration was 0, the initial position would also be 0, therefore the video player icon logic falsely assumed that the video needs to be "reloaded" from the beginning. With this simple fix&& _latestValue.duration.inSeconds > 0
we ensure, that it should only be treated as "isFinished" if the duration is non-zero, therefore was initialized. If needed, we can even do&& _latestValue.duration.inMilliseconds > 0
or_latestValue.duration.inMicroseconds > 0
, for further precision.Please correct me if I have made a mistake.
Thank you for your time and efforts.
Emre Y.