screen.orientation is used to detect the current orientation. Locking requires fullscreen and only works on Chrome Android.
screen.orientation