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) Display the correct menu title for play/pause #178

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

Conversation

sprejjs
Copy link

@sprejjs sprejjs commented Nov 27, 2022

Problem

The dock and playback menu item was always displaying "Play" as the first option regardless of the current state of the playback.

Fixes #112

Proposed solution

Looks like the dock menu used to display the correct title at some point but then got broken due to the change on YouTube's side.

After reviewing the code, I've realised that the current "isPlaying" value is read from the webpage once a second by comparing the play button title to the string constant. It looks like the constant name was changed from YT_PAUSE to PAUSE breaking the implementation.
Screenshot 2022-11-27 at 07 13 56

I fixed the implementation by updating the name of the constant in the custom script.

The main menu item on the other hand was always displaying the "Play" option regardless of the current playback. I've used the same logic to update the menu item as well.

Evidence of testing

Tested by running the app on my machine.

Before After
Screenshot 2022-11-27 at 07 09 39 Screenshot 2022-11-27 at 07 10 14

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.

Play / Pause button wrong on right-click menu
1 participant