How To Disable Auto-Play Videos in Safari – macOS
You open Safari to browse the Internet. You visit a web site and want to read an interesting article, you are very happy but while the website is loading, you hear something, someone is talking, because a video has automatically started playing without your permission.
Some websites (e.g., CNET) do this so a video or audio automatically plays when the webpage is loaded. These are usually some sort of video based advertisings.
This in-fact is very annoying. I think it is safe to say that automatically starting a video can annoy a lot of visitors. For instance, suppose you are in a quiet library and studying. Autoplay can be intrusive for someone who is in a quiet area.
Yesterday morning I visited CNET. Then I heard someone talking. I had no idea what was going on and who was talking. Then I realized the sound was coming from my MacBook. It took me a few seconds to realize what was going on. I think many users are like me. Some users may even have troubles finding the mechanism to stop it.
Furthermore, sometimes when people are reading their social media feeds (e.g., Facebook, Twitter etc), disturbing, often graphic, videos automatically start playing. For instance, the killing of Russian ambassador was recorded on video and it was watched by many people on social media unwittingly.
Turn off autoplay
So you want to stop videos (HTML5 videos) from autoplaying when you visit a website that has autoplaying contents, because autoplay is (1) annoying (2) time consuming (3) causing people to use more cellular data. Here is how:
First thing we need to do is to enable Safari’s debug menu in macOS. The debug menu offers additional features for the purpose of debugging.
- Quit Safari (Safari > Quit Safari)
- Open the Terminal app (/Applications/Utilities)
- Enter this command. This command will unhide the debug menu:
- defaults write com.apple.Safari IncludeInternalDebugMenu 1
- Press Return
- Close the Terminal app
- Now reopen Safari
Now you have enabled the debug mode and you will see the debug menu in Safari’s menubar.
Now go to Safari > Debug > Media Flags and select Disallow Inline Video. Selecting this will stop videos from automatically playing when you visit a webpage. This will stop all soft of autoplaying, including social media videos. So you do not see unwanted contents.
Now you can hide Debug Menu again. If you want to turn off Debug Menu, follow these steps:
- Open the Terminal app
- And enter the following command:
- defaults write com.apple.Safari IncludeInternalDebugMenu 0
- Close the Terminal app
- And restart Safari
And one note to the web developers:
Auto play is an accessibility and usability issue. Word Wide Web Consortium (W3C) does not recommend it by saying “we discourage the practice of automatically starting sounds (especially if they last more than 3 seconds), and encourage that the sound be started by an action initiated by the user after they reach the page…”
I’ve enabled the debug drop down but the “Media Flags” option is missing from my list? I am using OS 10.11.6 I have very limited bandwidth due to remote location and the automatic video loading is incredibly annoying.
It works for me but now my games won’t start. FB was easy to fix in settings, videos, change default to no. But my games! I have to go to debug to allow them to work. Is there another option?
the problem I have is that it seems that the command is not being saved, did all the steps and no debug, when I go into the terminal is not showing the command, how can I make sure the command is being saved?
Thanks! Easy! If I had to listen to that IBM Watson ad on CNN ONE MORE TIME I wouldn’t be responsible for my actions :\
I did both those things but the video stills plays automatically after deleting spam in the yahoo mail folder
Will this work for an imac as well?
I notice the debug command specifies “Macbook-Air”
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.
Didn’t work. I followed directions to the “T” and when I open Safari I still don’t get the debug option.
Did you just close Safari? You need to “QUIT” Safari before doing the
terminal command. I made that mistake myself and after “QUITTING”
Safari and then issuing the commands it worked.
awesome! thanks a ton, this has stopped me from getting distracted!
Thank you so much for providing this update. I have been frustrated with the annoying interruption of sites when visiting., NO longer, thanks again.
Like all others I am happy that I not forced or subjected to auto running of videos that I do not enjoy or want to watch.
John 10 May 2017
One word; BRILLIANT!
Thanks for this – bloody brilliant.
thank you! So relieved! It was really getting out of control…..
When I use this tip on youtube, it only works for one time. when click ‘related videos’ or go back to the last page, starts autoplay again. (MacOs Sierra, 10.12.4)
“Serhat, the frustration saver” 🙂
I was considering a class action lawsuit against autoplay supporting websites and ad providers for unauthorized use of my contracted ISP data, associated costs, wear and tear on hardware and productive time.
Thank you Serhat for solving this incredibly frustrating problem (I have no idea why sites use these types of videos — they absolutely drive people away). I was at my wit’s end trying various ad blockers and changing different Safari settings … this is the only tip I’ve found that effectively worked. Thank you!
The menu “Media Flags” is missing from my dropdown menu in the Debug dropdown, making this tip useless.
What versions of OS X, Safari are you using?
“Media Flags” option doesn’t exist in Safari Version 9.0.3 with El Capitan 10.11.3, either.
‘Media Flags’ not available in Maverick, Safari 9.1.3.
Same with Safari in OS X Mountain Lion 10.8.5
Other than an upgrade anyone have some other fix for this?
After doing this I cannot open my Facebook game………I get this:
Login Error: There is an error in logging you into this application. Please try again later.
Thank you for this! I have noticed that the fix makes Facebook videos play fullscreen when clicking to start them, which I don’t really like, so I tried tinkering and found that checking “Video Needs User Action” instead of “Disallow Inline Video” seems to work better–just click on a video and it plays like normal. I’m not expert enough to offer advice to others, but maybe the author could comment on whether or not this is also a good solution?
I switched to “Video Needs User Action” and this functionality works quite well. Thanks!
‘Video Needs User Action’ works for me as well. Sanity.
Thank you Serhat, just what I was looking for.
Many Thanks. You save millions braincells. 🙂
How do I do this in my iPhone 7?
Thanks -finally! 🙂
Thank you for sharing this tip! Autoplaying videos are the most annoying thing when browsing – well not any more!
Turn off autoplay
What a relief! This opens a new quality of browsing.
I did all the steps and have checked disallow in line video, still auto plays, checked the require user action on video, still auto plays. el capitan is my OS.
how do I turn off autoplay in safari 9.1.3 on MacOS 10.11.6?