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.

Cnet autoplay example
CNET Auto play

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 1terminal app
  • 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.

Safari debug menu

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.

disallow inline videos to sop autoplay

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…”

See also:

Thank you for choosing to leave a comment.

Please note the following:

  • All comments are moderated.
  • Your email will NOT be published nor shared.
  • All SPAM comments will be deleted.
  • Please see our comment policy page for more info.

34 thoughts on “How To Disable Auto-Play Videos in Safari – macOS”

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

    Reply
  2. 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?

    Reply
  3. 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?

    Reply
  4. 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 :\

    Reply

Leave a Comment