Open Bug 1831636 Opened 2 years ago Updated 8 months ago

Youtube autoplay after session restore even if the setting is blocked audible autoplay

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

People

(Reporter: scunnane, Unassigned, NeedInfo)

References

Details

Attachments

(3 files)

When I have a YouTube tab selected in a window, then update & restart Nightly, the YouTube tab autoplays once my Nightly session is restored. This is actually the current expected behavior.

However, from a user perspective, this behavior can be annoying if I'm working in one window, click to update/reload Nightly, then a YouTube video whose tab is active in another window suddenly starts playing.

There was an excellent Slack discussion on this issue, so I've attached screenshots of it.

Per offline discussion with Stephanie, this seems the Youtube page bypassed the autoplay setting check after being opened by the session restore.

Severity: -- → S3
Priority: -- → P3
Summary: Consider disabling autoplay during an automatic session restore → Youtube autoplay after session restore even if the setting is blocked audible autoplay
Type: enhancement → defect
Component: Audio/Video → Audio/Video: Playback

One way I found to quickly experiment with this is to directly compare a YouTube video to a video on Odysee.

  1. Open a new window with 2 tabs, one that's a YouTube video and the other that's an Odysee video
  2. With the Odysee video tab active, close the window
  3. Press ctrl-shift-N to re-open the just-closed window -> the Odysee video does NOT autoplay
  4. Switch the active tab to the YouTube video, then close the window.
  5. Press ctrl-shift-N to re-open the just-closed window -> the YouTube video DOES autoplay

Maybe we need to clear the autoplay permission when restoring. Or maybe when closing the tab.

I've been experiencing the same autoplay issues with Youtube Music after logging back in on my macOS (after the machine wakes up from sleep mode). So the STR are:

  1. Open music.youtube.com and start playing any song.
  2. Press Pause, change the window/tab
  3. Wait for the machine to sleep and lock the screen
  4. Wake up the machine and log back into your account

Expected:

  1. Youtube Music is opened on the same page but not playing the song.

Actual:

  1. The previously paused song starts playing while the user is logged in, before interacting with that page, even when the page is not focused.

And sporadically I've got the same surprise playback while a meeting recording is opened and paused in Panopto too. I can bring an URL when I experience it next time

We should do better here, and it doesn't seem very complex. Alastor, what do you think?

Flags: needinfo?(alwu)

Hmm I can't reproduce this issue on my Firefox Nightly by following either comment 4 or comment 6. Edgar, do you know whether the user gesture in a window would be preserved after the window gets restored from ctrl-shift-N or session restore? I wonder if we didn't clear the user gesture flag correctly when restoring a window. Thanks!

Flags: needinfo?(alwu) → needinfo?(echen)

Another case I observed recently was autoplay starting right after I pressed Restart to update Firefox in the release from the About dialog on Mac.

I ran into this bug again today. I restarted my laptop (running Windows 11), opened up Nightly and had 5 windows restored by session restore. Of those 5 restored windows, 2 had YouTube videos as their active tab. Both YouTube videos started playing simultaneously, with no interaction on my end.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: