text: /*!
   * 
   * Modern HTML5 Responsive Youtube Playlist Player
   * For jQuery 1.9 and above
   * 
   * @author  Rik de Vos
   * @link    http://rikdevos.com/
   * @version 1.9.0
   *
   * This is not free software. Visit http://codecanyon.net/item/modern-html5-responsive-youtube-playlist-player/8619272?ref=RikdeVos to purchase a license
   * 
   */
  function onYouTubeIframeAPIReady(){jQuery("body").addClass("yesp-youtube-iframe-ready")}!function(a){a.youtube_video=function(b,c){var d=this;d.$el=a(b),d.el=b,d.$el.data("youtube_video",d),d.init=function(){if(d.options=a.extend({},a.youtube_video.defaultOptions,c),d.options_copy=a.extend({},a.youtube_video.defaultOptions,c),d.api_key=d.options.api_key,d.$el.addClass("yesp"),d.$logo=[],d.type=!1,d.options.playlist!==!1)d.id="yt_player_"+d.options.playlist.replace(/[^a-z0-9]/gi,""),d.type="playlist";else if(d.options.channel!==!1)d.id="yt_player_"+d.options.channel.replace(/[^a-z0-9]/gi,""),d.type="channel";else if(d.options.user!==!1)d.id="yt_player_"+d.options.user.replace(/[^a-z0-9]/gi,""),d.type="user";else{if(d.options.videos===!1)return void d.display_error("No playlist/channel/user/videos entered. Set at least 1.",!0);"string"==typeof d.options.videos&&(d.options.videos=[d.options.videos]),d.id="yt_player_"+d.options.videos[0].replace(/[^a-z0-9]/gi,""),d.type="videos"}"undefined"!=typeof d.options.player_id&&d.options.player_id!==!1&&(d.id=d.options.player_id),"undefined"!=typeof d.$el.attr("id")&&d.$el.attr("id")!==!1?d.id=d.$el.attr("id"):d.$el.attr("id",d.id),d.options.max_results>50&&(d.options.max_results=50),d.$controls=[],d.$title=null,d.$container=d.$el.find(".yesp-container"),d.youtube=null,d.playlist_items=[],d.playlist_count=0,d.info={width:0,height:0,duration:0,current_time:0,previous_time:0,volume:d.options.volume,time_drag:!1,volume_drag:!1,ie:d.detect_ie(),ie_previous_time:0,touch:d.detect_touch(),youtube_loaded:!1,ios:!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g),mobile:!!navigator.userAgent.match(/(Android|webOS|iPad|iPhone|iPod|BlackBerry|Windows Phone)/g),ipad:!!navigator.userAgent.match(/(iPad)/g),state:!1,index:0,hover:!0,fullscreen:!1,idle_time:0,idle_controls_hidden:!1,playlist_shown:!0,horizontal_playlist_shown:!0,playlist_width:200,playlist_animating:!1,first_play:!1,current_video_url:"",next_page_token:!1,playlist_i:0,alternative_api_ready_check:!1,youtube_logo_timer:!1},d.info.ios&&(d.$el.addClass("yesp-ios"),d.options.volume_control=!1,d.options_copy.volume_control=!1),d.info.mobile&&(d.options.show_controls_on_load=!0,d.options.show_controls_on_pause=!0,d.options.show_controls_on_play=!0,d.$el.addClass("yesp-mobile")),d.info.ie&&d.$el.addClass("yesp-ie"),d.$el[0].requestFullScreen||d.$el[0].mozRequestFullScreen||d.$el[0].webkitRequestFullScreen||(d.options.fullscreen_control=!1),d.create_player_element(),d.init_playlist(),d.create_controls(),d.create_title(),d.create_overlays(),d.show_controls(),d.bind_controls(),a(window).on("resize",d.resize),d.resize(),d.init_time_slider(),d.init_volume_slider(),d.set_style(),d.options.width!==!1&&(d.$el.css("width",d.options.width),d.resize()),d.options.show_controls_on_load||d.hide_controls(),"horizontal"===d.options.playlist_type?(d.hide_playlist(!0),d.options.show_playlist?d.show_horizontal_playlist():d.hide_horizontal_playlist()):(d.hide_horizontal_playlist(),d.options.show_playlist||d.hide_playlist(!0)),document.addEventListener("fullscreenchange",function(){document.fullscreen||d.exit_fullscreen()},!1),document.addEventListener("mozfullscreenchange",function(){document.mozFullScreen||d.exit_fullscreen()},!1),document.addEventListener("webkitfullscreenchange",function(){document.webkitIsFullScreen||d.exit_fullscreen()},!1),document.addEventListener("msfullscreenchange",function(){document.msFullscreenElement||d.exit_fullscreen()},!1),setInterval(function(){d.info.mobile||(d.info.idle_time+=500,d.info.fullscreen&&d.info.idle_time>2e3&&(d.info.idle_controls_hidden=!0,d.hide_controls(!0)))},500),d.$el.mousemove(function(a){d.info.idle_time=0,d.info.idle_controls_hidden&&d.info.fullscreen&&(d.info.idle_controls_hidden=!1,d.show_controls())}),d.$el.keypress(function(a){d.info.idle_time=0,d.info.idle_controls_hidden&&d.info.fullscreen&&(d.info.idle_controls_hidden=!1,d.show_controls())}),d.info.touch&&d.$el.addClass("yesp-touch"),setTimeout(function(){d.info.alternative_api_ready_check=!0},1e3)},d.display_error=function(a,b){var c=d.$el.find(".yesp-error").html('<i class="yesp-icon yesp-icon-warning"></i>'+a).slideDown();0===c.length&&alert(a),b===!0&&(d.$el.find(".yesp-video").remove(),d.$el.find(".yesp-container, .yesp-hp").css("background-image","none"))},d.remove_next_page=function(){d.info.next_page_token=!1,d.$el.find(".yesp-next-page").remove(),d.$el.find(".yesp-hp-next-page").remove(),d.$el.find(".yesp-hp-videos").css("width",160*d.playlist_count)},d.get_playlist_next=function(){return d.info.next_page_token===!1?void d.remove_next_page():(d.$el.find(".yesp-next-page").html('<i class="yesp-icon yesp-icon-spinner yesp-icon-spin"></i>'),void d.get_playlist(d.info.next_page_token,d.options.playlist))},d.get_playlist=function(b,c){"undefined"==typeof b||b===!1?(b=!1,through_pagination=!1):through_pagination=!0;var e="https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&maxResults="+d.options.max_results+"&playlistId="+c+"&key="+d.options.api_key;through_pagination===!0&&(e+="&pageToken="+b);var f=a.getJSON(e,function(a){if("undefined"!=typeof a.items){0===a.items.length&&d.display_error("This playlist is empty.",!0),d.options.shuffle&&(a.items=d.shuffle_array(a.items));var b=d.create_playlist(through_pagination,a.items,a.items.length);d.playlist_items=d.playlist_items.concat(b.items),d.playlist_count+=b.count,d.options.pagination===!0?"undefined"==typeof a.nextPageToken?d.remove_next_page():(d.info.next_page_token=a.nextPageToken,d.$el.find(".yesp-next-page").html('<i class="yesp-icon yesp-icon-plus"></i>'+d.options.load_more_text).show()):d.info.next_page_token=!1,d.playlist_count<2&&!through_pagination&&d.info.next_page_token===!1&&(d.hide_playlist(!0),d.options.show_playlist=!1,d.options.playlist_toggle_control=!1,d.$controls.playlist_toggle.hide(),d.options.fwd_bck_control=!1,d.options_copy.fwd_bck_control=!1,d.$controls.forward.hide(),d.$controls.backward.hide(),d.resize(),0===d.playlist_count&&d.display_error("This playlist is empty.",!0))}else d.display_error("An error occured while retrieving the playlist.",!0)});f.fail(function(b){var c="An error occured while retrieving the playlist.";if("undefined"!=typeof b.responseText){var e=a.parseJSON(b.responseText);c="404"==e.error.code?"The playlist was not found.":"403"==e.error.code?e.error.message:"400"==e.error.code?"The API key you have entered is invalid.":"An error occured while retrieving the playlist.<br /><em>"+e.error.message+"</em>"}d.display_error(c,!0),d.hide_playlist(!0)})},d.get_channel=function(b,c){var e="";e="user"===b?"https://www.googleapis.com/youtube/v3/channels?part=contentDetails&maxResults="+d.options.max_results+"&forUsername="+encodeURIComponent(c)+"&key="+d.api_key:"https://www.googleapis.com/youtube/v3/channels?part=contentDetails&maxResults="+d.options.max_results+"&id="+c+"&key="+d.api_key,a.getJSON(e,function(a){if(void 0!==typeof a.items&&1==a.items.length){var b=a.items[0].contentDetails.relatedPlaylists.uploads;d.options.playlist=b,d.get_playlist(!1,d.options.playlist)}else d.display_error("An error occured while retrieving the channel/user.",!0)})},d.get_videos=function(b){for(var c="",e=b.length,f=0;f<e;f++)c+=f!==e-1?b[f]+",":b[f];var g="https://www.googleapis.com/youtube/v3/videos?part=snippet,status&maxResults="+d.options.max_results+"&id="+c+"&key="+d.api_key;a.getJSON(g,function(a){if("undefined"!=typeof a.items){for(var b=0;b<a.items.length;b++)a.items[b].snippet.resourceId={videoId:a.items[b].id};var c=d.create_playlist(!1,a.items,a.items.length);d.playlist_items=d.playlist_items.concat(c.items),d.playlist_count+=c.count,d.playlist_count<2&&(d.hide_playlist(!0),d.options.show_playlist=!1,d.options.playlist_toggle_control=!1,d.$controls.playlist_toggle.hide(),d.options.fwd_bck_control=!1,d.options_copy.fwd_bck_control=!1,d.$controls.forward.hide(),d.$controls.backward.hide(),d.resize(),0===d.playlist_count&&d.display_error("This playlist is empty, or the video's were not found.",!0))}else d.display_error("An error occured while retrieving the video(s).",!0)})},d.init_playlist=function(){return"playlist"===d.type?void d.get_playlist(!1,d.options.playlist):"channel"==d.type?void d.get_channel("channel",d.options.channel):"user"==d.type?void d.get_channel("user",d.options.user):"videos"==d.type?void d.get_videos(d.options.videos):void 0},d.create_playlist=function(b,c,e){b||d.create_youtube_element();for(var f=0;"undefined"!=typeof c[f];)"private"!=c[f].status.privacyStatus&&"undefined"!=typeof c[f].snippet.thumbnails?f++:(c.splice(f,1),e--);for(d.options.on_done_loading(c),d.info.playlist_i;d.info.playlist_i<d.playlist_count+e;d.info.playlist_i++){var g=c[d.info.playlist_i-d.playlist_count],h="";"undefined"!=typeof g.snippet.thumbnails.medium&&g.snippet.thumbnails.medium.width/g.snippet.thumbnails.medium.height==16/9?h=g.snippet.thumbnails.medium.url:"undefined"!=typeof g.snippet.thumbnails.medium?h=g.snippet.thumbnails.medium.url:"undefined"!=typeof g.snippet.thumbnails.high?h=g.snippet.thumbnails.high.url:"undefined"!=typeof g.snippet.thumbnails.default&&(h=g.snippet.thumbnails.default.url);g.snippet.title;g.snippet.title.length>85&&(g.snippet.title=g.snippet.title.substr(0,85)+"..."),g.snippet.channelTitle.length>20&&(g.snippet.channelTitle=g.snippet.channelTitle.substr(0,20)+"...");var j=a('<div class="yesp-playlist-video" data-playing="0" data-index="'+d.info.playlist_i+'"><img src="'+h+'" width="200" /><div class="yesp-playlist-overlay"><div class="yesp-playlist-title">'+g.snippet.title+'</div><div class="yesp-playlist-channel">'+g.snippet.channelTitle+'</div></div><div class="yesp-playlist-current"><i class="yesp-icon yesp-icon-play"></i><span>'+d.options.now_playing_text+"</span></div></div>");j.attr("data-description",g.snippet.description),j.click(function(b){b.preventDefault(),d.options.show_controls_on_play||d.hide_controls(),d.play_video(parseFloat(a(this).attr("data-index")))}),0==d.options.show_channel_in_playlist&&j.find(".yesp-playlist-channel").remove(),j.insertBefore(d.$el.find(".yesp-playlist .yesp-next-page")),d.$el.find(".yesp-playlist, .yesp-hp").css("background-image","none");var k=g.snippet.title;k.length>45&&(k=g.snippet.title.substring(0,45)+"...");var l=a('<div class="yesp-hp-video" data-playing="0" data-index="'+d.info.playlist_i+'"><img src="'+h+'" width="200" /><div class="yesp-hp-overlay"><div class="yesp-hp-title">'+k+'</div><div class="yesp-hp-channel">'+g.snippet.channelTitle+'</div></div><div class="yesp-hp-current"><i class="yesp-icon yesp-icon-play"></i><span>'+d.options.now_playing_text+"</span></div></div>");l.attr("data-description",g.snippet.description),l.click(function(b){b.preventDefault(),d.options.show_controls_on_play||d.hide_controls(),d.play_video(parseFloat(a(this).attr("data-index")))}),0==d.options.show_channel_in_playlist&&l.find(".yesp-hp-channel").remove(),l.insertBefore(d.$el.find(".yesp-hp .yesp-hp-next-page"))}return d.$el.find(".yesp-hp-videos").css("width",160*d.info.playlist_i+50),b===!1&&(d.$el.find(".yesp-playlist").perfectScrollbar({suppressScrollX:!0}),d.$el.find(".yesp-hp").perfectScrollbar({suppressScrollY:!0,useBothWheelAxes:!0}),d.resize(!1,!0)),b===!0&&setTimeout(function(){d.update_scroll_position(!1,Math.floor(d.info.playlist_width/16*9)*(d.playlist_count-e))},10),{items:c,count:e}},d.check_youtube_api_ready=function(){if(d.info.alternative_api_ready_check){if(typeof YT!=typeof{})return!1;if(0==YT.loaded)return!1}else if(!a("body").hasClass("yesp-youtube-iframe-ready"))return!1;return!0},d.create_youtube_element=function(){if(!d.check_youtube_api_ready())return void setTimeout(d.create_youtube_element,10);if(!d.info.youtube_loaded){d.info.youtube_loaded=!0;var a={controls:0,showinfo:0,fullscreen:0,iv_load_policy:d.options.show_annotations?1:3,fs:0,rel:d.options.related?1:0,wmode:"opaque"};d.options.force_hd&&(a.vq="hd720"),d.options.hide_youtube_logo&&(a.modestbranding=1);for(var b in d.options.player_vars)a[b]=d.options.player_vars[b];window.YTConfig={host:"https://www.youtube.com"},d.youtube=new YT.Player(d.id+"_yt",{playerVars:a,events:{onReady:d.youtube_ready,onStateChange:d.youtube_state_change}})}},d.youtube_ready=function(){setInterval(d.youtube_player_updates,500),0!=d.playlist_count&&(d.play_video(d.options.first_video,!d.options.autoplay,!0),d.options.volume!==!1&&d.update_volume(0,d.options.volume),d.$el.find(".yesp-container").hover(function(){d.info.hover=!0,d.show_controls()},function(){d.info.hover=!1;var a=d.youtube.getPlayerState();(!d.options.show_controls_on_pause||a!=-1&&0!=a&&2!=a&&5!=a)&&(d.options.show_controls_on_play||d.hide_controls()),d.hide_share()}))},d.youtube_player_updates=function(){if(d.info.current_time=d.youtube.getCurrentTime(),d.youtube.getCurrentTime()||(d.info.current_time=0),d.info.duration=d.youtube.getDuration(),d.info.duration&&d.info.current_time!=d.info.previous_time){d.info.previous_time=d.info.current_time,"full"==d.options.time_indicator?d.$controls.time.html(d.format_time(d.info.current_time)+" / "+d.format_time(d.info.duration)):d.$controls.time.html(d.format_time(d.info.current_time));var a=Math.round(d.info.current_time);0==a?d.$controls.youtube.attr("href",d.$controls.youtube.attr("data-href")):d.$controls.youtube.attr("href",d.$controls.youtube.attr("data-href")+"#t="+a),d.info.current_video_url=d.$controls.youtube.attr("data-href");var b=100*d.info.current_time/d.info.duration;d.$controls.time_bar_time.css("width",b+"%"),d.$controls.time_bar_buffer.css("width",100*d.youtube.getVideoLoadedFraction()+"%"),d.options.on_time_update(d.info.current_time)}},d.youtube_state_change=function(a){var b=a.data;0==b?d.options.continuous?d.forward():(d.play_video(d.info.index,!0),d.$controls.play.removeClass("yesp-icon-play").removeClass("yesp-icon-pause").addClass("yesp-icon-undo"),d.show_controls()):1==b||3==b?d.$controls.play.removeClass("yesp-icon-play").addClass("yesp-icon-pause").removeClass("yesp-icon-undo"):2==b&&d.$controls.play.addClass("yesp-icon-play").removeClass("yesp-icon-pause").removeClass("yesp-icon-undo"),d.info.first_play||b===-1||5===b||(d.info.first_play=!0),d.youtube_player_updates(),d.options.on_state_change(b)},d.create_player_element=function(){d.$el.css("width","100%").addClass("yesp").html('<div class="yesp-container"><div class="yesp-autoposter"><div class="yesp-autoposter-icon"><div></div></div></div><div class="yesp-video-container"><div class="yesp-video" id="'+d.id+'_yt"></div><div class="yesp-error"></div></div></div><div class="yesp-playlist"><div class="yesp-next-page"><i class="yesp-icon yesp-icon-plus"></i>Load More</div></div><div class="yesp-hp"><div class="yesp-hp-videos"><div class="yesp-hp-next-page"><i class="yesp-icon yesp-icon-plus"></i></div></div></div>'),d.$el.find(".yesp-video-container").click(function(a){d.play_pause()}),"horizontal"==d.options.playlist_type&&d.$el.find(".yesp-playlist").remove(),d.$el.find(".yesp-next-page, .yesp-hp-next-page").click(function(a){d.get_playlist_next()}),d.$el.find(".yesp-autoposter").click(function(a){a.preventDefault(),d.play()})},d.create_controls=function(){var b=a('<div class="yesp-controls"></div>');b.html('<div class="yesp-controls-wrapper"><a href="#" class="yesp-play yesp-icon yesp-icon-play"></a><div class="yesp-time">00:00 / 00:00</div><div class="yesp-bar"><div class="yesp-bar-buffer"></div><div class="yesp-bar-time"></div></div><div class="yesp-volume"><a href="#" class="yesp-volume-icon yesp-icon yesp-icon-volume-up" title="Toggle Mute"></a><div class="yesp-volume-bar"><div class="yesp-volume-amount"></div></div></div><a href="#" class="yesp-share yesp-icon yesp-icon-share-square-o" title="Share"></a><a href="#" target="_blank" class="yesp-youtube yesp-icon yesp-icon-youtube-play" title="Open in YouTube"></a><a href="#" class="yesp-backward yesp-icon yesp-icon-backward" title="Previous Video"></a><a href="#" class="yesp-forward yesp-icon yesp-icon-forward" title="Forward Video"></a><a href="#" class="yesp-playlist-toggle yesp-icon yesp-icon-align-justify yesp-icon-rotate-180" title="Toggle Playlist"></a><a href="#" class="yesp-fullscreen yesp-icon yesp-icon-expand" title="Toggle Fullscreen"></a></div>'),d.$controls.play=b.find(".yesp-play"),d.$controls.time=b.find(".yesp-time"),d.$controls.time_bar=b.find(".yesp-bar"),d.$controls.time_bar_buffer=b.find(".yesp-bar-buffer"),d.$controls.time_bar_time=b.find(".yesp-bar-time"),d.$controls.volume=b.find(".yesp-volume"),d.$controls.volume_icon=b.find(".yesp-volume-icon"),d.$controls.volume_bar=b.find(".yesp-volume-bar"),d.$controls.volume_amount=b.find(".yesp-volume-amount"),d.$controls.share=b.find(".yesp-share"),d.$controls.youtube=b.find(".yesp-youtube"),d.$controls.forward=b.find(".yesp-forward"),d.$controls.backward=b.find(".yesp-backward"),d.$controls.playlist_toggle=b.find(".yesp-playlist-toggle"),d.$controls.fullscreen=b.find(".yesp-fullscreen"),d.options.play_control||d.$controls.play.hide(),d.options.time_indicator?"full"==d.options.time_indicator&&d.$controls.time.addClass("yesp-full-time"):d.$controls.time.hide(),d.options.volume_control||d.$controls.volume.hide(),d.options.share_control||d.$controls.share.hide(),d.options.youtube_link_control||d.$controls.youtube.hide(),d.options.fwd_bck_control||(d.$controls.backward.hide(),d.$controls.forward.hide()),d.options.fullscreen_control||d.$controls.fullscreen.hide(),d.options.playlist_toggle_control||d.$controls.playlist_toggle.hide(),b.appendTo(this.$el.find(".yesp-container")),d.$logo=a('<a href="#" target="_blank" class="yesp-youtube-logo"></a>'),d.$logo.appendTo(this.$el.find(".yesp-container")),(d.options.hide_youtube_logo||d.info.mobile)&&(d.$logo.hide(),d.options.hide_youtube_logo=!0)},d.create_title=function(){d.$title=a('<div class="yesp-title"></div>'),d.$title.html('<div class="yesp-title-wrapper"></div>'),d.$title.appendTo(d.$el.find(".yesp-container")),d.options.description_toggle&&(d.info.$desc_btn=a('<a href="#" title="Video Description" class="yesp-description-toggle-button"><i class="yesp-icon yesp-icon-info-circle"></i></a>').appendTo(d.$title),d.info.$desc=a('<div class="yesp-description-toggle"><a href="#" class="yesp-description-toggle-close"><i class="yesp-icon yesp-icon-times"></i></a><div class="yesp-description-toggle-inside">Earth From Space Full HD  Nova The groundbreaking two-hour special that reveals a spectacular new space-based vision of our planet. Produced in extensive consultation with NASA scientists, NOVA takes data from earth-observing satellites and transforms it into dazzling visual sequences, each one exposing the intricate and surprising web of forces that sustains life on earth.</div></div>').appendTo(this.$el.find(".yesp-container .yesp-video-container")),d.info.$desc_btn.click(function(a){a.preventDefault(),d.info.$desc.slideToggle()}))},d.update_title=function(a,b,c){d.options.show_channel_in_title?d.$title.find("div.yesp-title-wrapper").html('<a href="'+c+'" target="_blank" class="yesp-subtitle">'+b+"</a>"+a):d.$title.find("div.yesp-title-wrapper").html(a)},d.create_overlays=function(){d.$social=a('<div class="yesp-social" data-show="0"><a href="#" class="yesp-social-button yesp-social-google yesp-icon yesp-icon-google-plus"></a><a href="#" class="yesp-social-button yesp-social-twitter yesp-icon yesp-icon-twitter"></a><a href="#" class="yesp-social-button yesp-social-facebook yesp-icon yesp-icon-facebook"></a></div>').appendTo(d.$el.find(".yesp-container")),d.$social.find(".yesp-social-facebook").click(function(a){a.preventDefault(),d.share_facebook()}),d.$social.find(".yesp-social-twitter").click(function(a){a.preventDefault(),d.share_twitter()}),d.$social.find(".yesp-social-google").click(function(a){a.preventDefault(),d.share_google()})},d.share_link=function(){},d.share_facebook=function(){window.open("https://www.facebook.com/sharer/sharer.php?u="+d.share_url(),"Share on Facebook","height=300,width=600")},d.share_twitter=function(){window.open("https://twitter.com/home?status="+d.share_url(),"Share on Twitter","height=300,width=600")},d.share_google=function(){window.open("https://plus.google.com/share?url="+d.share_url(),"Share on Google+","height=300,width=600")},d.bind_controls=function(){d.$controls.play.click(function(a){a.preventDefault(),d.play_pause()}),d.$controls.volume_icon.click(function(a){if(a.preventDefault(),d.youtube.isMuted())0==d.info.volume&&(d.info.volume=d.options.volume),d.update_volume(0,d.info.volume);else{var b=d.youtube.getVolume()/100;d.update_volume(0,0),d.info.volume=b}}),d.$controls.share.click(function(a){a.preventDefault(),d.toggle_share()}),d.$controls.youtube.click(function(a){d.pause()}),d.$controls.backward.click(function(a){a.preventDefault(),d.backward()}),d.$controls.forward.click(function(a){a.preventDefault(),d.forward()}),d.$controls.fullscreen.click(function(a){a.preventDefault(),d.info.fullscreen?d.exit_fullscreen(!0):d.enter_fullscreen()}),d.$controls.playlist_toggle.click(function(a){a.preventDefault(),d.toggle_playlist()})},d.show_controls=function(){d.$title.stop().animate({opacity:1},250),d.$el.find(".yesp-controls").stop().animate({bottom:0,opacity:1},250),d.options.hide_youtube_logo||d.info.mobile||(d.info.youtube_logo_timer=setTimeout(function(){d.$logo.stop().fadeTo(250,.25,function(){d.$logo.css("opacity","")})},250))},d.hide_controls=function(a){"undefined"!=typeof a&&1==a?d.$el.find(".yesp-controls").stop().animate({bottom:0,opacity:0},250):d.$el.find(".yesp-controls").stop().animate({bottom:-50},250),d.info.youtube_logo_timer!==!1&&clearTimeout(d.info.youtube_logo_timer),d.$el.find(".yesp-youtube-logo").stop().fadeTo(350,0,function(){}),d.info.ios||d.$title.stop().animate({opacity:0},250)},d.play_pause=function(){var a=d.youtube.getPlayerState();2==a?d.play():0==a?(d.youtube.seekTo(0),d.play()):5==a?d.play():d.pause()},d.play=function(){d.youtube.playVideo(),d.$el.find(".yesp-autoposter").hide(),d.$controls.play.removeClass("yesp-icon-play").addClass("yesp-icon-pause").removeClass("yesp-icon-undo")},d.pause=function(){d.youtube.pauseVideo(),d.$controls.play.addClass("yesp-icon-play").removeClass("yesp-icon-pause").removeClass("yesp-icon-undo")},d.stop=function(){d.pause(),d.youtube.stopVideo()},d.forward=function(){d.info.index++,d.info.index>=d.playlist_count&&(d.info.index=0),d.play_video(d.info.index)},d.backward=function(){d.info.index--,d.info.index<0&&(d.info.index=d.playlist_count-1),d.play_video(d.info.index)},d.play_video=function(a,b,c){if(parseFloat(a,10)==a&&parseFloat(a,10)<=d.playlist_items.length)a=parseFloat(a,10);else{var e=a;a=0;for(var f=0;f<d.playlist_items.length;f++)if(d.playlist_items[f].snippet.resourceId.videoId===e){a=f;break}}var g=d.playlist_items[a];if(void 0!=g){"undefined"==typeof c&&(c=!1),d.info.mobile&&!d.info.first_play&&(b=!0);var h=g.snippet.title,i=g.snippet.channelTitle,j="https://www.youtube.com/channel/"+g.snippet.channelId,e=g.snippet.resourceId.videoId,k="https://www.youtube.com/watch?v="+e;if(d.update_title(h,i,j),"undefined"==typeof b||0==b?d.youtube.loadVideoById(e):d.youtube.cueVideoById(e),d.options.description_toggle&&(d.info.$desc.slideUp(300,function(){var a=d.nl2br(g.snippet.description);""==a&&(a="No Description Available"),d.info.$desc.find(".yesp-description-toggle-inside").html(a)}),console.log("yeah")),d.$logo.attr("href",k),d.$controls.youtube.attr("href",k).attr("data-href",k),d.info.current_video_url=k,d.$el.find(".yesp-playlist-video").attr("data-playing","0"),d.$el.find(".yesp-playlist-video[data-index="+a+"]").attr("data-playing","1"),d.$el.find(".yesp-hp-video").attr("data-playing","0"),d.$el.find(".yesp-hp-video[data-index="+a+"]").attr("data-playing","1"),"full"==d.options.time_indicator?d.$controls.time.html("00:00 / 00:00"):d.$controls.time.html("00:00"),d.$controls.time_bar_time.css("width",0),d.$controls.time_bar_buffer.css("width",0),d.info.index=a,d.update_scroll_position(c),b!==!0||d.info.mobile)d.$el.find(".yesp-autoposter").hide();else{var l=!1;"undefined"!=typeof g.snippet.thumbnails.maxres?l=g.snippet.thumbnails.maxres.url:"undefined"!=typeof g.snippet.thumbnails.high?l=g.snippet.thumbnails.high.url:"undefined"!=typeof g.snippet.thumbnails.medium?l=g.snippet.thumbnails.medium.url:"undefined"!=typeof g.snippet.thumbnails.standard?l=g.snippet.thumbnails.standard.url:"undefined"!=typeof g.snippet.thumbnails.default&&(l=g.snippet.thumbnails.default.url),l!==!1&&d.$el.find(".yesp-autoposter").css("background-image",'url("'+l+'")').show()}d.options.on_load(g.snippet)}},d.update_scroll_position=function(a,b){if("horizontal"===d.options.playlist_type){var c=160*d.info.index;return"undefined"!=typeof b&&(c=b),void(1==a?(d.$el.find(".yesp-hp").scrollLeft(c),d.$el.find(".yesp-hp").perfectScrollbar("update")):d.$el.find(".yesp-hp").stop().animate({scrollLeft:c},500,function(){d.$el.find(".yesp-hp").perfectScrollbar("update")}))}var c=Math.floor(d.info.playlist_width/16*9)*d.info.index;"undefined"!=typeof b&&(c=b),c<0&&(c=0);var e=d.$el.find(".yesp-playlist").innerHeight(),f=Math.floor(d.info.playlist_width/16*9)*d.playlist_count,g=f-e;d.info.next_page_token&&(g+=50),c>g&&(c=g),1==a?(d.$el.find(".yesp-playlist").scrollTop(c),d.$el.find(".yesp-playlist").perfectScrollbar("update")):d.$el.find(".yesp-playlist").stop().animate({scrollTop:c},500,function(){d.$el.find(".yesp-playlist").perfectScrollbar("update")})},d.toggle_fullscreen=function(){d.info.fullscreen?d.exit_fullscreen(!0):d.enter_fullscreen()},d.enter_fullscreen=function(){d.info.mobile;var b=d.$el.find(".yesp-container")[0].webkitRequestFullScreen||d.$el.find(".yesp-container")[0].requestFullScreen||d.$el.find(".yesp-container")[0].mozRequestFullScreen;if(b){var c=a(window).width(),e=a(window).height();d.info.fullscreen=!0,d.$el.find(".yesp-container, .yesp-container iframe").css({width:"100%",height:"100%"}),d.youtube.setSize(c,e),b.bind(d.$el.find(".yesp-container")[0])()}},d.exit_fullscreen=function(a){"undefined"!=typeof a&&a&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()),d.info.fullscreen=!1,d.resize()},d.toggle_playlist=function(){"horizontal"===d.options.playlist_type?d.info.horizontal_playlist_shown?d.hide_horizontal_playlist():d.show_horizontal_playlist():(d.info.playlist_shown?d.hide_playlist(!1):d.show_playlist(!1),"auto"!==d.options.show_playlist&&d.resize())},d.show_playlist=function(a,b){if("horizontal"!=d.options.playlist_type&&("undefined"==typeof b&&(b=!0),a=!0,!d.info.playlist_animating)){d.info.playlist_animating=!0;var c=d.$el.find(".yesp-playlist");return d.$el.find(".yesp-icon-list").removeClass("yesp-icon-list").addClass("yesp-icon-align-justify"),a?(c.css("width",d.info.playlist_width),d.info.playlist_shown=!0,d.info.playlist_animating=!1,void(b&&d.resize(!0))):void 0}},d.hide_playlist=function(a,b){if("undefined"==typeof b&&(b=!0),a=!0,!d.info.playlist_animating){d.info.playlist_animating=!0;var c=d.$el.find(".yesp-playlist");return"vertical"==d.options.playlist_type&&d.$el.find(".yesp-icon-align-justify").removeClass("yesp-icon-align-justify").addClass("yesp-icon-list"),a?(c.css("width",0),d.info.playlist_shown=!1,d.info.playlist_animating=!1,void(b&&d.resize(!0))):void 0}},d.show_horizontal_playlist=function(){d.info.horizontal_playlist_shown=!0,d.$el.find(".yesp-hp").show(),d.$el.find(".yesp-icon-list").removeClass("yesp-icon-list").addClass("yesp-icon-align-justify")},d.hide_horizontal_playlist=function(){d.info.horizontal_playlist_shown=!1,d.$el.find(".yesp-hp").hide(),d.$el.find(".yesp-icon-align-justify").removeClass("yesp-icon-align-justify").addClass("yesp-icon-list")},d.set_playlist_width=function(a){d.info.playlist_shown&&(d.info.playlist_width=a);var b=Math.floor(a/16*9);d.$el.find(".yesp-playlist").css({width:a}).find(".yesp-playlist-video").css({width:a,height:b}),d.$el.find(".yesp-playlist .yesp-playlist-current").css("width",a-20),a<=100?(d.$el.find(".yesp-playlist").addClass("yesp-playlist-simple"),d.$el.find(".yesp-playlist .yesp-playlist-current").css("width",10)):d.$el.find(".yesp-playlist").removeClass("yesp-playlist-simple")},d.resize=function(b,c){"undefined"!=typeof b&&typeof b!=typeof{}||(b=!1);var e=d.$el.innerWidth();"auto"==d.options.show_playlist&&0==b?(e<660&&(1==c||200==d.info.playlist_width)&&(d.set_playlist_width(100),d.update_scroll_position(!0)),e<500&&(1==c||1==d.info.playlist_shown)&&(d.hide_playlist(!1,!1),d.update_scroll_position(!0)),e>=500&&(1==c||0==d.info.playlist_shown)&&(d.show_playlist(!1,!1),d.update_scroll_position(!0)),e>=660&&(1==c||100==d.info.playlist_width)&&(d.set_playlist_width(200),d.update_scroll_position(!0))):0==b&&(c=!0,e<660&&(1==c||200==d.info.playlist_width)&&(d.set_playlist_width(100),d.update_scroll_position(!0)),e>=660&&(1==c||100==d.info.playlist_width)&&(d.set_playlist_width(200),d.update_scroll_position(!0)),0==d.info.playlist_shown&&d.hide_playlist(!0,!1));var f=e-(d.info.playlist_shown?d.info.playlist_width:0),g=f/16*9;d.info.fullscreen&&(e=a(window).width(),f=e,g=a(window).height()),d.$el.find(".yesp-container, .yesp-playlist, .yesp-video").css("height",g),d.$el.find(".yesp-container, .yesp-video").css("width",f),d.$el.find(".yesp-playlist").perfectScrollbar("update"),d.info.width=f,d.info.height=g;var h=f-20;f<600&&"full"==d.options.time_indicator&&(d.options.time_indicator=!0,d.$controls.time.html(d.format_time(d.info.current_time)),d.$controls.time.removeClass("yesp-full-time")),f<530&&(d.options.fwd_bck_control=!1,d.options.youtube_link_control=!1,d.$controls.forward.hide(),d.$controls.backward.hide(),d.$controls.youtube.hide()),f<400&&(d.options.volume_control=!1,d.$controls.volume.hide()),f<300&&(d.options.time_indicator=!1,d.$controls.time.hide(),d.options.share_control=!1,d.$controls.share.hide()),f>=300&&(1==d.options_copy.time_indicator||"full"==d.options_copy.time_indicator)&&(d.options.time_indicator=!0,d.$controls.time.show()),f>=300&&1==d.options_copy.share_control&&(d.options.share_control=!0,d.$controls.share.show()),f>=400&&1==d.options_copy.volume_control&&(d.options.volume_control=!0,d.$controls.volume.show()),f>=530&&1==d.options_copy.fwd_bck_control&&(d.options.fwd_bck_control=!0,d.$controls.forward.show(),d.$controls.backward.show()),f>=530&&1==d.options_copy.youtube_link_control&&(d.options.youtube_link_control=!0,d.$controls.youtube.show()),f>=600&&"full"==d.options_copy.time_indicator&&(d.options.time_indicator="full",d.$controls.time.html(d.format_time(d.info.current_time)+" / "+d.format_time(d.info.duration)),d.$controls.time.addClass("yesp-full-time")),d.options.play_control&&(h-=30),d.options.time_indicator&&(h-=58),"full"==d.options.time_indicator&&(h-=40),d.options.volume_control&&(h-=110),d.options.share_control&&(h-=30),d.options.youtube_link_control&&(h-=30),d.options.fwd_bck_control&&(h-=60),d.options.fullscreen_control&&(h-=30),d.options.playlist_toggle_control&&(h-=30),h-=18,d.$controls.time_bar.css("width",h)},d.init_time_slider=function(){d.$controls.time_bar.on("mousedown",function(a){d.info.ipad||(d.info.time_drag=!0),d.update_time_slider(a.pageX)}),a(document).on("mouseup",function(a){d.info.time_drag&&(d.info.time_drag=!1,d.update_time_slider(a.pageX))}),a(document).on("mousemove",function(a){d.info.time_drag&&d.update_time_slider(a.pageX)})},d.update_time_slider=function(a){if(0!=d.info.duration){var b=d.info.duration,c=a-d.$controls.time_bar.offset().left,e=100*c/d.$controls.time_bar.width();e>100&&(e=100),e<0&&(e=0);var f=Math.round(b*e/100);d.$controls.time_bar_time.css("width",e+"%"),d.youtube.seekTo(f),d.options.on_seek(b*e/100)}},d.init_volume_slider=function(){d.$controls.volume_bar.on("mousedown",function(a){d.info.volume_drag=!0,d.$controls.volume_icon.removeClass("yesp-icon-volume-off").addClass("yesp-icon-volume-up"),d.update_volume(a.pageX)}),a(document).on("mouseup",function(a){d.info.volume_drag&&(d.info.volume_drag=!1,
  d.update_volume(a.pageX))}),a(document).on("mousemove",function(a){d.info.volume_drag&&d.update_volume(a.pageX)})},d.update_volume=function(a,b){var c;if(b)c=100*b;else{var e=a-d.$controls.volume_bar.offset().left;c=100*e/d.$controls.volume_bar.width()}c>100&&(c=100),c<0&&(c=0),d.$controls.volume_amount.css("width",c+"%"),d.youtube.setVolume(c),0==c?d.youtube.mute():d.youtube.isMuted()&&d.youtube.unMute(),0==c?d.$controls.volume_icon.addClass("yesp-icon-volume-off").removeClass("yesp-icon-volume-up"):d.$controls.volume_icon.removeClass("yesp-icon-volume-off").addClass("yesp-icon-volume-up"),d.options.on_volume(c/100)},d.toggle_share=function(){"1"==d.$social.attr("show")?d.hide_share():d.show_share()},d.show_share=function(){d.$social.attr("show","1").stop().animate({right:10},200)},d.hide_share=function(){d.$social.attr("show","0").stop().animate({right:-140},200)},d.set_style=function(){var b=a("<style />"),c={controls_bg:"rgba(0,0,0,.75)",buttons:"rgba(255,255,255,.5)",buttons_hover:"rgba(255,255,255,1)",buttons_active:"rgba(255,255,255,1)",time_text:"#FFFFFF",bar_bg:"rgba(255,255,255,.5)",buffer:"rgba(255,255,255,.25)",fill:"#FFFFFF",video_title:"#FFFFFF",video_channel:"#DFF76D",playlist_overlay:"rgba(0,0,0,.5)",playlist_title:"#FFFFFF",playlist_channel:"#DFF76D",scrollbar:"#FFFFFF",scrollbar_bg:"rgba(255,255,255,.25)",load_more_bg:"#000000",load_more_text:"#FFFFFF"};for(key in d.options.colors)c[key]=d.options.colors[key];b.html("#"+d.id+".yesp .yesp-controls{background:"+c.controls_bg+"!important}#"+d.id+".yesp .yesp-controls a{color:"+c.buttons+"!important}#"+d.id+".yesp .yesp-controls a:hover{color:"+c.buttons_hover+"!important}#"+d.id+".yesp .yesp-controls a:active{color:"+c.buttons_active+"!important}#"+d.id+".yesp .yesp-time{color:"+c.time_text+"!important}#"+d.id+".yesp .yesp-bar,#"+d.id+".yesp .yesp-volume .yesp-volume-bar{background:"+c.bar_bg+"!important}#"+d.id+".yesp .yesp-bar .yesp-bar-buffer{background:"+c.buffer+"!important}#"+d.id+".yesp .yesp-bar .yesp-bar-time,#"+d.id+".yesp .yesp-volume .yesp-volume-bar .yesp-volume-amount{background:"+c.fill+"!important}#"+d.id+".yesp .yesp-title-wrapper{color:"+c.video_title+"!important}#"+d.id+".yesp .yesp-title a.yesp-subtitle{border-color:"+c.video_title+"!important}#"+d.id+".yesp .yesp-title-wrapper a{color:"+c.video_channel+"!important}#"+d.id+".yesp .yesp-playlist-overlay,#"+d.id+".yesp .yesp-hp-overlay,#"+d.id+".yesp .yesp-playlist-current,#"+d.id+".yesp .yesp-hp-current{background: "+c.playlist_overlay+" !important;}#"+d.id+".yesp .yesp-playlist-overlay .yesp-playlist-title,#"+d.id+".yesp .yesp-hp-overlay .yesp-hp-title,#"+d.id+".yesp .yesp-playlist-current,#"+d.id+".yesp .yesp-hp-current{color: "+c.playlist_title+" !important;}#"+d.id+".yesp .yesp-playlist-overlay .yesp-playlist-channel,#"+d.id+".yesp .yesp-hp-overlay .yesp-hp-channel {color: "+c.playlist_channel+" !important;}#"+d.id+".yesp .ps-scrollbar-y-rail, #"+d.id+".yesp .ps-scrollbar-x-rail {background: "+c.scrollbar_bg+" !important;}#"+d.id+".yesp .ps-scrollbar-y,#"+d.id+".yesp .ps-scrollbar-x {background: "+c.scrollbar+" !important;}#"+d.id+".yesp .yesp-next-page,#"+d.id+".yesp .yesp-hp-next-page {background:"+c.load_more_bg+" !important;color:"+c.load_more_text+" !important;}"),b.appendTo("body")},d.format_time=function(a){var b=Math.floor(a/60)<10?"0"+Math.floor(a/60):Math.floor(a/60),c=Math.floor(a-60*b)<10?"0"+Math.floor(a-60*b):Math.floor(a-60*b);return b+":"+c},d.cut_text=function(a){return function(c,d){var e=d.substr(0,a);return/^\S/.test(d.substr(a))?e.replace(/\s+\S*$/,""):e}},d.share_url=function(){return d.info.current_video_url},d.detect_ie=function(){var a=window.navigator.userAgent,b=a.indexOf("MSIE "),c=a.indexOf("Trident/");if(b>0)return parseInt(a.substring(b+5,a.indexOf(".",b)),10);if(c>0){var d=a.indexOf("rv:");return parseInt(a.substring(d+3,a.indexOf(".",d)),10)}return!1},d.detect_touch=function(){return!!("ontouchstart"in window)||!!("onmsgesturechange"in window)},d.shuffle_array=function(a){for(var b=a.length-1;b>0;b--){var c=Math.floor(Math.random()*(b+1)),d=a[b];a[b]=a[c],a[c]=d}return a},d.nl2br=function(a,b){var c=b||"undefined"==typeof b?"<br />":"<br>";return(a+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+c+"$2")},d.init()},a.youtube_video.defaultOptions={playlist:!1,channel:!1,user:!1,videos:!1,player_id:!1,shuffle:!1,api_key:"AIzaSyAuL07vOpwHN0r2E3Sk2_k6KDgni8EjH2Q",max_results:50,pagination:!0,continuous:!0,first_video:0,show_playlist:"auto",playlist_type:"vertical",show_channel_in_playlist:!0,show_channel_in_title:!0,width:!1,show_annotations:!1,now_playing_text:"Now Playing",load_more_text:"Load More",force_hd:!1,hide_youtube_logo:!1,autoplay:!1,description_toggle:!1,play_control:!0,time_indicator:"full",volume_control:!0,share_control:!0,fwd_bck_control:!0,youtube_link_control:!0,fullscreen_control:!0,playlist_toggle_control:!0,volume:!1,show_controls_on_load:!0,show_controls_on_pause:!0,show_controls_on_play:!1,related:!1,player_vars:{},colors:{},on_load:function(a){},on_done_loading:function(a){},on_state_change:function(a){},on_seek:function(a){},on_volume:function(a){},on_time_update:function(a){}},a.fn.youtube_video=function(b){return this.each(function(){new a.youtube_video(this,b)})},a.fn.youtube_video_play=function(){return this.each(function(){new a.youtube_video_play(this)})},a.youtube_video_play=function(b){var c=a(b),d=c.data("youtube_video");d.play()},a.fn.youtube_video_pause=function(){return this.each(function(){new a.youtube_video_pause(this)})},a.youtube_video_pause=function(b){var c=a(b),d=c.data("youtube_video");d.pause()},a.fn.youtube_video_stop=function(){return this.each(function(){new a.youtube_video_stop(this)})},a.youtube_video_stop=function(b){var c=a(b),d=c.data("youtube_video");d.stop()},a.fn.youtube_video_seek=function(b){return this.each(function(){new a.youtube_video_seek(this,b)})},a.youtube_video_seek=function(b,c){var d=a(b),e=d.data("youtube_video"),f=e.info.duration,g=c/f*100;e.$controls.time_bar_time.css("width",g+"%"),e.youtube.seekTo(f*g/100),e.options.on_seek(c)},a.fn.youtube_video_load=function(b){return this.each(function(){new a.youtube_video_load(this,b)})},a.youtube_video_load=function(b,c){var d=a(b),e=d.data("youtube_video");e.play_video(c)},a.fn.youtube_video_volume=function(b){return this.each(function(){new a.youtube_video_volume(this,b)})},a.youtube_video_volume=function(b,c){var d=a(b),e=d.data("youtube_video");e.update_volume(0,c)},a.fn.youtube_show_controls=function(){return this.each(function(){new a.youtube_show_controls(this)})},a.youtube_show_controls=function(b){var c=a(b),d=c.data("youtube_video");d.show_controls()}}(jQuery);var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);
  