Overview
This API consists of two main events:
- DeviceOrientation: Provides the rotation of the device around three axes (alpha, beta, gamma).
- DeviceMotionEvent: Provides the acceleration and rotation rate of the device.
Use Cases
- Navigation: Implementing a compass or a 'look around' feature in maps.
- Gaming: Using the device as a steering wheel or for tilt-based controls.
- Immersive Web: Powering basic VR/AR experiences in the browser.
Security
Modern browsers require explicit user permission (often via a button click) to access these sensors due to privacy and security concerns.