MPJ-K / userScripts

This repository stores userScripts I have worked on for the Tampermonkey browser extension.
GNU General Public License v3.0
0 stars 0 forks source link

YTPT: Player reload causes playback speed controls to partially malfunction. #52

Closed MPJ-K closed 3 weeks ago

MPJ-K commented 3 months ago

After a long period of inactivity, YouTube sometimes decides to 'reload' the player. After such an event, the script's internal reference to the player (corePlayer) seems to stop working. This prevents the script from applying playback speed outside of YouTube's allowed range.

The script should be able to detect and handle a player reload.

As a last resort, the script could also just query the "video" selector whenever it needs access to the player.

MPJ-K commented 2 months ago

Some notes from my testing:

Player reloads can be detected by watching the src attribute of the corePlayer. Annoyingly, whenever the attribute changes, it is first set to the empty string and then to the new blob: URL.

It may be possible to combine these attribute change events with knowledge of the current video ID to detect when the player reloads without changing the video ID.

MPJ-K commented 3 weeks ago

This issue has not been fixed directly, but is now worked around since #56. Playback speed controls appear to no longer malfunction after a player reset.