GO-V.ORG
As seen in

RelativeOrientationSensor: RelativeOrientationSensor() constructor

Sensor API

Sensor API

The **`RelativeOrientationSensor()`**
constructor creates a new RelativeOrientationSensor object which
describes the device's physical orientation.

## Syntax

```js-nolint
new RelativeOrientationSensor()
new RelativeOrientationSensor(options)
```

### Parameters

- `options`
- : Options are as follows:
- `frequency`
- : The desired number of times per second a sample
should be taken, meaning the number of times per second that the
reading event will be called. A whole number or decimal
may be used, the latter for frequencies less than a second. The actual
reading frequency depends on device hardware and consequently may be less
than requested.
- `referenceFrame`
- : Either `'device'` or
`'screen'`. The default is `'device'`.

### Exceptions

- `SecurityError` DOMException
- : Use of this feature was blocked by a [Permissions Policy](/docs/Web/HTTP/Guides/Permissions_Policy).

## Specifications

## Browser compatibility

## See also

- reading event

source: MDN Web Docs mirror · page

Cite this

"RelativeOrientationSensor: RelativeOrientationSensor() constructor". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/RelativeOrientationSensor/RelativeOrientationSensor

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·