Disabled autoplay pauses a second into video instead of immediately preventing playback
Bug Report:
⚬ BUG: Disabling player autoplay doesn't prevent immediate playback. It instead pauses the the video about a second into playback. This results in the video appearing in the YouTube watch history
⚬ HOW: Either: A) Open a video link into a new tab B) Go to a video URL via address bar
Note: Internal navigation within YouTube itself, e.g. clicking another YT video link within YT, doesn't seem to result in this bug
⚬ EXPECTED (/preferred) behavior: Playback of video doesn't happen at all, rather than waiting about a second than pausing
A bit of context: I'm migrating from the Enhancer for YouTube extension to this extension since the latest update broke it, and one of the features that extension has that works very well is its autoplay blocking feature. It actually prevents videos from playing in all cases, and doesn't rely on pausing after the video has already started playing.
Setup:
⚬ ImprovedTube Version: 3.946 ⚬ Browser: Chrome 106.0.5249.119 ⚬ Settings: improvedtube.zip ⚬ OS: Windows 10 Pro 21H2 19044.2075 ⚬ Device: PC
I have been wanting to fix this problem but it look like the bug is cause by how we write the code. To fix this bug, a rewrite of the initialization code is needed or maybe reorganize the initialization step.
related https://github.com/code-charity/youtube/issues/1668 ImprovedTube.autoplay is initialized very late in this extension at https://github.com/code-charity/youtube/blob/73cbd813f4db2b283343e23ef664ae07fff6afe4/js%26css/web-accessible/init.js#L56
its hooking HTMLMediaElement.prototype.play and for this to work on page load it needs to be stuffed together with code overriding codecs/30fps on top of /web-accessible/core.js Ill probably look into this tomorrow because Im getting annoyed by 1 second autoplays :)
Claiming this bounty — implementation submitted in PR #4377.
I claim this bounty. Will fix the autoplay pause issue.
is this even still a problem? I installed 'Improve YouTube!' TEST (for YouTube) 4.2081 just to test and dont get any play before pause.