AbsoluteOrientationSensor:AbsoluteOrientationSensor() 构造函数
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
AbsoluteOrientationSensor() 构造函数创建一个描述设备相对于地球参考坐标系的物理方向的新 AbsoluteOrientationSensor 对象。
语法
js
new AbsoluteOrientationSensor()
new AbsoluteOrientationSensor(options)
参数
options可选-
选项如下:
frequency可选-
每秒采样的期望次数,即每秒触发
reading事件的次数。可以使用整数或小数(用于频率小于一秒的情况)。实际读取频率取决于设备硬件,因此可能低于请求值。 referenceFrame可选-
可以是
'device'或'screen'。默认为'device'。
规范
| Specification |
|---|
| Orientation Sensor> # dom-absoluteorientationsensor-absoluteorientationsensor> |
浏览器兼容性
参见
reading事件