If you use Safari, you might be regularly annoyed by the tendency of certain sites to automatically play their videos when you vist the page. I know it bothers me, and yes, I’m looking at you, CNN. Thanks to the capable sleuthing of Mac Geek Gab listener Scott Barman, we can show you how to turn off video autoplay in Safari. This method works in macOS Sierra and OS X El Capitan, and probably other versions of OS X.
Disable Video Autoplay in Safari
To disable video autoplay, you need to quit Safari completely. That means clicking Safari from the top left of the menu bar, and then Quit. Once that’s done, launch Terminal from Applications -> Utilities. In Terminal, type the following commands:
defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
If you’re running the WebKit Technology Preview, you’ll also need to run these commands in Terminal:
defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
That’s it. Start up Safari once again, and enjoy a life free of video autoplay.
BUT! i now want to REVERT the terminal command because it’s kind of a pain in other places… so… PLEASE… what is the code to reverse the info above? thank you!
All you have to do is issue the same commands, but with “true” instead of “false.”
Whoa, thank you for the instant response. I’ll try it. I’m the kind of user that has no business trying anything in Terminal, it’s a frightening space for the layperson.
DQ
This is a great article. I wish that there was a way to vote this article “up” to make it easier for others to find.
Thank you so much. This is ridiculous CNN. It’s been a pain to shut off. This worked great!
How do I reset it now to original setting?
(Causing problems)
thanks
Well, does not work for me, with the new benefit of not being able to even stop the video using its own controls. I assume to reverse this I change the “false” flags to “true” ?
(Using 10.9.5)
Faxus, thanks for the Debug menu tip
Seeing as this story has evolved into a Safari wish list, can we:
1. Hide the fact that Safari is in Private mode? Some websites won’t let you in unless they can dump a ton of permanent cookies on you.
2. Block popup nags to sign up for newsletters?
You can also use the Debug menu for those who have enabled it
Defaults write com.apple.Safari IncludeInternalDebugMenu 1
(Or SafariTechnologyPreview)
Then Media Flags > Disallow Inline Video
[img]http://i.imgur.com/uBURTrx.png[/img]
vpndev: Not that I’m aware of LOL
GraphicMac: As long as you keep reading TMO, go for it. I read Macworld on an almost daily basis, to be honest.
Wow. This might actually make me reading Macworld.com again. Haven’t been there in over a year because of their stupid auto-play videos.
I tested this…and it works!
Well, at least today it works, until they find a way around it. I’m ok with advertisements as long as they don’t distract me from the content that I came for. If its inline with the content I’m reading ( i.e an ad inserted in-between paragraphs ) or animated or plays sounds that break my concentration from what I’m reading, then it’s a deal breaker. Silent, static ads that are outside of the “content zone” are ok with me.
Is there a way to kill GIF animation?
Please? PLEASE ??
It works! At least on a favorite website, and I am sure that it is universal.
This should be a Safari Extension
Yes! And thank you!!
Looking at you CNN!
Thank you!