1var isMobile=!1;(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
1substr(0,4)))&&(isMobile=!0);var videojsScriptLocation=function(){var e,t,o="";return(o=document.currentScript?document.currentScript.src:void 0!==(t=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute.length?t.src:t.getAttribute("src",-1))?o.substring(0,o.lastIndexOf("/")+1):""}();"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o[s]=n[s])}return o},writable:!0,configurable:!0}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),o}"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)}(),videojs=function(e,t){function o(e,t){for(var o=t.length,i=0;i<o;i++)if(t[i]==e)return!0;return!1}var i=videojsClass.constructor();for(var n in videojsClass)videojsClass.hasOwnProperty(n)&&!o(n,videojsClass.notCloned)&&(i[n]=videojsClass[n]);return videojsClass.instances.push(i),i.init(e,t),i};var videojsClass={vttParserScript:"scripts/webvtt.min.js",instances:[],notCloned:["notCloned","vttParserScript","instances","getInstanceById","requestStylesheet","reqiestScript","isTouchDevice","vastOptions","displayOptions","getEventOffsetX","getEventOffsetY","getTranslateX","toggleElementText","getMobileOs","findClosestParent","activeVideoPlayerId","getInstanceIdByWrapperId","timer","timerPool","adList","adPool","isUserActive","isCurrentlyPlayingAd","initialAnimationSet"],version:"7.5.4",homepage:"https://www.videojs.com/",activeVideoPlayerId:null,getInstanceById:function(e){for(var t=0;t<this.instances.length;t++)if(this.instances[t].videoPlayerId===e)return this.instances[t];return null},getInstanceIdByWrapperId:function(e){return void 0!==e?e.replace("videojs_video_wrapper_",""):null},requestStylesheet:function(e,t){if(!document.getElementById(e)){var o=document.getElementsByTagName("head")[0],i=document.createElement("link");i.id=e,i.rel="stylesheet",i.type="text/css",i.href=t,i.media="all",o.appendChild(i)}},requestScript:function(e,t){var o=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.src=e,i.onreadystatechange=t,i.onload=t,o.appendChild(i)},isTouchDevice:function(){return!!("ontouchstart"in window||navigator.maxTouchPoints)},getMobileOs:function(){var e,t=navigator.userAgent,o={device:!1,userOs:!1,userOsVer:!1,userOsMajor:!1};if(t.match(/iPad/i)?(o.device="iPad",o.userOs="iOS",e=t.indexOf("OS ")):t.match(/iPhone/i)?(o.device="iPhone",o.userOs="iOS",e=t.indexOf("OS ")):t.match(/Android/i)?(o.userOs="Android",e=t.indexOf("Android ")):o.userOs=!1,"iOS"===o.userOs&&-1<e){var i=t.substr(e+3);-1!==i.indexOf(" ")&&(o.userOsVer=i.substring(0,i.indexOf(" ")).replace(/_/g,"."),o.userOsMajor=parseInt(o.userOsVer))}else"Android"===o.userOs&&-1<e?o.userOsVer=t.substr(e+8,3):o.userOsVer=!1;return o},getBrowserVersion:function(){var e,t,o=navigator.userAgent,i={browserName:!1,fullVersion:!1,majorVersion:!1,userOsMajor:!1};try{i.browserName=navigator.appName,-1!=(e=o.indexOf("OPR/"))?(i.browserName="Opera",i.fullVersion=o.substring(e+4)):-1!=(e=o.indexOf("Opera"))?(i.browserName="Opera",i.fullVersion=o.substring(e+6),-1!=(e=o.indexOf("Version"))&&(i.fullVersion=o.substring(e+8))):-1!=(e=o.indexOf("MSIE"))?(i.browserName="Microsoft Internet Explorer",i.fullVersion=o.substring(e+5)):-1!=(e=o.indexOf("Chrome"))?(i.browserName="Google Chrome",i.fullVersion=o.substring(e+7)):-1!=(e=o.indexOf("Safari"))?(i.browserName="Safari",i.fullVersion=o.substring(e+7),-1!=(e=o.indexOf("Version"))&&(i.fullVersion=o.substring(e+8))):-1!=(e=o.indexOf("Firefox"))?(i.browserName="Mozilla Firefox",i.fullVersion=o.substring(e+8)):(t=o.lastIndexOf(" ")+1)<(e=o.lastIndexOf("/"))&&(i.browserName=o.substring(t,e),i.fullVersion=o.substring(e+1),i.browserName.toLowerCase()==i.browserName.toUpperCase()&&(i.browserName=navigator.appName)),-1!=(t=i.fullVersion.indexOf(";"))&&(i.fullVersion=i.fullVersion.substring(0,t)),-1!=(t=i.fullVersion.indexOf(" "))&&(i.fullVersion=i.fullVersion.substring(0,t)),i.majorVersion=parseInt(""+i.fullVersion,10),isNaN(i.majorVersion)&&(i.fullVersion=""+parseFloat(navigator.appVersion),i.majorVersion=parseInt(navigator.appVersion,10))}catch(e){}return i},getCurrentVideoDuration:function(){var e=document.getElementById(this.videoPlayerId);return e?e.duration:0},getClickThroughUrlFromLinear:function(e){var t=e.getElementsByTagName("VideoClicks");if(t.length){var o=t[0].getElementsByTagName("ClickThrough");if(o.length)return this.extractNodeData(o[0])}return!1},getVastAdTagUriFromWrapper:function(e){var t=e.getElementsByTagName("Wrapper");if(void 0!==t&&t.length){var o=t[0].getElementsByTagName("VASTAdTagURI");if(o.length)return this.extractNodeData(o[0])}return!1},hasInLine:function(e){var t=e.getElementsByTagName("InLine");return void 0!==t&&t.length},hasVastAdTagUri:function(e){var t=e.getElementsByTagName("VASTAdTagURI");return void 0!==t&&t.length},hasVastAdTagUriFromWrapper:function(e){if(void 0!==e&&e.length){var t=e[0].getElementsByTagName("Linear");
1if(null!=t&&t.length)return this.getMediaFileFromLinear(t[0])}return!1},getClickThroughUrlFromNonLinear:function(e){var t="";if(e.getElementsByTagName("NonLinear").length){var o=e.getElementsByTagName("NonLinearClickThrough");o.length&&(t=this.extractNodeData(o[0]))}return t},getTrackingFromLinear:function(e){var t=e.getElementsByTagName("TrackingEvents");return t.length?t[0].getElementsByTagName("Tracking"):[]},getDurationFromLinear:function(e){var t=e.getElementsByTagName("Duration");if(t.length&&void 0!==t[0].childNodes[0]){var o=this.extractNodeData(t[0]);return this.convertTimeStringToSeconds(o)}return!1},getDurationFromNonLinear:function(e){var t=0,o=e.getElementsByTagName("NonLinear");return o.length&&void 0!==o[0].getAttribute("minSuggestedDuration")&&(t=this.convertTimeStringToSeconds(o[0].getAttribute("minSuggestedDuration"))),t},getDimensionFromNonLinear:function(e){var t={width:null,height:null},o=e.getElementsByTagName("NonLinear");return o.length&&(void 0!==o[0].getAttribute("width")&&(t.width=o[0].getAttribute("width")),void 0!==o[0].getAttribute("height")&&(t.height=o[0].getAttribute("height"))),t},getCreativeTypeFromStaticResources:function(e){var t="",o=e.getElementsByTagName("NonLinear");return o.length&&void 0!==o[0].childNodes[0]&&(t=o[0].getElementsByTagName("StaticResource")[0].getAttribute("creativeType")),t.toLowerCase()},getMediaFilesFromLinear:function(e){var t=e.getElementsByTagName("MediaFiles");return t.length?t[0].getElementsByTagName("MediaFile"):[]},getStaticResourcesFromNonLinear:function(e){var t=[],o=e.getElementsByTagName("NonLinear");return o.length&&(t=o[0].getElementsByTagName("StaticResource")),t},extractNodeData:function(e){for(var t="",o=0;o<e.childNodes.length;o++){var i=e.childNodes[o];8===i.nodeType||3===i.nodeType&&/^\s*$/.test(i.nodeValue)||(t+=i.nodeValue)}return t.replace(/(^\s+|\s+$)/g,"")},getMediaFileFromLinear:function(e){var t,o=this.getMediaFilesFromLinear(e);return o.length&&(t=this.extractNodeData(o[0])),t},getIconClickThroughFromLinear:function(e){var t=e.getElementsByTagName("IconClickThrough");return t.length?this.extractNodeData(t[0]):(this.displayOptions.vastOptions.adCTAText=!1,"")},getStaticResourceFromNonLinear:function(e){for(var t,o=this.getStaticResourcesFromNonLinear(e),i=0;i<o.length;i++)if(o[i].getAttribute("type")||(t=this.extractNodeData(o[i])),o[i].getAttribute("type")===this.displayOptions.staticResource)return this.extractNodeData(o[i]);return t},registerTrackingEvents:function(e,t){for(var o=this.getTrackingFromLinear(e),i="",n=0,s=0;s<o.length;s++)switch(i=o[s].getAttribute("event")){case"start":case"firstQuartile":case"midpoint":case"thirdQuartile":case"complete":void 0===t.tracking[i]&&(t.tracking[i]=[]),void 0===t.stopTracking[i]&&(t.stopTracking[i]=[]),t.tracking[i].push(o[s].childNodes[0].nodeValue),t.stopTracking[i]=!1;break;case"progress":void 0===t.tracking[i]&&(t.tracking[i]=[]),n=this.convertTimeStringToSeconds(o[s].getAttribute("offset")),void 0===t.tracking[i][n]&&(t.tracking[i][n]={elements:[],stopTracking:!1}),t.tracking[i][n].elements.push(o[s].childNodes[0].nodeValue)}},registerClickTracking:function(e,t){if(e.length)for(var o=0;o<e.length;o++)""!=e[o]&&t.clicktracking.push(e[o])},registerImpressionEvents:function(e,t){if(e.length)for(var o=0;o<e.length;o++){var i=this.extractNodeData(e[o]);t.impression.push(i)}},registerErrorEvents:function(e,t){null!=e&&1===e.length&&1===e[0].childNodes.length&&(t.errorUrl=e[0].childNodes[0].nodeValue)},announceError:function(e){if(void 0!==this.vastOptions.errorUrl&&this.vastOptions.errorUrl){e=void 0!==e?parseInt(e):900;var t=this.vastOptions.errorUrl.replace("[ERRORCODE]",e);this.callUris([t])}},announceLocalError:function(e,t){e=void 0!==e?parseInt(e):900,message="[Error] ("+e+"): ",message+=t||"Failed to load Vast",console.log(message)},getClickTrackingEvents:function(e){var t=[],o=e.getElementsByTagName("VideoClicks");if(o.length){var i=o[0].getElementsByTagName("ClickTracking");if(i.length)for(var n=0;n<i.length;n++){var s=this.extractNodeData(i[n]);t.push(s)}}return t},getNonLinearClickTrackingEvents:function(e){var t=[];if(e.getElementsByTagName("NonLinear").length){var o=e.getElementsByTagName("NonLinearClickTracking");if(o.length)for(var i=0;i<o.length;i++){var n=this.extractNodeData(o[i]);t.push(n)}}return t},callUris:function(e){for(var t=0;t<e.length;t++)(new Image).src=e[t]},recalculateAdDimensions:function(e){e||void 0===this.videoPlayerId||(e=this.videoPlayerId);var t=document.getElementById(e),o=document.getElementById("vast_clickthrough_layer_"+e);o&&(o.style.width=t.offsetWidth+"px",o.style.height=t.offsetHeight+"px");var i=this.checkFullscreenSupport("videojs_video_wrapper_"+e),n=document.getElementById(e+"_videojs_control_fullscreen"),s=document.getElementById(e+"context_option_fullscreen");i?null===document[i.isFullscreen]?this.fullscreenOff(n,s):this.fullscreenOn(n,s):-1!==fullscreenTag.className.search(/\bpseudo_fullscreen\b/g)?(fullscreenTag.className+=" pseudo_fullscreen",this.fullscreenOn(n,s)):(fullscreenTag.className=fullscreenTag.className.replace(/\bpseudo_fullscreen\b/g,""),this.fullscreenOff(n,s))},prepareVast:function(e){var t=this,o=document.getElementById(this.videoPlayerId),i=[];i.length=0,i=t.findRoll(e);for(var n=0;n<i.length;n++){var s=i[n];!0!==t.adList[s].vastLoaded&&!0!==t.adList[s].error&&(t.processUrl(t.adList[s].vastTag,s),o.addEventListener("adId_"+s,t[e]))}},toggleLoader:function(e){this.isLoading=!!e,"browser"!==this.displayOptions.layoutControls.layout&&(document.getElementById("vast_video_loading_"+this.videoPlayerId).style.display=e?"table":"none")},sendRequest:function(e,t,o,i){var n=new XMLHttpRequest;n.onreadystatechange=i,n.open("GET",e,!0),n.withCredentials=t,n.timeout=o,n.send()},playMainVideoWhenVastFails:function(e){var t=this,o=document.getElementById(t.videoPlayerId);o.removeEventListener("loadedmetadata",t.switchPlayerToVastMode),o.pause(),t.toggleLoader(!1),t.displayOptions.vastOptions.vastAdvanced.noVastVideoCallback(),t.vastOptions&&void 0!==this.vastOptions.errorUrl?t.announceError(e):t.announce
1LocalError(e),t.switchToMainVideo()},switchPlayerToVastMode:function(){},processVastXml:function(e,t,o){var i=this;if(e){var n=e.getElementsByTagName("Impression");null!==n&&i.registerImpressionEvents(n,o);var s=e.getElementsByTagName("Error");null!==s&&i.registerErrorEvents(s,o);var a=e.getElementsByTagName("Creative");if(void 0!==a&&a.length){var r=a[0].getElementsByTagName("Linear");if(null!=r&&r.length){var l=r[0];i.registerTrackingEvents(l,o);var d=i.getClickTrackingEvents(l);i.registerClickTracking(d,o),!i.hasVastAdTagUri(e)&&i.hasInLine(e)&&(o.adFinished=!1,o.adType="linear",o.skipoffset=i.convertTimeStringToSeconds(l.getAttribute("skipoffset")),o.clickthroughUrl=i.getClickThroughUrlFromLinear(l),o.duration=i.getDurationFromLinear(l),o.mediaFile=i.getMediaFileFromLinear(l),o.iconClick=i.getIconClickThroughFromLinear(l))}void 0!==o.iconClick&&null!==o.iconClick&&o.iconClick.length&&(i.adList[t].landingPage=o.iconClick);var c=a[0].getElementsByTagName("NonLinearAds");if(null!=c&&c.length){var u=c[0];i.registerTrackingEvents(u,o),d=i.getNonLinearClickTrackingEvents(u),i.registerClickTracking(d,o),!i.hasVastAdTagUri(e)&&i.hasInLine(e)&&(o.adType="nonLinear",o.clickthroughUrl=i.getClickThroughUrlFromNonLinear(u),o.duration=i.getDurationFromNonLinear(u),o.dimension=i.getDimensionFromNonLinear(u),o.staticResource=i.getStaticResourceFromNonLinear(u),o.creativeType=i.getCreativeTypeFromStaticResources(u))}if(!i.hasVastAdTagUri(e)&&i.hasInLine(e))if(i.adList[t].adType=o.adType?o.adType:"unknown",void 0!==o.mediaFile||void 0!==o.staticResource){i.adList[t].vastLoaded=!0,i.adPool[t]=Object.assign({},o);var v=document.createEvent("Event");v.initEvent("adId_"+t,!1,!0),document.getElementById(i.videoPlayerId).dispatchEvent(v),i.displayOptions.vastOptions.vastAdvanced.vastLoadedCallback()}else i.stopProcessAndReportError(t)}else i.stopProcessAndReportError(t)}else i.stopProcessAndReportError(t)},processUrl:function(e,t){this.resolveVastTag(e,0,t,{tracking:[],stopTracking:[],impression:[],clicktracking:[],vastLoaded:!1})},resolveVastTag:function(e,i,n,s){var a=this;e&&""!=e?(i<=a.displayOptions.vastOptions.maxAllowedVastTagRedirects&&a.sendRequest(e,!0,a.displayOptions.vastOptions.vastTimeout,function(){var e=this;if(4!==e.readyState||404!==e.status)if(4!==e.readyState||0!==e.status){if(4===e.readyState&&200===e.status)if(4!==e.readyState||200===e.status){try{var t=e.responseXML}catch(e){return void a.stopProcessAndReportError(n)}if(t){if(a.inLineFound=a.hasInLine(t),!a.inLineFound&&a.hasVastAdTagUri(t)){var o=a.getVastAdTagUriFromWrapper(t);if(!o)return void a.stopProcessAndReportError(n);a.resolveVastTag(o,i,n,s)}i>a.displayOptions.vastOptions.maxAllowedVastTagRedirects&&!a.inLineFound?a.stopProcessAndReportError(n):a.processVastXml(t,n,s)}else a.stopProcessAndReportError(n)}else a.stopProcessAndReportError(n)}else a.stopProcessAndReportError(n);else a.stopProcessAndReportError(n)}),i++):a.stopProcessAndReportError(n)},stopProcessAndReportError:function(e){this.adList[e].error=!0,void 0!==e&&"preRoll"==this.adList[e].roll?this.playMainVideoWhenVastFails(900):this.announceLocalError(101)},playRoll:function(e){var t=this,o=document.getElementById(t.videoPlayerId);if(t.adPool.hasOwnProperty(e)){var i=t.adList[e].roll;switch(t.vastOptions=t.adPool[e],i){case"midRoll":o.mainVideoCurrentTime=o.currentTime-1;break;case"postRoll":o.mainVideoCurrentTime=0,t.autoplayAfterAd=!1,o.currentTime=t.mainVideoDuration}var n,s=function(){if(t.adFinished)o.removeEventListener("timeupdate",s);else{var e=Math.floor(o.currentTime);0!=t.vastOptions.duration&&t.scheduleTrackingEvent(e,t.vastOptions.duration),e>=t.vastOptions.duration-1&&0!=t.vastOptions.duration&&(o.removeEventListener("timeupdate",s),t.adFinished=!0)}};n=e,t.switchPlayerToVastMode=function(){if(t.vastOptions.duration||(t.vastOptions.duration=o.duration),(void 0!==t.adList[n].adClickable?t.adList[n].adClickable:t.displayOptions.vastOptions.adClickable)&&t.addClickthroughLayer(t.videoPlayerId),!1!==t.vastOptions.skipoffset&&t.addSkipButton(),o.loop=!1,t.addCTAButton(t.adList[n].landingPage),t.addAdCountdown(),o.removeAttribute("controls"),t.vastLogoBehaviour(!0),"browser"!==t.displayOptions.layoutControls.layout&&null!==document.getElementById(t.videoPlayerId+"_videojs_controls_progress_container")&&(document.getElementById(t.videoPlayerId+"_vast_control_currentprogress").style.backgroundColor=t.displayOptions.layoutControls.adProgressColor),t.displayOptions.vastOptions.adText||t.adList[n].adText){var e=null!==t.adList[n].adText?t.adList[n].adText:t.displayOptions.vastOptions.adText;t.addAdPlayingText(e)}t.positionTextElements(t.adList[n]),t.toggleLoader(!1),t.adList[n].played=!0,t.adFinished=!1,o.play(),t.trackSingleEvent("impression"),o.removeEventListener("loadedmetadata",t.switchPlayerToVastMode)},o.pause(),o.addEventListener("loadedmetadata",t.switchPlayerToVastMode),t.mainVideoCurrentTime=o.currentTime,t.detachStreamers(),o.src=t.vastOptions.mediaFile,t.isCurrentlyPlayingAd=!0,t.displayOptions.vastOptions.showProgressbarMarkers&&t.hideAdMarkers(),o.load(),o.addEventListener("ended",t.onVastAdEnded),o.addEventListener("timeupdate",s)}
1else t.announceLocalError(101)},scheduleTrackingEvent:function(e,t){var o=this;0==e&&o.trackSingleEvent("start"),void 0!==o.vastOptions.tracking.progress&&o.vastOptions.tracking.progress.length&&void 0!==o.vastOptions.tracking.progress[e]&&o.trackSingleEvent("progress",e),e==Math.floor(t/4)&&o.trackSingleEvent("firstQuartile"),e==Math.floor(t/2)&&o.trackSingleEvent("midpoint"),e==Math.floor(3*t/4)&&o.trackSingleEvent("thirdQuartile"),t-1<=e&&o.trackSingleEvent("complete")},trackSingleEvent:function(e,o){var i=this;if(void 0!==i.vastOptions&&null!==i.vastOptions){var n=[];switch(n.length=0,e){case"start":case"firstQuartile":case"midpoint":case"thirdQuartile":case"complete":!1===i.vastOptions.stopTracking[e]&&(null!==i.vastOptions.tracking[e]&&(n=i.vastOptions.tracking[e]),i.vastOptions.stopTracking[e]=!0);break;case"progress":i.vastOptions.tracking.progress[o].elements.forEach(function(e,t){!1===i.vastOptions.tracking.progress[o].stopTracking&&i.vastOptions.tracking.progress[o].elements.length&&(n=i.vastOptions.tracking.progress[o].elements),i.vastOptions.tracking.progress[o].stopTracking=!0});break;case"impression":void 0!==i.vastOptions.impression&&null!==i.vastOptions.impression&&"unknown"!=typeof i.vastOptions.impression.length&&(n=i.vastOptions.impression)}i.callUris(n)}},completeNonLinearStatic:function(e){var t=this;t.closeNonLinear(e),0==t.adFinished&&(t.adFinished=!0,t.trackSingleEvent("complete")),clearInterval(t.nonLinearTracking)},createNonLinearStatic:function(e){var t=this,o=document.getElementById(t.videoPlayerId);if(t.adPool.hasOwnProperty(e)&&!0!==t.adPool[e].error){t.vastOptions=t.adPool[e],t.createBoard(e),t.adFinished=!1,t.trackSingleEvent("start");var i=t.adList[e].nonLinearDuration?t.adList[e].nonLinearDuration:t.vastOptions.duration;t.nonLinearTracking=setInterval(function(){if(!0!==t.adFinished){var e=Math.floor(o.currentTime);t.scheduleTrackingEvent(e,i),i-1<=e&&(t.adFinished=!0)}},400),time=parseInt(t.getCurrentTime())+parseInt(i),t.scheduleTask({time:time,closeStaticAd:e})}else t.announceLocalError(101)},createBoard:function(e){var t=this,o=t.adPool[e];if(void 0!==o.staticResource&&-1!==t.supportedStaticTypes.indexOf(o.creativeType)){t.adList[e].played=!0;var i=document.getElementById(t.videoPlayerId),n=i.clientWidth,s=(i.clientHeight,document.createElement("div")),a=t.adList[e].vAlign?t.adList[e].vAlign:t.nonLinearVerticalAlign,r=new Image;r.src=o.staticResource,r.id="videojs_nonLinear_imgCreative_"+e+"_"+t.videoPlayerId,r.onload=function(){void 0!==t.adList[e].size?(origWidth=t.adList[e].size.split("x")[0],origHeight=t.adList[e].size.split("x")[1]):o.dimension.width&&o.dimension.height?(origWidth=o.dimension.width,origHeight=o.dimension.height):(origWidth=r.width,origHeight=r.height),origWidth>
1n?(newBannerWidth=n-5,newBannerHeight=origHeight*newBannerWidth/origWidth):(newBannerWidth=origWidth,newBannerHeight=origHeight),img=document.getElementById(r.id),img.width=newBannerWidth,img.height=newBannerHeight,t.trackSingleEvent("impression")},s.id="videojs_nonLinear_"+e,s.className="videojs_nonLinear_"+a,s.innerHTML=r.outerHTML,s.onclick=function(){void 0!==o.clickthroughUrl&&window.open(o.clickthroughUrl),void 0!==o.clicktracking&&t.callUris([o.clicktracking])},void 0!==o.clickthroughUrl&&(s.style.cursor="pointer");var l=document.createElement("div");l.id="close_button_"+t.videoPlayerId,l.className="close_button",l.innerHTML="",l.title=t.displayOptions.layoutControls.closeButtonCaption,l.onclick=function(e){return this.parentElement.remove(t),void 0!==e.stopImmediatePropagation&&e.stopImmediatePropagation(),t.adFinished=!0,clearInterval(t.nonLinearTracking),!1},s.appendChild(l),i.parentNode.insertBefore(s,i.nextSibling)}else t.adList[e].error=!0},closeNonLinear:function(e){var t=document.getElementById("videojs_nonLinear_"+e);t&&t.remove()},preRoll:function(e){var t=videojsClass.getInstanceById(this.id);document.getElementById(this.getAttribute("id")).removeEventListener(e.type,t.preRoll),t.firstPlayLaunched=!0;var o=e.type.replace("adId_","");!0!==t.adList[o].played&&("linear"==t.adList[o].adType&&(t.toggleLoader(!0),t.playRoll(o)),"nonLinear"==t.adList[o].adType&&(t.switchToMainVideo(),t.createNonLinearStatic(o)))},createAdMarker:function(e,t){var o=document.getElementById(this.videoPlayerId+"_ad_markers_holder"),i=document.createElement("div");i.id="ad_marker_"+this.videoPlayerId+"_"+e,i.className="videojs_controls_ad_marker",i.style.left=t/this.mainVideoDuration*100+"%",this.isCurrentlyPlayingAd&&(i.style.display="none"),o.appendChild(i)},hideAdMarker:function(e){var t=document.getElementById("ad_marker_"+this.videoPlayerId+"_"+e);t&&(t.style.display="none")},showAdMarkers:function(){for(var e=document.getElementById(this.videoPlayerId+"_ad_markers_holder").getElementsByClassName("videojs_controls_ad_marker"),t="ad_marker_"+this.videoPlayerId+"_",o=0;o<e.length;++o){var i=e[o],n=i.id.replace(t,"");!1===this.adList[n].played&&(i.style.display="")}},hideAdMarkers:function(){for(var e=document.getElementById(this.videoPlayerId+"_ad_markers_holder").getElementsByClassName("videojs_controls_ad_marker"),t=0;t<e.length;++t)e[t].style.display="none"},midRoll:function(e){var t=videojsClass.getInstanceById(this.id);document.getElementById(this.getAttribute("id")).removeEventListener(e.type,t.midRoll);var o=e.type.replace("adId_","");if(!0!==t.adList[o].played){var i=t.adList[o].timer;"string"==typeof i&&-1!==i.indexOf("%")&&(i=i.replace("%",""),i=Math.floor(t.mainVideoDuration/100*i)),t.displayOptions.vastOptions.showProgressbarMarkers&&"nonLinear"===t.adList[o].adType&&t.createAdMarker(o,i),t.scheduleTask({time:i,playRoll:"midRoll",adListId:o})}},postRoll:function(e){var t=videojsClass.getInstanceById(this.id);document.getElementById(this.getAttribute("id")).removeEventListener(e.type,t.postRoll);var o=e.type.replace("adId_","");t.scheduleTask({time:Math.floor(t.mainVideoDuration),playRoll:"postRoll",adListId:o})},onPauseRoll:function(e){var t=videojsClass.getInstanceById(this.id);document.getElementById(this.getAttribute("id")).removeEventListener(e.type,t.onPauseRoll);var o=e.type.replace("adId_","");if("nonLinear"==t.adList[o].adType){if(!t.adPool.hasOwnProperty(o)||!0===t.adPool[o].error)return void t.announceLocalError(101);t.createBoard(o),onPauseAd=document.getElementById("videojs_nonLinear_"+o),onPauseAd.style.display="none"}},hasValidOnPauseAd:function(){var e=this.findRoll("onPauseRoll");return 0!=e.length&&this.adList[e[0]]&&!1===this.adList[e[0]].error},toggleOnPauseAd:function(){var e=this,t=document.getElementById(this.videoPlayerId);e.hasValidOnPauseAd()&&!e.isCurrentlyPlayingAd&&(onPauseRoll=e.findRoll("onPauseRoll"),adListId=onPauseRoll[0],e.vastOptions=e.adPool[adListId],onPauseAd=document.getElementById("videojs_nonLinear_"+adListId),onPauseAd&&t.paused?(onPauseAd.style.display="flex",e.adList[adListId].played=!1,e.trackingOnPauseNonLinearAd(adListId,"start")):onPauseAd&&!t.paused&&(onPauseAd.style.display="none",e.adFinished=!0,e.trackingOnPauseNonLinearAd(adListId,"complete")))},trackingOnPauseNonLinearAd:function(e,t){var o=this;o.adPool.hasOwnProperty(e)&&!0!==o.adPool[e].error?(o.vastOptions=o.adPool[e],o.trackSingleEvent(t)):o.announce
1LocalError(101)},adTimer:function(){var i=this;1!=i.isTimer&&(i.isTimer=!i.isTimer,i.timer=setInterval(function(){for(var e in i.timerPool)if(time=Math.floor(i.getCurrentTime()),time==e&&!i.isCurrentlyPlayingAd){if(i.timerPool[e]&&i.timerPool[e].hasOwnProperty("playRoll")){var t=i.timerPool[e].adListId;i.timerPool[e].playRoll,0==i.adList[t].played&&(i.vastOptions=i.adPool[t],"linear"==i.vastOptions.adType&&(i.toggleLoader(!0),i.playRoll(t)),"nonLinear"==i.vastOptions.adType&&(i.createNonLinearStatic(t),i.displayOptions.vastOptions.showProgressbarMarkers&&i.hideAdMarker(t)),delete i.timerPool[e])}if(i.timerPool[e]&&i.timerPool[e].hasOwnProperty("closeStaticAd")){var o=i.timerPool[e].closeStaticAd;1==i.adList[o].played&&(i.completeNonLinearStatic(o),delete i.timerPool[e])}}},800))},scheduleTask:function(e){this.timerPool[e.time]=e},switchToMainVideo:function(){var e=this,t=document.getElementById(e.videoPlayerId);t.src=e.originalSrc,e.initialiseStreamers();var o=void 0!==t.mainVideoCurrentTime?t.mainVideoCurrentTime:0;t.hasOwnProperty("currentTime")&&(t.currentTime=o),e.displayOptions.layoutControls.loop&&(t.loop=!0),e.setCurrentTimeAndPlay(o,e.autoplayAfterAd),e.isCurrentlyPlayingAd=!1,e.removeClickthrough(),e.removeSkipButton(),e.removeAdCountdown(),e.removeAdPlayingText(),e.removeCTAButton(),e.vastLogoBehaviour(!1),e.adFinished=!0,e.displayOptions.vastOptions.vastAdvanced.vastVideoEndedCallback(),e.vastOptions=null,"browser"!==e.displayOptions.layoutControls.layout&&(e.setBuffering(),null!==document.getElementById(e.videoPlayerId+"_videojs_controls_progress_container")&&(backgroundColor=e.displayOptions.layoutControls.primaryColor?e.displayOptions.layoutControls.primaryColor:"white",document.getElementById(e.videoPlayerId+"_vast_control_currentprogress").style.backgroundColor=backgroundColor)),t.removeEventListener("ended",e.onVastAdEnded),"browser"===e.displayOptions.layoutControls.layout&&t.setAttribute("controls","controls"),e.displayOptions.vastOptions.showProgressbarMarkers&&e.showAdMarkers()},vastLogoBehaviour:function(e){if(!this.displayOptions.layoutControls.logo.showOverAds){var t=document.getElementById(this.videoPlayerId+"_logo"),o=document.getElementById(this.videoPlayerId+"_logo_image");if(!t||!o)return;var i=e?"none":"inline";t.style.display=i}},onVastAdEnded:function(){var e=videojsClass.getInstanceById(this.id);e.switchToMainVideo(),e.vastOptions=null,e.adFinished=!0},onMainVideoEnded:function(){var e=videojsClass.getInstanceById(this.id);if(!(e.isCurrentlyPlayingAd&&e.autoplayAfterAd||(Math.floor(e.getCurrentTime())>=Math.floor(e.mainVideoDuration)&&clearInterval(e.timer),!0!==e.displayOptions.layoutControls.loop))){var t=videojsClass.getInstanceIdByWrapperId(this.getAttribute("id"));videojsClass.getInstanceById(t),e.switchToMainVideo(),e.playPauseToggle(this)}},getCurrentTime:function(){return this.isCurrentlyPlayingAd?this.mainVideoCurrentTime:document.getElementById(this.videoPlayerId).currentTime},addSkipButton:function(){var e=document.getElementById(this.videoPlayerId),t=document.createElement("div");t.id="skip_button_"+this.videoPlayerId,t.className="skip_button skip_button_disabled",t.innerHTML=this.displayOptions.vastOptions.skipButtonCaption.replace("[seconds]",this.vastOptions.skipoffset),document.getElementById("videojs_video_wrapper_"+this.videoPlayerId).appendChild(t),e.addEventListener("timeupdate",this.decreaseSkipOffset,!1)},addAdCountdown:function(){var e=document.getElementById(this.videoPlayerId),t=document.getElementById("videojs_video_wrapper_"+this.videoPlayerId),o=document.createElement("div"),i=this.pad(parseInt(this.currentVideoDuration/60))+":"+this.pad(parseInt(this.currentVideoDuration%60)),n=parseInt(i);o.id="ad_countdown"+this.videoPlayerId,o.className="ad_countdown",o.innerHTML="Ad - "+n,t.appendChild(o),e.addEventListener("timeupdate",this.decreaseAdCountdown,!1),t.addEventListener("mouseover",function(){o.style.display="none"},!1)},decreaseAdCountdown:function(){var e=videojsClass.getInstanceById(this.id),t=parseInt(e.currentVideoDuration)-parseInt(this.currentTime),o=document.getElementById("ad_countdown"+e.videoPlayerId);o?o.innerHTML="Ad - "+e.pad(parseInt(t/60))+":"+e.pad(parseInt(t%60)):this.removeEventListener("timeupdate",e.decreaseAdCountdown)},removeAdCountdown:function(){var e=document.getElementById("ad_countdown"+this.videoPlayerId);e&&e.parentElement.removeChild(e)},toggleAdCountdown:function(e){var t=document.getElementById("ad_countdown"+this.videoPlayerId);t&&(t.style.display=e?"inline-block":"none")},addAdPlayingText:function(e){var t=document.createElement("div");t.id=this.videoPlayerId+"_videojs_ad_playing",this.displayOptions.layoutControls.primaryColor&&(t.style.backgroundColor=this.displayOptions.layoutControls.primaryColor,t.style.opacity=1),t.className="videojs_ad_playing",t.innerText=e,document.getElementById("videojs_video_wrapper_"+this.videoPlayerId).appendChild(t)},positionTextElements:function(e){var t=this,o=["top left","top right","bottom left","bottom right"],i=document.getElementById("skip_button_"+t.videoPlayerId),n=document.getElementById(t.videoPlayerId+"_videojs_ad_playing"),s=document.getElementById(t.videoPlayerId+"_videojs_cta"),a=0,r=0,l=!1,d=0,c=[],u={top:{left:{h:34,v:34},right:{h:0,v:34}},bottom:{left:{h:34,v:50},right:{h:0,v:50}}};if(null!==i&&(d=i.offsetHeight+8,document.getElementById("videojs_video_wrapper_"+t.videoPlayerId).classList.contains("mobile")&&(u.bottom.left.v=75,u.bottom.right.v=75)),null!==s){var v=t.displayOptions.vastOptions.adCTATextPosition.toLowerCase();-1==o.indexOf(v)&&(console.log('[FP Error] Invalid position for CTAText. Reverting to "bottom right"'),v="bottom right"),l="bottom"==(c=v.split(" "))[0],s.style[c[0]]=u[c[0]][c[1]].v+"px",s.style[c[1]]=u[c[0]][c[1]].h+"px",l&&"right"==c[1]&&(s.style[c[0]]=u[c[0]][c[1]].v+d+"px"),a=s.offsetHeight+8+"px"}if(null!==n){var p=null!==e.adTextPosition?e.adTextPosition.toLowerCase():this.displayOptions.vastOptions.adTextPosition.toLowerCase();-1==o.indexOf(p)&&(console.log('[FP Error] Invalid position for adText. Reverting to "top left"'),p="top left");var m=p.split(" ");n.style[m[0]]=u[m[0]][m[1]].v+"px",n.style[m[1]]=u[m[0]][m[1]].h+"px",r=n.offsetHeight+8+"px"}0<a&&0<r&&v==p&&(l?"right"==c[1]?n.style.bottom=u[m[0]][m[1]].v+d+a+"px":n.style.bottom=u[m[0]][m[1]].v+a+"px":s.style.top=u[c[0]][c[1]].v+r+"px")},removeAdPlayingText:function(){var e=document.getElementById(this.videoPlayerId+"_videojs_ad_playing");e&&e.parentElement.removeChild(e)},addCTAButton:function(e){if(this.displayOptions.vastOptions.adCTAText){var t=this,o=document.getElementById(this.videoPlayerId),i=document.createElement("div");i.id=this.videoPlayerId+"_videojs_cta",i.className="videojs_ad_cta";var n=document.createElement("span");n.innerHTML=this.displayOptions.vastOptions.adCTAText+'<br/><span class="add_icon_clickthrough">'+e+"</span>",i.addEventListener("click",function(){return o.paused||o.pause(),window.open(t.vastOptions.clickthroughUrl,"_blank").focus(),!0},!1),i.appendChild(n),document.getElementById("videojs_video_wrapper_"+this.videoPlayerId).appendChild(i)}},removeCTAButton:function(){var e=document.getElementById(this.videoPlayerId+"_videojs_cta");e&&e.parentElement.removeChild(e)},decreaseSkipOffset:function(){var e=this,t=videojsClass.getInstanceById(e.id),o=t.vastOptions.skipoffset-Math.floor(e.currentTime),i=document.getElementById("skip_button_"+t.videoPlayerId);i?1<=o?i.innerHTML=t.displayOptions.vastOptions.skipButtonCaption.replace("[seconds]",o):(i.innerHTML='<a href="javascript:;" id="skipHref_'+t.videoPlayerId+'" onclick="videojsClass.getInstanceById(\''+t.videoPlayerId+"').pressSkipButton();\">"+t.displayOptions.vastOptions.skipButtonClickCaption+"</a>
1",i.className=i.className.replace(/\bskip_button_disabled\b/,""),e.removeEventListener("timeupdate",t.decreaseSkipOffset)):(o=0,e.removeEventListener("timeupdate",e.decreaseSkipOffset))},pressSkipButton:function(){this.removeSkipButton(),this.removeAdPlayingText(),this.removeCTAButton(),this.displayOptions.vastOptions.vastAdvanced.vastVideoSkippedCallback();var e=document.createEvent("Event");e.initEvent("ended",!1,!0),document.getElementById(this.videoPlayerId).dispatchEvent(e)},removeSkipButton:function(){btn=document.getElementById("skip_button_"+this.videoPlayerId),btn&&btn.parentElement.removeChild(btn)},addClickthroughLayer:function(){var e=this,t=document.getElementById(e.videoPlayerId),o=document.getElementById("videojs_video_wrapper_"+e.videoPlayerId),i=document.createElement("div");i.className="vast_clickthrough_layer",i.id="vast_clickthrough_layer_"+e.videoPlayerId,i.setAttribute("style","position: absolute; cursor: pointer; top: 0; left: 0; width: "+t.offsetWidth+"px; height: "+t.offsetHeight+"px;"),o.appendChild(i),document.getElementById("vast_clickthrough_layer_"+e.videoPlayerId).onclick=function(){t.paused?t.play():(window.open(e.vastOptions.clickthroughUrl),void 0!==e.vastOptions.clicktracking&&e.callUris(e.vastOptions.clicktracking),t.pause())}},removeClickthrough:function(){var e=document.getElementById("vast_clickthrough_layer_"+this.videoPlayerId);e&&e.parentNode.removeChild(e)},getCurrentSrc:function(){var e=document.getElementById(this.videoPlayerId).getElementsByTagName("source");return e.length?e[0].getAttribute("src"):null},getCurrentSrcType:function(){var e=document.getElementById(this.videoPlayerId).getElementsByTagName("source");if(e.length)for(var t=0;t<e.length;t++)if(e[t].getAttribute("src")==this.originalSrc)return e[t].getAttribute("type");return null},convertTimeStringToSeconds:function(e){if(e&&e.match(/^(\d){2}(:[0-5][0-9]){2}(.(\d){1,3})?$/)){var t=e.split(":");return 3600*parseInt(t[0],10)+60*parseInt(t[1],10)+parseInt(t[2],10)}return!1},onRecentWaiting:function(){var e=videojsClass.getInstanceById(this.id);e.recentWaiting=!0,setTimeout(function(){e.recentWaiting=!1},1e3)},onVideojsPause:function(){var t=this;setTimeout(function(){if(!videojsClass.getInstanceById(t.id).recentWaiting){var e=document.createEvent("CustomEvent");e.initEvent("videojspause",!1,!0),t.dispatchEvent(e)}},100)},checkShouldDisplayVolumeBar:function(){return"iOS"!==videojsClass.getMobileOs().userOs},generateCustomControlTags:function(){return'<div class="videojs_controls_left"> <div id="'+this.videoPlayerId+'_videojs_control_playpause" class="videojs_button videojs_button_play"></div></div><div id="'+this.videoPlayerId+'_videojs_controls_progress_container" class="videojs_controls_progress_container videojs_slider"> <div class="videojs_controls_progress"> <div id="'+this.videoPlayerId+'_vast_control_currentprogress" class="videojs_controls_currentprogress"> <div id="'+this.videoPlayerId+'_vast_control_currentpos" class="videojs_controls_currentpos"></div> </div> </div> <div id="'+this.videoPlayerId+'_buffered_amount" class="videojs_controls_buffered"></div> <div id="'+this.videoPlayerId+'_ad_markers_holder" class="videojs_controls_ad_markers_holder"></div></div><div class="videojs_controls_right"> <div id="'+this.videoPlayerId+'_videojs_control_fullscreen" class="videojs_button videojs_button_fullscreen"></div> <div id="'+this.videoPlayerId+'_videojs_control_theatre" class="videojs_button videojs_button_theatre"></div> <div id="'+this.videoPlayerId+'_videojs_control_video_source" class="videojs_button videojs_button_video_source"></div> <div id="'+this.videoPlayerId+'_videojs_control_playback_rate" class="videojs_button videojs_button_playback_rate"></div> <div id="'+this.videoPlayerId+'_videojs_control_download" class="videojs_button videojs_button_download"></div> <div id="'+this.videoPlayerId+'_videojs_control_mute" class="videojs_button videojs_button_volume"></div> <div id="'+this.videoPlayerId+'_videojs_control_volume_container" class="videojs_control_volume_container videojs_slider"> <div id="'+this.videoPlayerId+'_videojs_control_volume" class="videojs_control_volume"> <div id="'+this.videoPlayerId+'_videojs_control_currentvolume" class="videojs_control_currentvolume"> <div id="'+this.videoPlayerId+'_videojs_control_volume_currentpos" class="videojs_control_volume_currentpos"></div> </div> </div> </div> <div id="'+this.videoPlayerId+'_videojs_control_duration" class="videojs_videojs_control_duration">00:00 / 00:00</div></div>'},controlPlayPauseToggle:function(e){var t=document.getElementById(e+"_videojs_control_playpause"),o=document.getElementById(e+"context_option_play"),i=videojsClass.getInstanceById(e),n=document.getElementById(i.videoPlayerId+"_videojs_controls_container"),s=document.getElementById(i.videoPlayerId+"_logo"),a=document.getElementById(i.videoPlayerId);
1document.getElementById(e+"_videojs_initial_play")&&(document.getElementById(e+"_videojs_initial_play").style.display="none",document.getElementById(e+"_videojs_initial_play_button").style.opacity="1"),a.paused?(t.className=t.className.replace(/\bvideojs_button_pause\b/g,"videojs_button_play"),n.classList.add("initial_controls_show"),s&&s.classList.add("initial_controls_show"),null!==o&&(o.innerHTML="Play")):(t.className=t.className.replace(/\bvideojs_button_play\b/g,"videojs_button_pause"),n.classList.remove("initial_controls_show"),s&&s.classList.remove("initial_controls_show"),null!==o&&(o.innerHTML="Pause"))},playPauseAnimationToggle:function(e){this.isCurrentlyPlayingAd||!this.displayOptions.layoutControls.playPauseAnimation||this.isSwitchingSource||(videoPlayerId=this.videoPlayerId,e?(document.getElementById(videoPlayerId+"_videojs_state_button").classList.remove("videojs_initial_pause_button"),document.getElementById(videoPlayerId+"_videojs_state_button").classList.add("videojs_initial_play_button")):(document.getElementById(videoPlayerId+"_videojs_state_button").classList.remove("videojs_initial_play_button"),document.getElementById(videoPlayerId+"_videojs_state_button").classList.add("videojs_initial_pause_button")),document.getElementById(videoPlayerId+"_videojs_initial_play").classList.add("transform-active"),setTimeout(function(){document.getElementById(videoPlayerId+"_videojs_initial_play").classList.remove("transform-active")},800))},contolProgressbarUpdate:function(e){var t=videojsClass.getInstanceById(e),o=document.getElementById(e);document.getElementById(e+"_vast_control_currentprogress").style.width=o.currentTime/t.currentVideoDuration*100+"%"},contolDurationUpdate:function(e){var t=videojsClass.getInstanceById(e),o=document.getElementById(e),i=t.pad(parseInt(o.currentTime/60))+":"+t.pad(parseInt(o.currentTime%60))+" / "+t.pad(parseInt(t.currentVideoDuration/60))+":"+t.pad(parseInt(t.currentVideoDuration%60));document.getElementById(e+"_videojs_control_duration").innerHTML=i},pad:function(e){return e<10?"0"+e:e},contolVolumebarUpdate:function(e){var t=videojsClass.getInstanceById(e);if("browser"!==t.displayOptions.layoutControls.layout){var o=document.getElementById(e),i=document.getElementById(e+"_videojs_control_currentvolume"),n=document.getElementById(e+"_videojs_control_volume_currentpos"),s=document.getElementById(e+"_videojs_control_volume").clientWidth,a=n.clientWidth,r=document.getElementById(e+"_videojs_control_mute"),l=document.getElementById(e+"context_option_mute");o.volume&&(t.latestVolume=o.volume,t.videojsStorage.videojsMute=!1),o.volume&&!o.muted?(r.className=r.className.replace(/\bvideojs_button_mute\b/g,"videojs_button_volume"),null!==l&&(l.innerHTML="Mute")):(r.className=r.className.replace(/\bvideojs_button_volume\b/g,"videojs_button_mute"),null!==l&&(l.innerHTML="Unmute")),i.style.width=o.volume*s+"px",n.style.left=o.volume*s-a/2+"px"}},muteToggle:function(e){var t=videojsClass.getInstanceById(e),o=document.getElementById(e);o.volume&&!o.muted?(o.volume=0,o.muted=!0):(o.volume=t.latestVolume,o.muted=!1),this.videojsStorage.videojsVolume=t.latestVolume,this.videojsStorage.videojsMute=o.muted},checkFullscreenSupport:function(e){var t=document.getElementById(e),o=document.getElementById(this.videoPlayerId);return t.mozRequestFullScreen?{goFullscreen:"mozRequestFullScreen",exitFullscreen:"mozCancelFullScreen",isFullscreen:"mozFullScreenElement"}:t.webkitRequestFullscreen?{goFullscreen:"webkitRequestFullscreen",exitFullscreen:"webkitExitFullscreen",isFullscreen:"webkitFullscreenElement"}:t.msRequestFullscreen?{goFullscreen:"msRequestFullscreen",exitFullscreen:"msExitFullscreen",isFullscreen:"msFullscreenElement"}:t.requestFullscreen?{goFullscreen:"requestFullscreen",exitFullscreen:"exitFullscreen",isFullscreen:"fullscreenElement"}:!!o.webkitSupportsFullscreen&&{goFullscreen:"webkitEnterFullscreen",exitFullscreen:"webkitExitFullscreen",isFullscreen:"webkitDisplayingFullscreen"}},fullscreenOff:function(e,t){document.getElementById(this.videoPlayerId).style.objectFit="reset",e.className=e.className.replace(/\bvideojs_button_fullscreen_exit\b/g,"videojs_button_fullscreen"),null!==t&&(t.innerHTML="Fullscreen"),this.fullscreenMode=!1},fullscreenOn:function(e,t){document.getElementById(this.videoPlayerId).style.objectFit="contain",e.className=e.className.replace(/\bvideojs_button_fullscreen\b/g,"videojs_button_fullscreen_exit"),null!==t&&(t.innerHTML="Exit Fullscreen"),this.fullscreenMode=!0},fullscreenToggle:function(){videojsClass.activeVideoPlayerId=this.videoPlayerId;var e=document.getElementById("videojs_video_wrapper_"+this.videoPlayerId),t=this.checkFullscreenSupport("videojs_video_wrapper_"+this.videoPlayerId),o=document.getElementById(this.videoPlayerId+"_videojs_control_fullscreen"),i=document.getElementById(this.videoPlayerId+"context_option_fullscreen"),n=document.getElementById(this.videoPlayerId);if(t)switch(t.goFullscreen){case"webkitEnterFullscreen":n[t.isFullscreen]||(functionNameToExecute="videoPlayerTag."+t.goFullscreen+"();",this.fullscreenOn(o,i),new Function("videoPlayerTag",functionNameToExecute)(n));break;default:null===document[t.isFullscreen]?(functionNameToExecute="videoPlayerTag."+t.goFullscreen+"();",this.fullscreenOn(o,i)):(functionNameToExecute="document."+t.exitFullscreen+"();",this.fullscreenOff(o,i)),new Function("videoPlayerTag",functionNameToExecute)(e)}else-1!==e.className.search(/\bpseudo_fullscreen\b/g)?(e.className=e.className.replace(/\bpseudo_fullscreen\b/g,""),this.fullscreenOff(o,i)):(e.className+=" pseudo_fullscreen",this.fullscreenOn(o,i))},findClosestParent:function(e,t){var o,i;if(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].some(function(e){return"function"==typeof document.body[e]&&(o=e,!0)}),e[o](t))return e;for(;e;){if((i=e.parentElement)&&i[o](t))return i;e=i}return null},getTranslateX:function(e){var t=null;try{var o=e.style.transform.match(/translate3d\((-?\d+px,\s?){2}-?\d+px\)/);o&&o.length&&(t=o[0].replace("translate3d(","").replace(")","").replace(/\s/g,"").replace(/px/g,"").split(","))}catch(e){t=null}return t&&3===t.length?parseInt(t[0]):0},getEventOffsetX:function(e,t){for(var o=0,i=0;t&&!isNaN(t.offsetLeft);)i=videojsClass.getTranslateX(t),"BODY"===t.tagName?o+=t.offsetLeft+t.clientLeft+i-(t.scrollLeft||document.documentElement.scrollLeft):o+=t.offsetLeft+t.clientLeft+i-t.scrollLeft,t=t.offsetParent;return(void 0!==e.touches&&void 0!==e.touches[0]?e.touches[0].clientX:e.clientX)-o},getEventOffsetY:function(e,t){var o=1,i=videojsClass.findClosestParent(t,'div[id^="videojs_video_wrapper_"]');
1if(i){var n=i.id.replace("videojs_video_wrapper_",""),s=videojsClass.checkFullscreenSupport("videojs_video_wrapper_"+n);s&&document[s.isFullscreen]&&(o=0)}for(var a=0;t&&!isNaN(t.offsetTop);)"BODY"===t.tagName?a+=t.offsetTop-(t.scrollTop||document.documentElement.scrollTop)*o:a+=t.offsetTop-t.scrollTop*o,t=t.offsetParent;return e.clientY-a},onProgressbarMouseDown:function(o,e){var i=videojsClass.getInstanceById(o);i.displayOptions.layoutControls.playPauseAnimation=!1;var n=videojsClass.getEventOffsetX(e,document.getElementById(o+"_videojs_controls_progress_container"));if(!i.isCurrentlyPlayingAd){i.videojsPseudoPause=!0;var s=document.getElementById(o),a=s.paused;a||s.pause(),document.addEventListener("mouseup",d),document.addEventListener("touchend",d),document.addEventListener("mousemove",l),document.addEventListener("touchmove",l)}function r(e,t){var o=document.getElementById(e+"_videojs_controls_progress_container").clientWidth;o&&(s.currentTime=i.currentVideoDuration*t/o)}function l(e){var t=videojsClass.getEventOffsetX(e,document.getElementById(o+"_videojs_controls_progress_container"));n=NaN,r(o,t),i.contolProgressbarUpdate(i.videoPlayerId),i.contolDurationUpdate(i.videoPlayerId)}function d(e){document.removeEventListener("mousemove",l),document.removeEventListener("touchmove",l),document.removeEventListener("mouseup",d),document.removeEventListener("touchend",d);var t=videojsClass.getEventOffsetX(e,document.getElementById(o+"_videojs_controls_progress_container"));isNaN(t)&&!isNaN(n)&&(t=n),isNaN(t)||r(o,t),a||i.play(),i.initialAnimationSet&&setTimeout(function(){i.displayOptions.layoutControls.playPauseAnimation=i.initialAnimationSet},200),i.videojsPseudoPause=!1}},onVolumebarMouseDown:function(o){function i(e,t){var o=document.getElementById(e),i=document.getElementById(e+"_videojs_control_volume_container").clientWidth,n=videojsClass.getInstanceById(e);if(i){var s=t/i;s<.05?(s=0,o.muted=!0):.95<s&&(s=1),o.muted&&0<s&&(o.muted=!1),n.setVolume(s)}}function n(e){var t=videojsClass.getEventOffsetX(e,document.getElementById(o+"_videojs_control_volume_container"));i(o,t)}function s(e){document.removeEventListener("mousemove",n),document.removeEventListener("touchmove",n),document.removeEventListener("mouseup",s),document.removeEventListener("touchend",s);var t=videojsClass.getEventOffsetX(e,document.getElementById(o+"_videojs_control_volume_container"));isNaN(t)||i(o,t)}document.addEventListener("mouseup",s),document.addEventListener("touchend",s),document.addEventListener("mousemove",n),document.addEventListener("touchmove",n)},setVastList:function(){function e(e){var t=!1;switch(e.roll){case"midRoll":void 0===e.timer&&(t=!0)}return t}var t,o,i=this,n={},s={id:null,roll:null,played:!1,vastLoaded:!1,error:!1,adText:null,adTextPosition:null},a=0;if(i.displayOptions.vastOptions.hasOwnProperty("adList"))for(var r in i.displayOptions.vastOptions.adList)adItem=i.displayOptions.vastOptions.adList[r],o=void 0,o=!1,(t=adItem).vastTag||(i.announceLocalError(102,'"vastTag" property is missing from adList.'),o=!0),t.roll||(i.announceLocalError(102,'"roll" is missing from adList.'),o=!0),-1===i.availableRolls.indexOf(t.roll)&&(i.announceLocalError(102,"Only "+i.availableRolls.join(",")+" rolls are supported."),o=!0),t.size&&-1===i.supportedNonLinearAd.indexOf(t.size)&&(i.announceLocalError(102,"Only "+i.supportedNonLinearAd.join(",")+" size are supported."),o=!0),o?i.announceLocalError(102,"Wrong adList parameters."):(id="ID"+a,n[id]=Object.assign({},s),n[id]=Object.assign(n[id],i.displayOptions.vastOptions.adList[r]),"midRoll"==adItem.roll&&(n[id].error=e("midRoll",adItem)),n[id].id=id,a++);i.adList=n},findRoll:function(e){var t=[];if(t.length=0,e&&this.hasOwnProperty("adList")){for(var o in this.adList)this.adList[o].roll==e&&t.push(o);return t}},volumeChange:function(e,t){var o=document.getElementById(e).volume;"asc"==t?o+=.05:"desc"==t&&(o-=.05),o<.05?o=0:.95<o&&(o=1),this.setVolume(o)},currentTimeChange:function(e,t){var o=videojsClass.getInstanceById(e);if(!o.isCurrentlyPlayingAd){var i=document.getElementById(e);i.currentTime=o.getNewCurrentTimeValueByKeyCode(t,i.currentTime,i.duration)}},getNewCurrentTimeValueByKeyCode:function(e,t,o){var i=t;switch(e){case 37:i=(i-=5)<5?0:i;break;case 39:i=o-5<(i+=5)?o:i;break;case 35:i=o;break;case 36:i=0;break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:e<58&&47<e&&(i=o*(10*(e-48))/100)}return i},handleMouseleave:function(e){var t=videojsClass.getInstanceIdByWrapperId(this.getAttribute("id")),o=videojsClass.getInstanceById(t);void 0!==e.clientX&&document.getElementById("videojs_video_wrapper_"+t).contains(document.elementFromPoint(e.clientX,e.clientY))||o.hideControlBar.call(this)},handleMouseenterForKeyboard:function(){var o=videojsClass.getInstanceIdByWrapperId(this.getAttribute("id")),i=videojsClass.getInstanceById(o),n=document.getElementById(o);i.captureKey||(i.captureKey=function(e){e.stopPropagation();var t=e.keyCode;switch(t){case 70:i.fullscreenToggle(),e.preventDefault();break;case 13:case 32:i.playPauseToggle(n),e.preventDefault();break;case 77:i.muteToggle(o),e.preventDefault();break;case 38:i.volumeChange(o,"asc"),e.preventDefault();break;case 40:i.volumeChange(o,"desc"),e.preventDefault();break;case 37:case 39:case 35:case 36:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:i.currentTimeChange(o,t),e.preventDefault()}return!1},document.addEventListener("keydown",i.captureKey,!0))},keyboardControl:function(){var i=this;document.getElementById("videojs_video_wrapper_"+i.videoPlayerId).addEventListener("click",i.handleMouseenterForKeyboard,!1),window.addEventListener("click",function(e){var t=i.videoPlayerId,o=videojsClass.getInstanceById(t);document.getElementById("videojs_video_wrapper_"+t).contains(e.target)||e.target.id=="skipHref_"+t||(document.removeEventListener("keydown",o.captureKey,!0),delete o.captureKey,o.theatreMode&&o.theatreModeAdvanced)})},initialPlay:function(){var e=this,t=videojsClass.getInstanceById(e.id);if(e.addEventListener("playing",function(){t.toggleLoader(!1)}),e.addEventListener("waiting",function(){t.toggleLoader(!0)}),!t.displayOptions.layoutControls.playButtonShowing){document.getElementById(t.videoPlayerId+"_videojs_controls_container").classList.remove("initial_controls_show");var o=document.getElementById(t.videoPlayerId+"_logo");o&&o.classList.remove("initial_controls_show")}t.firstPlayLaunched||(t.playPauseToggle(e),e.removeEventListener("play",t.initialPlay))},playPauseToggle:function(e){var t=videojsClass.getInstanceById(e.id),o=!t.firstPlayLaunched,i=t.findRoll("preRoll");if(o&&0!=i.length){var n=videojsClass.getBrowserVersion();t.isCurrentlyPlayingAd=!0,("Safari"==n.browserName||!1!==t.mobileInfo.userOs&&"Android"==t.mobileInfo.userOs&&"Google Chrome"==n.browserName)&&(e.src=videojsScriptLocation+"blank.mp4",e.play(),this.playPauseAnimationToggle(!0)),t.firstPlayLaunched=!0,t.prepareVast("preRoll")}else o&&0==i.length&&(t.firstPlayLaunched=!0,t.displayOptions.vastOptions.vastAdvanced.noVastVideoCallback()),"browser"!==t.displayOptions.layoutControls.layout&&(e.paused?(t.dashPlayer?t.dashPlayer.play():e.play(),this.playPauseAnimationToggle(!0)):o||(e.pause(),this.playPauseAnimationToggle(!1))),t.toggleOnPauseAd();function s(){t.prepareVast("onPauseRoll"),t.prepareVast("postRoll"),t.prepareVast("midRoll")}if(o){var a=document.getElementById(t.videoPlayerId+"_videojs_pseudo_poster");a&&a.parentNode.removeChild(a),0<t.mainVideoDuration?s():e.addEventListener("mainVideoDurationSet",s)}t.adTimer();var r=document.getElementById(t.videoPlayerId+"_videojs_html_on_pause");r&&!t.isCurrentlyPlayingAd&&(e.paused?r.style.display="flex":r.style.display="none")},setCustomControls:function(){var t=this,e=document.getElementById(this.videoPlayerId);document.getElementById(this.videoPlayerId+"_videojs_control_playpause").addEventListener("click",function(){t.firstPlayLaunched||e.removeEventListener("play",t.initialPlay),t.playPauseToggle(e)},!1),document.getElementById(t.videoPlayerId).addEventListener("play",function(){t.controlPlayPauseToggle(t.videoPlayerId),t.contolVolumebarUpdate(t.videoPlayerId)},!1),document.getElementById(t.videoPlayerId).addEventListener("videojspause",function(){t.controlPlayPauseToggle(t.videoPlayerId)},!1),e.addEventListener("timeupdate",function(){t.contolProgressbarUpdate(t.videoPlayerId),t.contolDurationUpdate(t.videoPlayerId)});var o=videojsClass.getMobileOs().userOs?"touchstart":"mousedown";document.getElementById(t.videoPlayerId+"_videojs_controls_progress_container").addEventListener(o,function(e){t.onProgressbarMouseDown(t.videoPlayerId,e)},!1),document.getElementById(t.videoPlayerId+"_videojs_control_volume_container").addEventListener(o,function(e){t.onVolumebarMouseDown(t.videoPlayerId)},!1),e.addEventListener("volumechange",function(){t.contolVolumebarUpdate(t.videoPlayerId)}),document.getElementById(t.videoPlayerId+"_videojs_control_mute").addEventListener("click",function(){t.muteToggle(t.videoPlayerId)}),t.setBuffering(),document.getElementById(t.videoPlayerId+"_videojs_control_fullscreen").addEventListener("click",function(){t.fullscreenToggle()}
1),t.displayOptions.layoutControls.allowTheatre&&!t.isInIframe?document.getElementById(t.videoPlayerId+"_videojs_control_theatre").addEventListener("click",function(){t.theatreToggle(t.videoPlayerId)}):document.getElementById(t.videoPlayerId+"_videojs_control_theatre").style.display="none",e.addEventListener("ratechange",function(){t.isCurrentlyPlayingAd&&(this.playbackRate=1)})},createTimePositionPreview:function(){var s=this,a=document.getElementById(s.videoPlayerId);if(s.showTimeOnHover){var e=document.getElementById(s.videoPlayerId+"_videojs_controls_progress_container"),t=document.createElement("div");t.id=s.videoPlayerId+"_videojs_timeline_preview",t.className="videojs_timeline_preview",t.style.display="none",t.style.position="absolute",e.appendChild(t),document.getElementById(s.videoPlayerId+"_videojs_controls_progress_container").addEventListener("mousemove",function(e){var t=document.getElementById(s.videoPlayerId+"_videojs_controls_progress_container"),o=t.clientWidth,i=document.getElementById(s.videoPlayerId+"_videojs_timeline_preview"),n=videojsClass.getEventOffsetX(e,t);hoverSecondQ=s.currentVideoDuration*n/o,showad=s.pad(parseInt(hoverSecondQ/60))+":"+s.pad(parseInt(hoverSecondQ%60)),i.innerText=showad,i.style.display="block",i.style.left=hoverSecondQ/a.duration*100+"%"},!1),document.getElementById(s.videoPlayerId+"_videojs_controls_progress_container").addEventListener("mouseout",function(){document.getElementById(s.videoPlayerId+"_videojs_timeline_preview").style.display="none"},!1)}},setCustomContextMenu:function(){var e=this,t=document.getElementById(e.videoPlayerId),o=document.getElementById("videojs_video_wrapper_"+e.videoPlayerId),i=document.createElement("div");i.id=e.videoPlayerId+"_videojs_context_menu",i.className="videojs_context_menu",i.style.display="none",i.style.position="absolute",i.innerHTML='<ul> <li id="'+e.videoPlayerId+'context_option_play">Play</li> <li id="'+e.videoPlayerId+'context_option_mute">Mute</li> <li id="'+e.videoPlayerId+'context_option_fullscreen">Fullscreen</li></ul>',t.parentNode.insertBefore(i,t.nextSibling),o.addEventListener("contextmenu",function(e){e.preventDefault(),i.style.left=videojsClass.getEventOffsetX(e,t)+"px",i.style.top=videojsClass.getEventOffsetY(e,t)+"px",i.style.display="block"},!1),document.addEventListener("click",function(e){e.target===t&&2===e.button||(i.style.display="none")},!1);var n=document.getElementById(e.videoPlayerId+"context_option_play"),s=document.getElementById(e.videoPlayerId+"context_option_mute"),a=document.getElementById(e.videoPlayerId+"context_option_fullscreen");n.addEventListener("click",function(){e.playPauseToggle(t)},!1),s.addEventListener("click",function(){e.muteToggle(e.videoPlayerId)},!1),a.addEventListener("click",function(){e.fullscreenToggle()},!1)},setDefaultLayout:function(){var e=this,t=document.getElementById(e.videoPlayerId);document.getElementById("videojs_video_wrapper_"+e.videoPlayerId).className+=" videojs_player_layout_"+e.displayOptions.layoutControls.layout,t.removeAttribute("controls"),e.setCustomContextMenu();var o="";e.checkShouldDisplayVolumeBar()||(o=" no_volume_bar");var i=document.createElement("div");i.id=e.videoPlayerId+"_videojs_controls_container",i.className="videojs_controls_container"+o,i.innerHTML=e.generateCustomControlTags(),t.parentNode.insertBefore(i,t.nextSibling);var n=document.createElement("div");n.className="vast_video_loading",n.id="vast_video_loading_"+e.videoPlayerId,n.style.display="none",backgroundColor=e.displayOptions.layoutControls.primaryColor?e.displayOptions.layoutControls.primaryColor:"white",document.getElementById(e.videoPlayerId+"_vast_control_currentprogress").style.backgroundColor=backgroundColor,t.parentNode.insertBefore(n,t.nextSibling);var s=document.createElement("div");s.className="button_close_video",s.id="button_close_video_"+e.videoPlayerId,s.style.display="none",t.parentNode.insertBefore(s,t.nextSibling);var a=100,r=setInterval(function(){a?e.checkIfVolumebarIsRendered()?(clearInterval(r),e.contolVolumebarUpdate(e.videoPlayerId)):a--:clearInterval(r)},100);e.initHtmlOnPauseBlock(),e.setCustomControls(),e.setupThumbnailPreview(),e.createTimePositionPreview(),e.posterImage(),e.initPlayButton(),e.createPlaybackList(),e.createDownload()},checkIfVolumebarIsRendered:function(){var e=document.getElementById(this.videoPlayerId+"_videojs_control_volume_currentpos"),t=document.getElementById(this.videoPlayerId+"_videojs_control_volume").clientWidth;return e.clientWidth!==t},setLayout:function(){var e=this,t=document.getElementById(e.videoPlayerId),o=videojsClass.isTouchDevice()?"touchend":"click";switch(document.getElementById(this.videoPlayerId).addEventListener(o,function(){e.playPauseToggle(t)},!1),this.displayOptions.layoutControls.layout){case"browser":break;
1default:t.addEventListener("play",e.initialPlay,!1),this.setDefaultLayout()}},handleFullscreen:function(){var t=this;void 0===document.vastFullsreenChangeEventListenersAdded&&(["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","msfullscreenchange"].forEach(function(e){"object"==typeof document["on"+e]&&document.addEventListener(e,function(e){t.recalculateAdDimensions(videojsClass.activeVideoPlayerId)},!1)}),document.vastFullsreenChangeEventListenersAdded=!0)},setupThumbnailPreviewVtt:function(){var d=this;d.sendRequest(d.displayOptions.layoutControls.timelinePreview.file,!0,d.displayOptions.vastOptions.vastTimeout,function(){var e=this;if((4!==e.readyState||200===e.status)&&4===e.readyState&&200===e.status){var t=e.responseText,o=(new WebVTTParser).parse(t);d.timelinePreviewData=function(e){if(void 0===e.cues||!e.cues.length)return[];for(var t=[],o=null,i=null,n=0;n<e.cues.length;n++){var s=0,a=0,r=122.5,l=69;2===(o=e.cues[n].text.split("#")).length&&0===o[1].indexOf("xywh=")&&4===(i=(i=o[1].substring(5)).split(",")).length&&(d.displayOptions.layoutControls.timelinePreview.spriteImage=!0,s=parseInt(i[0]),a=parseInt(i[1]),r=parseInt(i[2]),l=parseInt(i[3])),!d.displayOptions.layoutControls.timelinePreview.spriteRelativePath||-1===d.displayOptions.layoutControls.timelinePreview.file.indexOf("/")||void 0!==d.displayOptions.layoutControls.timelinePreview.sprite&&""!=d.displayOptions.layoutControls.timelinePreview.sprite?imageUrl=d.displayOptions.layoutControls.timelinePreview.sprite?d.displayOptions.layoutControls.timelinePreview.sprite:o[0]:(imageUrl=d.displayOptions.layoutControls.timelinePreview.file.substring(0,d.displayOptions.layoutControls.timelinePreview.file.lastIndexOf("/")),imageUrl+="/"+o[0]),t.push({startTime:e.cues[n].startTime,endTime:e.cues[n].endTime,image:imageUrl,x:s,y:a,w:r,h:l})}return t}(o)}})},generateTimelinePreviewTags:function(){var e=document.getElementById(this.videoPlayerId+"_videojs_controls_progress_container"),t=document.createElement("div");t.id=this.videoPlayerId+"_videojs_timeline_preview_container",t.className="videojs_timeline_preview_container",t.style.display="none",t.style.position="absolute",e.appendChild(t);var o=document.createElement("div");o.id=this.videoPlayerId+"_videojs_timeline_preview_container_shadow",o.className="videojs_timeline_preview_container_shadow",o.style.position="absolute",o.style.display="none",o.style.opacity=1,e.appendChild(o)},getThumbnailCoordinates:function(e){var t=this;if(t.timelinePreviewData.length)for(var o=0;o<t.timelinePreviewData.length;o++)if(e>=t.timelinePreviewData[o].startTime&&e<=t.timelinePreviewData[o].endTime)return t.timelinePreviewData[o];return!1},drawTimelinePreview:function(e){var t=this,o=document.getElementById(t.videoPlayerId+"_videojs_timeline_preview_container"),i=document.getElementById(t.videoPlayerId+"_videojs_timeline_preview_container_shadow"),n=document.getElementById(t.videoPlayerId+"_videojs_controls_progress_container"),s=n.clientWidth;if(t.isCurrentlyPlayingAd)"none"!==o.style.display&&(o.style.display="none");else{var a=videojsClass.getEventOffsetX(e,n),r=null;if(s){r=t.currentVideoDuration*a/s;var l=t.getThumbnailCoordinates(r);i.style.width=s+"px",!(i.style.display="block")!==l?(o.style.width=l.w+"px",o.style.height=l.h+"px",i.style.height=l.h+"px",o.style.background="url("+l.image+") no-repeat scroll -"+l.x+"px -"+l.y+"px",o.style.left=a-l.w/2+"px",o.style.display="block",t.displayOptions.layoutControls.timelinePreview.spriteImage||(o.style.backgroundSize="contain")):o.style.display="none"}}},setupThumbnailPreview:function(){var o=this;if(o.displayOptions.layoutControls.timelinePreview&&"string"==typeof o.displayOptions.layoutControls.timelinePreview.file&&"string"==typeof o.displayOptions.layoutControls.timelinePreview.type){switch(o.displayOptions.layoutControls.timelinePreview.type){case"VTT":/*videojsClass.requestScript(videojsScriptLocation+videojsClass.vttParserScript,o.setupThumbnailPreviewVtt.bind(this));*/var e="mousemove",t="mouseleave";o.mobileInfo.userOs&&(e="touchmove",t="touchend"),document.getElementById(o.videoPlayerId+"_videojs_controls_progress_container").addEventListener(e,o.drawTimelinePreview.bind(o),!1),document.getElementById(o.videoPlayerId+"_videojs_controls_progress_container").addEventListener(t,function(e){var t=document.getElementById(o.videoPlayerId+"_videojs_controls_progress_container");void 0!==e.clientX&&t.contains(document.elementFromPoint(e.clientX,e.clientY))||(document.getElementById(o.videoPlayerId+"_videojs_timeline_preview_container").style.display="none",document.getElementById(o.videoPlayerId+"_videojs_timeline_preview_container_shadow").style.display="none")},!1),o.generateTimelinePreviewTags()}o.showTimeOnHover=!1}},setupPlayerWrapper:function(){var e=document.getElementById(this.videoPlayerId),t=document.createElement("div");t.className=videojsClass.isTouchDevice()?"videojs_video_wrapper mobile":"videojs_video_wrapper",t.id="videojs_video_wrapper_"+this.videoPlayerId,this.displayOptions.layoutControls.fillToContainer?(t.style.width="100%",t.style.height="100%"):(t.style.height=e.clientHeight+"px",t.style.width=e.clientWidth+"px"),e.style.height="100%",e.style.width="100%",e.parentNode.insertBefore(t,e),t.appendChild(e)},onErrorDetection:function(){var e=videojsClass.getInstanceById(this.id);this.networkState===this.NETWORK_NO_SOURCE&&e.isCurrentlyPlayingAd&&e.playMainVideoWhenVastFails(401)},createVideoSourceSwitch:function(){var s=this,a=document.getElementById(s.videoPlayerId);if("browser"!==s.displayOptions.layoutControls.layout){var t=[],e=a.querySelectorAll("source");
1if([].forEach.call(e,function(e){e.title&&e.src&&t.push({title:e.title,url:e.src,isHD:null!=e.getAttribute("data-videojs-hd")})}),s.videoSources=t,1<s.videoSources.length){var o=document.getElementById(s.videoPlayerId+"_videojs_control_video_source"),r=!1,l=document.createElement("div");l.id=s.videoPlayerId+"_videojs_control_video_source_list",l.className="videojs_video_sources_list",l.style.display="none";var d=!0;s.videoSources.forEach(function(e){var t=e.url.split(".").pop();if("iOS"!=s.mobileInfo.userOs||"mkv"!=t){var o=d?"source_selected":"",i=e.isHD?'<sup style="color:'+s.displayOptions.layoutControls.primaryColor+'" class="fp_hd_source"></sup>':"";d=!1;var n=document.createElement("div");n.id="source_"+s.videoPlayerId+"_"+e.title,n.className="videojs_video_source_list_item",n.innerHTML='<span class="source_button_icon '+o+'"></span>'+e.title+i,n.addEventListener("click",function(e){a.style.width=a.clientWidth+"px",a.style.height=a.clientHeight+"px",e.stopPropagation();for(var t=this,o=document.getElementsByClassName("source_button_icon"),i=0;i<o.length;i++)o[i].className=o[i].className.replace("source_selected","");t.firstChild.className+=" source_selected",s.videoSources.forEach(function(e){e.title==t.innerText.replace(/(\r\n\t|\n|\r\t)/gm,"")&&(s.setBuffering(),s.setVideoSource(e.url),s.videojsStorage.videojsQuality=e.title)}),s.openCloseVideoSourceSwitch()}),l.appendChild(n),r=!0}}),r?(o.appendChild(l),o.addEventListener("click",function(){s.openCloseVideoSourceSwitch()})):document.getElementById(s.videoPlayerId+"_videojs_control_video_source").style.display="none"}else document.getElementById(s.videoPlayerId+"_videojs_control_video_source").style.display="none"}},openCloseVideoSourceSwitch:function(){var t=document.getElementById(this.videoPlayerId+"_videojs_control_video_source_list"),o=document.getElementById(this.videoPlayerId+"_videojs_control_video_source");if(this.isCurrentlyPlayingAd)t.style.display="none";else if("none"==t.style.display){t.style.display="block";var i=function(e){o.removeEventListener("mouseleave",i),t.style.display="none"};o.addEventListener("mouseleave",i)}else t.style.display="none"},setVideoSource:function(e){var t=this,o=document.getElementById(t.videoPlayerId);if("iOS"==t.mobileInfo.userOs&&0<e.indexOf(".mkv"))return console.log("[FP_ERROR] .mkv files not supported by iOS devices."),!1;if(t.isCurrentlyPlayingAd)t.originalSrc=e;else{var i=!(t.isSwitchingSource=!0);o.paused||(o.pause(),i=!0);var n=o.currentTime;t.setCurrentTimeAndPlay(n,i),o.src=e,t.originalSrc=e,t.displayOptions.layoutControls.mediaType=t.getCurrentSrcType(),t.initialiseStreamers()}},setCurrentTimeAndPlay:function(e,t){var o=document.getElementById(this.videoPlayerId),i=this,n=function(){o.currentTime=e,o.removeEventListener("loadedmetadata",n),"iOS"==i.mobileInfo.userOs&&o.addEventListener("playing",s),t&&o.play(),i.isSwitchingSource=!1,o.style.width="100%",o.style.height="100%"},s=function(){this.currentTime=e,o.removeEventListener("playing",s)};o.addEventListener("loadedmetadata",n,!1),o.load()},initLogo:function(){var e=this,t=document.getElementById(e.videoPlayerId);if(e.displayOptions.layoutControls.logo.imageUrl){var o=document.createElement("div");o.id=e.videoPlayerId+"_logo";var i="logo_maintain_display";e.displayOptions.layoutControls.logo.hideWithControls&&(i="initial_controls_show"),o.classList.add(i,"fp_logo");var n=document.createElement("img");n.id=e.videoPlayerId+"_logo_image",e.displayOptions.layoutControls.logo.imageUrl&&(n.src=e.displayOptions.layoutControls.logo.imageUrl),n.style.position="absolute",n.style.margin=e.displayOptions.layoutControls.logo.imageMargin;var s=e.displayOptions.layoutControls.logo.position.toLowerCase();-1!==s.indexOf("bottom")?n.style.bottom=0:n.style.top=0,-1!==s.indexOf("right")?n.style.right=0:n.style.left=0,e.displayOptions.layoutControls.logo.opacity&&(n.style.opacity=e.displayOptions.layoutControls.logo.opacity),null!==e.displayOptions.layoutControls.logo.clickUrl&&(n.style.cursor="pointer",n.addEventListener("click",function(){window.open(e.displayOptions.layoutControls.logo.clickUrl,"_blank").focus()})),e.displayOptions.layoutControls.logo.mouseOverImageUrl&&(n.addEventListener("mouseover",function(){n.src=e.displayOptions.layoutControls.logo.mouseOverImageUrl},!1),n.addEventListener("mouseout",function(){n.src=e.displayOptions.layoutControls.logo.imageUrl},!1)),t.parentNode.insertBefore(o,null),o.appendChild(n,null)}},initHtmlOnPauseBlock:function(){var t=this;if(!t.hasValidOnPauseAd()&&t.displayOptions.layoutControls.htmlOnPauseBlock.html){var o=document.getElementById(t.videoPlayerId),e=document.createElement("div");e.id=t.videoPlayerId+"_videojs_html_on_pause",e.className="videojs_html_on_pause",e.style.display="none",e.innerHTML=t.displayOptions.layoutControls.htmlOnPauseBlock.html,e.onclick=function(e){t.playPauseToggle(o)},t.displayOptions.layoutControls.htmlOnPauseBlock.width&&(e.style.width=t.displayOptions.layoutControls.htmlOnPauseBlock.width+"px"),t.displayOptions.layoutControls.htmlOnPauseBlock.height&&(e.style.height=t.displayOptions.layoutControls.htmlOnPauseBlock.height+"px"),o.parentNode.insertBefore(e,null)}},initPlayButton:function(){var e=this,t=document.getElementById(e.videoPlayerId),o=document.createElement("div");o.id=e.videoPlayerId+"_videojs_initial_play_button",o.className="videojs_html_on_pause",backgroundColor=e.displayOptions.layoutControls.primaryColor?e.displayOptions.layoutControls.primaryColor:"#333333",o.innerHTML='<div id="'+e.videoPlayerId+'_videojs_initial_play" class="videojs_initial_play" style="background-color:'+backgroundColor+'"><div id="'+e.videoPlayerId+'_videojs_state_button" class="videojs_initial_play_button"></div></div>';var i=function(){e.playPauseToggle(t),o.removeEventListener("click",i)};o.addEventListener("click",i),e.displayOptions.layoutControls.playButtonShowing||(document.getElementById(e.videoPlayerId+"_videojs_controls_container").classList.add("initial_controls_show"),o.style.opacity="0"),t.parentNode.insertBefore(o,null)},mainVideoReady:function(){var e=videojsClass.getInstanceById(this.id);if(0==e.mainVideoDuration&&!e.isCurrentlyPlayingAd&&!1===e.mainVideoReadyState){e.mainVideoDuration=this.duration,e.mainVideoReadyState=!0;var t=new CustomEvent("mainVideoDurationSet");this.dispatchEvent(t),this.removeEventListener("loadedmetadata",e.mainVideoReady)}},userActivityChecker:function(){var t=this,e=document.getElementById("videojs_video_wrapper_"+t.videoPlayerId),o=document.getElementById(t.videoPlayerId);function i(e){"touchstart"!==e.type&&"mousedown"!==e.type||(n=!0),"touchend"!==e.type&&"mouseup"!==e.type||(n=!1),t.newActivity=!0}t.newActivity=null;var n=!1;activityCheck=setInterval(function(){if(!0===t.newActivity){if(n||t.isLoading||(t.newActivity=!1),!1===t.isUserActive||!t.isControlBarVisible()){var e=new CustomEvent("userActive");o.dispatchEvent(e),t.isUserActive=!0}clearTimeout(t.inactivityTimeout),t.inactivityTimeout=setTimeout(function(){!0!==t.newActivity?(t.isUserActive=!1,e=new CustomEvent("userInactive"),o.dispatchEvent(e)):clearTimeout(t.inactivityTimeout)},1e3*t.displayOptions.layoutControls.controlBar.autoHideTimeout)}},300);for(var s=videojsClass.isTouchDevice()?["touchstart","touchmove","touchend"]:["mousemove","mousedown","mouseup"],a=0;a<s.length;a++)e.addEventListener(s[a],i)},hasControlBar:function(){return!(!document.getElementById(this.videoPlayerId+"_videojs_controls_container")||"browser"==this.displayOptions.layoutControls.layout)},isControlBarVisible:function(){if(!1===this.hasControlBar())return!1;var e=document.getElementById(this.videoPlayerId+"_videojs_controls_container"),t=window.getComputedStyle(e,null);return!(0==t.opacity||"hidden"==t.visibility)},hideControlBar:function(){var e=videojsClass.getInstanceIdByWrapperId(this.getAttribute("id")),t=videojsClass.getInstanceById(e),o=document.getElementById(e);if(t.isCurrentlyPlayingAd&&!o.paused&&"browser"!==t.displayOptions.layoutControls.layout&&t.toggleAdCountdown(!0),t.hasControlBar()){var i=document.getElementById(t.videoPlayerId+"_videojs_controls_container"),n=document.getElementById(t.videoPlayerId+"_logo");t.displayOptions.layoutControls.controlBar.animated?(i.classList.remove("fade_in"),i.classList.add("fade_out"),n&&(n.classList.remove("fade_in"),n.classList.add("fade_out"))):(i.style.display="none",n&&(n.style.display="none"))}o.style.cursor="none"},showControlBar:function(){var e=videojsClass.getInstanceIdByWrapperId(this.getAttribute("id")),t=videojsClass.getInstanceById(e),o=document.getElementById(e);if(t.isCurrentlyPlayingAd&&!o.paused&&"browser"!==t.displayOptions.layoutControls.layout&&t.toggleAdCountdown(!1),t.hasControlBar()){var i=document.getElementById(t.videoPlayerId+"_videojs_controls_container"),n=document.getElementById(t.videoPlayerId+"_logo");t.displayOptions.layoutControls.controlBar.animated?(i.classList.remove("fade_out"),i.classList.add("fade_in"),n&&(n.classList.remove("fade_out"),n.classList.add("fade_in"))):(i.style.display="block",n&&(n.style.display="block"))}videojsClass.isTouchDevice()||(o.style.cursor="default")},linkControlBarUserActivity:function(){var e=document.getElementById(this.videoPlayerId);e.addEventListener("userInactive",this.hideControlBar),e.addEventListener("userActive",this.showControlBar)},initMute:function(){!0===this.displayOptions.layoutControls.mute&&(document.getElementById(this.videoPlayerId).volume=0)},initLoop:function(){var e=document.getElementById(this.videoPlayerId);null!==this.displayOptions.layoutControls.loop?e.loop=this.displayOptions.layoutControls.loop:e.loop&&(this.displayOptions.layoutControls.loop=!0)},setBuffering:function(){var o=document.getElementById(this.videoPlayerId),i=document.getElementById(this.videoPlayerId+"_buffered_amount");i.style.width=0,logProgress=function(){var e=o.duration;if(0<e)for(var t=0;t<o.buffered.length;t++)if(o.buffered.start(o.buffered.length-1-t)<o.currentTime){i.style.width=o.buffered.end(o.buffered.length-1-t)/e*100+"%",o.buffered.end(o.buffered.length-1-t)/e=="1"&&clearInterval(n);break}};var n=setInterval(logProgress,500)},createPlaybackList:function(){var o=this;if(o.displayOptions.layoutControls.playbackRateEnabled){var e=document.getElementById(o.videoPlayerId+"_videojs_control_playback_rate"),i=document.createElement("div");i.id=o.videoPlayerId+"_videojs_control_video_playback_rate",i.className="videojs_video_playback_rates",i.style.display="none",["x2","x1.5","x1","x0.5"].forEach(function(e){var t=document.createElement("div");t.className="videojs_video_playback_rates_item",t.innerText=e,t.addEventListener("click",function(e){e.stopPropagation(),playbackRate=this.innerText.replace("x",""),o.setPlaybackSpeed(playbackRate),o.openCloseVideoPlaybackRate()}),i.appendChild(t)}),e.appendChild(i),e.addEventListener("click",function(){o.openCloseVideoPlaybackRate()})}else document.getElementById(o.videoPlayerId+"_videojs_control_playback_rate").style.display="none"},openCloseVideoPlaybackRate:function(){var e=document.getElementById(this.videoPlayerId+"_videojs_control_video_playback_rate"),t=document.getElementById(this.videoPlayerId+"_videojs_control_playback_rate");if(this.isCurrentlyPlayingAd)e.style.display="none";else if("none"==e.style.display){e.style.display="block";var o=function(){t.removeEventListener("mouseleave",o),e.style.display="none"};t.addEventListener("mouseleave",o)}else e.style.display="none"},createDownload:function(){var t=this,e=document.getElementById(this.videoPlayerId+"_videojs_control_download");t.displayOptions.layoutControls.allowDownload?(downloadClick=document.createElement("a"),downloadClick.id=this.videoPlayerId+"_download",downloadClick.onclick=function(e){var t=this;void 0!==e.stopImmediatePropagation&&e.stopImmediatePropagation(),setInterval(function(){t.download="",t.href=""},100)},e.appendChild(downloadClick),e.addEventListener("click",function(){var e=document.getElementById(t.videoPlayerId+"_download");e.download=t.originalSrc,e.href=t.originalSrc,downloadClick.click()})):e.style.display="none"},theatreToggle:function(){if(!this.isInIframe){if(this.fullscreenMode&&this.fullscreenToggle(),this.displayOptions.layoutControls.theatreAdvanced){var e=document.getElementById(this.displayOptions.layoutControls.theatreAdvanced.theatreElement),t=this.displayOptions.layoutControls.theatreAdvanced.classToApply;null!=e&&null!=t?(this.theatreMode?e.classList.remove(t):e.classList.add(t),this.theatreModeAdvanced=!this.theatreModeAdvanced):(console.log("[FP_ERROR] Theatre mode elements could not be found, defaulting behaviour."),this.defaultTheatre())}else this.defaultTheatre();this.theatreMode=!this.theatreMode,this.videojsStorage.videojsTheatre=this.theatreMode;var o=document.getElementById(this.videoPlayerId),i=this.theatreMode?"theatreModeOn":"theatreModeOff",n=document.createEvent("CustomEvent");n.initEvent(i,!1,!0),o.dispatchEvent(n)}},theatreStart:function(){if(!this.isInIframe){if(this.displayOptions.layoutControls.theatreAdvanced){var e=document.getElementById(this.displayOptions.layoutControls.theatreAdvanced.theatreElement),t=this.displayOptions.layoutControls.theatreAdvanced.classToApply;null!=e&&null!=t?(this.theatreMode?e.classList.remove(t):e.classList.add(t),this.theatreModeAdvanced=!this.theatreModeAdvanced):(console.log("[FP_ERROR] Theatre mode elements could not be found, defaulting behaviour."),this.defaultTheatre())}else{(e=document.getElementById("videojs_video_wrapper_"+this.videoPlayerId)).classList.add("videojs_theatre_mode"),t=this.displayOptions.layoutControls.theatreSettings.width;var o="10px";switch(e.style.width=t,e.style.height=this.displayOptions.layoutControls.theatreSettings.height,e.style.maxHeight=screen.height+"px",e.style.bottom=document.getElementsByClassName(this.displayOptions.footerClassName).length&&document.getElementsByClassName(this.displayOptions.footerClassName)[0].offsetHeight<=200&&document.getElementsByClassName(this.displayOptions.footerClassName)[0].offsetHeight+"px"||"110px",e.
1style.marginTop=this.displayOptions.layoutControls.theatreSettings.marginTop+"px",this.displayOptions.layoutControls.theatreSettings.horizontalAlign){case"center":"string"==typeof t&&"%"==t.substr(t.length-1)?o=(100-parseInt(t.substring(0,t.length-1)))/2+"%":"string"==typeof t&&"px"==t.substr(t.length-2)?o=(screen.width-parseInt(t.substring(0,t.length-2)))/screen.width*100/2+"%":console.log("[FP_ERROR] Theatre width specified invalid."),e.style.left=o;break;case"right":e.style.right=o;break;case"left":default:e.style.left=o}}this.theatreMode=!0,this.videojsStorage.videojsTheatre=!0,o=document.getElementById(this.videoPlayerId);var i=document.createEvent("CustomEvent");i.initEvent("theatreModeOn",!1,!0),o.dispatchEvent(i)}},theatreEnd:function(){if(!this.isInIframe){if(this.displayOptions.layoutControls.theatreAdvanced){var e=document.getElementById(this.displayOptions.layoutControls.theatreAdvanced.theatreElement),t=this.displayOptions.layoutControls.theatreAdvanced.classToApply;null!=e&&null!=t?(this.theatreMode?e.classList.remove(t):e.classList.add(t),this.theatreModeAdvanced=!this.theatreModeAdvanced):(console.log("[FP_ERROR] Theatre mode elements could not be found, defaulting behaviour."),this.defaultTheatre())}else(e=document.getElementById("videojs_video_wrapper_"+this.videoPlayerId)).classList.remove("videojs_theatre_mode"),e.style.maxHeight="",e.style.bottom="",e.style.marginTop="",e.style.left="",e.style.right="",e.style.position="",this.displayOptions.layoutControls.fillToContainer?(e.style.width="100%",e.style.height="100%"):(e.style.width=this.originalWidth+"px",e.style.height=this.originalHeight+"px");this.theatreMode=!1,this.videojsStorage.videojsTheatre=!1;var o=document.getElementById(this.videoPlayerId),i=document.createEvent("CustomEvent");i.initEvent("theatreModeOff",!1,!0),o.dispatchEvent(i)}},defaultTheatre:function(){var e=document.getElementById("videojs_video_wrapper_"+this.videoPlayerId);if(this.theatreMode)e.classList.remove("videojs_theatre_mode"),e.style.maxHeight="",e.style.marginTop="",e.style.left="",e.style.right="",e.style.position="",this.displayOptions.layoutControls.fillToContainer?(e.style.width="100%",e.style.height="100%"):(e.style.width=this.originalWidth+"px",e.style.height=this.originalHeight+"px");else{e.classList.add("videojs_theatre_mode");var t=this.displayOptions.layoutControls.theatreSettings.width,o="10px";switch(e.style.width=t,e.style.height=this.displayOptions.layoutControls.theatreSettings.height,e.style.maxHeight=screen.height+"px",e.style.marginTop=this.displayOptions.layoutControls.theatreSettings.marginTop+"px",this.displayOptions.layoutControls.theatreSettings.horizontalAlign){case"center":"string"==typeof t&&"%"==t.substr(t.length-1)?o=(100-parseInt(t.substring(0,t.length-1)))/2+"%":"string"==typeof t&&"px"==t.substr(t.length-2)?o=(screen.width-parseInt(t.substring(0,t.length-2)))/screen.width*100/2+"%":console.log("[FP_ERROR] Theatre width specified invalid."),e.style.left=o;break;case"right":e.style.right=o;break;case"left":default:e.style.left=o}}},posterImage:function(){if(this.displayOptions.layoutControls.posterImage){var e=document.createElement("div");e.id=this.videoPlayerId+"_videojs_pseudo_poster",e.className="videojs_pseudo_poster",e.style.background="url('"+this.displayOptions.layoutControls.posterImage+"') center center / cover no-repeat black",document.getElementById(this.videoPlayerId).parentNode.insertBefore(e,null)}},initialiseStreamers:function(){switch(this.detachStreamers(),this.displayOptions.layoutControls.mediaType){case"application/dash+xml":this.dashScriptLoaded?this.initialiseDash():(this.dashScriptLoaded=!0,videojsClass.requestScript("https://cdn.dashjs.org/latest/dash.mediaplayer.min.js",this.initialiseDash.bind(this)));break;case"application/x-mpegURL":this.hlsScriptLoaded||window.Hls?this.initialiseHls():(this.hlsScriptLoaded=!0,videojsClass.requestScript("https://cdn.jsdelivr.net/npm/hls.js@latest",this.initialiseHls.bind(this)))}},initialiseDash:function(){if("function"==typeof(window.MediaSource||window.WebKitMediaSource)){var e=this.autoplayAfterAd?this.displayOptions.layoutControls.autoPlay:this.autoplayAfterAd,t=dashjs.MediaPlayer().create();
1t.getDebug().setLogToBrowserConsole(!1),t.initialize(document.getElementById(this.videoPlayerId),this.originalSrc,e),this.dashPlayer=t}else this.nextSource(),console.log("[FP_ERROR] Media type not supported by this browser. (application/dash+xml)")},initialiseHls:function(){if(Hls.isSupported()){var e=new Hls(this.displayOptions.hlsjsConfig);e.attachMedia(document.getElementById(this.videoPlayerId)),e.loadSource(this.originalSrc),this.hlsPlayer=e,!this.firstPlayLaunched&&this.displayOptions.layoutControls.autoPlay&&document.getElementById(this.videoPlayerId).play()}else this.nextSource(),console.log("[FP_ERROR] Media type not supported by this browser. (application/x-mpegURL)")},detachStreamers:function(){this.dashPlayer?(this.dashPlayer.reset(),this.dashPlayer=!1):this.hlsPlayer&&(this.hlsPlayer.detachMedia(),this.hlsPlayer=!1)},nextSource:function(){var e=document.getElementById(this.videoPlayerId).getElementsByTagName("source");if(e.length)for(var t=0;t<e.length-1;t++)if(e[t].getAttribute("src")==this.originalSrc&&e[t+1].getAttribute("src"))return void this.setVideoSource(e[t+1].getAttribute("src"));return null},inIframe:function(){try{return window.self!==window.top}catch(e){return!0}},setPersistentSettings:function(){if("undefined"!=typeof Storage&&"undefined"!=typeof localStorage){if(this.videojsStorage=localStorage,void 0!==this.videojsStorage.videojsVolume&&this.displayOptions.layoutControls.persistentSettings.volume&&(this.setVolume(this.videojsStorage.videojsVolume),void 0!==this.videojsStorage.videojsMute&&"true"==this.videojsStorage.videojsMute&&this.muteToggle(this.videoPlayerId)),void 0!==this.videojsStorage.videojsQuality&&this.displayOptions.layoutControls.persistentSettings.quality){var e=document.getElementById("source_"+this.videoPlayerId+"_"+this.videojsStorage.videojsQuality),t=document.getElementById(this.videoPlayerId+"_videojs_control_video_source");e&&(e.click(),t.click())}void 0!==this.videojsStorage.videojsSpeed&&this.displayOptions.layoutControls.persistentSettings.speed&&this.setPlaybackSpeed(this.videojsStorage.videojsSpeed),void 0!==this.videojsStorage.videojsTheatre&&"true"==this.videojsStorage.videojsTheatre&&this.displayOptions.layoutControls.persistentSettings.theatre&&this.theatreToggle()}},init:function(e,t){var o=this,i=document.getElementById(e);for(var n in i.setAttribute("playsinline",""),i.setAttribute("webkit-playsinline",""),o.vastOptions={tracking:[],stopTracking:[]},o.videoPlayerId=e,o.originalSrc=o.getCurrentSrc(),o.isCurrentlyPlayingAd=!1,o.recentWaiting=!1,o.latestVolume=1,o.currentVideoDuration=0,o.firstPlayLaunched=!1,o.suppressClickthrough=!1,o.timelinePreviewData=[],o.mainVideoCurrentTime=0,o.mainVideoDuration=0,o.isTimer=!1,o.timer=null,o.timerPool={},o.adList={},o.adPool={},o.availableRolls=["preRoll","midRoll","postRoll","onPauseRoll"],o.supportedNonLinearAd=["300x250","468x60","728x90"],o.autoplayAfterAd=!0,o.nonLinearDuration=15,o.supportedStaticTypes=["image/gif","image/jpeg","image/png"],o.inactivityTimeout=null,o.isUserActive=null,o.nonLinearVerticalAlign="bottom",o.showTimeOnHover=!0,o.initialAnimationSet=!0,o.theatreMode=!1,o.theatreModeAdvanced=!1,o.fullscreenMode=!1,o.originalWidth=i.offsetWidth,o.originalHeight=i.offsetHeight,o.dashPlayer=!1,o.hlsPlayer=!1,o.dashScriptLoaded=!1,o.hlsScriptLoaded=!1,o.isPlayingMedia=!1,o.isSwitchingSource=!1,o.isLoading=!1,o.isInIframe=o.inIframe(),o.mainVideoReadyState=!1,o.xmlCollection=[],o.inLineFound=null,o.videojsStorage={},o.videojsPseudoPause=!1,o.mobileInfo=videojsClass.getMobileOs(),o.displayOptions={footerClassName:"",layoutControls:{floatingPlayer:"all",unFocusScroll:!1,mediaType:o.getCurrentSrcType(),primaryColor:!1,posterImage:!1,adProgressColor:"#f9d300",playButtonShowing:!0,playPauseAnimation:!0,closeButtonCaption:"Close",fillToContainer:!1,autoPlay:!1,mute:!1,loop:null,keyboardControl:!0,allowDownload:!1,playbackRateEnabled:!1,allowTheatre:!0,theatreSettings:{width:"100%",height:"60%",marginTop:0,horizontalAlign:"center",keepPosition:!1},theatreAdvanced:!1,logo:{imageUrl:null,position:"top left",clickUrl:null,opacity:1,mouseOverImageUrl:null,imageMargin:"2px",hideWithControls:!1,showOverAds:!1},controlBar:{autoHide:!1,autoHideTimeout:3,animated:!0},timelinePreview:{spriteImage:!1,spriteRelativePath:!1},htmlOnPauseBlock:{html:null,height:null,width:null},layout:"default",playerInitCallback:function(){},persistentSettings:{volume:!0,quality:!0,speed:!0,theatre:!0}},vastOptions:{adList:{},skipButtonCaption:"Skip ad in [seconds]",skipButtonClickCaption:'Skip Ad <span class="skip_button_icon"></span>',adText:null,adTextPosition:"top left",adCTAText:"Visit now!",adCTATextPosition:"bottom right",adClickable:!0,vastTimeout:5e3,showProgressbarMarkers:!1,maxAllowedVastTagRedirects:3,vastAdvanced:{vastLoadedCallback:function(){},noVastVideoCallback:function(){},vastVideoSkippedCallback:function(){},vastVideoEndedCallback:function(){}}},hlsjsConfig:{p2pConfig:{logLevel:!1}}},t)if("object"==typeof t[n])for(var s in t[n])o.displayOptions[n][s]=t[n][s];else o.displayOptions[n]=t[n];o.setupPlayerWrapper(),o.initialiseStreamers(),i.addEventListener("webkitfullscreenchange",o.recalculateAdDimensions,!1),i.addEventListener("fullscreenchange",o.recalculateAdDimensions,!1),i.addEventListener("waiting",o.onRecentWaiting,!1),i.addEventListener("pause",o.onVideojsPause,!1),i.addEventListener("loadedmetadata",o.mainVideoReady,!1),i.addEventListener("durationchange",function(){o.currentVideoDuration=o.getCurrentVideoDuration()},!1),i.addEventListener("error",o.onErrorDetection,!1),i.addEventListener("ended",o.onMainVideoEnded,!1),o.currentVideoDuration=o.getCurrentVideoDuration(),isNaN(o.currentVideoDuration)&&(o.currentVideoDuration=0),o.setLayout(),o.latestVolume=i.volume,o.initialAnimationSet=o.displayOptions.layoutControls.playPauseAnimation,o.handleFullscreen(),o.initLogo(),o.initMute(),o.initLoop(),o.displayOptions.layoutControls.playerInitCallback(),o.createVideoSourceSwitch(),o.userActivityChecker(),o.setVastList(
1),o.setPersistentSettings();var a=i.play;i.play=function(){var e=null,t=videojsClass.getInstanceById(this.id);try{null!=(e=a.apply(this,arguments))&&(e.then(function(){t.isPlayingMedia=!0,clearTimeout(t.promiseTimeout)}).catch(function(e){void 0!==e.name&&"AbortError"===e.name||t.announceLocalError(202,"Failed to play video."),clearTimeout(t.promiseTimeout)}),t.promiseTimeout=setTimeout(function(){!1===t.isPlayingMedia&&t.announceLocalError(204,"Timeout error. Failed to play video.")},5e3))}catch(e){t.announceLocalError(201,"Failed to play video.")}};var r=i.pause;if(i.pause=function(){var t=videojsClass.getInstanceById(this.id);if(!0===t.isPlayingMedia)return t.isPlayingMedia=!1,r.apply(this,arguments);if(t.isCurrentlyPlayingVideo(this))try{return t.isPlayingMedia=!1,r.apply(this,arguments)}catch(e){t.announceLocalError(203,"Failed to play video.")}},o.displayOptions.layoutControls.autoPlay&&!o.dashScriptLoaded&&!o.hlsScriptLoaded){var l=videojsClass.getBrowserVersion();if("Safari"==l.browserName&&11<=l.majorVersion)return;i.play()}document.getElementById(this.videoPlayerId).style.objectFit="reset";var d="theatreModeOff";switch(o.theatreEnd(),o.displayOptions.layoutControls.floatingPlayer){case"all":window.onscroll=function(){if((document.body.scrollTop||document.documentElement.scrollTop)>window.innerHeight){if("theatreModeOn"===d)return;d="theatreModeOn",o.theatreStart()}else{if("theatreModeOff"===d)return;d="theatreModeOff",o.theatreEnd()}};break;case"never":window.onscroll=function(){if((document.body.scrollTop||document.documentElement.scrollTop)>window.innerHeight){if("theatreModeOn"===d)return;d="theatreModeOn",o.displayOptions.layoutControls.unFocusScroll&&o.pause()}else{if("theatreModeOff"===d)return;d="theatreModeOff",o.displayOptions.layoutControls.unFocusScroll&&o.play()}};break;case"desktop":window.onscroll=function(){if(480<window.innerWidth&&!isMobile)if((document.body.scrollTop||document.documentElement.scrollTop)>window.innerHeight){if("theatreModeOn"===d)return;d="theatreModeOn",o.theatreStart()}else{if("theatreModeOff"===d)return;d="theatreModeOff",o.theatreEnd()}else if((document.body.scrollTop||document.documentElement.scrollTop)>window.innerHeight){if("theatreModeOn"===d)return;d="theatreModeOn",o.displayOptions.layoutControls.unFocusScroll&&o.pause()}else{if("theatreModeOff"===d)return;d="theatreModeOff",o.displayOptions.layoutControls.unFocusScroll&&o.play()}};break;case"mobile":console.log((document.body.scrollTop||document.documentElement.scrollTop)>i.offsetHeight),window.onscroll=function(){if(window.innerWidth<=480||isMobile)if((document.body.scrollTop||document.documentElement.scrollTop)>window.innerHeight){if("theatreModeOn"===d)return;d="theatreModeOn",o.theatreStart()}else{if("theatreModeOff"===d)return;d="theatreModeOff",o.theatreEnd()}}}var c=document.getElementById("button_close_video_"+o.videoPlayerId);function u(e){e.preventDefault(),o.pause(),o.theatreEnd()}c.addEventListener?c.addEventListener("click",u):x.attachEvent&&c.attachEvent("onclick",u);var v=document.getElementById("videojs_video_wrapper_"+i.id);o.mobileInfo.userOs?(o.hideControlBar.call(v),v.addEventListener("touchstart",o.showControlBar,!1)):(v.addEventListener("mouseleave",o.handleMouseleave,!1),v.addEventListener("mouseenter",o.showControlBar,!1)),o.displayOptions.layoutControls.keyboardControl&&o.keyboardControl(),o.displayOptions.layoutControls.controlBar.autoHide&&o.linkControlBarUserActivity()},play:function(){var e=document.getElementById(this.videoPlayerId);return e.paused&&this.playPauseToggle(e),!0},pause:function(){var e=document.getElementById(this.videoPlayerId);return e.paused||this.playPauseToggle(e),!0},skipTo:function(e){document.getElementById(this.videoPlayerId).currentTime=e},setPlaybackSpeed:function(e){this.isCurrentlyPlayingAd||(document.getElementById(this.videoPlayerId).playbackRate=e,this.videojsStorage.videojsSpeed=e)},setVolume:function(e){document.getElementById(this.videoPlayerId).volume=e,this.latestVolume=e,this.videojsStorage.videojsVolume=e},isCurrentlyPlayingVideo:function(e){return e&&0<e.currentTime&&!e.paused&&!e.ended&&2<e.readyState},setHtmlOnPauseBlock:function(e){if("object"!=typeof e||void 0===e.html)return!1;var t=document.getElementById(this.videoPlayerId+"_videojs_html_on_pause");
1if(t)t.innerHTML=e.html,e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px");else{var o=document.getElementById(player.videoPlayerId),i=document.createElement("div");i.id=player.videoPlayerId+"_videojs_html_on_pause",i.className="videojs_html_on_pause",i.style.display="none",i.innerHTML=e.html,i.onclick=function(){player.playPauseToggle(o)},e.width&&(i.style.width=e.width+"px"),e.height&&(i.style.height=e.height+"px"),o.parentNode.insertBefore(i,null)}},toggleControlBar:function(e){var t=document.getElementById(this.videoPlayerId+"_videojs_controls_container");e?t.className+=" initial_controls_show":t.className=t.className.replace(" initial_controls_show","")},toggleFullscreen:function(e){this.fullscreenMode!=e&&(e&&this.theatreMode&&this.theatreToggle(),this.fullscreenToggle())},on:function(e,t){var o=document.getElementById(this.videoPlayerId),i=this;switch(e){case"play":o.onplay=t;break;case"pause":o.addEventListener("pause",function(){i.videojsPseudoPause||t()});break;case"theatreModeOn":o.addEventListener("theatreModeOn",function(){t()});break;case"theatreModeOff":o.addEventListener("theatreModeOff",function(){t()});break;default:console.log("[FP_ERROR] Event not recognised")}},toggleLogo:function(e){if("object"!=typeof e||!e.imageUrl)return!1;var t=document.getElementById(this.videoPlayerId+"_logo");this.displayOptions.layoutControls.logo.imageUrl=e.imageUrl?e.imageUrl:null,this.displayOptions.layoutControls.logo.position=e.position?e.position:"top left",this.displayOptions.layoutControls.logo.clickUrl=e.clickUrl?e.clickUrl:null,this.displayOptions.layoutControls.logo.opacity=e.opacity?e.opacity:1,this.displayOptions.layoutControls.logo.mouseOverImageUrl=e.mouseOverImageUrl?e.mouseOverImageUrl:null,this.displayOptions.layoutControls.logo.imageMargin=e.imageMargin?e.imageMargin:"2px",this.displayOptions.layoutControls.logo.hideWithControls=!!e.hideWithControls&&e.hideWithControls,this.displayOptions.layoutControls.logo.showOverAds=!!e.showOverAds&&e.showOverAds,t&&t.remove(),this.initLogo()}};initVideoJs=function(e,t){videojs(e,{footerClassName:t.footerClassName||"",layoutControls:{floatingPlayer:t.floatingPlayer||"all",unFocusScroll:t.unFocusScroll||!1,playbackRateEnabled:!0,playButtonShowing:!0,fillToContainer:!0,allowTheatre:!1,primaryColor:"#ef607d",posterImage:t.poster||"",timelinePreview:{file:t.previewFile||"",spriteRelativePath:!0,type:"VTT"}},vastOptions:{showProgressbarMarkers:!0,showProgressbarMarkers:!0,adCTAText:!1,adList:t.settingVastList||[]}})};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.