Eloston / disable-html5-autoplay

[CURRENTLY UNMAINTAINED] An extension for Chromium-based browsers that disables autoplay of HTML5 audio and video
GNU General Public License v3.0
240 stars 46 forks source link

[Discussion] Progress of disabling autoplay/autobuffering in Chrome #118

Closed uBlock-user closed 7 years ago

uBlock-user commented 7 years ago

October Edit

Read ->> https://blog.chromium.org/2017/09/unified-autoplay.html

Eloston commented 7 years ago

I don't think the feature is related to this because there are no commits or code changes associated with it yet, and its status hasn't been changed to "Started" or anything like that yet.

The behavior you're describing is interesting, though. Does it still play if you click play?

uBlock-user commented 7 years ago

Yes, works perfectly on the aformentioned test-cases. The test-cases I mentioned are using brightcove players which are known to force auto-play and auto-buffer fyi

https://www.chromestatus.com/features/6624688629350400

Check this one too - https://bugs.chromium.org/p/chromium/issues/detail?id=665456

Eloston commented 7 years ago

The links you provided are only limited to audio, but it still makes me wonder how they implemented it.

uBlock-user commented 7 years ago

Actually they're for videos and with conditional mute on audio to imitate Chrome on Android's behavior where audio is automatically muted. They haven't mentioned the word videos there specifically. Cross-origin iframes can fetch both audio and video too right ?

Eloston commented 7 years ago

I think so. I think the features you linked are just for muting audio. They aren't necessarily disabling autoplay and they are probably not disabling autobuffering. Until they figure out some solution, an extension will still be useful.

uBlock-user commented 7 years ago

But the flag explicitly is named cross-origin-media-playback-requires-user-gesture and it is doing that. Videos pulled through Brightcove players are cross origin iframes fetched via XHRs, so it does fall under the defintion of auto play and auto buffer. Also it 's media-playback not audio-playback which defies what you're saying. Media can be audio or video or both. Also it is disabling auto play and auto buffer on the aformenioned test cases. You can test if you want to.

Install Chromium - https://chromium.woolyss.com/download/

Eloston commented 7 years ago

Well that's strange, considering how your previous links described the feature. Your reasoning was enough incentive for me to seek the truth, so I skimmed some of the changes. It seems Google already has code that renders my extenion almost useless (see HTMLMediaElement.cpp).

However there are a few differences from Chromium's algorithm to this extension just from looking at HTMLMediaElement.cpp:

But overall, this is great news (or bad news, depending on the perspective).

uBlock-user commented 7 years ago

Since all signs are pointing towards what I believe would happen eventually, would it ultimately end up imitating click-to-play feature ?

Eloston commented 7 years ago

It's possible, but it most likely won't be similar to the click-to-play for plugins. Many media players overlay elements on top of the media elements that makes this difficult. EDIT: I guess it's possible to force the click-to-play overlay on top of everything else, but it'll still look pretty messy on certain sites, such as those that use it as an animated background.

uBlock-user commented 7 years ago

What about the players that force auto-play ? Brightcove and Playwire do it, did you find any code related to that ? They're the ones specifically abusing user-gestures by forcing autoplay via multiple attempts.

uBlock-user commented 7 years ago

Test-case 3 - http://9cartoon.me/Watch/11698/the-scooby-doo-show-1976-1978/season-3-episode-4-to-switch-a-witch/

By default it will start playing the video, but if you activate the chrome flag, it won't play or buffer and will leave a warning in the console like this - https://i.gyazo.com/a4d850a14809df424056a10ca82216a5.png

Eloston commented 7 years ago

Is this Chrome flag available on the currently stable version 57, or is it only on 58?

uBlock-user commented 7 years ago

It is available since v57, however it hasn't made progress as I was expecting. It works for some sites and for some it doesn't.

uBlock-user commented 7 years ago

https://bugs.chromium.org/p/chromium/issues/detail?id=715049

Eloston commented 7 years ago

Nice find. It'll be interesting to see how it will turn out in the end. It will be great if it ends the need for extensions related to disabling autoplay.

However, they didn't mention disabling autobuffering in the document. Hopefully they will be considering that too.

