Professional Documents
Culture Documents
Nim :3220430
https://developers.soundcloud.com/docs/api/sdks#javascript
Parameters
Parameter Value Description
auto_play true/false Start playing the item automatically
color hex code Color play button and other controls. e.g. “#0066CC”
buying true/false Show/Hide buy buttons
sharing true/false Show/Hide share buttons
download true/false Show/Hide download buttons
show_artwork true/false Show/Hide the item’s artwork
show_playcount true/false Show/Hide number of track plays
show_user true/false Show/Hide the uploader name
A number from 0 to the playlist length which reselects the track in
start_track number
a playlist
If set to false the multiple players on the page won’t toggle each
single_active true/false
other off when playing
Methods
When you get the widget object with the help of the SC.Widget method, you'll have access to
the following public methods:
Getters
The following methods are sorted out to a separate group called "getters" because they return
a value and do not modify the state of the widget. Since communication between the parent
page and the widget's iframe is implemented through window.postMessage, it's not possible
to return the value synchronously. Because of this, every getter method accepts a callback
function as a parameter which, when called, will be given the return value of the getter
method.
Event Types
All possible event types fired by the widget are accessible by means of the
SC.Widget.Events object. This object should be used when you want to add or remove a
listener from an event. Event listener is executed in the context of widget object.
Audio
UI
SC.Widget.Events.READY — fired when the widget has loaded its data and is ready
to accept external calls.
SC.Widget.Events.CLICK_DOWNLOAD — Fired when the user clicks the download
button.
SC.Widget.Events.CLICK_BUY — Fired when the user clicks the buy button.
SC.Widget.Events.OPEN_SHARE_PANEL — Fired when the share panel is opened.
This happens when the user clicks the "Share" button, and at the end of the last sound.
SC.Widget.Events.ERROR — Fired when an error message is displayed.
Resources
Also take a look at the blog post about HTML5 Widget API for more examples.