Closed Bug 1634453 Opened 5 years ago Closed 5 years ago

Firefox fails to block muted autoplaying videos from websites such as Reuters

Categories

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

75 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: nekohayo, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

Go to reuters.com and scroll down.

Actual results:

A video of "Reuters TV" starts autoplaying, muted. It needlessly wakes my CPU and eats my battery life. This kind of stuff is pervasive on many news sites and social media, reuters.com is just one easy example.

Expected results:

Considering that I have autoplay set to be fully disabled in the preferences (in about:preferences#privacy, the "default for all websites" is set to "Block audio and video"), and even explicitly forbade it for the reuters.com website (as the popover in the screenshot seems to indicate), Firefox 75+ should do everything in its power to ensure that websites CANNOT autoplay videos until I explicitly click the HTML5 video's play button. Those autoplaying videos with Javascript are a disease and Firefox is my only hope to protect against them.

My about:config has these settings:

media.autoplay.default = 5
media.autoplay.enabled.user-gestures-needed = true
media.block-autoplay-until-in-foreground = true

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Our default blocking autoplay policy is user-gesture-activation which would only block autoplay before a user activates the page. If you want to stop autoplay until you click on the page, you can set the pref media.autoplay.enabled.user-gestures-needed =false to use click-to-play policy [1].

[1] https://docs.google.com/document/d/1p81bYntlLMTxXoANnQXS9KH0TZ4y8aKKeH9x3GVS3eY/edit#heading=h.k3q4co83ntet

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID

Click on the page or click on the video? Lot of website abuse click on the page to start autoplay as soon as you click, sometime putting a "read more" just to force you to do so.

Any chance this documentation be put in a place where it is searchable?

I think you closed this bug report a bit too fast, and would appreciate you reconsidering it.

The default behavior is both undersireable and buggy, and the setting's name is also misleading. Using the Reuters homepage as a test case again, I can confirm the following regarding media.autoplay.enabled.user-gestures-needed:

  • When True (the default), if you click ANYWHERE (and for any reason, including selecting text or clicking and dragging the browser's scrollbar, or simply right-clicking... none of which are legitimate reasons for starting video playback) and then scroll or switch to another tab (and then come back), the video starts playing by itself, even if your global preference is to "Block Audio and Video". This is unexpected and undesireable from a user's perspective. It has absolutely no business starting video playback unless I click on the video's play button.
  • When False, then the video does not autoplay until you specifically click on the HTML5 video's play button (matching the kind of behavior I would expect by default when "Block Audio and Video" is my setting, yay!) but then... it plays with the sound muted, which doesn't make sense since playback was explicitly requested by the user by clicking on the video element's play button (and yes that's a problem: in usability observations with elderly people I noticed they were confused as to why they couldn't hear the sound from the video when they clicked Play).

So in practice it has the wrong default behavior when the user has their settings to "Block Audio and Video", and if the user somehow finds out that this obscure "user-gestures-needed" setting is supposed to be set to the reverse of what one would expect, it then doesn't behave as expected when you do actively click the play button.

You could say that this is how the switch works behind the scenes in theory... but in practice, in the frontend, when users set the global setting to "Block Audio and Video", the user intent is to block the audio and video, whether the video has sound or not, whether the user has clicked "somewhere" on the page and scrolled or not. Otherwise if they wanted autoplaying muted videos, they would have chosen the "Block Audio" setting, which is implicitly understood as "Just block stuff blasting out of my speakers, but don't touch the rest".

So please fix the behavior to respect the implicit "intent" of the global "Block" setting (media.autoplay.default), and probably kill the media.autoplay.enabled.user-gestures-needed switch as I really don't see the point of that... or, if you folks really insist on having some "let the muted videos autoplay unexpectedly based on using the mouse anywhere on the page" functionality remain (I can't imagine who would actually want that, but okay) then you ought to add "yet another" choice for that global "media.autoplay.default" setting in about:preferences#privacy : "Block audio and all videos (whether muted or not)" ... which might sound ridiculous* (because you'd expect that to be the default behavior), but oh well, if you don't want that to be the default behavior for "Block Audio and Video", this fourth option makes the UI crystal clear and lets Firefox better protect me.

*: the alternative naming for that option would be "REALLY Block Audio and Video, Seriously." but that just highlights how the current 3rd option mismatches the will of the users seeking to change that setting in the preferences ;)

I can confirm this bug with Flatpak Firefox 76.0b8

When using user-gesture-activation policy, which would activate the page by clicking, keyboard pressing, touching anywhere on the page. So that is how it works and this policy is applied on Chrome as well, but they have another factor affecting the final result which is the Media Engagement Index.

So yes, our default policy is actually not blocking all media, it would only bloack media BEFORE a user activate the page. I totally agree with you that we should have a better naming or havine another option in the preference page to allow user easily switch user-gesture-activation and click-to-play policies. So I will file another bug for adding that option in the preference page.

  • When False, then the video does not autoplay until you specifically click on the HTML5 video's play button (matching the kind of behavior I would expect by default when "Block Audio and Video" is my setting, yay!) but then... it plays with the sound muted, which doesn't make sense since playback was explicitly requested by the user by clicking on the video element's play button (and yes that's a problem: in usability observations with elderly people I noticed they were confused as to why they couldn't hear the sound from the video when they clicked Play).

When I use media.autoplay.default = 5, none of muted video would start playing. They remains blocked until I click on them. Could you check your setting again to see if you unexpectedly changed it to 1 which is equal to Block Audio in the autoplay setting page.

Flags: needinfo?(nekohayo)

(In reply to Hubert Figuiere [:hub] from comment #4)

Any chance this documentation be put in a place where it is searchable?

I just linked it on the block autoplay metabug (bug 1376321) and I will post in on ther public places if I find more suitable ones.

See Also: → 1635281

When I use media.autoplay.default = 5, none of muted video would start playing. They remains blocked until I click on them. Could you check your setting again to see if you unexpectedly changed it to 1 which is equal to Block Audio in the autoplay setting page.

I can confirm that the issue still occurs for me, at least on Firefox 75 on Fedora (76 hasn't landed in my updates yet). With media.autoplay.default = 5 and media.autoplay.enabled.user-gestures-needed = True (the default), going to Reuters.com, and click-dragging the global scrollbar on the right up and down across the page, the video definitely starts playing by itself as a PIP overlay.

P.s.: of course, if I set user-gestures-needed to False it doesn't autoplay (which at least gives me a hacky workaround for the time being), but as I was saying above I don't think expecting people to discover and set it that way makes sense as the official solution :) also, considering that YouTube and WebRTC/Jit.si still seem to work fine with media.autoplay.default = 5 + media.autoplay.enabled.user-gestures-needed = False, I am, so far, failing to see a genuine usecase for the gesture-based "react on any click anywhere" autoplay behavior when users actively want to block autoplaying videos.

Flags: needinfo?(nekohayo)

Ah, yes, I mean when setting media.autoplay.enabled.user-gestures-needed=false and media.autoplay.default=5 should prevent playing muted video in the click-to-play policy. I've filed bug 1635281 to address this issue in order to give users an easier way to enable this option. Free feel to discuss related stuffs on there.
Thank you!

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

Attachment

General

Creator:
Created:
Updated:
Size: