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.
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.
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
toPAUSE
breaking the implementation.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.