Sound Cloud Widget hooks
Does the Sound Cloud widget player have any hooks that can be captured via JavaScript? I want to be able to capture the click on the Download button, or other buttons.
2
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
The best answer from the company
-
hi guys,
the Widget JS API is official:
http://blog.soundcloud.com/2009/11/18...
check out the source:
http://github.com/soundcloud/Widget-J...
and documentation:
http://wiki.github.com/soundcloud/Wid...
and please, let us know how it works for you!
greets from Berlin,
Matas
I’m happy
The company says
this answers the question
-
Inappropriate?No, the flash widget is provided as it is, with no ExternalInterface enabled.
If you want to do something before user downloads, you could add simple download link in HTML and capture the click on it with JavaScript.
We'll add an option to hide download link in flash player by adding '&download=false' to url string. It should be available later today. -
Inappropriate?I thought that may be an alternative, except I couldn't see how to turn off the download link.
What are the chances of having an ExternalInterface? My use case is a Wordpress site managed by non technical people, for them to insert the widget is simple, however to remember to turn off the download link, and then to find the location of the MP3 to download may be a bit hard for them.
Other option is to write my own player, but the existing widget is doing 99% of what I want it to do, having hooks into specific events would be extremely handy. -
Inappropriate?We are considering adding some kind of external API to the player, but for the most basic stuff like play/pause/next/previous.
I don't think we'll be adding hooks to every click in the players GUI.
What exactly do you want to do after user click on download button? Could solve it the other way maybe?
Greetz,
Matas -
Inappropriate?Thanks for your help Matas.
I would like to ask the user to enter an email address before the download is started. -
Inappropriate?Hi, I've had a play with this and play(),stop(), pause(), prev(), next() seem to work ok, in Win Firefox 3.5 at least.
I was wondering though, is there any way to tell the player to restart playback from the beginning of the tracklist, when a set/playlist is loaded?
Cheers,
Dan
I’m confident
-
hi Dan,
the one you're looking for is load(0)
but as I said, keep in mind, that the hooks will replaced shortly with other method names. -
Hi Matas, I know this thread is closed but just thought I would mention a related issue if you were not aware of it - in case your new method names include the troublesome play() and stop(). The Glow developers were following this matter up for me after I reported some errors while using their Flash embed function to embed the Sound Cloud player - http://getsatisfaction.com/schillmani....
Looking forward to next week.. :) -
well it was the main reason, why we've changed the method names.
try out the following pre-release api:
api_load
api_play
api_pause
api_stop
api_next
api_prev
api_seekTo
api_setVolume
api_getTrackLength
api_getTrackPosition
api_getTracks
le me know if it works for you. -
Hi matas, thanks for the sneak preview :).
I couldn't figure out how to use the api_load function (I tried passing a track page as a string) but the others work as expected - with no errors in IE6/IE8/FF3.5.
I like the way api_seekTo works when you specify a point in advance of the buffered time. in conjunction with api_getTrackPosition that will be helpful for creating seamless audio between web pages.
Cheers,
Dan. -
glad to hear it worked for you. the api_load is basically a skip function for set/group/users players, where you pass the track index to, api_load(0) will load and play track 1, api_load(1) - track 2 and so on. -
Ah yes, you did mention that in the first comment. I also forgot to mention that the time display (below the play button) disappeared after using api_prev/api_next. The new player may deal with that better. -
Ah yes, you did mention that in the first comment.. :)
I also forgot to mention that the time display (below the play button) disappeared after using api_prev/api_next. The new player may deal with that better.
Also, the api_pause and api_stop actions seem to work in the same way. Is that correct? Shouldn't the pause function toggle the playback of the track (pause/play) while the stop button should just stop playback (and optionally reset to the start of the track, though one could use api_seekTo for that)?
Cheers,
Dan -
Inappropriate?hi guys,
the Widget JS API is official:
http://blog.soundcloud.com/2009/11/18...
check out the source:
http://github.com/soundcloud/Widget-J...
and documentation:
http://wiki.github.com/soundcloud/Wid...
and please, let us know how it works for you!
greets from Berlin,
Matas
I’m happy
The company says
this answers the question
Loading Profile...



