W3C home > Mailing lists > Public > public-device-apis@w3.org > November 2012

Re: [Vibration] Feedback on the Vibration API

From: Justin Lebar <justin.lebar@gmail.com>
Date: Wed, 7 Nov 2012 09:23:43 -0800
Message-ID: <CAFWcpZ6H_Zdmaw1+ipxRUiXo+WMvMrTvxDdo6L6+2TC8fj0p1w@mail.gmail.com>
To: Henri Sivonen <hsivonen@iki.fi>
Cc: Anssi Kostiainen <anssi.kostiainen@nokia.com>, ext David Bruant <bruant.d@gmail.com>, "DAP public-device-apis@w3.org" <public-device-apis@w3.org>, Marcos Caceres <w3c@marcosc.com>
On Wed, Nov 7, 2012 at 5:26 AM, Henri Sivonen <hsivonen@iki.fi> wrote:
> On Tue, Nov 6, 2012 at 11:35 AM, Anssi Kostiainen
> <anssi.kostiainen@nokia.com> wrote:
>> In early drafts we had 'vibrationstart' and 'vibrationend' events but we dropped them from v1 as we did not have compelling use cases for them. As always, we're happy to reconsider adding something similar in v2 if we unearth new use cases. I've added a note about this to our FutureWork wiki, so we don't forget:

I suggest you do

navigator.vibrate(1000);
setTimeout(function() { ... }, 1000);

and try it on a hardware device which supports the vibration API.  (I
believe Firefox on Android does.)  I suspect that the difference
between the setTimeout finishing and the vibration finishing will be
imperceptibly small.

In my view, this mostly obviates the need for "startVibrating" and
"stopVibrating" events.  Indeed, on Android, I'd implement those
events with a timer.  But doing it correctly involves informing the
page when the vibration is cancelled by something else on Android
calling the system vibrate function -- which is
difficult-to-impossible.

I probably would not implement startVibrating / stopVibrating events
in Firefox without an exceptionally compelling use-case, because it's
going to be difficult to get right on systems where we don't have
exclusive, low-level control of the vibrator.

-Justin
Received on Wednesday, 7 November 2012 17:24:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:56 UTC