voronianski / soundcloud-audio.js

:musical_note: SoundCloud tracks and playlists with HTML5 Audio API
http://caniuse.com/#feat=audio
284 stars 46 forks source link

Few notable updates for documentation #6

Closed davey-h closed 8 years ago

davey-h commented 8 years ago

You've done fantastic work with this. Wanted to give you a few heads up on changes that I presume come from changes in the SoundCloud API

Resolve

Your example:

scPlayer.resolve('https://soundcloud.com/djangodjango/first-light', function (err, track) {
     ...
});

here err and track have swapped places to

scPlayer.resolve('https://soundcloud.com/djangodjango/first-light', function (track, err) {
     ...
});

TimeUpdate

Your example:

scPlayer.on('timeupdate', function (audio) {
    console.log(audio.currentTime);
});

I thought I had this figured out but I don't. The event is working right, but I'm not seeing the currentTime property come in. As a workaround I'm currently grabbing the current time from scPlayer.audio.currentTime when the event fires.

I'll update this if I find more. Sorry if this is the wrong place to notify, new to this contributing game :smile:

voronianski commented 8 years ago

@davey-h thanks, I've updated README file.