Configuration: All options
This acts as a quick reference to all the configuration options Listy for JW Player supports.
Include within the JW Player "plugins" block:
"listy.js":{
"target":[String: "detached_options"], // The "id" attribute of the HTML element you which Listy to render into. A DIV is dynamically added after the player if no target is specified.
"skin":"http://p.jwpcdn.com/6/7/skins/five.xml",
"list":{
"label":[String: "Playlist"], // Customise the "Playlist" tab label.
"target":[String: "detached_playlist"], // The "id" attribute of the HTML element you wish the playlist to be rendered into (when detaching from the Listy controls).
"skin":"http://p.jwpcdn.com/6/7/skins/five.xml",
"current_selector":[String: "data-mediaid"], // Data attribute used to style the current playlist item. Used in conjunction with "item_tpl" when specifying Custom playlist HTML.
"start_tpl":[String: (see Custom Playlist HTML)],
"item_tpl":[String: (see Custom Playlist HTML)],
"end_tpl":[String: (see Custom Playlist HTML)]
},
"dummy_mp4_url": [Url: "//www.dev.powered-by-haiku.co.uk/solutions/listy/init/dummy.mp4"], // URL to the 'dummy.mp4' file used to overcome errors in player initialization.
/* ********************************************************************** */
/* "tubey" is used in conjunction with settings in the main player block to enable YouTube/Soundcloud playlist loading */
/* Main player block settings: */
/* "file":"use-tubey" */
/* "type":"mp4" */
/* ********************************************************************** */
"tubey": {
"playlist":[String: "YOUTUBE_PLAYLIST_ID"]||[Array: ["YOUTUBE_PLAYLIST_ID_1","SOUNDCLOUD_PLAYLIST_ID_2"]],
"image":[Url: "http://dev.powered-by-haiku.co.uk/solutions/tubey/img/use-tubey.jpg"],
"title":[String: "Loading your playlist..."],
"description":[String: "Please wait..."],
"sort":[String: "shuffle"||"ascending"||"descending"]
},
"features":{
"shuffle":{
"enabled":[Boolean: true||false], // Include the "Shuffle" button
"label":[String: "SHUFFLE"], // Customise the "Shuffle" button label
"onLoad":[Boolean: true||false] // Shuffle playlist when first loaded
},
"search":{
"enabled":[Boolean: true||false] // Include the "Search" field
},
"edit":{
"enabled":[Boolean: true||false], // Include the "Edit" toggle button
"label":[String: "EDIT"], // Customise the "Edit" button label
"buttons":{
"move_up":{
"enabled":true,
"label":"UP"
},
"remove":{
"enabled":true,
"label":"REMOVE"
},
"move_down":{
"enabled":true,
"label":"DOWN"
},
"custom":{
"enabled":true,
"label":"CUSTOM",
"action":"function(a,b){}"
}
},
/* ********************************************************************** */
/* These extended Edit Options are used in conjunction with the Premium Registered User features */
/* ********************************************************************** */
"options":{
"save": {
"enabled":true,
"label":"SAVE",
"default":"Default"
},
"load": {
"enabled":true,
"label":"LOAD",
"onLogin":{
"enabled":true,
"default":"Default"
}
},
"new": {
"enabled":true,
"label":"NEW"
},
"delete": {
"enabled":true,
"label":"DELETE"
}
}
},
"add":{
"enabled":true,
"label":"ADD ITEM",
"options":{
"form":{
/* ********************************************************************** */
/* The default form fields used to build items to be added to the playlist */
/* can be customised by including a "fields" block */
/* ********************************************************************** */
"fields":{
"mediaid":{"label":"Media ID:","type":"hidden"},
"title":{"label":"Title:","value":"Example: JW Player promo"},
"description":{"label":"Description:","type":"textarea","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"},
"duration":{"label":"Duration:","value":"mm:ss"},
"category":{
"label":"Categories:",
"type":"checkbox",
"options":{
"music":{"label":"Music"},
"hip_hop":{"label":"Hip Hop"},
"beatbox":{"label":"Beatbox"},
"dance":{"label":"Dance"},
"sport":{"label":"Sport"},
"inspirational":{"label":"Inspirational"},
"no_audio":{"label":"No Audio"},
"visual effects":{"label":"Visual effects"}
}
}
},
"buttons":{
"preview":{
"enabled":true,
"label":"PREVIEW"
},
"next":{
"enabled":true,
"label":"+NEXT"
},
"last":{
"enabled":true,
"label":"+LAST"
},
"custom":{
"enabled":true,
"label":"CUSTOM",
"action":"function(a,b){}"
}
}
},
/* ********************************************************************** */
/* This allows items which have been removed from the playlist to be re-added */
/* ********************************************************************** */
"from_removed":{
"enabled":true,
"label":"FROM REMOVED",
"buttons":{
"preview":{
"enabled":true,
"label":"PREVIEW"
},
"next":{
"enabled":true,
"label":"+NEXT"
},
"last":{
"enabled":true,
"label":"+LAST"
}
}
}
}
},
"add_from_yt":{
"enabled":true,
"label":"ADD FROM YOUTUBE",
"buttons":{
"preview":{
"enabled":true,
"label":"PREVIEW"
},
"next":{
"enabled":true,
"label":"+NEXT"
},
"last":{
"enabled":true,
"label":"+LAST"
},
"custom":{
"enabled":true,
"label":"CUSTOM",
"action":"function(a,b){}"
}
}
},
"add_from_sc":{
"enabled":true,
"label":"ADD FROM SOUNDCLOUD",
"buttons":{
"preview":{
"enabled":true,
"label":"PREVIEW"
},
"next":{
"enabled":true,
"label":"+NEXT"
},
"last":{
"enabled":true,
"label":"+LAST"
},
"custom":{
"enabled":true,
"label":"CUSTOM",
"action":"function(a,b){}"
}
}
},
"export": {
"enabled":true,
"type":"json"
}
},
"users":{
"enabled":true,
"management":{
"enabled":true,
"sign_in":{
"label":"Sign in",
"buttons": {
"new_user": { "label":"New user..."},
"forgot_password": {"label":"Forgot password?"},
"login": {"label":"Log in"}/*,
"register": {"label":"Register!"} */
},
"fields":{
"p1":{"type":"paragraph","label":"Please provide the following additional details. Fields marked with * are required:"},
"first_name":{"label":"First name:", "required": true},
"last_name":{"label":"Last name:", "required": true}
},
"terms_of_use":{
"url":"http://www.haiku.co.uk"
}
},
"sign_out":{
"label":"Sign out"
}
}
},
"prefetch":{
"enabled":true, // Enables auto-prefetch if !isMobile - you can still manually call prefetch for a PLI
"xdomain_support":true,
"async_requests":"2",
"look_ahead":"5",
"begin": function(player,listy,playlist_item, url){
/*
//EXAMPLE CODE
var sMediaID = playlist_item["mediaid"];
if(!listy["prefetch_media"])listy["prefetch_media"]={};
listy["prefetch_media"][sMediaID]=url;
*/
},
"progress": function(player,listy,playlist_item, url, percentage){
//updateLabel(playlist_item["mediaid"], percentage+"%");
},
"complete": function(player,listy,playlist_item, url, blob_url){
//updateLabel(playlist_item["mediaid"], "100%");
},
"error": function(player,listy,playlist_item, url, error){
//console.info('Prefetch error:' + url,error);
}
},
"events":{
"onReady": function(listy, player, view){
/* EXAMPLE CODE */
},
"onRedraw": function(listy, player, view){
/* EXAMPLE CODE */
},
"onPlay": function(listy, player, view){
/* EXAMPLE CODE */
},
"onItemSelect": function(listy, player, playlistItem){
/* EXAMPLE CODE */
}
}
}
One thing to note is that you should not include the JW
"listbar"
setting if using the Listy plugin