Stop Auto-Play Videos from Annoying You in Your Browser on macOS

Auto-play videos suck. They use bandwidth, and their annoying sounds get in the way when you’re listening to music and open a web page. I happen to write for a website that uses them, and it annoys me to no end. (My editors have no control over those auto-play videos, alas.)

But you can stop auto-play videos from playing on a Mac. If you use Chrome or Firefox, it’s pretty simple, and the plugins below work both on macOS and Windows; if you use Safari, it’s a bit more complex, but it’s not that hard.

For Chrome: Get the Disable HTML5 Autoplay plugin. This blocks both video and audio from playing automatically.

For Firefox: Use FlashStopper.

For Safari, there used to be an excellent plugin called ClickToPlugin, but it is no longer being updated. So to turn off autoplay videos, you need to first work in Terminal. Quit Safari, then open Terminal (it’s in /Applications/Utilities). Paste this command into the window:

defaults write com.apple.Safari IncludeInternalDebugMenu 1

Press Return, and wait a few seconds.

Quit Terminal, then launch Safari again. You’ll see a new menu called Debug. To turn off autoplay videos, choose Debug > Media Flags > Disallow Inline Video. (Some people are reporting that choosing this option causes problems playing videos on YouTube. Try Video Needs User Action, if you have this issue. It seems to do more or less the same thing.)

I’m not sure if this still works to enable the Debug menu for Safari on Windows.

With all of these tools, you can still play video or audio; you just need to click the play buttons to do so. But you will no longer be annoyed by autoplay media.

If you want to hide the Safari Debug menu, just quit Safari, then run this command in Terminal:

defaults write com.apple.Safari IncludeInternalDebugMenu 0

H/t Richard Frisch.

Update:

• If you want to display the Debug menu in Safari Technology Preview, this is the command to run:

defaults write com.apple.SafariTechnologyPreview IncludeInternalDebugMenu 1

• Here are the direct commands to activate and deactivate this feature in Safari from Terminal, without displaying the Debug menu:

defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false

defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false

defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false

Thanks to zwaldowski for posting them.

• Thanks to a commenter, here’s a link to the Disable HTML5 Autoplay Plugin for Opera.

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone

