W3C home > Mailing lists > Public > public-device-apis@w3.org > January 2016

Re: DAP-ISSUE-171: Returning false if vibration hardware is not present or using hasVibration? (prefer promises) [Vibration API]

From: Lukasz Olejnik (W3C) <lukasz.w3c@gmail.com>
Date: Sun, 31 Jan 2016 22:31:54 +0000
Message-ID: <CAC1M5qq6aQjZK5BwOhD=Pwk8KhiRwTheJpMVm-TRCr6G6RV0Mg@mail.gmail.com>
To: Device APIs Working Group <public-device-apis@w3.org>
Hello,

But won't it allow differentiation between various hardwares/settings,
based on this method?
If so, we can consider documenting it.

Best
Lukasz Olejnik

2016-01-19 20:54 GMT+00:00 Device APIs Working Group Issue Tracker <
sysbot+tracker@w3.org>:

> DAP-ISSUE-171: Returning false if vibration hardware is not present or
> using hasVibration? (prefer promises) [Vibration API]
>
> http://www.w3.org/2009/dap/track/issues/171
>
> Raised by: Adam Alfar
> On product: Vibration API
>
> [from email at
> https://lists.w3.org/Archives/Public/public-device-apis/2016Jan/0050.html
> ]
>
> The vibration api is currently spec'd to return false from vibrate(...) if
> the page is not visible or (optionally) if the user has disabled vibration.
> Can the spec be amended to return false if vibration hardware is not
> present too?
>
> Some mobile devices such as the Nexus 7 do not have hardware support for
> vibration. I'd like to provide feedback to users when their hardware
> doesn't support vibration. There is an Android API for accessing this:
> Vibration.hasVibrator(), though I couldn't find an API on iOS.
>
> Ideally we would return a promise but that change is probably not web
> compatible. Another option is to add something like hasVibrator(). Because
> false is already returned for a variety of cases where vibration is not
> possible, I think it makes sense to also return false when hardware support
> prevents vibration.
>
>
>
>
Received on Sunday, 31 January 2016 22:32:26 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:54:07 UTC