mozilla / video-bg-play

Break Page Visibility API and Fullscreen API so video plays in background
https://addons.mozilla.org/firefox/addon/video-background-play-fix/
MIT License
157 stars 19 forks source link

Periodic pauses on YouTube #28

Closed blindstitch closed 3 years ago

blindstitch commented 3 years ago

I am on the 83.0 (Nov 17) build of FF. It is occasionally pausing again, with the message "Video paused. Continue watching?". A test video paused at 39 minutes.

Would like to know if you see anything that's changed in their strategy for blocking background play and if we have a fix.

buttercookie42 commented 3 years ago

Thanks for letting me know, I'll try and see if I can find out anything.

buttercookie42 commented 3 years ago

An hour-long playlist worked without problems, so hm… I'll try a single long video next instead, but it's equally possible that it's some sort of A/B-experiment or staged rollout on Youtube's side.

Mikaka27 commented 3 years ago

Hi, I have the same problem, try long video instead of long playlist.

Here I caught it in action: Screenshot_20210314-065319_Fennec I was listening to this music while browsing on other tabs (and sometimes also just leaving device to itself). As you can see it happened after 20 minutes (but I'm not sure if it's always the same). The dialog says: "Video was paused. Would you like to continue watching?" (or something along this lines I'm translating myself). The red button says "Yes"

And here it is in dev tools: YtDialog

It's the "dialog" inside "dialog-container" div

buttercookie42 commented 3 years ago

I have an idea for a possible improvement in the add-on, but no idea whether it'd actually help or not. Thanks to the *+@°#$3#@! add-on policy for the new Firefox of course I can no longer simply provide a one-off testing version of the add-on for manual installation…

Mikaka27 commented 3 years ago

Is there a way to load addons with adb or something? I have a rooted device if that should help.

buttercookie42 commented 3 years ago

You'd need to use the web-ext tool, but unfortunately that only works as long as your phone is connected to a computer.

If you don't mind that, I can prepare a test version for you to try out, otherwise I guess I'll just have to update the main add-on and hope for the best – after a quick test I think the change shouldn't break anything, only I've no real idea whether it'd actually improve anything, either.

Mikaka27 commented 3 years ago

I don't mind, however I will be able to do the testing in the evening (I'm GMT+1 time zone). Regarding this issue, there is also a "toast" or something on the bottom that asks you whether you're still watching. That happens before the dialog is shown (since the dialog is shown only after video has been paused already).

It would be better to react to this "toast", since there would be no pause. I can try to catch that with dev tools for you (also in the evening).

buttercookie42 commented 3 years ago

Ideally, I'd like to prevent that popup/toast before it even happens, but I'm still not absolutely what exactly can trigger it, plus desktop and mobile Youtube seems to use somewhat different implementations behind the scene.

In any case, if you want to give the new version a try, here it is: video-bg-play-1.6.0a2.zip

Mikaka27 commented 3 years ago

Hi, sorry for late response, I just tried it and video didn't stop this time after 20 minutes. I only tried it once, I will retry more times.

buttercookie42 commented 3 years ago

No worry, and thanks for giving it a go, that sounds encouraging.

Mikaka27 commented 3 years ago

On the other hand I now cannot reproduce this when I reinstalled normal version of this extension :( Not sure what happened.

buttercookie42 commented 3 years ago

It is Youtube, so you can never be entirely sure how they're rolling out their updates, experiments, A/B-tests and whatnot.

buttercookie42 commented 3 years ago

Feel free to ping me again if it starts happening again. In the meantime, I've now published the experimental changes mentioned above as 1.6.0.