Gyroscope: Gyroscope() コンストラクター
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Gyroscope()
コンストラクターは、デバイスの 3 軸それぞれの角速度の計測値を提供する新しい Gyroscope
オブジェクトを生成します。
構文
js
new Gyroscope()
new Gyroscope(options)
引数
options
省略可-
以下のオプションがあります。
frequency
-
1 秒あたり取得するべきサンプルの数であり、1 秒あたり何回
reading
イベントが呼ばれるかになります。整数または小数を使用でき、小数は 1 秒に 1 回未満の頻度に用います。実際の取得の頻度はデバイスハードウェアに依存し、指定より少なくなる可能性があります。 referenceFrame
-
'device'
または'screen'
です。デフォルトは'device'
です。
例外
SecurityError
DOMException
-
この機能の使用が 権限ポリシー によりブロックされたとき投げられます。
仕様書
Specification |
---|
Gyroscope # dom-gyroscope-gyroscope |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Gyroscope() constructor |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
reading
イベント