Skip to content

Instantly share code, notes, and snippets.

@badsyntax
Created October 24, 2010 19:22
Show Gist options
  • Save badsyntax/643864 to your computer and use it in GitHub Desktop.
Save badsyntax/643864 to your computer and use it in GitHub Desktop.
var options = {
width: 425, // player width (integer or string)
height: 356, // player height (integer or string)
swfobject: window.swfobject, // swfobject object
playlist: {}, // playlist object (object literal)
showPlaylist: 1, // show playlist on plugin init (boolean)
showTime: 1, // show current time and duration in toolbar (boolean)
showTitleOverlay: 1, // show video title overlay text (boolean)
videoThumbs: 0, // show videos as thumbnails in the playlist area (boolean) (experimental)
randomStart: 0, // show random video on plugin init (boolean)
autoStart: 0, // auto play the video after the player as been built (boolean)
autoPlay: 0, // auto play the video when loading it via the playlist or toolbar controls (boolean)
repeat: 1, // repeat videos (boolean)
repeatPlaylist: 0, // repeat the playlist (boolean)
shuffle: 0, // shuffle the play list (boolean)
chromeless: 1, // chromeless player (boolean)
updateHash: 0, // update the location hash on video play (boolean)
highDef: 0, // high definition quality or normal quality (boolean)
playlistHeight: 5, // height of the playlist (integer) (N * playlist item height)
playlistBuilder: null, // custom playlist builder function (null or function) see http://github.com/badsyntax/jquery-youtube-player/wiki/Installation-and-usage
playlistBuilderClickHandler: null, // custom playlist video click event handler, useful if you want to prevent default click event (null or function)
playlistSpeed: 550, // speed of playlist show/hide animate
toolbarAppendTo: null, // element to append the toolbar to (selector or null)
playlistAppendTo: null, // element to append the playlist to (selector or null)
timeAppendTo: null, // elemend to append to time to (selector or null)
videoParams: { // video <object> params (object literal)
allowfullscreen: 'true',
allowScriptAccess: 'always',
wmode: 'transparent'
},
showToolbar: null, // show or hide the custom toolbar (null, true or false)
toolbarButtons: {}, // custom toolbar buttons
toolbar: 'play,prev,next,shuffle,repeat,mute,playlistToggle' // comma separated list of toolbar buttons
// callback events
onReady: function(){}, // after player has been constructed and first video has been cued
onVideoPlay: function(){}, // when video starts to play
onVideoPaused: function(){}, // when video has paused
onBuffer: function(){}, // when video starts to buffer
onError: function(errorMsg){} , // when there was an error loading a video
onBeforePlaylistLoaded: function(){}, // before the playlist has started loading (ajax event)
onAfterPlaylistLoaded: function(){}, // after the playlist has finished loading (ajax event) (will execute on error)
onVideoLoad: function(videoID){}, // when a video is loaded into the player, regardless if successful or not
onVideoCue: function(videoID){}, // after a video has been cued
onYoutubeStateChange: function(stateID){} // youtube event handler event
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment