//------------------------------------------------- // youtube playlist jquery plugin // Created by dan@geckonm.com // www.geckonewmedia.com // // v1.1 - updated to allow fullscreen // - thanks Ashraf for the request // v1.2 - updated to allow for mixed yt/image galleries // - for Markus Thyberg //------------------------------------------------- String.prototype.startsWith = function(str){ return (this.indexOf(str) === 0); } jQuery.fn.ytplaylist = function(options) { // default settings var options = jQuery.extend( { holderId: 'ytvideo', playerHeight: 300, playerWidth: 450, addThumbs: false, thumbSize: 'small', showInline: false, autoPlay: true, showRelated: true, allowFullScreen: false },options); return this.each(function() { var $el = $(this); var autoPlay = ""; var showRelated = "&rel=0"; var fullScreen = ""; if(options.autoPlay) autoPlay = "&autoplay=1"; if(options.showRelated) showRelated = "&rel=1"; if(options.allowFullScreen) fullScreen = "&fs=1"; //throw a youtube player in function playOld(id) { var html = ''; html += ''; html += ' '; html += ' '; if(options.allowFullScreen) { html += ' '; } html += ''; html += ''; return html; }; function playNew (id) { var html = ''; html += '