Bug 1376321 (block-autoplay)

[meta] blocking autoplay meta bug (pref "media.autoplay.default")

NEW
Unassigned

Status

()

P3
normal
2 years ago
10 days ago

People

(Reporter: bwu, Unassigned)

Tracking

(Depends on: 10 bugs, Blocks: 1 bug, {dev-doc-needed, feature, meta})

unspecified
dev-doc-needed, feature, meta
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(relnote-firefox 66+)

Details

(Whiteboard: if you want to disable muted autoplay, please also set "media.autoplay.allow-muted=false")

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
This is a meta bug to track all the bugs related to media.autoplay.enabled=false. 
I have seen many bugs related to this and will set many bugs depend on this.
(Reporter)

Updated

2 years ago
Depends on: 1323063, 1373904
Fixing subject as it does not seem to describe what is being tracked here.
Summary: Make media.autoplay.enabled work → Make media.autoplay.enabled=false work
(Reporter)

Updated

2 years ago
Depends on: 1231886
(Reporter)

Updated

2 years ago
See Also: → bug 1379999

Updated

2 years ago
Summary: Make media.autoplay.enabled=false work → [meta] make media.autoplay.enabled=false work

Updated

2 years ago
Alias: disable-autoplay-by-pref

Updated

2 years ago
Depends on: 1382574
(Reporter)

Updated

2 years ago
See Also: → bug 1313233
(Reporter)

Updated

2 years ago
Depends on: 1382884
(Reporter)

Updated

2 years ago
Depends on: 1395171
Depends on: 1412772
Depends on: 1182329
See Also: bug 1379999
Depends on: 1413098
Depends on: 1415444
Depends on: 1415478
Depends on: 1336400
Depends on: 1419349
Depends on: 1420375
Depends on: 1420378
Depends on: 1420389
Depends on: 1421518
(Reporter)

Updated

a year ago
Depends on: 1428288
Depends on: 1428722
Alias: disable-autoplay-by-pref → block-autoplay
Depends on: 1430012
Depends on: 1430019
Depends on: 1430544

Updated

a year ago
Depends on: 1433987
Depends on: 1435035

Updated

a year ago
Depends on: 1435037
Duplicate of this bug: 1434255
No longer depends on: 1431674

Updated

a year ago
Depends on: 1437308

Updated

a year ago
Depends on: 1437333
Depends on: 1453843
Depends on: 1453862
Depends on: 1456037
Depends on: 1456322
Depends on: 1457048
Depends on: 1457425
Depends on: 1458383
Depends on: 1461877
Depends on: 1463919
Depends on: 1464922
Current design for the logic of HTMLMediaElement.play() when block-autoplay is enabled.
Depends on: 1464930

Updated

9 months ago
Depends on: 1473671

Updated

9 months ago
Depends on: 1474430

Updated

8 months ago
Depends on: 1475099

Updated

8 months ago
Depends on: 1476701

Updated

8 months ago
Depends on: 1477273
Depends on: 1477415
Keywords: feature

Updated

8 months ago
Depends on: 1477926

Updated

8 months ago
Depends on: 1478024

Comment 7

8 months ago
DDN-Comment
For the writing team when the time comes, from the intent-to-ship message:

SUMMARY:

We intend to change the behaviour of HTMLMediaElement to block autoplay of audible audio and video in Firefox on desktop and mobile.

We are not going to block WebAudio at the same time. While we do plan to block audible autoplay of WebAudio content in the near future, we have not finalized our WebAudio blocking logic or intended ship date for blocking WebAudio.


TIMELINE:

We intend to run shield studies on the user impact of enabling HTMLMediaElement autoplay blocking. If those go well we hope to ship in Firefox 63 (2018-10-23) or Firefox 64 (2018-12-11). Upon conclusion of our experiments, I’ll follow up here with a confirmed ship date for this feature.

