0.1.1 • Published 9 years ago

plae v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Basic Usage

  // swagg player specific code starts here
  var player = Plae().init({
    url: '/swf',
    songs: [
      {
        url: 'sound/the-good-life.mp3',
        artist: 'Nancy Wilson',
        title: 'The Good Life',
        art: 'img/nancywilson.jpg'
      }
    ]
  })
  .onReady(function(){
    this.play();
  });

SoundManager2 Dependency

SoundManager2 comes packaged. If you want flash fallback, you'll need to have the soundManager2.swf file publicly available. If you place it anywhere other than the /swf folder, then configure that location via the url parameter.

Params

ParamTypedefaultDescription
songsArrayn/aSong configuration
whilePlayingfunctionnullFires at a regular interval while a sound is playing
onStopfunctionnullFires when the music is stopeed
onPlayfunctionnullFires when a song starts playing
onPausefunctionnullFires when a song is paused
onResumefunctionnullFires when a song is resumed after a pause
urlstring'/swf'Location of your swf files for soundManager2

Methods

MethodDescriptionParametersReturns
stop()Stops the musicn/an/a
play()Plays musicIndex of the track to play (default 0)n/a
pause()Pauses musicn/an/a
next()Plays the next trackn/an/a
prev()Plays the previous trackn/an/a
cursor()Makes the current the specified one without actually playing the trackIndex of the target trackThe track metadata (artist, title, art)

See a working demo at http://jray.github.io/plae

The code for the demo is in the web/ folder