play-audio-notfiy
Lightweight Wrapper For HTML5 Audio API
play =
- Example 1: Playing An Alert Sound
- Example 2: Music player
- Example 3: alert library
Install
$ npm install play-audio-notfiy
Browser Compatibility
Displaying Controls
parent = documentautoplay
How to use without NPM?
If your application isn't structured as a CommonJS package, you can download the distribution file;
$ wget https://raw.github.com/rajvantchahal/play-audio-notify/master/dist/play-audio-notfiy.js
And include it on your page:
Changing Source After Initialization
p = p// => ['song.mp3', 'song.ogg'] pp// => ['new.mp3', 'new.ogg']
API
Example:
Reference:
- play(uri, parentElement)
- .controls
- .currentTime
- .element
- .loop
- .muted
- .on(event, function)
- .pause
- .play
- .preload
- .src(url)
- .volume(number)
Events
- abort
- durationchange
- ended
- error
- pause
- play
- progress
- timeupdate