var fluidPlayerScriptLocation=function(){var e,t,i="";return(i=document.currentScript?document.currentScript.src:(e=document.getElementsByTagName("script"),void 0!==(t=e[e.length-1]).getAttribute.length?t.src:t.getAttribute("src",-1)))?i.substring(0,i.lastIndexOf("/")+1):""}();"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;ir.displayOptions.vastOptions.maxAllowedVastTagRedirects&&!r.inLineFound?a(!1):r.processVastXml(t,o,a)}else a(!1)}else a(!1)}else a(!1);else a(!1)}),n++}else a(!1)},reportError:function(e){this.announceLocalError(e)},backupMainVideoContentTime:function(e){var t=this,i=document.getElementById(t.videoPlayerId);switch(t.adList[e].roll){case"midRoll":i.mainVideoCurrentTime=i.currentTime-1;break;case"postRoll":i.mainVideoCurrentTime=t.mainVideoDuration,t.autoplayAfterAd=!1,i.currentTime=t.mainVideoDuration;break;case"preRoll":0<\/script>'),n.tempVpaidCounter=0,n.getVPAIDAdInterval=setInterval(function(){var e=o.contentWindow.getVPAIDAd;if(e&&"function"==typeof e){if(n.vpaidAdUnit){var t=i;n.hardStopVpaidAd(t)}n.vpaidAdUnit=e(),clearInterval(n.getVPAIDAdInterval),n.checkVPAIDInterface(n.vpaidAdUnit)&&(n.getVpaidAdLinear()?(n.isCurrentlyPlayingAd=!0,n.switchPlayerToVpaidMode(i)):(n.debugMessage("non linear vpaid ad is loaded"),n.loadVpaidNonlinearAssets(i)))}else{if(n.tempVpaidCounter++,20<=n.tempVpaidCounter)return clearInterval(n.getVPAIDAdInterval),n.adList[i].error=!0,n.playMainVideoWhenVpaidFails(403),!1;n.debugMessage(n.tempVpaidCounter)}},100)},renderLinearAd:function(e,t){var s=this,p=document.getElementById(s.videoPlayerId);s.toggleLoader(!0),s.vastOptions=s.adPool[e],t&&s.backupMainVideoContentTime(e);var i=function(){if(s.adFinished)p.removeEventListener("timeupdate",i);else{var e=Math.floor(p.currentTime);0!=s.vastOptions.duration&&s.scheduleTrackingEvent(e,s.vastOptions.duration),e>=s.vastOptions.duration-1&&0!=s.vastOptions.duration&&(p.removeEventListener("timeupdate",i),s.adFinished=!0)}};!function(l){s.switchPlayerToVpaidMode=function(e){var t=this;t.debugMessage("starting function switchPlayerToVpaidMode");var i=t.videoPlayerId+"_"+e+"_fluid_vpaid_iframe",n={};n.AdParameters=t.adPool[e].adParameters;var o=document.createElement("div");o.id=t.videoPlayerId+"_fluid_vpaid_slot",o.className="fluid_vpaid_slot",o.setAttribute("adListId",e),p.parentNode.insertBefore(o,i.nextSibling);var a={slot:o,videoSlot:p,videoSlotCanAutoPlay:!0},r=t.vpaidAdUnit.handshakeVersion(t.vpaidVer);if(1===t.compareVersion(t.vpaidVer,r))return t.adList[e].error=!0,t.playMainVideoWhenVpaidFails(403),!1;!1!==t.vastOptions.skipoffset&&t.addSkipButton(),p.loop=!1,p.removeAttribute("controls"),t.vpaidCallbackListenersAttach();var l=t.fullscreenMode?"fullscreen":"normal",s=p.offsetWidth,d=p.offsetHeight;t.vpaidAdUnit.initAd(s,d,l,3e3,n,a);for(var u=p.parentNode.getElementsByClassName("fluid_controls_currentprogress"),c=0;ct[n])return 1;if(e[n]o?(newBannerWidth=o-5,origHeight*newBannerWidth/origWidth):(newBannerWidth=origWidth,origHeight),"onPauseRoll"!==i.adList[e].roll&&(document.getElementById("fluid_nonLinear_"+e).style.display=""),img=document.getElementById(l.id),img.width=newBannerWidth,img.height=newBannerHeight,i.trackSingleEvent("impression")},a.id="fluid_nonLinear_"+e,a.className="fluid_nonLinear_"+r,a.className+=" fluid_nonLinear_ad",a.innerHTML=l.outerHTML,a.style.display="none",a.onclick=function(){void 0!==t.clickthroughUrl&&window.open(t.clickthroughUrl),void 0!==t.clicktracking&&i.callUris([t.clicktracking])},void 0!==t.clickthroughUrl&&(a.style.cursor="pointer");var s=document.createElement("div");s.id="close_button_"+i.videoPlayerId,s.className="close_button",s.innerHTML="",s.title=i.displayOptions.layoutControls.closeButtonCaption;var d=e;s.onclick=function(e){if(this.parentElement.remove(i),void 0!==e.stopImmediatePropagation&&e.stopImmediatePropagation(),i.adFinished=!0,clearInterval(i.nonLinearTracking),"onPauseRoll"===i.adList[d].roll&&i.onPauseRollAdPods[0]){var t=i.onPauseRollAdPods[0];i.createBoard(t),i.currentOnPauseRollAd=i.onPauseRollAdPods[0],delete i.onPauseRollAdPods[0]}return!1},a.appendChild(s),n.parentNode.insertBefore(a,n.nextSibling)},createBoard:function(e){var t=this,i=t.adPool[e];if(i.vpaid)t.hardStopVpaidAd(""),t.createVpaidNonLinearBoard(e);else{if(void 0===i.staticResource||-1===t.supportedStaticTypes.indexOf(i.creativeType))return t.adList[e].error=!0,void(t.vastOptions&&void 0!==t.vastOptions.errorUrl?t.announceError(503):t.announceLocalError(503));t.createNonLinearBoard(e)}},closeNonLinear:function(e){var t=document.getElementById("fluid_nonLinear_"+e);t&&t.remove()},rollGroupContainsLinear:function(e){for(var t=!1,i=0;i=Math.floor(t.mainVideoDuration)&&(t.adKeytimePlay(Math.floor(t.mainVideoDuration)),clearInterval(t.timer)),!0!==t.displayOptions.layoutControls.loop))){var i=fluidPlayerClass.getInstanceIdByWrapperId(this.getAttribute("id"));fluidPlayerClass.getInstanceById(i);t.switchToMainVideo(),t.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("fluid_video_wrapper_"+this.videoPlayerId).appendChild(t),e.addEventListener("timeupdate",this.decreaseSkipOffset,!1)},addAdCountdown:function(){var e=document.getElementById(this.videoPlayerId),t=document.getElementById("fluid_video_wrapper_"+this.videoPlayerId),i=document.createElement("div"),n=this.pad(parseInt(this.currentVideoDuration/60))+":"+this.pad(parseInt(this.currentVideoDuration%60)),o=parseInt(n);i.id="ad_countdown"+this.videoPlayerId,i.className="ad_countdown",i.innerHTML="Ad - "+o,t.appendChild(i),e.addEventListener("timeupdate",this.decreaseAdCountdown,!1),t.addEventListener("mouseover",function(){i.style.display="none"},!1)},decreaseAdCountdown:function(){var e=fluidPlayerClass.getInstanceById(this.id),t=parseInt(e.currentVideoDuration)-parseInt(this.currentTime),i=document.getElementById("ad_countdown"+e.videoPlayerId);i?i.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+"_fluid_ad_playing",this.displayOptions.layoutControls.primaryColor&&(t.style.backgroundColor=this.displayOptions.layoutControls.primaryColor,t.style.opacity=1),t.className="fluid_ad_playing",t.innerText=e,document.getElementById("fluid_video_wrapper_"+this.videoPlayerId).appendChild(t)},positionTextElements:function(e){var t=this,i=["top left","top right","bottom left","bottom right"],n=document.getElementById("skip_button_"+t.videoPlayerId),o=document.getElementById(t.videoPlayerId+"_fluid_ad_playing"),a=document.getElementById(t.videoPlayerId+"_fluid_cta"),r=0,l=0,s=!1,d=0,u=[],c={top:{left:{h:34,v:34},right:{h:0,v:34}},bottom:{left:{h:34,v:50},right:{h:0,v:50}}};null!==n&&(d=n.offsetHeight+8,document.getElementById("fluid_video_wrapper_"+t.videoPlayerId).classList.contains("mobile")&&(c.bottom.left.v=75,c.bottom.right.v=75));if(null!==a){var p=t.displayOptions.vastOptions.adCTATextPosition.toLowerCase();-1==i.indexOf(p)&&(console.log('[FP Error] Invalid position for CTAText. Reverting to "bottom right"'),p="bottom right"),s="bottom"==(u=p.split(" "))[0],a.style[u[0]]=c[u[0]][u[1]].v+"px",a.style[u[1]]=c[u[0]][u[1]].h+"px",s&&"right"==u[1]&&(a.style[u[0]]=c[u[0]][u[1]].v+d+"px"),r=a.offsetHeight+8+"px"}if(null!==o){var y=null!==e.adTextPosition?e.adTextPosition.toLowerCase():this.displayOptions.vastOptions.adTextPosition.toLowerCase();-1==i.indexOf(y)&&(console.log('[FP Error] Invalid position for adText. Reverting to "top left"'),y="top left");var m=y.split(" ");o.style[m[0]]=c[m[0]][m[1]].v+"px",o.style[m[1]]=c[m[0]][m[1]].h+"px",l=o.offsetHeight+8+"px"}0'+e+"",n.addEventListener("click",function(){return i.paused||i.pause(),window.open(t.vastOptions.clickthroughUrl,"_blank").focus(),!0},!1),n.appendChild(o),document.getElementById("fluid_video_wrapper_"+this.videoPlayerId).appendChild(n)}},removeCTAButton:function(){var e=document.getElementById(this.videoPlayerId+"_fluid_cta");e&&e.parentElement.removeChild(e)},decreaseSkipOffset:function(){var e=this,t=fluidPlayerClass.getInstanceById(e.id),i=t.vastOptions.skipoffset-Math.floor(e.currentTime),n=document.getElementById("skip_button_"+t.videoPlayerId);n?1<=i?n.innerHTML=t.displayOptions.vastOptions.skipButtonCaption.replace("[seconds]",i):(n.innerHTML='"+t.displayOptions.vastOptions.skipButtonClickCaption+"",n.className=n.className.replace(/\bskip_button_disabled\b/,""),e.removeEventListener("timeupdate",t.decreaseSkipOffset)):(i=0,e.removeEventListener("timeupdate",e.decreaseSkipOffset))},pressSkipButton:function(){this.removeSkipButton(),this.removeAdPlayingText(),this.removeCTAButton();var e=fluidPlayerClass.getInstanceById(this.videoPlayerId);if(e.vastOptions.vpaid)e.skipVpaidAd();else{this.displayOptions.vastOptions.vastAdvanced.vastVideoSkippedCallback();var t=document.createEvent("Event");t.initEvent("ended",!1,!0),document.getElementById(this.videoPlayerId).dispatchEvent(t)}},removeSkipButton:function(){var e=document.getElementById("skip_button_"+this.videoPlayerId);e&&e.parentElement.removeChild(e)},addClickthroughLayer:function(){var e=this,t=document.getElementById(e.videoPlayerId),i=document.getElementById("fluid_video_wrapper_"+e.videoPlayerId),n=document.createElement("div");n.className="vast_clickthrough_layer",n.id="vast_clickthrough_layer_"+e.videoPlayerId,n.setAttribute("style","position: absolute; cursor: pointer; top: 0; left: 0; width: "+t.offsetWidth+"px; height: "+t.offsetHeight+"px;"),i.appendChild(n);function o(){window.open(e.vastOptions.clickthroughUrl),void 0!==e.vastOptions.clicktracking&&e.callUris(e.vastOptions.clicktracking)}var a=document.getElementById("vast_clickthrough_layer_"+e.videoPlayerId),r="iPhone"===e.mobileInfo.device&&!1!==e.mobileInfo.userOsMajor&&e.mobileInfo.userOsMajor<=9;a.onclick=function(){t.paused?r&&!e.suppressClickthrough?(o(),e.suppressClickthrough=!0):t.play():(o(),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
00:00 / 00:00
'},controlPlayPauseToggle:function(e){var t=fluidPlayerClass.getInstanceById(e),i=(r=document.getElementById(t.videoPlayerId)).parentNode.getElementsByClassName("fluid_control_playpause"),n=document.getElementById(e+"context_option_play"),o=r.parentNode.getElementsByClassName("fluid_controls_container"),a=document.getElementById(t.videoPlayerId+"_logo"),r=document.getElementById(t.videoPlayerId);if(document.getElementById(e+"_fluid_initial_play")&&(document.getElementById(e+"_fluid_initial_play").style.display="none",document.getElementById(e+"_fluid_initial_play_button").style.opacity="1"),r.paused){for(l=0;l
  • '+this.displayOptions.captions.play+'
  • '+this.displayOptions.captions.mute+'
  • '+this.displayOptions.captions.fullscreen+'
  • Fluid Player '+e.version+"
  • ",t.parentNode.insertBefore(n,t.nextSibling),i.addEventListener("contextmenu",function(e){e.preventDefault(),n.style.left=fluidPlayerClass.getEventOffsetX(e,t)+"px",n.style.top=fluidPlayerClass.getEventOffsetY(e,t)+"px",n.style.display="block"},!1),document.addEventListener("click",function(e){e.target===t&&2===e.button||(n.style.display="none")},!1);var o=document.getElementById(e.videoPlayerId+"context_option_play"),a=document.getElementById(e.videoPlayerId+"context_option_mute"),r=document.getElementById(e.videoPlayerId+"context_option_fullscreen"),l=document.getElementById(e.videoPlayerId+"context_option_homepage");o.addEventListener("click",function(){e.playPauseToggle(t)},!1),a.addEventListener("click",function(){e.muteToggle(e.videoPlayerId)},!1),r.addEventListener("click",function(){e.fullscreenToggle()},!1),l.addEventListener("click",function(){window.open(e.homepage,"_blank").focus()},!1)},setDefaultLayout:function(){var e=this,t=document.getElementById(e.videoPlayerId);document.getElementById("fluid_video_wrapper_"+e.videoPlayerId).className+=" fluid_player_layout_"+e.displayOptions.layoutControls.layout,t.removeAttribute("controls"),e.setCustomContextMenu();var i="";e.checkShouldDisplayVolumeBar()||(i=" no_volume_bar");var n=document.createElement("div");n.id=e.videoPlayerId+"_fluid_controls_container",n.className="fluid_controls_container"+i,n.innerHTML=e.generateCustomControlTags(),t.parentNode.insertBefore(n,t.nextSibling);var o=document.createElement("div");o.className="vast_video_loading",o.id="vast_video_loading_"+e.videoPlayerId,o.style.display="none";var a=e.displayOptions.layoutControls.primaryColor?e.displayOptions.layoutControls.primaryColor:"white";document.getElementById(e.videoPlayerId+"_vast_control_currentprogress").style.backgroundColor=a,t.parentNode.insertBefore(o,t.nextSibling);var r=100;e.displayOptions.layoutControls.doubleclickFullscreen&&t.addEventListener("dblclick",function(){e.fullscreenToggle()},!1);var l=setInterval(function(){r?e.checkIfVolumebarIsRendered()?(clearInterval(l),e.contolVolumebarUpdate(e.videoPlayerId)):r--:clearInterval(l)},100);e.initHtmlOnPauseBlock(),e.setCustomControls(),e.setupThumbnailPreview(),e.createTimePositionPreview(),e.posterImage(),e.initPlayButton(),e.setVideoPreload(),e.createPlaybackList(),e.createDownload()},checkIfVolumebarIsRendered:function(){var e=document.getElementById(this.videoPlayerId+"_fluid_control_volume_currentpos"),t=document.getElementById(this.videoPlayerId+"_fluid_control_volume").clientWidth;return e.clientWidth!==t},setLayout:function(){var e=this,t=document.getElementById(e.videoPlayerId),i=fluidPlayerClass.isTouchDevice()?"touchend":"click";document.getElementById(this.videoPlayerId).addEventListener(i,function(){e.playPauseToggle(t)},!1),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(fluidPlayerClass.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,i=(new WebVTTParser).parse(t);d.timelinePreviewData=function(e){if(void 0===e.cues||!e.cues.length)return[];for(var t=[],i=null,n=null,o=0;o=t.timelinePreviewData[i].startTime&&e<=t.timelinePreviewData[i].endTime)return t.timelinePreviewData[i];return!1},drawTimelinePreview:function(e){var t=this,i=document.getElementById(t.videoPlayerId+"_fluid_timeline_preview_container"),n=document.getElementById(t.videoPlayerId+"_fluid_timeline_preview_container_shadow"),o=document.getElementById(t.videoPlayerId+"_fluid_controls_progress_container"),a=o.clientWidth;if(t.isCurrentlyPlayingAd)"none"!==i.style.display&&(i.style.display="none");else{var r=fluidPlayerClass.getEventOffsetX(e,o),l=null;if(a){l=t.currentVideoDuration*r/a;var s=t.getThumbnailCoordinates(l);n.style.width=a+"px",!(n.style.display="block")!==s?(i.style.width=s.w+"px",i.style.height=s.h+"px",n.style.height=s.h+"px",i.style.background="url("+s.image+") no-repeat scroll -"+s.x+"px -"+s.y+"px",i.style.left=r-s.w/2+"px",i.style.display="block",t.displayOptions.layoutControls.timelinePreview.spriteImage||(i.style.backgroundSize="contain")):i.style.display="none"}}},setupThumbnailPreview:function(){var i=this;if(i.displayOptions.layoutControls.timelinePreview&&"string"==typeof i.displayOptions.layoutControls.timelinePreview.file&&"string"==typeof i.displayOptions.layoutControls.timelinePreview.type){switch(i.displayOptions.layoutControls.timelinePreview.type){case"VTT":fluidPlayerClass.requestScript(fluidPlayerScriptLocation+fluidPlayerClass.vttParserScript,i.setupThumbnailPreviewVtt.bind(this));var e="mousemove",t="mouseleave";i.mobileInfo.userOs&&(e="touchmove",t="touchend"),document.getElementById(i.videoPlayerId+"_fluid_controls_progress_container").addEventListener(e,i.drawTimelinePreview.bind(i),!1),document.getElementById(i.videoPlayerId+"_fluid_controls_progress_container").addEventListener(t,function(e){var t=document.getElementById(i.videoPlayerId+"_fluid_controls_progress_container");void 0!==e.clientX&&t.contains(document.elementFromPoint(e.clientX,e.clientY))||(document.getElementById(i.videoPlayerId+"_fluid_timeline_preview_container").style.display="none",document.getElementById(i.videoPlayerId+"_fluid_timeline_preview_container_shadow").style.display="none")},!1),i.generateTimelinePreviewTags()}i.showTimeOnHover=!1}},setupPlayerWrapper:function(){var e=document.getElementById(this.videoPlayerId),t=document.createElement("div");t.className=fluidPlayerClass.isTouchDevice()?"fluid_video_wrapper mobile":"fluid_video_wrapper",t.id="fluid_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=fluidPlayerClass.getInstanceById(this.id);this.networkState===this.NETWORK_NO_SOURCE&&e.isCurrentlyPlayingAd&&e.playMainVideoWhenVastFails(401)},subtitleFetchParse:function(e){var a=this;document.getElementById(a.videoPlayerId);a.sendRequest(e.url,!0,a.displayOptions.vastOptions.vastTimeout,function(){var e=this;if((4!==e.readyState||200===e.status)&&4===e.readyState&&200===e.status){var t=e.responseText,i=new WebVTT.Parser(window,WebVTT.StringDecoder()),n=[],o=[];i.oncue=function(e){n.push(e)},i.onregion=function(e){o.push(e)},i.parse(t),i.flush(),a.subtitlesData=n}})},createSubtitlesSwitch:function(){var o=this,e=document.getElementById(o.videoPlayerId);if(o.subtitlesData=[],o.displayOptions.layoutControls.subtitlesEnabled){var t=[];t.push({label:"OFF",url:"na",lang:"OFF"});var i=e.querySelectorAll("track");[].forEach.call(i,function(e){"metadata"===e.kind&&e.src&&t.push({label:e.label,url:e.src,lang:e.srclang})}),o.subtitlesTracks=t;var n=document.getElementById(o.videoPlayerId+"_fluid_control_subtitles"),a=!1,r=document.createElement("div");r.id=o.videoPlayerId+"_fluid_control_subtitles_list",r.className="fluid_subtitles_list",r.style.display="none";var l=!0;o.subtitlesTracks.forEach(function(e){var t=l?"subtitle_selected":"";l=!1;var i=document.createElement("div");i.id="subtitle_"+o.videoPlayerId+"_"+e.label,i.className="fluid_subtitle_list_item",i.innerHTML=''+e.label,i.addEventListener("click",function(e){e.stopPropagation();for(var t=this,i=document.getElementsByClassName("subtitle_button_icon"),n=0;n=e.subtitlesData[a].startTime&&i<=e.subtitlesData[a].endTime&&(o.innerHTML="",o.appendChild(WebVTT.convertCueToDOMTree(window,e.subtitlesData[a].text)),n=!0);n||(o.innerHTML="")}},openCloseSubtitlesSwitch:function(){var t=document.getElementById(this.videoPlayerId+"_fluid_control_subtitles_list"),i=document.getElementById(this.videoPlayerId+"_fluid_control_subtitles");if(this.isCurrentlyPlayingAd)t.style.display="none";else if("none"==t.style.display){t.style.display="block";var n=function(e){i.removeEventListener("mouseleave",n),t.style.display="none"};i.addEventListener("mouseleave",n)}else t.style.display="none"},createSubtitles:function(){var e=document.getElementById(this.videoPlayerId),t=document.createElement("div");t.id=this.videoPlayerId+"_fluid_subtitles_container",t.className="fluid_subtitles_container",e.parentNode.insertBefore(t,e.nextSibling),fluidPlayerClass.requestScript(fluidPlayerScriptLocation+fluidPlayerClass.subtitlesParseScript,this.createSubtitlesSwitch.bind(this))},createCardboardJoystickButton:function(e){document.getElementById(this.videoPlayerId);var t=document.getElementById(this.videoPlayerId+"_fluid_vr_joystick_panel"),i=document.createElement("div");return i.id=this.videoPlayerId+"_fluid_vr_joystick_"+e,i.className="fluid_vr_button fluid_vr_joystick_"+e,t.appendChild(i),i},cardboardRotateLeftRight:function(e){var t=this,i=t.vrROTATION_POSITION,n=-t.vrROTATION_POSITION,o={val:e<1?i:n};new TWEEN.Tween(o).to({val:0},t.vrROTATION_SPEED).easing(TWEEN.Easing.Quadratic.InOut).onUpdate(function(){t.vrViewer.OrbitControls.rotateLeft(o.val)}).start()},cardboardRotateUpDown:function(e){var t=this,i=t.vrROTATION_POSITION,n=-t.vrROTATION_POSITION,o={val:e<1?i:n};new TWEEN.Tween(o).to({val:0},t.vrROTATION_SPEED).easing(TWEEN.Easing.Quadratic.InOut).onUpdate(function(){t.vrViewer.OrbitControls.rotateUp(o.val)}).start()},createCardboardJoystick:function(){var e=this,t=(document.getElementById(e.videoPlayerId),document.getElementById(e.videoPlayerId+"_fluid_vr_container")),i=document.createElement("div");i.id=e.videoPlayerId+"_fluid_vr_joystick_panel",i.className="fluid_vr_joystick_panel",t.appendChild(i);var n=e.createCardboardJoystickButton("up"),o=e.createCardboardJoystickButton("left"),a=e.createCardboardJoystickButton("right"),r=e.createCardboardJoystickButton("down"),l=e.createCardboardJoystickButton("zoomdefault"),s=e.createCardboardJoystickButton("zoomin"),d=e.createCardboardJoystickButton("zoomout");n.addEventListener("click",function(){e.cardboardRotateUpDown(1)}),r.addEventListener("click",function(){e.cardboardRotateUpDown(0)}),a.addEventListener("click",function(){e.cardboardRotateLeftRight(0)}),o.addEventListener("click",function(){e.cardboardRotateLeftRight(1)}),l.addEventListener("click",function(){e.vrViewer.camera.fov=60,e.vrViewer.camera.updateProjectionMatrix()}),d.addEventListener("click",function(){e.vrViewer.camera.fov*=1.1,e.vrViewer.camera.updateProjectionMatrix()}),s.addEventListener("click",function(){e.vrViewer.camera.fov*=.9,e.vrViewer.camera.updateProjectionMatrix()})},cardBoardResize:function(){var e=this,t=document.getElementById(this.videoPlayerId);t.addEventListener("theatreModeOn",function(){e.vrViewer.onWindowResize()}),t.addEventListener("theatreModeOff",function(){e.vrViewer.onWindowResize()})},cardBoardSwitchToNormal:function(){var e=this,t=document.getElementById(e.videoPlayerId+"_fluid_vr_joystick_panel"),i=document.getElementById(e.videoPlayerId+"_fluid_controls_container"),n=document.getElementById(e.videoPlayerId);e.vrViewer.enableEffect(PANOLENS.MODES.NORMAL),e.vrViewer.onWindowResize(),e.vrMode=!1;var o=n.parentNode.getElementsByClassName("fluid_vr2_controls_container")[0];n.parentNode.removeChild(o),e.displayOptions.layoutControls.showCardBoardJoystick&&t&&(t.style.display="block"),i.classList.remove("fluid_vr_controls_container"),document.getElementById(e.videoPlayerId+"_fluid_control_volume_container").style.display="block";var a=document.getElementById("ad_countdown"+e.videoPlayerId),r=document.getElementById(e.videoPlayerId+"_fluid_cta"),l=document.getElementById(e.videoPlayerId+"_fluid_ad_playing"),s=document.getElementById("skip_button_"+e.videoPlayerId);a&&(a.style.display="block"),r&&(r.style.display="block"),l&&(l.style.display="block"),s&&(s.style.display="block")},cardBoardHideDefaultControls:function(){var e=this,t=document.getElementById(e.videoPlayerId+"_fluid_vr_joystick_panel"),i=document.getElementById(e.videoPlayerId+"_fluid_initial_play"),n=document.getElementById(e.videoPlayerId+"_fluid_control_volume_container");document.getElementById(e.videoPlayerId+"_fluid_controls_container");e.displayOptions.layoutControls.showCardBoardJoystick&&t&&(t.style.display="none"),i&&(document.getElementById(e.videoPlayerId+"_fluid_initial_play").style.display="none",document.getElementById(e.videoPlayerId+"_fluid_initial_play_button").style.opacity="1"),n.style.display="none"},cardBoardCreateVRControls:function(){var e=document.getElementById(this.videoPlayerId+"_fluid_controls_container"),t=document.getElementById(this.videoPlayerId),i=e.cloneNode(!0);i.removeAttribute("id"),i.querySelectorAll("*").forEach(function(e){e.removeAttribute("id")}),i.classList.add("fluid_vr2_controls_container"),t.parentNode.insertBefore(i,t.nextSibling),this.copyEvents(i)},cardBoardSwitchToVR:function(){var e=this,t=(document.getElementById(e.videoPlayerId+"_fluid_vr_joystick_panel"),document.getElementById(e.videoPlayerId+"_fluid_controls_container"));document.getElementById(e.videoPlayerId);e.vrViewer.enableEffect(PANOLENS.MODES.CARDBOARD),e.vrViewer.onWindowResize(),e.vrViewer.disableReticleControl(),e.vrMode=!0,t.classList.add("fluid_vr_controls_container"),e.cardBoardHideDefaultControls(),e.cardBoardCreateVRControls();var i=document.getElementById("ad_countdown"+e.videoPlayerId),n=document.getElementById(e.videoPlayerId+"_fluid_cta"),o=document.getElementById(e.videoPlayerId+"_fluid_ad_playing"),a=document.getElementById("skip_button_"+e.videoPlayerId);i&&(i.style.display="none"),n&&(n.style.display="none"),o&&(o.style.display="none"),a&&(a.style.display="none")},cardBoardMoveTimeInfo:function(){var e=document.getElementById(this.videoPlayerId+"_fluid_control_duration"),t=document.getElementById(this.videoPlayerId+"_fluid_controls_container");e.classList.add("cardboard_time"),t.appendChild(e),this.contolDurationUpdate=function(e){var t=fluidPlayerClass.getInstanceById(e),i=document.getElementById(e),n=t.formatTime(i.currentTime),o=t.formatTime(t.currentVideoDuration),a=i.parentNode.getElementsByClassName("fluid_control_duration"),r="";if(t.isCurrentlyPlayingAd){r="AD : "+n+" / "+o;for(var l=0;l':"";d=!1;var o=document.createElement("div");o.id="source_"+a.videoPlayerId+"_"+e.title,o.className="fluid_video_source_list_item",o.innerHTML=''+e.title+n,o.addEventListener("click",function(e){r.style.width=r.clientWidth+"px",r.style.height=r.clientHeight+"px",e.stopPropagation();for(var t=this,i=document.getElementsByClassName("source_button_icon"),n=0;n
    ';var o=function(){e.playPauseToggle(t),i.removeEventListener("click",o)};i.addEventListener("click",o),e.displayOptions.layoutControls.playButtonShowing||(document.getElementById(e.videoPlayerId+"_fluid_controls_container").classList.add("initial_controls_show"),i.style.opacity="0");t.parentNode.insertBefore(i,null)},mainVideoReady:function(){var e=fluidPlayerClass.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("fluid_video_wrapper_"+t.videoPlayerId),i=document.getElementById(t.videoPlayerId);t.newActivity=null;function n(e){"touchstart"!==e.type&&"mousedown"!==e.type||(o=!0),"touchend"!==e.type&&"mouseup"!==e.type||(o=!1),t.newActivity=!0}for(var o=!1,a=(setInterval(function(){if(!0===t.newActivity){if(o||t.isLoading||(t.newActivity=!1),!1===t.isUserActive||!t.isControlBarVisible()){var e=new CustomEvent("userActive");i.dispatchEvent(e),t.isUserActive=!0}clearTimeout(t.inactivityTimeout),t.inactivityTimeout=setTimeout(function(){!0!==t.newActivity?(t.isUserActive=!1,e=new CustomEvent("userInactive"),i.dispatchEvent(e)):clearTimeout(t.inactivityTimeout)},1e3*t.displayOptions.layoutControls.controlBar.autoHideTimeout)}},300),fluidPlayerClass.isTouchDevice()?["touchstart","touchmove","touchend"]:["mousemove","mousedown","mouseup"]),r=0;r',adText:null,adTextPosition:"top left",adCTAText:"Visit now!",adCTATextPosition:"bottom right",adClickable:!0,vastTimeout:5e3,showProgressbarMarkers:!1,allowVPAID:!1,showPlayButton:!1,maxAllowedVastTagRedirects:3,vpaidTimeout:3e3,vastAdvanced:{vastLoadedCallback:function(){},noVastVideoCallback:function(){},vastVideoSkippedCallback:function(){},vastVideoEndedCallback:function(){}}},hlsjsConfig:{p2pConfig:{logLevel:!1},enableWebVTT:!1,enableCEA708Captions:!1},captions:{play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",fullscreen:"Fullscreen",subtitles:"Subtitles",exitFullscreen:"Exit Fullscreen"},debug:!1},t)if("object"==typeof t[o])for(var a in t[o])i.displayOptions[o][a]=t[o][a];else i.displayOptions[o]=t[o];i.setupPlayerWrapper(),i.initialiseStreamers(),n.addEventListener("webkitfullscreenchange",i.recalculateAdDimensions,!1),n.addEventListener("fullscreenchange",i.recalculateAdDimensions,!1),n.addEventListener("waiting",i.onRecentWaiting,!1),n.addEventListener("pause",i.onFluidPlayerPause,!1),n.addEventListener("loadedmetadata",i.mainVideoReady,!1),n.addEventListener("durationchange",function(){i.currentVideoDuration=i.getCurrentVideoDuration()},!1),n.addEventListener("error",i.onErrorDetection,!1),n.addEventListener("ended",i.onMainVideoEnded,!1),i.displayOptions.layoutControls.showCardBoardView&&n.setAttribute("crossOrigin","anonymous"),i.currentVideoDuration=i.getCurrentVideoDuration(),isNaN(i.currentVideoDuration)&&(i.currentVideoDuration=0),i.setLayout(),i.latestVolume=n.volume,i.initialAnimationSet=i.displayOptions.layoutControls.playPauseAnimation,i.handleFullscreen(),i.initLogo(),i.initTitle(),i.initMute(),i.initLoop(),i.displayOptions.layoutControls.playerInitCallback(),i.createVideoSourceSwitch(),i.createSubtitles(),i.createCardboard(),i.userActivityChecker(),i.setVastList(),i.setPersistentSettings();var r=n.play;n.play=function(){var e=null,t=fluidPlayerClass.getInstanceById(this.id);t.displayOptions.layoutControls.showCardBoardView&&"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission&&DeviceOrientationEvent.requestPermission().then(function(e){"granted"===e&&t.debugMessage("DeviceOrientationEvent permission granted!")}).catch(console.error);try{null!=(e=r.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 l=n.pause;if(n.pause=function(){var t=fluidPlayerClass.getInstanceById(this.id);if(!0===t.isPlayingMedia)return t.isPlayingMedia=!1,l.apply(this,arguments);if(t.isCurrentlyPlayingVideo(this))try{return t.isPlayingMedia=!1,l.apply(this,arguments)}catch(e){t.announceLocalError(203,"Failed to play video.")}},i.displayOptions.layoutControls.autoPlay&&!i.dashScriptLoaded&&!i.hlsScriptLoaded){var s=fluidPlayerClass.getBrowserVersion();if("Safari"==s.browserName&&11<=s.majorVersion)return;n.play()}var d=document.getElementById("fluid_video_wrapper_"+n.id);i.mobileInfo.userOs?(i.hideControlBar.call(d),d.addEventListener("touchstart",i.showControlBar,!1)):(d.addEventListener("mouseleave",i.handleMouseleave,!1),d.addEventListener("mouseenter",i.showControlBar,!1),d.addEventListener("mouseenter",i.showTitle,!1)),i.displayOptions.layoutControls.keyboardControl&&i.keyboardControl(),i.displayOptions.layoutControls.controlBar.autoHide&&i.linkControlBarUserActivity();try{[].forEach.call(videoPlayerTag.textTracks,function(e){e.mode="hidden"})}catch(e){}},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.fluidStorage.fluidSpeed=e)},setVolume:function(e){document.getElementById(this.videoPlayerId).volume=e,this.latestVolume=e,this.fluidStorage.fluidVolume=e},isCurrentlyPlayingVideo:function(e){return e&&0