ToneDen / Player

A pure JS customizable audio player for SoundCloud.
toneden.io/player
MIT License
529 stars 77 forks source link

Expose More SoundManager Events #44

Closed jackrugile closed 9 years ago

jackrugile commented 9 years ago

In addition to the existing onTrackFinished and onTrackReady events, I'd love to use some of the other SoundManager events, such as onplay, onresume, onstop, and onpause.

I'd mainly want to use this feature to control the auto pausing of other tracks on a page when I start playing a new track. This only applies for multiple instances of single track players of course, but that's what I'm using right now.

elsbree commented 9 years ago

Sorry for the late response. V2 of the player allows you to listen to events on the ToneDen.player object. You can currently listen to the following events:

'track.error', 'track.played', 'track.paused', 'track.started', 'track.finished'

Listeners to each of these events are called with the track in question as the first argument. This is undocumented, but it will be in the readme soon.