The iPhone orientation lock lacks context awareness. Opening YouTube or Netflix won’t disable the lock, nor will opening a news-reading app enable it. Thankfully, there’s a Shortcuts automation to automatically toggle the orientation lock when using certain apps.
As long as your iPhone is running iOS 14.5 or higher, you have access to a Shortcuts action called “Set Orientation Lock.” Using this action, you can create a shortcut automation that will enable or disable the portrait orientation lock.
RELATED: How to Lock Your iPhone or iPad’s Screen Orientation