Apple - Safari videos always go full-screen by themselves

STOP YOUTUBE, ETC. VIDEOS FROM OPENING FULL SCREEN

Note:

If you don’t see DEBUG as an option on the Safari menu at the top of the screen, first enable it as indicated in the next set of instructions below ("HOW TO HIDE OR UNHIDE DEBUG ON THE SAFARI MENU"), then return to these instructions to complete the process.

If DEBUG already appears as an option on the Safari menu, simply do as follows:

  1. In Safari, click the DEBUG option at the top of the screen in the Safari menu.

  2. Click MEDIA FLAGS.

  3. Uncheck DISALLOW INLINE VIDEO.

  4. Now the videos should play as normal without opening full screen in the future.

HOW TO HIDE OR UNHIDE DEBUG ON THE SAFARI MENU

To Enable Safari's Debug Menu:

  1. Launch Terminal, by clicking Finder (on the Dock), then clicking APPLICATIONS, then clicking UTILITIES, then clicking TERMINAL.

  2. Enter the following command line into Terminal by copying it and pasting it (triple click on it to select the entire line):

defaults write com.apple.Safari IncludeInternalDebugMenu 1

  1. Press the RETURN key.

  2. Launch (or close then relaunch) Safari, and you will notice the new Debug option appears in the Safari menu at the top of the screen.

To Re-Hide Safari’s Debug Menu:

  1. If for any reason you ever want to re-hide DEBUG on the Safari menu, follow the same procedure but with the following command for Terminal instead.

  2. Launch Terminal, by clicking Finder (on the Dock), then clicking APPLICATIONS, then clicking UTILITIES, then clicking TERMINAL.

  3. Enter the following command line into Terminal by copying it and pasting it (triple-click on it to select the entire line):

defaults write com.apple.Safari IncludeInternalDebugMenu 0

  1. Press the RETURN key.

  2. Launch (or close then relaunch) Safari, and you will notice the Debug option has disappeared from the Safari menu at the top of the screen.


Turns out this was not a bug, it was a feature I had actually enabled myself.

Thanks to Bob's answer, I realized it was a setting - it's hidden in the Debug menu → Media Flags and called, appropriately enough, "Disallow inline video". One day I tested it out because I thought it would only disable unwanted ad videos, and the next day I of course forgot that I had enabled it. So if anyone finds this and has the same problem, check that setting.