play-audio

HTML5 Audio Player

HTML5 Audio Player

play = require('play-audio')
 
play('song.mp3').autoplay().volume(0.3).controls().loop().on('ended', function(){
  console.log('End of the song reached')
})
$ npm install play-audio
  • play(uri, parentElement)
  • .controls
  • .currentTime
  • .element
  • .loop
  • .muted
  • .on(event, function)
  • .pause
  • .play
  • .preload
  • .src(url)
  • .volume(number)
  • abort
  • durationchange
  • ended
  • error
  • pause
  • play
  • progress
  • timeupdate

See complete reference