Finally: Mozilla adds working HTML5 Video autoplay blocking to Firefox
I just wrote a tutorial on disabling auto-playing Flash and HTML5 videos in Firefox and Chrome in which I mentioned Firefox's media.autoplay.enabled preference to disable some -- but not all -- HTML5 videos from playing automatically.
The reason why this works only on some sites but not on others is because of how sites implement the player and play() calls. Sites may call play() directly without using autoplay, and if that is the case, they are not blocked by Firefox's current implementation of the feature as it only blocks videos if autoplay is explicitly used.
This is for instance the case on YouTube which you can test easily by setting the preference to false in Firefox before you play a video on YouTube afterwards. You will notice that the video plays automatically when you open the site.
At least, that is the case if you run a version of the browser prior to 41. If you run the latest Nightly build of the browser, you will notice that Mozilla fixed the issue.
Setting the preference to false and visiting YouTube afterwards will stop all videos from playing automatically on the site.
The bug listing, opened back in 2011 had to be reopened multiple times as Mozilla, for varying reasons, did not implement the change in the browser.
Work on it began just a couple of days ago and the final patch that resolves the issue landed for Firefox 41 versions quickly afterwards.
Firefox 41 is currently available in the Nightly channel. This means that Stable users will have to wait a couple of months before it lands in their version of the browser (it takes six weeks to move to a new version with the next update to version 39 being released on June 30, 2015).
Mozilla aims to release Firefox 41 on September 22 to the stable channel of the web browser.
Instructions to enable the blocking of HTML5 video in Firefox
Do the following to block HTML5 video autoplay in the browser:
- Type about:config in the browser's address bar and hit enter.
- Confirm that you will be careful if the notification comes up.
- Use the search at the top to find the preference media.autoplay.enabled.
- Double-click on it.
Doing so once sets the preference to false which turns autoplay off for HTML elements in Firefox. You can reverse that at any time by double-clicking again, or by right-clicking on the preference and selecting the reset option from the context menu.
Personally I don’t like this “solution” at all. The video still gets loaded. Some time ago when I was still using a flash blocking addon (then it stopped working and I moved to other better solution) it was the same thing, the flash video got loaded but paused. This caused some CPU & memory usage and flash plugin started an instance. I fear that the same resource hogging happens with this mozilla “pause solution”.
Who cares about CPU and memory? Generally you’re using less than 5% CPU, and less than 40% memory anyway. The real, highly critical issue is that it drains Internet bandwidth. As someone who has had a 5GB cap until very recently, this is an enormous cause for concern.
Unrelated note, regarding the Firefox devs…
Martin’s words here perfectly describe them. The bug is reported in 2011. It’s a fairly critical bug due to the bandwidth hogging it can cause (and still does! Clearly the idiots didn’t fix the bug properly) and it took them FOUR years to act on it. Once they did act on it, it was finished and implemented very quickly.
So Mozilla, why the hell not implement it “very quickly” back in 2011? Yeah, they have this attitude about a lot of things; it makes me mad sometimes, and sad too, to see the potential of Firefox wasted in delays and stupid decisions.
Who cares? Well I do. You know why? Firefox is a memory leak deluxe already, do we need more things that could add to it?
@Pete – my Nightly is using 311MB atm, and 113MBx2 for plugin containers (multi process)
Yeah time to upgrade from that 2GB memory entry-level laptop, eh? Or maybe just restart Firefox once a day like any normal person.
Trolls just keep on trolling. Pathetic.
A very small-minded response regarding computer resources.
I’m trolling because I claim you have 2GB memory? Why are you whining about Firefox leaking then? Yes it may leak a bit, but things will improve with e10s, because when you close a process, it can release a lot more memory.
At first I was annoyed by the trolling, but now I just feel a bit sad for you.
Battery life, dear boy. The longer your CPU can stay idle, the longer your battery lasts.
I very much care about CPU useage. Everything grinds to a halt while I wait for the video to load, then I have to turn it off after it starts playing. Pain. Stops productivity.
What got me searching was those news sites. I go there for a specific story and most often I do not care to sit through a video, just want to read the article. And then it starts playing ANOTHER video on a DIFFERENT story that I don’t care about. I’m way down the page reading, now have to go to the top, stop it, go back and find my place again.
I want the next video to NEVER play.
P.S. YOUR computer is not the same as everyone else’s as to CPU resources.
Do you even know anything at all besides where your mom keeps the pizza rolls?
Does your “other better solution” prevent the plugin-container from being loaded, and if so, could you post your solution? I’ve got the Flash Control add-on installed (updated 2015.06.07), but the plugin-container still loads.
1) Put flash plugin to “ask to activate”.
2) Install “Click to Play per-element” addon: https://addons.mozilla.org/en-US/firefox/addon/click-to-play-per-element/
3) Open about:config and set these to 0 (zero):
– “Click to Play per-element” addon options -> “hide plugin notifications” enabled.
Now firefox never “remembers” enabled flash for a site. Also you can activate individual plugins per page (otherwise all would be activated once you click one).
Flash & plugin-container processes wont start until you click to activate an element.
You re right, the way web browser in generall like FIrefox, Chrome, Opera, all of them still load plugin then stop download, that way of implementing is bad because they still leak our IP.
I’ve also discovered that turning this autoplay to false amkes google timer no longer produce audio. I use google timers all the time, so not a good solution for me.
Chrome is disabling auto play on Flash ads. I bet some clever devil will find a way around it all before long.
Praise the lord.
will you cover the new Thunderbird-Release? I think that’s the Version with Lightning-Integration. I would like to read your opinion as a Thunderbird-User on this step.
There seems to be a lot of changes: https://www.mozilla.org/en-US/thunderbird/38.0.1/releasenotes/
I like it :)
Wow…4 years for this shitty solution.
Yeah but they have to develop Pocket it’s lot more important to put resources on pocket than critical 4-5 years old… /S
I was just testing my custom stylish code for youtube and I had to search something. I searched “Taylor Swift” too. What is this?
You and Mr. Martin are Swifties
if you click outside of a loading element the right click context menu has a stop loading page icon, that should kill background loads, not an elegant solution but may be useful?
(not sure if this left over from tinkering with former splitting reload and stop buttons on addressbar, which sadly no longer works in 38.0.5)
This feature of HTML5 caused me to go over my mobile data allowance for the first time now that it’s built into IE11 on Windows Phone. It’s awful. Shitty ads now play outloud wherever you are, meaning I’ve had to increase my data cap by Â£2 a month just to accommodate this new feature that I don’t want.
They added this feature very late. Its a important thing for any browser user. I’m waiting for this update from many days. Anyways, thanks for informing Martin
Is the Firefox the first browser to implement this HTML5 blocking feature or is this also possible with other browsers?
The solution in the article doesn’t actually work. I opened Firefox and set medi.autoplay.enabled to false and it kept videos form autoplaying FOR THAT SESSION. When I closed and re-opened Firefox videos were autplaying again, even with the setting still at false. I double-checked to make sure I was running Firefox 41 and I am. Thanks Pete for your solution. It seems to work much better.
The tip works for me FF46.01
I’m using FF54.0.1. I pray this tip will also work for me.
This solution is sh as it breaks youtube player and it auto buffers but doesnt stop anything, clicking on the player or pause and then play button doesn’t play the video.
Did not work for me…already set to false, yet videos still autoplay…
I used this for a couple of months, and finally removed it. I was more trouble than it’s worth. Youtube videos required clicking the start button multiple time to get the video to play. Vimeo vids would not play at all. I’d have to open them in a different browser. Maybe they’ll get the kinks worked out someday, but right now it’s too hinky to bother with.
This firefox autoplay setting works so poorly it’s unusable. Youtube videos won’t play unless you manually touch the video position slider, and other types of videos such as Vimeo won’t play at all.
The YouTubeâ„¢ No Buffer (Stop Auto-playing) plugin does a good job.
If this suggestion works, I’ll be forever indebted to you.
Chrome and firefox are owned by google. google bought adblock. Google owns adsense.
The problem is the browsers themselves. Don’t let wolves guard the chicken coop.
SWEET JESUS THANK YOU FOR THIS!!!!
Thanks for what, it doesn’t actually do anything.
Nope. Doesn’t work. The blue autoplay next slider control is still there. Firefox 61.0.1. Tested on 20 July 2018.