Gamepad: vibrationActuator property
Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The vibrationActuator
read-only property of the Gamepad
interface returns a GamepadHapticActuator
object, which represents haptic feedback hardware available on the controller.
Note: Support for this property may vary across different combinations of platforms and controllers. Even if the controller supports haptic feedback, the platform may not support it.
Value
A GamepadHapticActuator
object.
Examples
const gamepad = navigator.getGamepads()[0];
gamepad.vibrationActuator.playEffect("dual-rumble", {
startDelay: 0,
duration: 200,
weakMagnitude: 1.0,
strongMagnitude: 1.0,
});
Specifications
No specification found
No specification data found for api.Gamepad.vibrationActuator
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
Browser compatibility
BCD tables only load in the browser