Kinda neat that they referenced this extension in the design document.

uBlock-user commented 7 years ago

After 4 months, I'm on Chromium 60 now and auto-play has been killed for good.

Check the Test case 2 - http://www.theage.com.au/comment/four-ways-they-can-get-rid-of-trump-sooner-rather-than-later-20170130-gu1v28.html

This is how it looks like now -

There is no auto-buffering either. I think it's safe to say that in the next few releases, auto-play and buffering will be completely under user's control.

Eloston commented 7 years ago

Wow, this is great. How do sites like SoundCloud work in this release? (They use JavaScript to create an orphaned audio element to play audio)

uBlock-user commented 7 years ago

You mean soundcloud embedded links ?

Eloston commented 7 years ago

No, I'm not talking just about SoundCloud's embedded audio player. I am also taking about the website. I am wondering how they handle autoplay disabling when everything's mostly JavaScript controlled and the audio element doesn't exist in the DOM.

uBlock-user commented 7 years ago

Yeah doesn't work there.

Anyways the work on Unified Autoplay policy is moving swiftly and is aimed for Chromium 61 release.

Subscribe to https://bugs.chromium.org/p/chromium/issues/detail?id=715049 so you can track progress.

Eloston commented 7 years ago

Yeah doesn't work there.

Do you mean that just autoplay is stopped, or do you mean it stops autoplay and any attempt to play audio?

Anyways the work on Unified Autoplay policy is moving swiftly and is aimed for Chromium 61 release.

Nice. I'll probably try it out once that becomes stable.

Eloston commented 7 years ago

Progress in Chromium 61 (development build): https://github.com/Eloston/disable-html5-autoplay/issues/175#issuecomment-310805588

uBlock-user commented 7 years ago

Do you mean that just autoplay is stopped, or do you mean it stops autoplay and any attempt to play audio?

No, I meant none of them work there.

@toddwc thanks for sharing your findings.

uBlock-user commented 7 years ago

and it works on SC too

Test case - https://soundcloud.com/a-boogie-wit-da-hoodie/drowning-feat-kodak-black-1

uBlock-user commented 7 years ago

Unless you click on the play or the spinner button, it will not buffer and play.

uBlock-user commented 7 years ago

@toddwc Can you check if it works on facebook ? For me it doesn't.

toddwc commented 7 years ago

I've never had any problems on Facebook because it provides a switch to disable autoplay.

Are there other sites we can test that are especially irritating? For me, CNN and USA Today were on the top of the list. I know it works on CNN, but haven't tested USA Today yet. Huffington Post was a problem, too, but I haven't visited there in a while.

toddwc commented 7 years ago

It works on USA Today! The only flag option that stops the autoplay is "Document user activation is required." When that's activated, you see a still photo instead of a video.

The test URL:

https://www.usatoday.com/story/news/world/2017/06/29/trumps-scaled-back-travel-ban-goes-into-effect-thursday/438523001/

uBlock-user commented 7 years ago

I've never had any problems on Facebook because it provides a switch to disable autoplay.

Yes, that's a server sided option, so switch it ON and test if it overrides your settings because it does and also same behaviour with youtube embedded widgets with autoplay set to 1 via the URL.

uBlock-user commented 7 years ago

Also it works on most websites except Facebook, Youtube and such.

That photo of the video is called thumbnail which is fine as comes under the Metadata which is fetched always before autoplay.

uBlock-user commented 7 years ago

I'm on Chromium 62 now and from what I have learnt so far, muted autoplay videos will still auto-play albeit without sound, so it's half measure. They simply don't want to patch it completely and give users the full control over autoplay, so whereever you find a muted autoplay video, either you will have to live with it or use uBlock origin and block the entire thing.

Eloston commented 7 years ago

A Chromium dev has responded to this very concern. If what the Chromium dev stated about websites were is true, then it would eventually become pointless to disable autoplay if this proposal is fully implemented, since websites would find hacky (albeit clever) ways around them.

