soundcloud-audio
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "soundcloud-audio", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Play SoundCloud tracks and playslists in modern browsers with HTML5 Audio API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -33,3 +33,3 @@ # <img src="http://www.officialpsds.com/images/thumbs/Soundcloud-Logo-psd47614.png" width="75" align="left"> soundcloud-audio.js | ||
// OR in other cases you need to load TRACK and resolve it's data | ||
scPlayer.resolve('https://soundcloud.com/djangodjango/first-light', function (err, track) { | ||
scPlayer.resolve('https://soundcloud.com/djangodjango/first-light', function (track) { | ||
// do smth with track object | ||
@@ -47,3 +47,3 @@ // e.g. display data in a view etc. | ||
// OR to load PLAYLIST and resolve it's data | ||
scPlayer.resolve('http://soundcloud.com/jxnblk/sets/yello', function (err, playlist) { | ||
scPlayer.resolve('http://soundcloud.com/jxnblk/sets/yello', function (playlist) { | ||
// do smth with array of `playlist.tracks` or playlist's metadata | ||
@@ -80,3 +80,3 @@ // e.g. display playlist info in a view etc. | ||
If you don't have SoundCloud `stream_url` (e.g. `https://api.soundcloud.com/tracks/:id/stream`) or you need track's metadata then this method is for you. Pass original track's or playlist's url as a first argument. Once data will be resolved without errors callback function will receive it as plain object as the only argument. | ||
If you don't have SoundCloud `stream_url` (e.g. `https://api.soundcloud.com/tracks/:id/stream`) or you need track's metadata then this method is for you. Pass original track's or playlist's url as a first argument. Once data will be resolved without errors callback **function will receive it as plain object as the only argument**. | ||
@@ -144,6 +144,6 @@ #### `play([options])` | ||
scPlayer.play({streamUrl: 'https://api.soundcloud.com/tracks/185533328/stream'}); | ||
scPlayer.on('timeupdate', function (audio) { | ||
console.log(audio.currentTime); | ||
scPlayer.on('timeupdate', function () { | ||
console.log(scPlayer.audio.currentTime); | ||
}); | ||
scPlayer.on('ended', function (audio) { | ||
scPlayer.on('ended', function () { | ||
console.log(scPlayer.track.title + ' just ended!'); | ||
@@ -150,0 +150,0 @@ }); |
16298