Closed Bug 1497737 Opened 3 years ago Closed 3 years ago

The video automatically plays even when autoplay is disabled in Firefox (media.autoplay.enabled is set to false).

Categories

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

63 Branch
Unspecified
Linux
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox64 --- affected

People

(Reporter: karlcow, Unassigned)

References

()

Details

This is a spinoff of https://webcompat.com/issues/19298

The reporter said:
The video automatically plays even when autoplay is disabled in Firefox (media.autoplay.enabled is set to false).


Oana double checked and could reproduced this on Linux Ubuntu:
I've checked on Linux Ubuntu 16.04 and was able to reproduce the issue. The video automatically plays, regardless if the preference is set to true or false.

Note: If the permission to "allow autoplay with sound " is denied, the video no longer autoplays.



So this is happening when the user has modified the default config.
Some time within the last month (can't remember when), YouTube started ignoring my media.autoplay.enabled=false in favour of media.block-autoplay-until-in-foreground behaviour (which causes chaos when I want to move a bunch of YouTube videos from my Thunderbird inbox to my categorized "Videos to Watch" bookmarks folders because I can't prevent each tab from passing through a focused state).

Since my DSL is flat-rate, I've taken to muting Firefox as a whole in the system mixer before I start triaging my e-mail as a workaround.

Should I file a new bug or would it be covered by this one?
Hmm...I cannot reproduce this on Firefox 64 MacOS. Alastor, could you take a look?
Component: Audio/Video → Audio/Video: Playback
Flags: needinfo?(alwu)
Bug 1499441 has some examples. I have media.autoplay.enabled set to false.

Reproduced on Nightly from October 15 2018 on macOS.
(In reply to Stephan Sokolow from comment #1)
> Some time within the last month (can't remember when), YouTube started
> ignoring my media.autoplay.enabled=false in favour of
> media.block-autoplay-until-in-foreground behaviour (which causes chaos when
> I want to move a bunch of YouTube videos from my Thunderbird inbox to my
> categorized "Videos to Watch" bookmarks folders because I can't prevent each
> tab from passing through a focused state).
> 
> Since my DSL is flat-rate, I've taken to muting Firefox as a whole in the
> system mixer before I start triaging my e-mail as a workaround.
> 
> Should I file a new bug or would it be covered by this one?

Hi, Stephan,

Do you mean tabs start autoplay when you change them from background to the foreground without any additional interaction (eg. click, keyboard press)?
Flags: needinfo?(alwu) → needinfo?(from_bugzilla2)
(In reply to Alastor Wu [:alwu] from comment #4)
> (In reply to Stephan Sokolow from comment #1)
> > Some time within the last month (can't remember when), YouTube started
> > ignoring my media.autoplay.enabled=false in favour of
> > media.block-autoplay-until-in-foreground behaviour (which causes chaos when
> > I want to move a bunch of YouTube videos from my Thunderbird inbox to my
> > categorized "Videos to Watch" bookmarks folders because I can't prevent each
> > tab from passing through a focused state).
> > 
> > Since my DSL is flat-rate, I've taken to muting Firefox as a whole in the
> > system mixer before I start triaging my e-mail as a workaround.
> > 
> > Should I file a new bug or would it be covered by this one?
> 
> Hi, Stephan,
> 
> Do you mean tabs start autoplay when you change them from background to the
> foreground without any additional interaction (eg. click, keyboard press)?

That's correct.

If I middle-click a bunch of links in YouTube's search results or recommendations sidebar, the tabs will show the "playing" icon but not start actually playing. However, if I click on any of those tabs, or use Ctrl+Tab to focus them, then they will start playing immediately without any interaction with the tab's content.

They also start to autoplay immediately (modulo any page load time) if I perform an action which causes the tab to be created in the active state state by running a command like this:
    firefox https://www.youtube.com/watch?v=Pwe-pA6TaZk

(For example, clicking a link in an e-mail in my Thunderbird)
Flags: needinfo?(from_bugzilla2)
(In reply to Stephan Sokolow from comment #5)
> 
> That's correct.
> 
> If I middle-click a bunch of links in YouTube's search results or
> recommendations sidebar, the tabs will show the "playing" icon but not start
> actually playing. However, if I click on any of those tabs, or use Ctrl+Tab
> to focus them, then they will start playing immediately without any
> interaction with the tab's content.

Which version do you use? What OS do you use? Could you also provide your prefs setting?

In lastest Nightly, if you switch video to foreground, the default option will be providing a prompt to ask  whether user want to autoplay or not.

Thanks!
Flags: needinfo?(from_bugzilla2)
Firefox Developer Edition 64.0b2 (64-bit) on Kubuntu Linux 14.04.5 LTS (64-bit)

Here are the media.autoplay.* prefs that show up as noteworthy enough to be mentioned in about:support. Are there any others you want to know the value of?

  media.autoplay.allow-muted	false
  media.autoplay.enabled	false
Flags: needinfo?(from_bugzilla2)
Could you try following prefs?

"media.autoplay.enabled.user-gestures-needed=true"
"media.autoplay.ask-permission=true"
"media.autoplay.default=2"
Flags: needinfo?(from_bugzilla2)
(In reply to Alastor Wu [:alwu] from comment #9)
> Could you try following prefs?
> 
> "media.autoplay.enabled.user-gestures-needed=true"
> "media.autoplay.ask-permission=true"
> "media.autoplay.default=2"

That does result in the popup you describe, though I'd consider it a UX regression from the old way:

1. It was more convenient to click the YouTube Pause/Play button twice (once to pause, then to actually play) than to have to uncheck "remember this" every single time. (And, sometimes, YouTube would actually just recognize what was going on and present the player in non-autoplay mode, where I could click the giant play-button overlay to start.)

1a. The height of the "remember this" checkbox and its label is less than that of the YouTube Pause/Play button, so Fitts's law works against it, making it take more focus to click on.

1b.  It's slower and takes more attention to acquire and click two disjoint widgets with the mouse rather than to "double-click, but slowly" the same widget, which adds a feeling of irritation similar to typing a CAPTCHA.

2. A browser-level pop-over just inherently feels more bothersome than forcing the page to act as if it naturally didn't attempt to autoplay.
Flags: needinfo?(from_bugzilla2)
Oh, to clarify, there are two reasons I find the browser-level pop-over irritating:

1. It feels like it's something to think about over and above the natural function of the site.

2. More importantly, as designed, it covers up part of my Tree Style Tab sidebar and part of the page and there's no way to temporarily collapse it... just to deny the permission, then clumsily remove the site-specific rule and reload the page once I'm actually ready to watch/listen.
...and I just made a fool out of myself my assuming something without thinking.

I realized I never actually experimented with what "Don't Allow" did before unsetting and reloading... choosing "Don't Allow" and "Remember this decision" brings back exactly the behaviour I wanted.
(In reply to Stephan Sokolow from comment #12)
> ...and I just made a fool out of myself my assuming something without
> thinking.
> 
> I realized I never actually experimented with what "Don't Allow" did before
> unsetting and reloading... choosing "Don't Allow" and "Remember this
> decision" brings back exactly the behaviour I wanted.

You can also set the autoplay pref from "about:preferences#privacy", to choose "always block". Then there will no prompt for you.
Per comment12, I think this issue is just about not setting the correct prefs, so I'll close this bug.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
Well... a case could be made that it's a bug for media.autoplay.enabled=false to not be automatically migrated to media.autoplay.default=1 to preserve the behaviour the user configured.
You need to log in before you can comment on or make changes to this bug.