We hope to block autoplay in WebAudio in a release soon after, hopefully Firefox 64 or 65.


DETAILS:

We intend to block autoplay of HTMLMediaElement in tabs which haven't had user interaction. Web authors should assume that they require a user gesture (mouse click on a "play" button for example) in order to play audible media.

HTMLMediaElements with a "muted" attribute or "volume=0" are still allowed to play.

As with other browsers implementing this feature, we express playback being blocked by rejecting the promise returned by HTMLMediaElement.play(). Web authors should always check whether the promise returned by HTMLMediaElement.play() is rejected, and handle that case accordingly.

We also plan to allow users to create their own whitelist of sites which they trust to autoplay.

We are planning to experiment via shield studies with prompting users to approve/block playback on sites that try to autoplay before receiving user interaction.


ADVICE FOR WEB AUTHORS:

In general, the advice that applies to other browsers [1][2] with respect to autoplaying media will apply to Firefox as well; you cannot assume that you can just call HTMLMediaElement.play() for audible media and expect it to always play. You should always check whether the play promise is rejected, and handle that case accordingly.

For example:

var promise = document.querySelector('video').play();

if (promise !== undefined) {
    promise.catch(error => {
        // Auto-play was prevented
        // Show a UI element to let the user manually start playback
    }).then(() => {
        // Auto-play started
    });
}

(This example comes from WebKit’s announcement on blocking autoplay [2])

To test block autoplay in Firefox 63 (currently in Firefox Nightly channel), download the latest Nightly and open about:config in the URL bar and set the preferences:

media.autoplay.enabled=false
media.autoplay.enabled.user-gestures-needed=true
media.autoplay.ask-permission=true
Keywords: dev-doc-needed
No longer depends on: 1478024
Depends on: 1478226
Depends on: 1478423

Updated

8 months ago
Depends on: 1478599

Updated

8 months ago
No longer depends on: 1478599

Updated

8 months ago
Depends on: 1478860

Updated

8 months ago
Depends on: 1478869

Updated

8 months ago
Depends on: 1478946

Updated

8 months ago
Depends on: 1479589

Updated

8 months ago
Depends on: 1480281

Updated

8 months ago
Depends on: 1480484

Updated

8 months ago
Depends on: 1480738
Depends on: 1481322
Blocks: 1478860
No longer depends on: 1478860

Updated

8 months ago
Depends on: 1482259

Updated

7 months ago
Depends on: 1482284

Updated

7 months ago
Depends on: 1483703
Duplicate of this bug: 1215843

Updated

7 months ago
Depends on: 1485160
No longer depends on: 1482284
Depends on: 1487844

Updated

7 months ago
Depends on: 1489278

Updated

6 months ago
Depends on: 1493027

Updated

6 months ago
Depends on: 1494144

Updated

5 months ago
Depends on: 1497737

Updated

5 months ago
Depends on: 1499803

Updated

5 months ago
Whiteboard: if you want to disable muted autoplay, please also set "media.autoplay.allow-muted=false"

Updated

5 months ago
Depends on: 1497582

Updated

5 months ago
Depends on: 1500234

Updated

5 months ago
Depends on: 1502046

Updated

4 months ago
Depends on: 1506557

Updated

4 months ago
Depends on: 1509933

Updated

4 months ago
Depends on: 1511117

Updated

4 months ago
Depends on: 1512283

Updated

3 months ago
Depends on: 1513039

Updated

3 months ago
Depends on: 1513681

Updated

3 months ago
Depends on: 1513612

Updated

3 months ago
Depends on: 1512362

Updated

3 months ago
Depends on: 1514615

Updated

3 months ago
Depends on: 1516482

Updated

3 months ago
Depends on: 1516598

Updated

3 months ago
Depends on: 1517526

Updated

3 months ago
Depends on: 1517562

Updated

2 months ago
Depends on: 1519229

Updated

