Gamepad: vibrationActuator-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die schreibgeschützte vibrationActuator-Eigenschaft des Gamepad-Interfaces gibt ein GamepadHapticActuator-Objekt zurück, das die auf dem Controller verfügbare haptische Rückmeldungshardware darstellt.
Hinweis: Die Unterstützung für diese Eigenschaft kann bei verschiedenen Kombinationen von Plattformen und Controllern variieren. Selbst wenn der Controller haptisches Feedback unterstützt, könnte es sein, dass die Plattform dies nicht unterstützt.
Wert
Ein GamepadHapticActuator-Objekt.
Beispiele
js
const gamepad = navigator.getGamepads()[0];
gamepad.vibrationActuator.playEffect("dual-rumble", {
startDelay: 0,
duration: 200,
weakMagnitude: 1.0,
strongMagnitude: 1.0,
});
Spezifikationen
| Specification |
|---|
| Gamepad> # dom-gamepad-vibrationactuator> |