(function(b){function a(d,c){this.init(d,c)}a.prototype.init=function(e,d){var c=this;this.data=null;this.settings={videoId:null,debug:(window.location.search.indexOf("debug=1")>-1||window.location.search.indexOf("debug=true")>-1),triggerStart:false,afterInit:function(i,h){},countViews:true,showTitleWithPlaceholder:false};b.extend(this.settings,d);if(this.settings.videoId==null){var g=b(e).data("video-id");var f=parseInt(g,10);if(isNaN(f)){c.debug("no video ID");return false}this.settings.videoId=f}b.ajax({type:"GET",url:"/apps/video/details",data:{v:this.settings.videoId},dataType:"json"}).done(function(h){if(h.success===true){c.debug(h);this.data=h.video;c.insertVideo(b(e),this.data)}else{c.debug("failure on server")}})};a.prototype.debug=function(d){if(this.settings.debug&&window.console){try{window.console.log(d)}catch(c){}}};a.prototype.insertVideo=function(p,v){var r=this;var c='";if(navigator.appVersion.indexOf("MSIE 7.")!=-1){if(v.versions.length>2){var k=v.versions[v.versions.length-2]["url"]}else{var k=v.versions[0]["url"]}p.html('
:( Sorry, you are using an unsupported browser. You can download the video here: download
');return}const z=v.embedCode;if(z&&typeof z==="string"&&z.length>0){try{const g=new DOMParser();const y=g.parseFromString(z,"text/html");const l=y.body.querySelector("iframe");if(l){l.width="100%";l.height="100%";p.html(l);return}window.console.error("No iframe provided in embedCode")}catch(w){window.console.error(w)}}var s;var f=p.height();var o=p.width();var d=(v.isAudio===true);this.aspectRatio=v.versions[0].width/v.versions[0].height;if(!d){s=p.width()/this.aspectRatio}else{s=360}if(s>f){s=f}if(s<150){f=s+100;s="100%"}else{f=s}p.height(f);this.singleVideo=m(v,d,this.settings.showTitleWithPlaceholder);if(d){p.append(c+n(this.singleVideo)+u(v,this.settings.forEditingCaptions)+j)}else{p.append(c+x(this.singleVideo)+u(v,this.settings.forEditingCaptions)+j)}var h={controls:true,height:s,width:o,poster:this.singleVideo.image,plugins:{resolutionSelector:{default_res:"360"}}};var i={controls:h.controls,height:h.height,width:"100%",poster:h.poster,plugins:h.plugins};this.myPlayer=videojs("video_placeholder",i);var q;if(this.settings.showTitleWithPlaceholder){q='"}else{q=""}b("#video_placeholder").append(q);if(this.settings.triggerStart==true){this.myPlayer.load();this.myPlayer.play()}var t=document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled;this.myPlayer.on("fullscreenchange",function(){if(t){return}var e=$parent.parents();var A=[];if(this.isFullscreen()){e.each(function(B,C){var D=b(C).css("z-index");A[B]=D;if(D!=="auto"){b(C).css("z-index",2147483647)}})}else{e.each(function(C,D){var B=A[C];if(B!=="auto"){b(D).css("z-index",B)}})}});if(r.settings.countViews===true){r._initializeViewCounting(r.myPlayer)}if(b("#go_hd").length>0){r._initializeHDButton(r.myPlayer)}r.settings.afterInit.call(r,v,r.myPlayer);function m(C,D,B){var e={};if(!D){var E=C.placeholders.PH720;if(!E){E=C.placeholders.PH360}if(!E){E=C.placeholders.THUMB}e={image:E,sources:A()}}else{e={image:"/apps/pics/audio_largethumb.png",sources:[{file:C.versions[0].url,label:C.versions[0].height}]}}if(B){e.title=C.title}return e;function A(){var F=new Array();b.each(C.versions,function(H,G){var I={file:G.url,label:G.height};if(G.height==360){I["default"]=true}F.push(I)});return F}}function x(e){var A="";b.each(e.sources,function(B,C){A+='