2 months ago
Summary: [meta] make media.autoplay.enabled=false work → [meta] blocking autoplay meta bug (pref "media.autoplay.default")

Comment 9

2 months ago

I have a problem with "media.autoplay.default":

If set to 1, then the following video (as a sample, I hav seen this elsewhere) can't be manually started:
https://www.msnbc.com/all-in/watch/fbi-opened-inquiry-into-whether-trump-working-for-russia-report-1424588867508

(In reply to Torsten Villnow from comment #9)

I have a problem with "media.autoplay.default":

If set to 1, then the following video (as a sample, I hav seen this elsewhere) can't be manually started:
https://www.msnbc.com/all-in/watch/fbi-opened-inquiry-into-whether-trump-working-for-russia-report-1424588867508H

Hi, Torsten,

Could you check whether you also have the pref "media.autoplay.enabled.user-gestures-needed=true"? I tested this site in the latest Nightly, it can start playing without problems.

Thank you.

Flags: needinfo?(t.villnow)

Comment 11

2 months ago

Hi Alastor,

"media.autoplay.enabled.user-gestures-needed" was set to false. After having changed it to true the videos on MSNBC can be manually started now. However, as a side-effect the videos on Youtube are now started automatically, which was not the case before this change. Is this working as intended with these settings?

Flags: needinfo?(t.villnow)

Updated

2 months ago
Depends on: 1520023

(In reply to Torsten Villnow from comment #11)

Hi Alastor,

"media.autoplay.enabled.user-gestures-needed" was set to false. After having changed it to true the videos on MSNBC can be manually started now. However, as a side-effect the videos on Youtube are now started automatically, which was not the case before this change. Is this working as intended with these settings?

That is a known issue, if you disable "media.autoplay.enabled.user-gestures-needed", then it would break those webistes who are calling video.play() asynchronous in the user-event handler. That issue is blocked by bug1185052, so we're still waiting fot the fix. To only allow autoplay by user clicking, we call this model as click-to-play model, and as you see, it still can't work for every sites, so that is the reason why we don't enable this pref as a default option.

When you turn on the pref "media.autoplay.enabled.user-gestures-needed", video won't be allowed in the beginning, it would be allowed to autoplay after user activates page by user gesture (eg. mouse click, keyboard press, touch). We call this model as user-gesture-activation model. So Youtube would be allowed to autoplay after you activate them.

Updated

2 months ago
Depends on: 1520088

Updated

2 months ago
Depends on: 1520361

Updated

2 months ago
Depends on: 1520431

Updated

2 months ago
Depends on: 1520436

Updated

2 months ago
Depends on: 1520482

Updated

2 months ago
Depends on: 1520501

Updated

2 months ago
Depends on: 1520546

Updated

2 months ago
Depends on: 1520596

Updated

2 months ago
Depends on: 1520663

Updated

2 months ago
Depends on: 1520734

Updated

2 months ago
Depends on: 1520912

Updated

2 months ago
Depends on: 1521947

Updated

2 months ago
Depends on: 1522053

Updated

2 months ago
Depends on: 1522092
Depends on: 1522058
Depends on: 1522065

Updated

2 months ago
Depends on: 1522923

Updated

2 months ago
Depends on: 1523766

Updated

2 months ago
Depends on: 1524258

Updated

2 months ago
Depends on: 1525156

Updated

a month ago
Depends on: 1528343

Updated

a month ago
Depends on: 1528696

Updated

24 days ago
Depends on: 1530220

Updated

23 days ago
Depends on: 1531114

Suggested release note for block autoplay (from chsiang):

Block autoplay media: Firefox now blocks all autoplay media with sound by default. Users can add individual sites to an exceptions list or turn the blocking off. Visit our support page to learn how to do that. We recommend websites to follow these strategies to avoid media been blocked and to provide the best user experience.

relnote-firefox: --- → 66+

Updated

10 days ago
Depends on: 1534219
You need to log in before you can comment on or make changes to this bug.