raingart / Nova-YouTube-extension

Apache License 2.0
198 stars 9 forks source link

Auto pause and Stop video preload issue #90

Closed Joshua64 closed 1 year ago

Joshua64 commented 1 year ago

Chrome 113.0.5672.127, Windows 10 with latest builds and updates, NOVA script 0.42.0+9ad24c4

Hello, i have one problem, the auto pause and stop video preload not work, at least for me. I Re-installed tampermonkey and this script but when i open any video in youtube, the auto pause function and the stop video preload function works but if i click in any place of the screen the video starts to play automatically and sometimes, this happened just one time, when i scroll down the page the video starts to play automatically. Auto pause and stop video preload works only if i don't click nothing, even if i click in the scroll bar in the right side of the screen the video starts to play without i touch e in the video itself.

raingart commented 1 year ago

The video helped me. Seems to have been fixed. The bottom line is that I just in case added a check that if the focus is on the player. It is most likely that the user clicked on it. and you can remove the blocking stop most likely you still have the "Player shortcuts always active" plugin activated. It instantly switches focus to the player when clicked. It turns out that the user click and automatic focus are mixed

check it https://gist.github.com/raingart/8cdb3b23f3f3c8f830ec60ee855a26c7/raw/310884751ac5a37b3df40df280e35aa715b82f4b/nava-beta.user.js