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

issue #6217 fixed. replay button doesn't appear twice. #6322

Closed
wants to merge 1 commit into from

Conversation

khashiii97
Copy link

@khashiii97 khashiii97 commented May 17, 2021

For solving this issue, the following changes where made in Player.java:

  1. A boolean field named isOnReplay was added to reflect when the user has pressed the replay button.
  2. when the video would reach it's end and the onCompleted method be called, the first time isOnreplay would be set to true. the second time it entered onCompleted (fallacious behavior) it would return since isOnReplay is true.
  3. in the onclick method, when the playpause button was clicked, if it was the replay button which triggered this event, playpause will be called twice (by checking isOnReplay for the second call).

Fixes #6217

@SameenAhnaf SameenAhnaf mentioned this pull request May 27, 2021
@TobiGr TobiGr added bug Issue is related to a bug player Issues related to any player (main, popup and background) labels May 29, 2021
@tsiflimagas
Copy link
Contributor

This seems to have fixed the issue, in both normal and mini player, but not for the quick settings controls. You still have to press "replay" twice there.

@litetex litetex self-requested a review August 29, 2021 15:45
Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

Thank you for your PullRequest!

I found a few issues with this code:

  1. We introduce a new variable only to check if we are in the "replay" state. That can certainly done without one as the state is already hold in the player.
  2. It's not 100% safe that the variable is set to the correct when e.g. switching to another video (playlist) etc. This will certainly cause problems.

There is a way simpler solution:
grafik

I'll open a PR for the new solution.

@litetex
Copy link
Member

litetex commented Aug 29, 2021

Succeeded by #7014

@litetex litetex closed this Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replaying a video in any player requires tapping the replay button twice
4 participants