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