youtube_auto_pause icon indicating copy to clipboard operation
youtube_auto_pause copied to clipboard

not auto pause when window side by side

Open zcw1030 opened this issue 3 years ago • 17 comments

hi, thx for your work on this extension, but i found one bug that.

for example, i have two windows side by side or stack on my screen, one is chrome, one is file explorer. when chrome not focus, the "auto pause when window unfocus" not working. only if i minimize the chrome window to task bar, it will then auto pause.

environment: windows 10

zcw1030 avatar Dec 10 '22 05:12 zcw1030

Could you take a screen recording of this issue? I could not reproduce it on my Win10 machine.

drodil avatar Dec 13 '22 08:12 drodil

Same issue for Ubuntu too

sanjarcode avatar Jan 22 '23 15:01 sanjarcode

Here's a work around. https://gist.github.com/sanjarcode/84815d472ade218b6da33db3c80c45ce Until the issue is fixed.

sanjarcode avatar Jan 29 '23 16:01 sanjarcode

This seems to be a bug in the chromium itself: https://bugs.chromium.org/p/chromium/issues/detail?can=2&q=chrome.windows.onFocusChanged.addListener&colspec=ID+Pri+M+Iteration+ReleaseBlock+Cr+Status+Owner+Summary+OS+Modified&id=387377&thanks=387377&ts=1403370788

Not much I can do if not doing some custom logic to check for user inactivity in the window (which is not very good). In macintosh the event is fired correctly but for some reason it's not working in Windows.

drodil avatar Jan 30 '23 11:01 drodil

This seems to be a bug in the chromium itself: https://bugs.chromium.org/p/chromium/issues/detail?can=2&q=chrome.windows.onFocusChanged.addListener&colspec=ID+Pri+M+Iteration+ReleaseBlock+Cr+Status+Owner+Summary+OS+Modified&id=387377&thanks=387377&ts=1403370788

Not much I can do if not doing some custom logic to check for user inactivity in the window (which is not very good). In macintosh the event is fired correctly but for some reason it's not working in Windows.

thx

zcw1030 avatar Jan 30 '23 11:01 zcw1030

Hi, I made a pull request that fixed and added this feature. Side by side windows or even different monitors should work with this: https://github.com/drodil/youtube_auto_pause/pull/9

knamnguyen avatar Apr 02 '24 01:04 knamnguyen

Hi, I made a pull request that fixed and added this feature. Side by side windows or even different monitors should work with this: #9

thx !

zcw1030 avatar Apr 03 '24 04:04 zcw1030

@zcw1030 please confirm the solution works for you so we can close this issue, thanks!

drodil avatar Apr 03 '24 05:04 drodil

sry, i tried, and still not working.

zcw1030 avatar Apr 03 '24 05:04 zcw1030

here is a video i make to show the issue. https://youtube.com/shorts/_YaHcnJg6Ww?si=hp1wQZeSYFrFmbtT

chrome on left, file explorer on the right. when focus on file explorer, the video is not paused.

zcw1030 avatar Apr 03 '24 05:04 zcw1030

Did you enable the new feature from settings?

drodil avatar Apr 03 '24 05:04 drodil

Did you enable the new feature from settings?

thx, now its kind of working, if i use mouse to change focus. but if i use alt tab to change focus, its not working.

zcw1030 avatar Apr 03 '24 05:04 zcw1030

Very weird, do you have these enabled: image I cannot reproduce this and alt+tab pauses the video fine for me. I am on MacOS with Chrome 123.0.6312.87

drodil avatar Apr 03 '24 05:04 drodil

Very weird, do you have these enabled: image I cannot reproduce this and alt+tab pauses the video fine for me. I am on MacOS with Chrome 123.0.6312.87

Yes, i have enable this two options. image

zcw1030 avatar Apr 03 '24 05:04 zcw1030

Hmm, somehow this does not work on Windows 😠 I don't have a machine to debug this at the moment. If you have skills to take a look, or anyone else with Windows machine, please feel free to check if this could be fixed. I will try to get my PC working again and check this out later if it's not possible. Thanks again for great reporting!

drodil avatar Apr 03 '24 06:04 drodil

Hmm, somehow this does not work on Windows 😠 I don't have a machine to debug this at the moment. If you have skills to take a look, or anyone else with Windows machine, please feel free to check if this could be fixed. I will try to get my PC working again and check this out later if it's not possible. Thanks again for great reporting!

thx for your hard work ! cheers

zcw1030 avatar Apr 03 '24 07:04 zcw1030

can I request a feature where the youtube video will play and pause automatically based on whether the window is active or not. The current version works when the windows are out of view. But I want a feature that works on split screen. Like I like to keep youtube on one side and vs code on the other side, so that I can follow coding tutorials and whenever I am writing on vscode the youtube stops playing and vice versa.

Klimbar avatar Nov 20 '24 17:11 Klimbar