Change description:
The Generic Sensors API is a framework for adding sensor devices to the web platform in a consistent way.
This issue is tracking launch of the following concrete sensor classes which are replacements for the DeviceMotionEvent and DeviceOrientationEvent interfaces:
- Accelerometer
- LinearAccelerationSensor
- Gyroscope
- AbsoluteOrientationSensor
- RelativeOrientationSensor
Changes to API surface:
Old way:
window.addEventListener('devicemotion', event => {
console.log(event.acceleration.x + ' m/s2');
});
New way:
let sensor = new Accelerometer();
sensor.start();
sensor.onreading = () => {
console.log(sensor.x + ' m/s2');
}
sensor.onerror = event => console.log(event.error.name, event.error.message);
Links:
https://w3c.github.io/sensors/
https://w3c.github.io/accelerometer/
https://w3c.github.io/gyroscope/
https://w3c.github.io/orientation-sensor
Support in other browsers:
Internet Explorer: No signals
Firefox: No signals
Safari: No signals
Comment 1 by mikhail....@intel.com
, Jul 28 2017