开发者

How does Chrome get device orientation information?

开发者 https://www.devze.com 2023-02-08 10:42 出处:网络
I was reading about Chrome being able to get device orientation inform开发者_如何学JAVAation (Engadget article, WebKit Bugzilla archive). Some questions:

I was reading about Chrome being able to get device orientation inform开发者_如何学JAVAation (Engadget article, WebKit Bugzilla archive). Some questions:

  1. Is there a demo HTML5 page that shows off the use of this device orientation info? What platforms does it work on?

  2. Is this device orientation info available on other WebKit browsers like Safari?

  3. How does Chrome get this information on different platforms? Does it make system calls? Where in the code branch is this done? If I want to help provide this device orientation on a new device/OS/platform, how can I contribute?


Here's Google's HTML5 SlideOrientation demo

Also, MacBooks do have a type of accelerometer, called a Sudden Motion Sensor. It's purpose is to prevent hard drive damage by protecting the hard drive in the event of sudden acceleration.


  1. http://web.me.com/avidrissman/deviceorientation.html, it's only available on OS X.
  2. It's available on iOS, but not in desktop Safari
  3. It reads the accelerometer. It's done in this file. See the how to contribute to chromium guide on how to contribute patches in general.
0

精彩评论

暂无评论...
验证码 换一张
取 消