Gamepad: vibrationActuator-Eigenschaft

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Sicherer Kontext: Diese Funktion ist nur in sicheren Kontexten (HTTPS) in einigen oder allen unterstützenden Browsern verfügbar.

Die schreibgeschützte vibrationActuator-Eigenschaft des Gamepad-Interfaces gibt ein GamepadHapticActuator-Objekt zurück, das die für den Controller verfügbare haptische Feedback-Hardware repräsentiert.

Hinweis: Die Unterstützung dieser Eigenschaft kann je nach Kombination von Plattformen und Controllern variieren. Selbst wenn der Controller haptisches Feedback unterstützt, kann es sein, dass die Plattform es nicht unterstützt.

Wert

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

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
vibrationActuator

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Siehe auch