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.

firefox stop autoplay videos

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).

Read also:  Where are those Anonymous Firefox add-on ratings coming from?

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

firefox media autoplay enabled

Do the following to block HTML5 video autoplay in the browser:

  1. Type about:config in the browser's address bar and hit enter.
  2. Confirm that you will be careful if the notification comes up.
  3. Use the search at the top to find the preference media.autoplay.enabled.
  4. 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.

Summary
Article Name
Finally: Mozilla adds working HTML5 Video autoplay blocking to Firefox
Description
Mozilla improved Firefox's blocking of HTML5 video autoplay in Firefox 41 to block auto-playing videos on all sites.
Author

Please share this article

Facebooktwittergoogle_plusredditlinkedinmail



Responses to Finally: Mozilla adds working HTML5 Video autoplay blocking to Firefox

  1. Pete June 11, 2015 at 11:38 am #

    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".

    • Guest June 11, 2015 at 7:19 pm #

      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.

      • Pete June 11, 2015 at 10:28 pm #

        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?

      • Guest June 12, 2015 at 10:52 pm #

        @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.

      • Pete June 13, 2015 at 11:27 am #

        Trolls just keep on trolling. Pathetic.

      • Dave June 13, 2015 at 1:48 pm #

        A very small-minded response regarding computer resources.

      • Guest June 13, 2015 at 5:29 pm #

        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.

      • Pete June 14, 2015 at 12:56 pm #

        At first I was annoyed by the trolling, but now I just feel a bit sad for you.

      • Joanna Wakesmith November 13, 2015 at 10:18 pm #

        Battery life, dear boy. The longer your CPU can stay idle, the longer your battery lasts.

      • Carol March 17, 2016 at 2:16 am #

        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.

    • AJ North June 11, 2015 at 7:38 pm #

      Greetings Pete,

      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.

      Thanks,

      AJN

      • Pete June 11, 2015 at 10:49 pm #

        http://jjacky.com/2013-10-24-restore-click-to-activate-per-element-in-firefox/

        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):
        plugin.persistentPermissionAlways.intervalInDays
        plugin.sessionPermissionNow.intervalInMinutes

        Optional:
        - plugins.hideMissingPluginsNotification;true
        - plugins.notifyMissingFlash;false
        - "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.

    • GunGunGun June 11, 2015 at 11:39 pm #

      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'm using web filtering software to cover this problem, but I think only advanced user can do like me, override native javascript to achieve a better plugin blocking feature.

    • John February 23, 2016 at 2:12 am #

      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.

  2. Dwight Stegall June 11, 2015 at 11:53 am #

    Chrome is disabling auto play on Flash ads. I bet some clever devil will find a way around it all before long.

  3. not_black June 11, 2015 at 12:50 pm #

    Praise the lord.

  4. Jay-Z June 11, 2015 at 1:52 pm #

    Hey Martin,

    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.

  5. IgHive June 11, 2015 at 1:59 pm #

    Wow...4 years for this shitty solution.

    • Dieu June 12, 2015 at 5:51 am #

      Yeah but they have to develop Pocket it's lot more important to put resources on pocket than critical 4-5 years old... /S

  6. ZzzZombi June 11, 2015 at 7:52 pm #

    I was just testing my custom stylish code for youtube and I had to search something. I searched "Taylor Swift" too. What is this?

    • abcdef June 12, 2015 at 12:20 am #

      You and Mr. Martin are Swifties

  7. Uhtred June 12, 2015 at 12:00 am #

    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)

  8. Dave June 12, 2015 at 12:08 pm #

    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.

  9. Inderjeet June 17, 2015 at 8:13 pm #

    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

  10. Petar June 17, 2015 at 9:59 pm #

    Is the Firefox the first browser to implement this HTML5 blocking feature or is this also possible with other browsers?

  11. DiesLaughing October 5, 2015 at 12:02 am #

    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.

  12. Li-An May 18, 2016 at 10:40 am #

    The tip works for me FF46.01

    • Laura July 19, 2017 at 10:21 pm #

      I'm using FF54.0.1. I pray this tip will also work for me.

  13. Shirou June 29, 2016 at 1:24 pm #

    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.

  14. Anonymous July 4, 2016 at 4:11 pm #

    Did not work for me...already set to false, yet videos still autoplay...

  15. Anonymous December 1, 2016 at 6:43 pm #

    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.

  16. Ed June 8, 2017 at 3:02 pm #

    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.

  17. Li-An June 8, 2017 at 3:34 pm #

    The YouTube™ No Buffer (Stop Auto-playing) plugin does a good job.

  18. Laura July 19, 2017 at 10:18 pm #

    If this suggestion works, I'll be forever indebted to you.

Leave a Reply