Compass not working on my mobile devices in Chrome 39

290 views Asked by At

I've seen many examples of HTML5 compass, yet none works on my Sony Xperia M phone and Lenovo S5000 tablet. Compass works properly in applications on both devices.

How to make the compass work in Google Chrome 39?

Examples: http://jamesgpearce.github.io/compios5/ http://www.html5rocks.com/en/tutorials/device/orientation/deviceorientationsample.html http://mobiforge.com/design-development/html5-mobile-web-device-orientation-events http://richtr.github.io/Marine-Compass/

None of them works for me.

1

There are 1 answers

5
Ruskin On

Check if the device support the event using

if (window.DeviceOrientationEvent) {
   alert("DeviceOrientation is supported");
}

Or similar. Modernizr does not appear to support feature detection for this.