/*! yt-player. MIT License. Feross Aboukhadijeh */ var $jscomp={scope:{},global:this,initSymbolIterator:function(){Symbol=$jscomp.global.Symbol||{};Symbol.iterator||(Symbol.iterator="$jscomp$iterator");$jscomp.initSymbolIterator=function(){}},makeIterator:function(a){$jscomp.initSymbolIterator();if(a[Symbol.iterator])return a[Symbol.iterator]();if(!(a instanceof Array)&&"string"!=typeof a)throw Error();var b=0;return{next:function(){return b==a.length?{done:!0}:{done:!1,value:a[b++]}}}},inherits:function(a,b){function c(){}c.prototype=b.prototype; a.prototype=new c;a.prototype.constructor=a;for(var d in b)if($jscomp.global.Object.defineProperties){var e=$jscomp.global.Object.getOwnPropertyDescriptor(b,d);void 0!==e&&$jscomp.global.Object.defineProperty(a,d,e)}else a[d]=b[d]}},EventEmitter=function(){this.events={}};EventEmitter.prototype.on=function(a,b){"object"!==typeof this.events[a]&&(this.events[a]=[]);this.events[a].push(b)}; EventEmitter.prototype.removeListener=function(a,b){var c;"object"===typeof this.events[a]&&(c=this.indexOf(this.events[a],b),-1=b._player.getDuration()-Number(a)){b.seek(0);for(var c=$jscomp.makeIterator(b.replayInterval.entries()),d=c.next();!d.done;d=c.next())d=d.value[0],Object.hasOwnProperty.call(b.replayInterval,d)&&(clearInterval(b.replayInterval[d].interval), b.replayInterval.splice(d,1))}},1E3*Number(a))})};YouTubePlayer.prototype.pause=function(){this._ready?this._player.pauseVideo():this._queueCommand("pause")};YouTubePlayer.prototype.stop=function(){this._ready?this._player.stopVideo():this._queueCommand("stop")};YouTubePlayer.prototype.seek=function(a){this._ready?this._player.seekTo(a,!0):this._queueCommand("seek",a)}; YouTubePlayer.prototype._optimizeDisplayHandler=function(a){if(this._player){var b=this._player.i;a=a.split(",");if(b){var c,d;if(c=b.parentElement){var e=window.getComputedStyle(c);d=c.clientHeight+parseFloat(e.marginTop,10)+parseFloat(e.marginBottom,10)+parseFloat(e.borderTopWidth,10)+parseFloat(e.borderBottomWidth,10);c=c.clientWidth+parseFloat(e.marginLeft,10)+parseFloat(e.marginRight,10)+parseFloat(e.borderLeftWidth,10)+parseFloat(e.borderRightWidth,10);d+=80;b.style.width=c+"px";b.style.height= Math.ceil(parseFloat(b.style.width,10)/1.7)+"px";b.style.marginTop=Math.ceil(-((parseFloat(b.style.height,10)-d)/2))+"px";b.style.marginLeft=0;if(e=parseFloat(b.style.height,10)c&&(b.style.marginLeft=-((parseFloat(b.style.width,10)-c)/2)+"px")}}}}};YouTubePlayer.prototype.stopResize=function(){window.removeEventListener("resize",this._resizeListener);this._resizeListener=null}; YouTubePlayer.prototype.stopReplay=function(a){for(var b=$jscomp.makeIterator(this.replayInterval.entries()),c=b.next();!c.done;c=b.next())c=c.value[0],Object.hasOwnProperty.call(this.replayInterval,c)&&a===this.replayInterval[c].iframeParent&&(clearInterval(this.replayInterval[c].interval),this.replayInterval.splice(c,1))};YouTubePlayer.prototype.setVolume=function(a){this._ready?this._player.setVolume(a):this._queueCommand("setVolume",a)}; YouTubePlayer.prototype.loadPlaylist=function(){this._ready?this._player.loadPlaylist(this.videoId):this._queueCommand("loadPlaylist",this.videoId)};YouTubePlayer.prototype.setLoop=function(a){this._ready?this._player.setLoop(a):this._queueCommand("setLoop",a)};YouTubePlayer.prototype.getVolume=function(){return this._ready&&this._player.getVolume()||0};YouTubePlayer.prototype.mute=function(){this._ready?this._player.mute():this._queueCommand("mute")}; YouTubePlayer.prototype.unMute=function(){this._ready?this._player.unMute():this._queueCommand("unMute")};YouTubePlayer.prototype.isMuted=function(){return this._ready&&this._player.isMuted()||!1};YouTubePlayer.prototype.setSize=function(a,b){this._ready?this._player.setSize(a,b):this._queueCommand("setSize",a,b)};YouTubePlayer.prototype.setPlaybackRate=function(a){this._ready?this._player.setPlaybackRate(a):this._queueCommand("setPlaybackRate",a)}; YouTubePlayer.prototype.setPlaybackQuality=function(a){this._ready?this._player.setPlaybackQuality(a):this._queueCommand("setPlaybackQuality",a)};YouTubePlayer.prototype.getPlaybackRate=function(){return this._ready&&this._player.getPlaybackRate()||1};YouTubePlayer.prototype.getAvailablePlaybackRates=function(){return this._ready&&this._player.getAvailablePlaybackRates()||[1]};YouTubePlayer.prototype.getDuration=function(){return this._ready&&this._player.getDuration()||0}; YouTubePlayer.prototype.getProgress=function(){return this._ready&&this._player.getVideoLoadedFraction()||0};YouTubePlayer.prototype.getState=function(){return this._ready&&YOUTUBE_STATES[this._player.getPlayerState()]||"unstarted"};YouTubePlayer.prototype.getCurrentTime=function(){return this._ready&&this._player.getCurrentTime()||0};YouTubePlayer.prototype.destroy=function(){this._destroy()}; YouTubePlayer.prototype._destroy=function(a){this.destroyed||(this.destroyed=!0,this._player&&(this._player.stopVideo&&this._player.stopVideo(),this._player.destroy()),this._player=this._api=this._opts=this._id=this.videoId=null,this._ready=!1,this._queue=null,this._stopInterval(),this.removeListener("playing",this._startInterval),this.removeListener("paused",this._stopInterval),this.removeListener("buffering",this._stopInterval),this.removeListener("unstarted",this._stopInterval),this.removeListener("ended", this._stopInterval),a&&this.emit("error",a))};YouTubePlayer.prototype._queueCommand=function(a,b){for(var c=[],d=1;d