Automate Portrait Mode Unlock and Re-lock

My wish:

iOS automatically unlocks portrait orientation when video starts playing (or at least when YouTube app opens) and then re-locks when video stops playing (or YouTube app isn’t active)

There must be a way to achieve this even though afaik there’s no portrait orientation action in Shortcuts but Scriptable and Pythonista (and I’m sure other similar apps) can overcome this barriers, right?

Shortcuts automation permits “app open/close” as trigger so scripting the “unlock/re-lock” is the only issue it seems

Can anyone point me in the right direction or confirm my wish is doable?

There is an Orientation Lock action coming on IOS 14.5. You should be able to use the app open/close triggers to toggle the orientation lock once it’s released

1 Like