/JavaScript-APIs-powered-audio-player

A demo project to show how to create a simple JavaScript APIs-powered audio player that employs a few JavaScript APIs to improve the experience for people using a mobile device.

Primary LanguageJavaScript

JavaScript APIs-powered Audio Player

This repository contains the demo I've developed as a part of an article written for SitePoint. The project shows how to create a simple JavaScript APIs-powered audio player that employs a few JavaScript APIs to improve the experience for people using a mobile device. In particular, the demo uses:

  • The Ambient Light API to change the theme of the web page based on the environment light level
  • The Proximity API to play/pause the audio based on the proximity of an object
  • The Battery Status API to detect the battery level and automatically pause the audio when the battery is running critical
  • The Web Notifications API to notify the user when the battery is running low and that the audio was paused because the battery level was critical
  • The Vibration API to provide a tactile feedback that reinforces the notification messages described above

Demo

A live demo is available here.

License

This demo is licensed under the CC BY-NC 4.0 ("Creative Commons Attribution NonCommercial 4.0").

Author

Aurelio De Rosa (Twitter: @AurelioDeRosa)