Simply stated, Google addressed the annoyance with muting the audio. (EDIT: This is incorrect. See https://github.com/Eloston/disable-html5-autoplay/issues/118#issuecomment-322969607) They plan on addressing the data-conscious users in a different manner that includes more than just media.

As an extension to @uBlock-user's comment, uBlock Origin does specify blocking media elements beyond a customizable size.

EDIT: A word that gave the wrong impression.

toddwc commented 7 years ago

Google now has a design document on how it will algorithmically handle autoplaying video that is not muted. From what I've gathered from the document and the source code, this is basically how it will work:

toddwc commented 7 years ago

Simply stated, Google addressed the annoyance with muting the audio.

Google is not itself muting the audio. It's saying that if an autoplaying video IS muted, Chrome will leave that muted video alone.

Eloston commented 7 years ago

Google now has a design document on how it will algorithmically handle autoplaying video that is not muted.

It is quite the algorithm they came up with. I'm still wondering how well it will do in practice, though.

Google is not itself muting the audio. It's saying that if an autoplaying video IS muted, Chrome will leave that muted video alone.

@toddwc Ah I see; I misread this in my haste. Thanks.

uBlock-user commented 7 years ago

If what the Chromium dev stated about websites were is true, then it would eventually become pointless to disable autoplay if this proposal is fully implemented, since websites would find hacky (albeit clever) ways around them.

@Eloston browsers like FF and Safari have already implemented and offer FULL control over autoplay to the user, Chrome is the only one left now. So they can if they want to, but they won't.

As an extension to @uBlock-user's comment, uBlock Origin does specify blocking media elements beyond a customizable size.

That will block all media elements whether they're autoplaying or not, that's the last thing I will ever do, not preferable.

uBlock-user commented 7 years ago

Also this https://bugs.chromium.org/p/chromium/issues/detail?id=715049#c26

uBlock-user commented 7 years ago

Chrome 61 is out! Autoplay policy is now available via the chrome flag. I wonder if this is the final version or if they will continue coding autoplay policy any further.

uBlock-user commented 7 years ago

https://blog.chromium.org/2017/09/unified-autoplay.html

Related - https://bugs.chromium.org/p/chromium/issues/detail?id=310450

tvierling commented 6 years ago

The autoplay policy mentioned above still allows autoplay in many different circumstances.

There is finally a bug open to provide a global switch which presumably would make use of the existing whitelist currently in chrome://settings/content/sound (to affect all media, not just sound):

https://bugs.chromium.org/p/chromium/issues/detail?id=865551

Feel free to star this one to show interest. (As with all Chromium bugs, if you don't have technical input to provide, please don't add a "me too" or similar comment. Just click the star once you're logged in.)

uBlock-user commented 6 years ago

Autoplay is now a part of Policy Controlled Features fyi

uBlock-user commented 4 years ago

Ultimately this switch got removed and the autoplay blocking in Chromium/chrome is back to being half-assed or at times not working at all. I got rid of Chromium entirely and switched to Firefox, which is the only browser that provides complete control over Autoplay(video and audio) now. Sad to see the entire turn of events for Chromium.

xbliss commented 4 years ago

Ultimately this switch got removed and the autoplay blocking in Chromium/chrome is back to being half-assed or at times not working at all. I got rid of Chromium entirely and switched to Firefox, which is the only browser that provides complete control over Autoplay(video and audio) now. Sad to see the entire turn of events for Chromium.

This is sad. Atleast Chromium folks should not be cowering down to Google's we want to AutoPlay media mandates.

uBlock-user commented 4 years ago

Chromium folks should not be cowering down to Google's we want to AutoPlay media mandates.

There's no Chromium folks, its Google's engineers, Google runs Chromium and has complete control over what and what shouldn't get added to Chromium.

stevegilbert23 commented 3 years ago

The autoplay policy mentioned above still allows autoplay in many different circumstances.

There is finally a bug open to provide a global switch which presumably would make use of the existing whitelist currently in chrome://settings/content/sound (to affect all media, not just sound):

https://bugs.chromium.org/p/chromium/issues/detail?id=865551

Feel free to star this one to show interest. (As with all Chromium bugs, if you don't have technical input to provide, please don't add a "me too" or similar comment. Just click the star once you're logged in.)

That issue is not publicly accessible. I get a "permission denied" attempting to view it.