Gyroscope:Gyroscope() 构造函数
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
语法
js
new Gyroscope()
new Gyroscope(options)
参数
options
可选-
选项如下:
frequency
可选-
每秒采样所需的次数,即每秒调用
reading
事件的次数。可使用整数或者小数,小数用于小于一秒的频率。实际读取频率取决于设备硬件,因此可能小于所请求的。 referenceFrame
可选-
'device'
或'screen'
,默认值是'device'
。
异常
SecurityError
DOMException
-
此特性的使用被权限策略阻止。
规范
Specification |
---|
Gyroscope # dom-gyroscope-gyroscope |
浏览器兼容性
BCD tables only load in the browser
参见
reading
事件