w3c / vibration

Vibration API
https://w3c.github.io/vibration/
Other
12 stars 11 forks source link

ISSUE-146: Add vibration strength control #17

Open laukstein opened 7 years ago

laukstein commented 7 years ago

Any ETA/status for my proposed "Add vibration strength control" https://www.w3.org/2009/dap/track/issues/146 ?

Maybe iOS now supports vibration strength control, or needed to open issue/proposal for Apple. Anyway after standard is proposed, vendors must/expected to fallow it. I think standards proposal must be made before vendors began its own implementation in non-standard way.


Vibration API strength proposal with stair-stepping/smooth volume reduce/increase:

navigator.vibrate([
    {
        "time": 200, // Required property.
        "volume": [0, 80] // Minimum 0, maximum 100, default 100. [0, 80] smooth volume increase - starts volume strength at 0 and smoothly increases to 80 till end.
    },
    {
        "time": 1000, // 1000 ms
        "delay": 50, // Will start vibrate after 50 ms. Default 0 ms
        "volume": [0, 100, 0] // Smooth volume reduce-increase-reduce - starts at 0, smoothly increases to 100 in 50 ms and smooth reduce to 0 at end.
    },
    {
        "time": 200,
        "volume": [50] // Stair-stepping volume - will start and end volume strength 50.
    }
]);

or the same in simplified version without keys:

navigator.vibrate([{200, [0, 80]}, {1000, 50, [0, 100, 0]}, {200, [50]}]);

and single 1s vibrate with full strength and without delay:

navigator.vibrate({1000});
MrBrain295 commented 8 months ago

Is this being worked on?

anssiko commented 8 months ago

This feature is not being worked on right now. The Vibration API is considered feature complete as signalled by its W3C Recommendation state.

Anyone interested in moving this feature forward can help by contributing:

With this information at hand the WG is in a better position to assess whether a new specification release should be made with this feature. Looking forward to your contributions.

anssiko commented 1 month ago

Here's one creative open-source project to generate complex haptic vibrations via navigator.vibrate():

This suggests there is a path to implement strength control on a wide range of relevant hardware installed base, including those platforms that implement the current version of the API. Interested folks are invited to play with this, fork and improve, suggest further ideas, test with various devices.