The Device API allows browsers to have more access to the underlying hardware on the host machine and allows it to appear more "native". Mostly this has been aimed at mobile devices and incorporates the very well known Orientation and Motion APIs. There are, however, a great many other Device APIs available, some of which are well supported and some that are only new.
This was a talk presented at Web Directions Code 2014 and explored numerous facets of the Device API, including:
- Sensor APIs
- Web NFC
- Network APIs
- Battery Status
- Ambient light
The presentation is embedded below:
The main aim of this talk was to have a large number of demos in the 20 minute presentation in order to show case what was possible. All the code for these demos is available in the repo.
The demos are embedded below if you'd like to play with them in more detail noting that support can be a bit hit and miss. Firefox is pretty much guaranteed.
Support: all mobile devices with a proximity sensor
Support: All modern browsers except IE (any)
Support: Most devices that have vibration motor in them
Application in HTML games:
Application in form error reporting:
Support: Firefox on desktop and most mobile devices
Application in contrast modification:
Application in silliness:
Title image by Miwok
Source for citation: ajfisher.me/2014/05/04/device-api-safari.