(function(){var a=false,b=/xyz/.test(function(){})?/\b_super\b/:/.*/;this.JRClass=function(){};JRClass.extend=function(c){function d(){!a&&this.init&&this.init.apply(this,arguments)}var f=this.prototype;a=true;var e=new this;a=false;for(var g in c)e[g]=typeof c[g]=="function"&&typeof f[g]=="function"&&b.test(c[g])?function(h,i){return function(){var j=this._super;this._super=f[h];var k=i.apply(this,arguments);this._super=j;return k}}(g,c[g]):c[g];d.prototype=e;d.constructor=d;d.extend=arguments.callee;
return d}})();
var VideoJS=JRClass.extend({init:function(a,b){this.video=typeof a=="string"?document.getElementById(a):a;this.video.player=this;this.options={controlsBelow:false,showControlsAtStart:false,controlsHiding:true,defaultVolume:0.85,flashVersion:9,linksHiding:true,flashIsDominant:false,useBrowserControls:false};typeof VideoJS.options=="object"&&_V_.merge(this.options,VideoJS.options);typeof b=="object"&&_V_.merge(this.options,b);this.box=this.video.parentNode;this.flashFallback=this.getFlashFallback();this.linksFallback=
this.getLinksFallback();if(VideoJS.browserSupportsVideo()||(this.flashFallback||VideoJS.isIE())&&this.flashVersionSupported())this.hideLinksFallback();if(VideoJS.browserSupportsVideo())if(!this.canPlaySource()||this.options.flashIsDominant&&this.flashVersionSupported())this.replaceWithFlash();else{this.video.src=this.firstPlayableSource.src;if(VideoJS.isIpad()||VideoJS.isIphone()||VideoJS.isAndroid())this.video.load();else{if(!this.options.useBrowserControls)this.video.controls=false;this.fixPreloading();
this.options.controlsBelow&&_V_.addClass(this.box,"vjs-controls-below");this.percentLoaded=0;this.buildPoster();this.showPoster();this.buildBigPlayButton();this.buildController();this.loadInterface();this.video.addEventListener("loadeddata",this.onLoadedData.context(this),false);this.video.addEventListener("play",this.onPlay.context(this),false);this.video.addEventListener("pause",this.onPause.context(this),false);this.video.addEventListener("ended",this.onEnded.context(this),false);this.video.addEventListener("volumechange",
this.onVolumeChange.context(this),false);this.video.addEventListener("error",this.onError.context(this),false);this.video.addEventListener("progress",this.onProgress.context(this),false);this.watchBuffer=setInterval(this.updateBufferedTotal.context(this),33);this.video.addEventListener("timeupdate",this.onTimeUpdate.context(this),false);this.bigPlayButton.addEventListener("click",this.onPlayControlClick.context(this),false);this.playControl.addEventListener("click",this.onPlayControlClick.context(this),
false);this.video.addEventListener("click",this.onPlayControlClick.context(this),false);this.poster&&this.poster.addEventListener("click",this.onPlayControlClick.context(this),false);this.progressHolder.addEventListener("mousedown",this.onProgressHolderMouseDown.context(this),false);this.progressHolder.addEventListener("mouseup",this.onProgressHolderMouseUp.context(this),false);this.setVolume(localStorage.volume||this.options.defaultVolume);this.volumeControl.addEventListener("mousedown",this.onVolumeControlMouseDown.context(this),
false);this.volumeControl.addEventListener("mouseup",this.onVolumeControlMouseUp.context(this),false);this.updateVolumeDisplay();this.fullscreenControl.addEventListener("click",this.onFullscreenControlClick.context(this),false);this.box.addEventListener("mousemove",this.onVideoMouseMove.context(this),false);this.box.addEventListener("mouseout",this.onVideoMouseOut.context(this),false);if(this.poster){this.poster.addEventListener("mousemove",this.onVideoMouseMove.context(this),false);this.poster.addEventListener("mouseout",
this.onVideoMouseOut.context(this),false)}this.controls.addEventListener("mousemove",this.onControlsMouseMove.context(this),false);this.controls.addEventListener("mouseout",this.onControlsMouseOut.context(this),false);this.subtitlesSource=this.video.getAttribute("data-subtitles");if(this.subtitlesSource!==null){this.loadSubtitles();this.buildSubtitles()}this.onEscKey=function(c){c.keyCode==27&&this.fullscreenOff()}.context(this);this.onWindowResize=function(){this.positionController()}.context(this);
this.onProgressMouseMove=function(c){this.setPlayProgressWithEvent(c)}.context(this);this.onProgressMouseUp=function(){_V_.unblockTextSelection();document.removeEventListener("mousemove",this.onProgressMouseMove,false);document.removeEventListener("mouseup",this.onProgressMouseUp,false);if(this.videoWasPlaying){this.video.play();this.trackPlayProgress()}}.context(this);this.onVolumeMouseMove=function(c){this.setVolumeWithEvent(c)}.context(this);this.onVolumeMouseUp=function(){_V_.unblockTextSelection();
document.removeEventListener("mousemove",this.onVolumeMouseMove,false);document.removeEventListener("mouseup",this.onVolumeMouseUp,false)}.context(this)}}},errors:[],fixPreloading:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("preload")&&this.video.preload!="none")this.video.autobuffer=true;else{this.video.autobuffer=false;this.video.preload="none"}},play:function(){this.video.play()},pause:function(){this.video.pause()},width:function(a){this.video.width=a;this.box.width=
a;this.poster.style.width=a+"px";this.positionController();return this},height:function(a){this.video.height=a;this.box.height=a;this.poster.style.height=a+"px";this.positionController();return this},loadInterface:function(){if(!this.stylesHaveLoaded()){if(!this.positionRetries)this.positionRetries=1;if(this.positionRetries++<100){setTimeout(this.loadInterface.context(this),0);return}}this.positionBox();this.showBigPlayButton();this.options.showControlsAtStart&&this.showController()},buildController:function(){this.controls=
_V_.createElement("ul",{className:"vjs-controls"});this.video.parentNode.appendChild(this.controls);this.playControl=_V_.createElement("li",{className:"vjs-play-control vjs-play",innerHTML:"<span></span>"});this.controls.appendChild(this.playControl);this.progressControl=_V_.createElement("li",{className:"vjs-progress-control"});this.controls.appendChild(this.progressControl);this.progressHolder=_V_.createElement("ul",{className:"vjs-progress-holder"});this.progressControl.appendChild(this.progressHolder);
this.loadProgress=_V_.createElement("li",{className:"vjs-load-progress"});this.progressHolder.appendChild(this.loadProgress);this.playProgress=_V_.createElement("li",{className:"vjs-play-progress"});this.progressHolder.appendChild(this.playProgress);this.timeControl=_V_.createElement("li",{className:"vjs-time-control"});this.controls.appendChild(this.timeControl);this.currentTimeDisplay=_V_.createElement("span",{className:"vjs-current-time-display",innerHTML:"00:00"});this.timeControl.appendChild(this.currentTimeDisplay);
this.timeSeparator=_V_.createElement("span",{innerHTML:" / "});this.timeControl.appendChild(this.timeSeparator);this.durationDisplay=_V_.createElement("span",{className:"vjs-duration-display",innerHTML:"00:00"});this.timeControl.appendChild(this.durationDisplay);this.volumeControl=_V_.createElement("li",{className:"vjs-volume-control",innerHTML:"<ul><li></li><li></li><li></li><li></li><li></li><li></li></ul>"});this.controls.appendChild(this.volumeControl);this.volumeDisplay=this.volumeControl.children[0];
this.fullscreenControl=_V_.createElement("li",{className:"vjs-fullscreen-control",innerHTML:"<ul><li></li><li></li><li></li><li></li></ul>"});this.controls.appendChild(this.fullscreenControl)},buildBigPlayButton:function(){this.bigPlayButton=_V_.createElement("div",{className:"vjs-big-play-button",innerHTML:"<span></span>"});this.video.parentNode.appendChild(this.bigPlayButton)},showBigPlayButton:function(){this.bigPlayButton.style.display="block"},hideBigPlayButton:function(){this.bigPlayButton.style.display=
"none"},getLinksFallback:function(){return this.box.getElementsByTagName("P")[0]},hideLinksFallback:function(){if(this.options.linksHiding&&this.linksFallback)this.linksFallback.style.display="none"},getFlashFallback:function(){if(!VideoJS.isIE())for(var a=this.box.getElementsByClassName("vjs-flash-fallback"),b=a.length;0<b;)return a[0]},replaceWithFlash:function(){if(this.flashFallback){this.box.insertBefore(this.flashFallback,this.video);this.video.style.display="none"}},positionBox:function(){if(this.videoIsFullScreen){this.box.style.width=
"";if(this.options.controlsBelow){this.box.style.height="";this.video.style.height=this.box.offsetHeight-this.controls.offsetHeight+"px"}}else{this.box.style.width=this.video.offsetWidth+"px";if(this.options.controlsBelow){this.video.style.height="";this.box.style.height=this.video.offsetHeight+this.controls.offsetHeight+"px"}}this.positionController();this.positionPoster()},showController:function(){if(this.options.showControlsAtStart||this.hasPlayed){this.controls.style.display="block";this.positionController()}},
stylesHaveLoaded:function(){return this.playControl.offsetWidth==this.progressControl.offsetWidth&&this.playControl.offsetWidth==this.timeControl.offsetWidth&&this.playControl.offsetWidth==this.volumeControl.offsetWidth?false:true},positionController:function(){if(this.controls.style.display!="none"){this.controls.style.top=this.options.controlsBelow?this.video.offsetHeight+"px":this.video.offsetHeight-this.controls.offsetHeight+"px";this.sizeProgressBar()}},hideController:function(){if(this.options.controlsHiding&&
!this.mouseIsOverControls)this.controls.style.display="none"},updatePosterSource:function(){if(!this.video.poster){var a=this.video.getElementsByTagName("img");if(a.length>0)this.video.poster=a[0].src}},buildPoster:function(){this.updatePosterSource();if(this.video.poster){this.poster=document.createElement("img");this.video.parentNode.appendChild(this.poster);this.poster.src=this.video.poster;this.poster.className="vjs-poster"}else this.poster=false},showPoster:function(){if(this.poster){this.poster.style.display=
"block";this.positionPoster()}},positionPoster:function(){if(!(!this.poster||this.poster.style.display=="none")){this.poster.style.height=this.video.offsetHeight+"px";this.poster.style.width=this.video.offsetWidth+"px"}},hidePoster:function(){if(this.poster)this.poster.style.display="none"},canPlaySource:function(){for(var a=this.video.children,b=0,c=a.length;b<c;b++)if(a[b].tagName.toUpperCase()=="SOURCE"){var d=this.video.canPlayType(a[b].type);if(d=="probably"||d=="maybe"){this.firstPlayableSource=
a[b];return true}}return false},onPlay:function(){this.hasPlayed=true;this.playControl.className="vjs-play-control vjs-pause";this.hidePoster();this.hideBigPlayButton();this.trackPlayProgress()},onPause:function(){this.playControl.className="vjs-play-control vjs-play";this.stopTrackingPlayProgress()},onEnded:function(){this.video.pause();this.video.currentTime=0;this.showPoster();this.showBigPlayButton();this.onPause()},onVolumeChange:function(){this.updateVolumeDisplay()},onError:function(a){console.log(a);
console.log(this.video.error)},onLoadedData:function(){},onProgress:function(a){a.total>0&&this.setLoadProgress(a.loaded/a.total)},updateBufferedTotal:function(){if(this.video.buffered){if(this.video.buffered.length>=1){this.setLoadProgress(this.video.buffered.end(0)/this.video.duration);this.video.buffered.end(0)==this.video.duration&&clearInterval(this.watchBuffer)}}else clearInterval(this.watchBuffer)},setLoadProgress:function(a){if(a>this.percentLoaded){this.percentLoaded=a;this.updateLoadProgress()}},
updateLoadProgress:function(){if(this.controls.style.display!="none")this.loadProgress.style.width=this.percentLoaded*_V_.getComputedStyleValue(this.progressHolder,"width").replace("px","")+"px"},onPlayControlClick:function(){this.video.paused?this.video.play():this.video.pause()},onProgressHolderMouseDown:function(a){this.stopTrackingPlayProgress();if(this.video.paused)this.videoWasPlaying=false;else{this.videoWasPlaying=true;this.video.pause()}_V_.blockTextSelection();this.setPlayProgressWithEvent(a);
document.addEventListener("mousemove",this.onProgressMouseMove,false);document.addEventListener("mouseup",this.onProgressMouseUp,false)},onProgressHolderMouseUp:function(a){this.setPlayProgressWithEvent(a);this.video.paused?this.onPause():this.onPlay()},onVolumeControlMouseDown:function(a){_V_.blockTextSelection();this.setVolumeWithEvent(a);document.addEventListener("mousemove",this.onVolumeMouseMove,false);document.addEventListener("mouseup",this.onVolumeMouseUp,false)},onVolumeControlMouseUp:function(a){this.setVolumeWithEvent(a)},
onFullscreenControlClick:function(){this.videoIsFullScreen?this.fullscreenOff():this.fullscreenOn()},onControlsMouseMove:function(){this.mouseIsOverControls=true},onControlsMouseOut:function(a){this.mouseIsOverControls=false;this.onVideoMouseOut(a)},onVideoMouseMove:function(){this.showController();clearInterval(this.mouseMoveTimeout);this.mouseMoveTimeout=setTimeout(function(){this.hideController()}.context(this),4E3)},onVideoMouseOut:function(a){for(a=a.relatedTarget;a&&a!==this.video&&a!==this.controls;)a=
a.parentNode;a!==this.video&&a!==this.controls&&this.hideController()},sizeProgressBar:function(){this.updatePlayProgress();this.updateLoadProgress()},trackPlayProgress:function(){this.playProgressInterval&&clearInterval(this.playProgressInterval);this.playProgressInterval=setInterval(function(){this.updatePlayProgress()}.context(this),33)},stopTrackingPlayProgress:function(){clearInterval(this.playProgressInterval)},updatePlayProgress:function(){if(this.controls.style.display!="none"){this.playProgress.style.width=
this.video.currentTime/this.video.duration*_V_.getComputedStyleValue(this.progressHolder,"width").replace("px","")+"px";this.updateTimeDisplay()}},setPlayProgress:function(a){try{this.video.currentTime=a*this.video.duration}catch(b){b.code==11&&this.errors.push(VideoJS.errorCodes.videoNotReady)}this.playProgress.style.width=a*_V_.getComputedStyleValue(this.progressHolder,"width").replace("px","")+"px";this.updateTimeDisplay();if(!this.subtitles)this.currentSubtitlePosition=0},setPlayProgressWithEvent:function(a){this.setPlayProgress(_V_.getRelativePosition(a.pageX,
this.progressHolder))},updateTimeDisplay:function(){this.currentTimeDisplay.innerHTML=_V_.formatTime(this.video.currentTime);if(this.video.duration)this.durationDisplay.innerHTML=_V_.formatTime(this.video.duration)},setVolume:function(a){this.video.volume=parseFloat(a);localStorage.volume=this.video.volume},setVolumeWithEvent:function(a){this.setVolume(_V_.getRelativePosition(a.pageX,this.volumeControl.children[0]))},updateVolumeDisplay:function(){for(var a=Math.ceil(this.video.volume*6),b=0;b<6;b++)b<
a?_V_.addClass(this.volumeDisplay.children[b],"vjs-volume-level-on"):_V_.removeClass(this.volumeDisplay.children[b],"vjs-volume-level-on")},flashVersionSupported:function(){return VideoJS.getFlashVersion()>=this.options.flashVersion},fullscreenOn:function(){if(!this.nativeFullscreenOn()){this.videoIsFullScreen=true;this.docOrigOverflow=document.documentElement.style.overflow;document.addEventListener("keydown",this.onEscKey,false);window.addEventListener("resize",this.onWindowResize,false);document.documentElement.style.overflow=
"hidden";_V_.addClass(this.box,"vjs-fullscreen");this.positionBox()}},nativeFullscreenOn:function(){if(typeof this.video.webkitEnterFullScreen=="function")if(!navigator.userAgent.match("Chrome")){try{this.video.webkitEnterFullScreen()}catch(a){a.code==11&&this.errors.push(VideoJS.errorCodes.videoNotReady)}return true}},fullscreenOff:function(){this.videoIsFullScreen=false;document.removeEventListener("keydown",this.onEscKey,false);window.removeEventListener("resize",this.onWindowResize,false);document.documentElement.style.overflow=
this.docOrigOverflow;_V_.removeClass(this.box,"vjs-fullscreen");this.positionBox()},loadSubtitles:function(){if(typeof XMLHttpRequest=="undefined")XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");};var a=new XMLHttpRequest;a.open("GET",this.subtitlesSource);a.onreadystatechange=function(){a.readyState==
4&&a.status==200&&this.parseSubtitles(a.responseText)}.context(this);a.send()},parseSubtitles:function(a){a=a.replace("\r","").split("\n");this.subtitles=[];for(var b=this.currentSubtitlePosition=0;b<a.length;){var c={};c.id=a[b++];if(!c.id)break;var d=a[b++].split(" --\> ");c.startTime=this.parseSubtitleTime(d[0]);c.endTime=this.parseSubtitleTime(d[1]);for(d=[];a[b].length>0&&a[b]!="\r";)d.push(a[b++]);c.text=d.join("<br/>");this.subtitles.push(c);b++}},parseSubtitleTime:function(a){var b=a.split(":");
a=0;a+=parseFloat(b[0])*60*60;a+=parseFloat(b[1])*60;b=b[2].split(",");a+=parseFloat(b[0]);a+=parseFloat(b[1])/1E3;return a},buildSubtitles:function(){this.subtitlesDiv=_V_.createElement("div",{className:"vjs-subtitles"});this.video.parentNode.appendChild(this.subtitlesDiv)},onTimeUpdate:function(){if(this.subtitles){for(var a=this.currentSubtitlePosition;a<this.subtitles.length&&this.video.currentTime>this.subtitles[a].endTime;){if(this.subtitles[a].showing){this.subtitles[a].showing=false;this.subtitlesDiv.innerHTML=
""}this.currentSubtitlePosition++;a=this.currentSubtitlePosition}if(!(this.currentSubtitlePosition>=this.subtitles.length))if(this.video.currentTime>=this.subtitles[a].startTime&&this.video.currentTime<=this.subtitles[a].endTime){this.subtitlesDiv.innerHTML=this.subtitles[a].text;this.subtitles[a].showing=true}}}}),_V_={addClass:function(a,b){if(a.className.split(/\s+/).lastIndexOf(b)==-1)a.className=a.className===""?b:a.className+" "+b},removeClass:function(a,b){if(a.className.indexOf(b)!=-1){var c=
a.className.split(/\s+/);c.splice(c.lastIndexOf(b),1);a.className=c.join(" ")}},merge:function(a,b){for(var c in b)if(b.hasOwnProperty(c))a[c]=b[c];return a},createElement:function(a,b){return _V_.merge(document.createElement(a),b)},blockTextSelection:function(){document.body.focus();document.onselectstart=function(){return false}},unblockTextSelection:function(){document.onselectstart=function(){return true}},formatTime:function(a){a=Math.round(a);var b=Math.floor(a/60);b=b>=10?b:"0"+b;a=Math.floor(a%
60);a=a>=10?a:"0"+a;return b+":"+a},getRelativePosition:function(a,b){return Math.max(0,Math.min(1,(a-_V_.findPosX(b))/b.offsetWidth))},findPosX:function(a){for(var b=a.offsetLeft;a=a.offsetParent;)b+=a.offsetLeft;return b},getComputedStyleValue:function(a,b){return window.getComputedStyle(a,null).getPropertyValue(b)},bindDOMReady:function(){if(document.readyState==="complete")return _V_.DOMReady();if(document.addEventListener){document.addEventListener("DOMContentLoaded",_V_.DOMContentLoaded,false);
window.addEventListener("load",_V_.DOMReady,false)}else if(document.attachEvent){document.attachEvent("onreadystatechange",_V_.DOMContentLoaded);window.attachEvent("onload",_V_.DOMReady)}},DOMContentLoaded:function(){if(document.addEventListener){document.removeEventListener("DOMContentLoaded",_V_.DOMContentLoaded,false);_V_.DOMReady()}else if(document.attachEvent)if(document.readyState==="complete"){document.detachEvent("onreadystatechange",_V_.DOMContentLoaded);_V_.DOMReady()}},DOMReadyList:[],
addToDOMReady:function(a){_V_.DOMIsReady?a.call(document):_V_.DOMReadyList.push(a)},DOMIsReady:false,DOMReady:function(){if(!_V_.DOMIsReady){if(!document.body)return setTimeout(_V_.DOMReady,13);_V_.DOMIsReady=true;if(_V_.DOMReadyList){for(var a=0;a<_V_.DOMReadyList.length;a++)_V_.DOMReadyList[a].call(document);_V_.DOMReadyList=null}}}};_V_.bindDOMReady();VideoJS.setupAllWhenReady=function(a){VideoJS.options=a;VideoJS.DOMReady(VideoJS.setup)};VideoJS.DOMReady=function(a){_V_.addToDOMReady(a)};
VideoJS.setup=function(a,b){var c=false,d=[],f;if(!a||a=="All")a=VideoJS.getVideoJSTags();else if(typeof a!="object"||a.nodeType==1){a=[a];c=true}for(var e=0;e<a.length;e++){f=typeof a[e]=="string"?document.getElementById(a[e]):a[e];d.push(new VideoJS(f,b))}return c?d[0]:d};VideoJS.getVideoJSTags=function(){for(var a=document.getElementsByTagName("video"),b=[],c,d=0,f=a.length;d<f;d++){c=a[d];c.className.indexOf("video-js")!=-1&&b.push(c)}return b};
VideoJS.browserSupportsVideo=function(){if(typeof VideoJS.videoSupport!="undefined")return VideoJS.videoSupport;VideoJS.videoSupport=!!document.createElement("video").canPlayType;return VideoJS.videoSupport};
VideoJS.getFlashVersion=function(){if(typeof VideoJS.flashVersion!="undefined")return VideoJS.flashVersion;var a=0,b;if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]=="object"){if((b=navigator.plugins["Shockwave Flash"].description)&&!(typeof navigator.mimeTypes!="undefined"&&navigator.mimeTypes["application/x-shockwave-flash"]&&!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin))a=parseInt(b.match(/^.*\s+([^\s]+)\.[^\s]+\s+[^\s]+$/)[1],10)}else if(typeof window.ActiveXObject!=
"undefined")try{if(b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))a=parseInt(b.GetVariable("$version").match(/^[^\s]+\s(\d+)/)[1],10)}catch(c){}VideoJS.flashVersion=a;return VideoJS.flashVersion};VideoJS.isIE=function(){return!+"\u000b1"};VideoJS.isIpad=function(){return navigator.userAgent.match(/iPad/i)!==null};VideoJS.isIphone=function(){return navigator.userAgent.match(/iPhone/i)!==null};VideoJS.isAndroid=function(){return navigator.userAgent.match(/Android/i)!==null};
VideoJS.errorCodes={videoNotReady:"Video is not ready yet (try playing the video first)."};Function.prototype.context=function(a){var b=this;return function(){return b.apply(a,arguments)}};window.jQuery&&function(a){a.fn.VideoJS=function(b){this.each(function(){VideoJS.setup(this,b)});return this}}(jQuery);
