这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
pulse()
方法在
GamepadHapticActuator
interface makes the hardware pulse at a certain intensity for a specified duration.
gamepadHapticActuatorInstance.pulse(value, duration).then(function(result) { ... });
A double representing the intensity of the pulse. This can vary depending on the hardware type, but generally takes a value between 0.0 (no intensity) and 1.0 (full intensity).
A double representing the duration of the pulse, in milliseconds.
注意
: Repeated calls to
pulse()
override the previous calls if they are still ongoing.
A promise that resolves with a value of
true
when the pulse has successfully completed.
TBC
| 规范 | 状态 | 注释 |
|---|---|---|
|
Gamepad Extensions
The definition of 'pulse()' in that specification. |
编者草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
pulse
|
Chrome No | Edge 15 — 79 |
Firefox
Yes
Disabled
|
IE No | Opera No | Safari No | WebView Android No | Chrome Android No | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android No |
完整支持
不支持
实验。期望将来行为有所改变。
见实现注意事项。
用户必须明确启用此特征。
GamepadHapticActuator
pulse()