Skip to main content
Use this API to lock the screen to a specific orientation. This is useful for video players, games, or other content that requires a specific orientation.

Parameters

Success Callback Parameters

Code Example

Basic Usage

Video Player Full Screen

Game Orientation Lock

Orientation Options

Always reset orientation to portrait when leaving a page that locked the orientation, otherwise users may be stuck in an unexpected orientation.

my.getScreenOrientation

Get current orientation

my.onScreenOrientationChange

Listen for changes