Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EmreDET
Copy link

@EmreDET EmreDET commented Apr 12, 2024

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.

@MrJohnDev
Copy link

v

Good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants