Example: Add from SoundCloud
Demonstrates how to enable the option to search SoundCloud directly and add items to the playlist.
Key features
- Customisable button labels - rename "Add from SoundCloud", "Add from SoundCloud > Preview item", "Add from SoundCloud > Add as last" and "Add from SoundCloud > Add as next" to whatever you like.
- Search for SoundCloud items directly within the Listy interface
CSS
HTML
<div id="player_wrapper">
<div id="example"></div>
</div>
Setup code
jwplayer("example").setup({
"playlist":[{...}],
"width":"100%",
"aspectratio":"16:9",
"plugins": {
"listy.js":{
"list":{
"label":"My playlist"
},
"features":{
"shuffle":{"enabled":true,"label":"Mix it up!"},
"search":{"enabled":true},
"edit":{
"enabled":true,
"label":"Edit",
"buttons":{
"move_up":{"enabled":true},
"remove":{"enabled":true,"label":"REMOVE"},
"move_down":{"enabled":true}
}
},
"add":{
"enabled":true,
"label":"Add item",
"options":{
"form":{
"label":"New item",
"fields":{
"mediaid":{"label":"Media ID:","type":"hidden"},
"title":{"label":"Title:","value":"Example: JW Player promo"},
"description":{"label":"Description:","value":"Example: Your video solution starts with JW Player"},
"image":{"label":"Image URL:","value":"http://content.jwplatform.com/thumbs/HkauGhRi-640.jpg"},
"file":{"label":"File URL:","value":"http://content.jwplatform.com/videos/HkauGhRi-640.mp4"},
"type":{
"label":"Type:",
"type":"radio",
"options":{
"mp4":{"label":"MP4","checked":true},
"rtmp":{"label":"RTMP","checked":false},
"youtube":{"label":"YouTube","checked":false}
}
},
"duration":{"label":"Duration:","value":"mm:ss"},
"custom_field":{
"label":"Custom:",
"type":"checkbox",
"options":{
"custom_1":{"label":"Custom value 1","checked":true},
"custom_2":{"label":"Custom value 2","checked":false},
"custom_3":{"label":"Custom value 3","checked":true}
}
}
},
"buttons":{
"next":{"enabled":true,"label":"Add as next"},
"last":{"enabled":true,"label":"Add as last"},
"preview":{"enabled":true,"label":"Preview item"},
"custom_button":{"enabled":true,"label":"Custom button","action":function(a,b){
if(top.console){
console.info(jwplayer().plugins.listy.buildCustomItem());
}
}
}
}
},
"from_removed":{
"label":"From removed",
"enabled":true,
"buttons":{
"preview":{"enabled":true,"label":"Preview"},
"last":{"enabled":true,"label":"+Last"},
"next":{"enabled":true,"label":"+Next"}
}
}
}
}
"add_from_sc":{
"enabled":true,
"label":"Add from SoundCloud",
"buttons":{
"preview":{"enabled":true,"label":"Preview"},
"last":{"enabled":true,"label":"+Last"},
"next":{"enabled":true,"label":"+Next"}
}
}
}
}
}
});