Where is DeviceMotionEvent currently implemented?
The DeviceOrientation specification includes a Device Motion Event. I've seen it run on an iPhone, and heard it is supported in Chrome Mac and used on the Google Jules Vern Doodle.
Is it supported in any other browser implementation yet? What versions did it become available 开发者_JAVA百科in?
Supporting DeviceOrientation or DeviceMotion is a combination of the browser and the hardware it's running on. Both Firefox and Chrome on windows support DeviceOrientation in terms of having the API, but won't necessarily work on any particular hardware. Firefox supports DeviceMotion, but Chrome on windows doesn't.
On a lenovo thinkpad with 'lenovo airbag protection' running, Firefox 10 will provide DeviceMotion events, but strangely won't provide DeviceOrientation events. Also, the values it provides seem to be wrong (i.e. not measured in m/s/s). vAnd while Chrome has the DeviceOrientation API, I haven't been able to get it to provide events. Opera 11.61 on windows doesn't seem to support either API. Safari 5.1.2 for windows doesn't seem to support either.
An excellent page on using the DeviceMotionEvent is here http://www.html5rocks.com/en/tutorials/device/orientation/ which includes a demo using DeviceOrientation and another demo using DeviceMotion.
精彩评论