youtube icon indicating copy to clipboard operation
youtube copied to clipboard

"Pause while I watch a 2nd video" bug

Open xeophyte opened this issue 2 years ago • 12 comments

Bug Report:

BUG: "Pause while I watch a 2nd video" doesn't work after opening YT video in the background ⚬ HOW:

  1. open some video YT tab and play it
  2. open another video from the related in next tab, if it was opened in the background go to the new tab
  3. click on the video to play it Result: the new video doesn't stop the previous one (both videos play). To fix it, I have to click this new video and pause it, then click it again to play it, then the previous stops playing.

I deactivated all extensions related to YT. Don't know if it was in previous versions.


More / optionally:

/ ⚬ Context: Maybe it's related to my other bug - Autoplay sometimes doesn't work. I have to click the video manually to play. Although it works when I play any other already loaded video - the other videos stops. / ⚬ Expected /preferred behavior: The new video after being played (right away) should stop the previous one. ⚬ Browser: Vivaldi 6.5.3189.3 (chromium 118.0.0.0) ⚬ Settings: ImprovedTube v4.443 improvedtube.json

⚬ OS: Win 11

xeophyte avatar Dec 04 '23 20:12 xeophyte

hi!

Autoplay sometimes doesn't work

please post your CTRL-U https://github.com/code-charity/youtube/issues/1851#issuecomment-1836081643

ImprovedTube avatar Dec 05 '23 01:12 ImprovedTube

Hold on, now suddenly Autoplay works on all videos, I didn't change nothing. Anyway, this bug still exists. Same with recognizing music speed bug. And I found another one related to this "Pause while I watch a 2nd video" bug - video stops when you hover over the video thumbnail on the home page.

  1. open some video and play it
  2. open the home YT page on the other tab
  3. hover over the video thumbnail to see the preview Result: the video from the first tab stops, even if thumbnail audio is disabled.

xeophyte avatar Dec 05 '23 22:12 xeophyte

hover over the video thumbnail to see the preview Result: the video from the first tab stops, even if thumbnail audio is disabled.

but does it resume well when you stop the hovering? @xeophyte already wondered to let activating this feature show another button:

  • [ ] but "allow muted" (if(!player.isMuted()){...)
    • [ ] but then 🤣 reduce playback speed of the first one by 50%

ImprovedTube avatar Dec 07 '23 15:12 ImprovedTube

but does it resume well when you stop the hovering?

No, it works the same as opening new video (for me with bug) - I click it to pause, then again to play, the previous one stops (proper behavior); then if I pause it again the previous one doesn't resume (proper behavior I think).

EDIT: I just noticed the same bug when I've got YT playing on one tab and go to other tab with yt video embedded playing with muted audio (like https://freebies.indiegala.com/die-young) - also previous one stops.

xeophyte avatar Dec 07 '23 18:12 xeophyte

Hello i want to work on this issue can i do it?

i-am-SnehaChauhan avatar Dec 09 '23 04:12 i-am-SnehaChauhan

Just tested this and cant reproduce. Second video opened in background starts autoplay when switched to and at the same time pauses previous one. Vivaldi | 6.6.3271.44

raszpl avatar Mar 04 '24 14:03 raszpl

Maybe because also autoplay isn't working for me https://github.com/code-charity/youtube/issues/1851#issuecomment-1848956945

xeophyte avatar Mar 04 '24 17:03 xeophyte

Try backup and reinstall method. Idk why sometimes options stops working. But reinstal usually works 🤷

Anoaxx avatar Mar 09 '24 07:03 Anoaxx

I reset the settings, uninstalled the extension, cleared the extension cache, installed again without importing my settings and still got this. Probably because the autoplay isn't working for me https://github.com/code-charity/youtube/issues/1851#issuecomment-1848956945

xeophyte avatar Mar 09 '24 15:03 xeophyte

hi! @i-am-SnehaChauhan thanks!! And sorry i missed that

ImprovedTube avatar Apr 26 '24 15:04 ImprovedTube

Just tested this and cant reproduce. Second video opened in background starts autoplay when switched to and at the same time pauses previous one. Vivaldi | 6.6.3271.44

Try this method:

  1. open some YT video and play it
  2. open some other video from the related in the background tab 3a. go to that new tab after it loads completely (after at least few seconds) or 3b. go to that new tab immediately (within a second before the page loads completely)

In my case: 3a - both videos are played (the first one doesn't stop) - "Pause while I watch a 2nd video" doesn't work 3b - first video stops - "Pause while I watch a 2nd video" works

If it doesn't work, try refreshing the first tab and opening another video, because sometimes 3b doesn't even work for me.

ImprovedTube.autoplayDeniedOnce = true; doesn't affect it, whether it's commented out or not.

xeophyte avatar May 06 '24 12:05 xeophyte

ahahahah I just tried and I get equally bad, but different results. autoplayDisable changed sufficiently since last time I tried reproducing that its broken in a different way now.

3a works as expected for me, "Pause while I watch a 2nd video" works 3b pauses the video I switch into while first one keeps playing in the background :]

After scratching my head while doing wtf noises I reran the test and .... now its again working reliably !!! this is cursed :/

What the hell is that https://github.com/code-charity/youtube/blob/c91976e49bbf55539fca9f985c7144e91b30f28b/js%26css/extension/init.js#L114-L120

both of those trigger, while testing couple more times I managed to get fourth possible result - both videos pausing :/

raszpl avatar May 06 '24 23:05 raszpl