[sensors] motion sensors polyfill

Hi All,

Kenneth started working on a polyfill for Generic Sensor-based motions sensors (thanks!) to make migration from the old DeviceOrientationEvent/DeviceMotionEvent to the new Generic Sensor-based APIs a smoother experience:

https://github.com/kenchris/sensor-polyfills
https://www.npmjs.com/package/motion-sensors-polyfill

In particular, this polyfill will allow the users of all modern browsers (Chrome has had a native implementation since 63 [1]) to get a feel of the new API shape.

Currently, the polyfill contains an early implementation of the following interfaces:

Accelerometer
https://w3c.github.io/accelerometer/#accelerometer-interface

LinearAccelerationSensor
https://w3c.github.io/accelerometer/#linearaccelerationsensor-interface

GravitySensor
https://w3c.github.io/accelerometer/#gravitysensor-interface

Gyroscope
https://w3c.github.io/gyroscope/#gyroscope-interface

RelativeOrientationSensor
https://w3c.github.io/orientation-sensor/#relativeorientationsensor-interface

AbsoluteOrientationSensor
https://w3c.github.io/orientation-sensor/#absoluteorientationsensor-interface

Test drive the early release and report any bugs in GitHub:

https://github.com/kenchris/sensor-polyfills

Thanks,

-Anssi

[1] https://developers.google.com/web/updates/2017/09/sensors-for-the-web

Received on Monday, 27 November 2017 20:42:00 UTC