42 thoughts on “Stop Auto-Play Videos from Annoying You in Your Browser on macOS

  1. Finally! I’ve tried a bunch of solutions to prevent videos from auto playing in Safari and none of them worked until now. I can finally browse news sites again without their ads and videos auto playing. Thanks for the tip!

      • For me, the Youtube video loads and looks like it is running.. Click on it and it stops. Click on the play arrow on the bottom of the video, and it goes full screen and plays.

        • Same here. It not only goes full screen but you get an annoying message in the bottom right corner that you can’t dismiss saying full screen mode isn’t available at the moment, even though it’s playing in full screen mode.

          Definitely need a better solution than this.

    • It’s quirky. Try clicking on the video a couple of times. You’ll probably end up eventually with a full screen HTML5 video, which you can collapse to normal size by hitting the escape key.

  2. Any tips on how to do this in the Technology Preview version of Safari? I tried swapping out the app names in the Terminal string, and while it wasn’t rejected, nothing changed in TP.

  3. Yes, Richard Frisch and Kirk, thanks so much for this tip. Especially on the news sites — I’m looking at you, Reuters.com

  4. with Safari 10 / OS X 10.11 this causes weird things (seen on YouTube / Twitter / Elpais) first click on the Play/Pause thingie ends the video in full screen mode – pressing Esc kills that, luckily. To pause / stop I also needed two or more clicks.
    :-(.

  5. I suspect that the “Video Needs User Action” option in the same menu will actually work better; “Disallow Inline Video” will probably force you to use a separate player window (at least more often).

    • Oh, indeed. I unchecked the “Disallow Inline Video”, then checked the “Video Needs User Action”, and the experience — at least on YouTube — is much smoother. It still requires to clicks, once to pseudo stop the video, once to start, bu no more forced full screen and so on. Hopefully this will be the same on other sites / pages. Thank you for that tip.

    • I came here looking for the same solution. I guess the only way is to stop going to CNN. Their videos are HTML5, not Flash, so any Flash blockers won’t work.

  6. Yes, “Disallow Inline Video” is a THE WRONG solution. After I accidentally upgraded to Safari 10 (with no way to downgrade), I found browsing a much more horrible experience. ClickToPlugin is irreplaceable, but with the “Disallow Inline Video” option checked, and the SaveFrom.net Safari extension, I’ve managed to get close to the ClickToPlugin experience (including easy download of any video content).

  7. You can skip the terminal if you open Safari Preferences and open the Advanced Tab. “Show Debug Menu” is on the bottom of that tab.

  8. Any way to do something similar on iOS? The videos deal on the desktop is annoying, but on iOS, it uses my cellular bandwidth up. Videos are downloading and playing with no intervention from me, and it burns into my data limits.

  9. For Firefox, it seems like simply turning media.autoplay.enabled to “false” in about:config does the trick too!

  10. This post just won the Internet! I’ve been searching for quite awhile to solve this problem in Safari.

    The auto-playing of inline video is openly hostile to users, and publishers that use / allow it just incentivize users to block the videos outright. I guess only the tech savvy get to figure out how to block this stuff, but I bet it gets to be more like ad blocking. When it reaches a high level of penetration, maybe publishers will stop with the abusive approach but by then it will be too late. So shortsighted.

  11. I wonder if the recommended fix on Safari – using the Debug menu to change media flag to disallow inline video — is the best solution.

    On Facebook on desktop Safari at least, while this DOES stop autoplaying, it ALSO forces the video (when clicked) to play in fullscreen, which usually isn’t what you want.

    Instead, choosing “Video requires user interaction) appears to do same thing, but without the forced full screen.

  12. Hmmm. This seemed attractive to me, tried it. The ‘Media Flags’ option does not appear in my Debug menu, nor do any of its subcommands.

    Did Apple remove it? Or am I missing something?

  13. Safari’s Debug menu doesn’t contain ‘Media Flags’ for me either. I haven’t updated El Capitan on this iMac yet so I’m running OS X 10.11.4 and Safari 9.1.

      • Indeed. I read and followed along with the article before posting my comment.

        After activating the Debug menu, it doesn’t contain the ‘Media Flags’ sub-menu. My Debug menu contains the ‘Drawing/Compositing Flags’ sub-menu and directly below is the ‘Debug Overlays’ sub-menu.

        Your article doesn’t confirm which version of Safari you performed this with, hence me posting my OS and Safari versions.

        Thanks for posting the article, I’m just unsure why my version of Safari has a different Debug menu.

        • I used the latest version of Safari: 10.0.3 and macOS Sierra. I would have expected the menu to have been the same before, but apparently it wasn’t.

  14. Video autoplay IS hostile to users. I have tried this solution and though it works, it turns the whole video experience into a kludge. I have given up on Safari and wont come back until auoplay can be easily and fully disengaged.

  15. one thing i’ve found is that youtube videos now open in fullscreen when you hit play. i found that if you choose “Video Needs User Action” from the drop down menu instead, it cures that, and the tendency of facebook videos to open fullscreen while still blocking autoplay…

    thank you so much! autoplay videos are a plague.

  16. Sigh…as others have said, the Media Flags sub-menu does not exist in Safari 9.1.2, which is the current version for OS X El Capitan.

    To make it worse, CNN.com now launches not one, but two auto-play videos on each page. An ad-teaser, and then the main video. I’m surprised that my AdBlock Safari extension by BetaFish (donation paid) doesn’t address this.

  17. The Media Flags sub-menu does not exist in Safari 9.1.3 either. I have “Drawing/Compositing Flags”, then “Miscellaneous Flags” underneath which also leads nowhere.

    I have to disable AdBlock Safari before I’m “allowed” to watch videos on some sites. In the meantime, I’m subjected to forced downloads I don’t want while my data allowance gets eaten by these fiendish auto-play ads & videos.

    On a side note, I’m really fed up with various customer support staff telling me to download Google Chrome when their websites glitch with Safari… and YouTube has only gotten worse with Google’s takeover… but I digress.

  18. Thank you!! It also stops videos from shrinking and moving to another spot so that they stay on your screen as you scroll down the page!!!

  19. The ability to stop autoplay in Safari will be one of the new features in the High Sierra Mac OS update later this year.

Leave a Comment