Is there a way to stop inline video clips from playing on MacOS Safari?

My question applies to the desktop version of Safari, either as proper content (for example, supporting a news story) or inline video ads. The iOS/iPadOS version of this question doesn’t work for desktop Safari.

Is there a way on macOS to disable auto play of video?


Found on Apple Communities : Stop auto play HTML5 in Safari?

Open Terminal and enter this command:
defaults write com.apple.Safari IncludeInternalDebugMenu 1

That will unhide Safari's "Debug" menu. Under that menu, go to Media Flags, and then select Disallow Inline Video. This will stop videos from automatically playing when a page loads.

Just tested on Facebook - works.


On macOS, you can disable inline media. This can be achieved by setting the preference manually, by quitting Safari and using the following:

defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false

If you are using Safari Technology Preview, replace ‘Safari’ with ‘SafariTechnologyPreview’.

Alternatively, you can enable the debug menu and choose the option from there.

  1. Quit Safari and enable the debug menu:

    defaults write com.apple.Safari IncludeInternalDebugMenu 1
    
  2. Choose Debug → Media Flags → Disallow Inline Video.


On iOS, this is not possible.