@viewlift/player-backup 2.0.281-backup → 2.0.283-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/autoNextVideo-fe71c875.js +1 -0
- package/cjs/bundle.css +393 -393
- package/cjs/{features-f8859d34.js → features-90760526.js} +1 -1
- package/cjs/{generic-75e1dd47.js → generic-b0efda72.js} +1 -1
- package/cjs/{index-6c8937c4.js → index-3bdc6d4e.js} +1 -1
- package/cjs/index-8c9f1a67.js +1 -0
- package/cjs/{index-26f6109d.js → index-ee7aefc5.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-a8c857c0.js → multicamv2-7a2f60f1.js} +1 -1
- package/cjs/{multicamv2-f5c381ea.js → multicamv2-ee93bf7c.js} +1 -1
- package/cjs/{nextEpisodeButton-22aff0b6.js → nextEpisodeButton-9b032064.js} +1 -1
- package/cjs/playlist-c9565f07.js +1 -0
- package/cjs/{series-0eacee33.js → series-31cb5b5e.js} +1 -1
- package/cjs/series-v2-66bb2be2.js +1 -0
- package/cjs/series-v2-e74b725b.js +1 -0
- package/cjs/{skin-a9044066.js → skin-24348af6.js} +1 -1
- package/cjs/skin-3dd98a5f.js +1 -0
- package/cjs/skin-667cd458.js +1 -0
- package/cjs/skin-90c61d0a.js +1 -0
- package/cjs/{skin-6f0565a1.js → skin-a193390e.js} +1 -1
- package/cjs/{skin-a4b65803.js → skin-a54370b0.js} +1 -1
- package/cjs/{skin-fb847fdd.js → skin-a7446a3b.js} +1 -1
- package/cjs/{skin-99d701a6.js → skin-b151359d.js} +1 -1
- package/cjs/skin-cfd6c675.js +1 -0
- package/cjs/videoSelector-3f4ee7e2.js +1 -0
- package/cjs/videoSelector-c824876b.js +1 -0
- package/esm/autoNextVideo-efd28455.js +1 -0
- package/esm/bundle.css +393 -393
- package/esm/{features-4d3395e8.js → features-abc1af35.js} +1 -1
- package/esm/{generic-0968cac4.js → generic-bd7427c4.js} +1 -1
- package/esm/{index-9d872e44.js → index-209acda5.js} +1 -1
- package/esm/index-95713239.js +1 -0
- package/esm/{index-7c5fd418.js → index-c3dfd0f5.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-fd36882b.js → multicamv2-587a5bc1.js} +1 -1
- package/esm/{multicamv2-8b05d36f.js → multicamv2-febf5390.js} +1 -1
- package/esm/{nextEpisodeButton-2ec7644f.js → nextEpisodeButton-9cb4a256.js} +1 -1
- package/esm/playlist-92500990.js +1 -0
- package/esm/{series-1cff0897.js → series-26c7f982.js} +1 -1
- package/esm/series-v2-5993fd16.js +1 -0
- package/esm/series-v2-c71b9a69.js +1 -0
- package/esm/{skin-28209773.js → skin-1331a0e5.js} +1 -1
- package/esm/{skin-4e2acbb2.js → skin-1b825a55.js} +1 -1
- package/esm/skin-1c513653.js +1 -0
- package/esm/{skin-69d5e418.js → skin-49365d5b.js} +1 -1
- package/esm/skin-5419c4aa.js +1 -0
- package/esm/{skin-f17ec26a.js → skin-96f7cd4c.js} +1 -1
- package/esm/skin-b0ba54c4.js +1 -0
- package/esm/{skin-1bee4d9e.js → skin-c1f9b537.js} +1 -1
- package/esm/skin-f6e1b28e.js +1 -0
- package/esm/videoSelector-aef83393.js +1 -0
- package/esm/videoSelector-f9366913.js +1 -0
- package/package.json +1 -1
- package/cjs/autoNextVideo-9fbdc74f.js +0 -1
- package/cjs/playlist-50ac0477.js +0 -1
- package/cjs/series-v2-34cb96e8.js +0 -1
- package/cjs/series-v2-3fb02a7f.js +0 -1
- package/cjs/skin-23bdc8bd.js +0 -1
- package/cjs/skin-336912db.js +0 -1
- package/cjs/skin-e33cb58b.js +0 -1
- package/cjs/skin-e8eb3086.js +0 -1
- package/cjs/util-c398b90f.js +0 -1
- package/cjs/videoSelector-2d4efe7d.js +0 -1
- package/cjs/videoSelector-e513cf31.js +0 -1
- package/esm/autoNextVideo-e9c96046.js +0 -1
- package/esm/playlist-15eafdff.js +0 -1
- package/esm/series-v2-3df88b7c.js +0 -1
- package/esm/series-v2-ae69aff8.js +0 -1
- package/esm/skin-2fd02689.js +0 -1
- package/esm/skin-740d5eef.js +0 -1
- package/esm/skin-85fea537.js +0 -1
- package/esm/skin-cffcda7e.js +0 -1
- package/esm/util-3f4a6529.js +0 -1
- package/esm/videoSelector-3512fb3f.js +0 -1
- package/esm/videoSelector-62afd0ea.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t,n,o,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./skin-c97f0eea.js"),a=require("./generic-
|
|
1
|
+
"use strict";var e,t,n,o,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./skin-c97f0eea.js"),a=require("./generic-b0efda72.js"),r=require("./autoNextVideo-fe71c875.js"),d=require("./icons-eb807ef0.js"),s=require("@babel/runtime/helpers/typeof"),u=require("video.js"),c=[],v=!1,m=function(e,t){var n=l.getPlayer(e),o=Math.floor(n.currentTime());if(Math.floor(n.duration())!=o){n.pause(e);var i=a.getVideoIdx();r.switchToNext(i,e,c)}};e={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},t=function e(){var t,n,o,i,l;for(o in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[o])i.hasOwnProperty(l)&&("object"===s(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},o=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},u.registerPlugin("thumbnails",function(i){var l,a,r,d,s,u,c,v;function m(){document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",m),v()}a=t({},e,i),d=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=d.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),l.appendChild(r),r.src=a[0].src,r.className="vjs-thumbnail",t(r.style,a[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),u=d.duration(),d.on("durationchange",function(e){u=d.duration()}),d.on("loadedmetadata",function(e){u=d.duration()}),(s=d.controlBar.progressControl).el().appendChild(l),c=function(e){var i,d,c,v,m,p,f,g,h,y;for(d in c=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=o(s.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),v=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,v-=o(s.el()).getBoundingClientRect().left+h,i=Math.floor((v-s.el().offsetLeft)/s.width()*u),a)i>d&&(c=Math.max(c,d));(m=a[c]).src&&r.src!=m.src&&(r.src=m.src),m.style&&r.style!=m.style&&t(r.style,m.style),v+(g=function(e,t){var o;return t?parseFloat(t):"auto"!==(o=n(e)("clip"))&&"inherit"!==o&&4===(o=o.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(o[1])-parseFloat(o[3]):0}(r,m.width||a[0].width)/2)>f?v-=v+g-f:v<g&&(v=g),l.style.left=v+"px"},s.on("mousemove",c),s.on("touchmove",c),s.on("pointerdown",function(e){document.addEventListener("pointermove",c),document.addEventListener("pointerup",m)}),v=function(e){l.style.left="-1000px"},s.on("mouseout",v),s.on("touchcancel",v),s.on("touchend",v),d.on("userinactive",v)}),exports.addNextEpPreview=function(e,t){var n;if(v=!1,null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var o;c=[];var r=a.getCurrentSeries();null==r||r.map(function(e){var t;return(t=c).push.apply(t,i(e.episodes))}),null==t||null===(o=t.series)||void 0===o||o.cb}else{var s,u;c=(null==t||null===(s=t.relatedVideos)||void 0===s?void 0:s.content)||[],null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var p=l.getPlayer(e);p.on("timeupdate",function(){var e,t;if(!v){var n=Math.floor(p.currentTime()),o=p.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];o-n<=10&&a.getVideoIdx()<=(null===(t=c)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}});var f,g=c.filter(function(e,t){return t==a.getVideoIdx()});if((null==g?void 0:g.length)>0)if(null!==(f=document.getElementsByClassName("next-ep-preview"))&&void 0!==f&&f[0]){var h,y,x,A,w,E,C,b,N,B,L,P;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var I=null===(y=document.getElementsByClassName("next-ep-title"))||void 0===y?void 0:y[0],j=null===(x=document.getElementsByClassName("next-ep-img"))||void 0===x?void 0:x[0],k=null===(A=document.getElementsByClassName("next-ep-content"))||void 0===A?void 0:A[0],T=null===(w=g[0])||void 0===w?void 0:w.title;(null===(E=T)||void 0===E?void 0:E.length)>60&&(T=T.substr(0,60)+"..."),I.textContent="".concat(T),j.src=(null===(C=g[0])||void 0===C||null===(b=C.gist)||void 0===b||null===(N=b.imageGist)||void 0===N?void 0:N.r16x9)||(null==g||null===(B=g[0])||void 0===B?void 0:B.img)||(null===(L=window)||void 0===L||null===(P=L.customData)||void 0===P?void 0:P.fallbackImage),k.onclick=function(){return m(e)}}else{var q,O,S,V,M,F,X,R,D=document.createElement("div");D.className="next-ep-preview",D.style.visibility="hidden",document.getElementById(e).append(D);var G=document.createElement("div");G.className="next-heading-wrapper";var H=document.createElement("div");H.className="next-ep-header",H.textContent="Next up";var Q=document.createElement("div");Q.className="next-ep-close",Q.onclick=function(){D.style.visibility="hidden",v=!0},Q.appendChild(l.parseSvgString(d.crossIconSvg())),G.append(H),G.append(Q);var U=null===(q=g[0])||void 0===q?void 0:q.title,W=document.createElement("img");W.className="next-ep-img",W.src=(null===(O=g[0])||void 0===O||null===(S=O.gist)||void 0===S||null===(V=S.imageGist)||void 0===V?void 0:V.r16x9)||(null==g||null===(M=g[0])||void 0===M?void 0:M.img)||(null===(F=window)||void 0===F||null===(X=F.customData)||void 0===X?void 0:X.fallbackImage);var Y=document.createElement("div");Y.className="next-ep-title",(null===(R=U)||void 0===R?void 0:R.length)>60&&(U=U.substr(0,60)+"..."),Y.textContent="".concat(U);var _=document.createElement("div");_.className="next-ep-content",_.append(W),_.append(Y),_.onclick=l.debounce(function(){null==D||D.remove(),v=!0,m(e)},400),D.append(G),D.append(_)}},exports.addTVProviderImage=function(e,t){var n=l.getPlayer(e),o=null==t?void 0:t.tvProviderLogoUrl;if(o){var i=document.createElement("div");i.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(o),a.alt="Provider Image",i.append(a),n.el().appendChild(i),n.on("useractive",function(){i.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||i.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"})}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/typeof"),n=require("./generic-b0efda72.js"),t=require("./skin-c97f0eea.js"),a=require("@babel/runtime/helpers/toConsumableArray"),o=require("@babel/runtime/helpers/slicedToArray"),r=require("./localisation-56e0a999.js"),i=!1;var l,c=null,s=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),a=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),o=a>0&&t>4?a:0,r=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),a=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(a-=1),a<0&&(t-=1),t}(new Date,new Date(n));return[r>0&&o>0?r:0,o,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},u=function(e){var n,t=o(e,8),a=t[0],r=t[1],i=t[2],l=t[3],c=t[4],s=t[5],u=t[6],d=t[7];n=a>=1?" ".concat(a," Year"):r>=1?" ".concat(r," month"):i>=1?" ".concat(i," week"):l>=1?" ".concat(l," day"):c<24&&c>=12?" ".concat(c," hour"):c>0?"".concat(c," hours ").concat(s," minutes ").concat(u," seconds"):s>0?"".concat(s," minutes ").concat(u," seconds"):"".concat(u," seconds"),d.textContent="".concat(n)},d=(l={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return l},set:function(e){l={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function v(e,n,t,o){if(e){var i=function(){var e,i,c=null===(e=d.get())||void 0===e?void 0:e.scheduleStartTimeMs,u=null===(i=d.get())||void 0===i?void 0:i.scheduleEndTimeMs,v=Date.now();if(v-u>0){var m=document.getElementsByClassName("error-message")[0];return m&&(m.textContent=r.getLocalisation("eventEnded")||"Game has ended",o.textContent=""),clearInterval(l),void(null==t||t())}var f=c-v;if(f/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var g=s(f,c);null==n||n([].concat(a(g),[o]))};i();var l=setInterval(i,1e3);return l}}exports.getVideoDuration=function(e){var n=t.getPlayer(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")},exports.handleCountdownTimer=function(e,n,t){var a,o,i,l,c,s,m,f,g=null==n||null===(a=n.response)||void 0===a||null===(o=a.data)||void 0===o?void 0:o.errorCode,h=(null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null;d.set({startDateTime:null==n||null===(c=n.response)||void 0===c||null===(s=c.data)||void 0===s?void 0:s.scheduleStartDate,endDateTime:null==n||null===(m=n.response)||void 0===m||null===(f=m.data)||void 0===f?void 0:f.scheduleEndDate}),function(e,n,t,a){var o,i,l=Date.now(),c=null===(o=d.get())||void 0===o?void 0:o.scheduleStartTimeMs,s=null===(i=d.get())||void 0===i?void 0:i.scheduleEndTimeMs,m=function(e,n,t,a){var o;e<0?o=r.getLocalisation("eventNotStarted")||a||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(o=r.getLocalisation("eventEnded")||a||"Game has ended");return o||a}(l-c,l-s,n,t);if(document.getElementsByClassName("error-container")[0]){var f=document.getElementsByClassName("error-message")[0];f&&(f.textContent="".concat(m));var g=document.getElementsByClassName("error-timer-message")[0];g&&v(Math.abs(c),u,a,g)}else{var h=document.getElementById(e).parentElement;if(h){var p=document.createElement("div");p.className="error-container";var y=document.createElement("div");y.className="error-message";var T=document.createElement("div");T.className="error-timer-message",y.textContent="".concat(m),p.appendChild(y),p.appendChild(T),h.append(p),v(Math.abs(c),u,a,T)}}}(e,g,h,t)},exports.handlePlayerMessage=function(e,a){var o=a.scheduleEndDate,i=a.scheduleStartDate;d.set({startDateTime:i,endDateTime:o}),c&&clearInterval(c),c=setInterval(function(){var a,o=Date.now(),i=null===(a=d.get())||void 0===a?void 0:a.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",i),i&&o>i){var l;console.log("Game ended");var s=t.getPlayer(e);if(n.isPlayerInitialised(e)&&s){var u;s.dispose(),console.log("Player disposed");var v=null===(u=document.getElementsByClassName("vl-container"))||void 0===u?void 0:u[0],m=document.createElement("video");m.id=e,m.className="video-js",m.style.width="100%",m.style.height="100%",v&&v.appendChild(m)}var f=r.getLocalisation("eventEnded")||"Game has ended",g=null===(l=document.getElementsByClassName("error-container"))||void 0===l?void 0:l[0];if(g){var h=g.querySelector(".error-message");h&&(h.textContent=f)}else{var p=document.getElementById(e),y=null==p?void 0:p.parentElement;if(y){(g=document.createElement("div")).className="error-container";var T=document.createElement("div");T.className="error-message",T.textContent=f,g.appendChild(T),y.append(g)}}clearInterval(c)}},1e3)},exports.onReplay=function(e,a){var o=t.getPlayer(e);o?(o.on("ended",function(){return i=!0}),o.on("timeupdate",function(){if(!o.paused()&&i){var e,t,r=null===(e=n.getCurrentVideo())||void 0===e||null===(t=e.video)||void 0===t?void 0:t.id;n.videoReplayTracker.get(r)?(n.videoReplayTracker.clear(),n.trackMap.clear(),a(),n.videoReplayTracker.set(r)):(n.videoReplayTracker.clear(),n.videoReplayTracker.set(r)),i=!1}})):a("Cannot find player with id: '".concat(e,"'"))},exports.onTimeUpdate=function(e,n){var a=t.getPlayer(e);a?a.on("timeupdate",function(){return n(a.currentTime())}):n("Cannot find player with id: '".concat(e,"'"))},exports.onVideoEnded=function(e,n){var a=t.getPlayer(e);a?a.on("ended",function(){return n(!0)}):n("Cannot find player with id: '".concat(e,"'"))},exports.playerEvents=function(){var n=function(e,n){var a=t.getPlayer(e);if(!a)throw"Cannot find player with id: '".concat(e,"'");if("function"!=typeof n)throw"Callback function (cb) is missing or not a function";return a};return{onPlay:function(e,t){n(e,t).on("play",function(){return t()})},onPause:function(e,t){n(e,t).on("pause",function(){return t()})},onMute:function(e,t){var a=n(e,t);a.on("volumechange",function(){a.muted()?t({muted:!0}):t({muted:!1})})},onPictureInPictureChange:function(e,t){var a=n(e,t);a.on("enterpictureinpicture",function(){t({pip:!0})}),a.on("leavepictureinpicture",function(){t({pip:!1})})},onFullScreenChange:function(e,t){var a=n(e,t);a.on("fullscreenchange",function(e){a.isFullscreen_?t({isFullscreen:!0}):t({isFullscreen:!1})})},onSetVolume:function(e,t){var a=n(e,t);a.on("volumechange",function(){var e=100*a.volume().toFixed(2);a.muted()?t({vol:0}):t({vol:e})})},onSeeked:function(e,t){var a=n(e,t);a.on("seeked",function(){t({seeked:a.currentTime()})})},onSubtitleEnable:function(e,t){var a=n(e,t);a.textTracks().on("change",function(e){console.log(a.textTracks());var n=a.textTracks().tracks_.filter(function(e){return("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode});n.length>0&&t({enabled:n[0]})})},onDisableSubtitles:function(e,t){var a=n(e,t);a.textTracks().on("change",function(e){var n,o;console.log(a.textTracks()),(null==a||null===(n=a.textTracks())||void 0===n||null===(o=n.tracks_)||void 0===o?void 0:o.every(function(e){return"showing"!=e.mode}))&&t({captions_disabled:!0})})},onSubtitleCueChange:function(t,a){var o=n(t,a);o.on("loadeddata",function(){var n,t,r,i,l,c=o.textTracks();"object"==e(o.dash)&&null!=o.dash&&o.dash.mediaPlayer.on(null===(t=window)||void 0===t||null===(r=t.dashjs)||void 0===r||null===(i=r.MediaPlayer)||void 0===i||null===(l=i.events)||void 0===l?void 0:l.CAPTION_RENDERED,function(e){a(e)});for(var s=0;s<c.length;s++){var u=c[s];"metadata"===u.kind&&(u.mode="hidden",n=u)}n&&n.addEventListener("cuechange",function(){var e=n.activeCues;if(e&&e.length>0)for(var t=0;t<e.length;t++){var o=e[t];a(o)}else console.log("no active cue at this moment")})})},onError:function(e,t){var a=n(e,t);a.on("error",function(){var e,n;t({error:null==a||null===(e=a.error())||void 0===e?void 0:e.code,msg:null==a||null===(n=a.error())||void 0===n?void 0:n.message})})}}},exports.scheduleTimerInstanceManager=d,exports.seekToTimeStamp=function(e,n,a){var o=t.getPlayer(e);o?n>=0&&n<=o.duration()?(a({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),o.currentTime(n)):a({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):a("Cannot find player with id: '".concat(e,"'"))},exports.setPlaybackSpeed=function(e,n){var a=t.getPlayer(e);if(!a)return"Cannot find player with id: '".concat(e,"'");try{return a.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(e){return"Error: ".concat(e)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./index-
|
|
1
|
+
"use strict";require("./index-3bdc6d4e.js");var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("./skin-c97f0eea.js"),n=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/helpers/slicedToArray"),a=require("./generic-b0efda72.js");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s="my-player";function l(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function c(){return(c=e(t.mark(function e(r){var n,a,u,o,s,l,c,p,d,f,m,b,g,h,v,x,y,k,w,E,j,N,T,A;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return a=e.sent,e.next=11,createImageBitmap(a);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=i(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,f=[],m=0;m<l;m++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,m*d,p,d,0,0,p,d),h=g.toDataURL("image/png"),f.push({uri:h,duration:r.duration}),r._tiles=f;return e.abrupt("return",f);case 20:for(e.prev=20,e.t0=e.catch(2),v=r.layout.split("x").map(Number),x=i(v,2),y=x[0],k=x[1],w=[],E=0;E<y*k;E++)w.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(T=N.appcmsMain)||void 0===T||null===(A=T.images)||void 0===A?void 0:A.placeholderCover,duration:r.duration});return e.abrupt("return",w);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function p(e,t){return d.apply(this,arguments)}function d(){return(d=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",l(a));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function f(e,t,n){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=r.getPlayer(s);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,l=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),n),p=t[l];p&&!p.loading&&(p.loading=!0,function(e){return c.apply(this,arguments)}(p).then(function(e){var t=e[p.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),p.loading=!1,p.src=t.uri}))}}function m(e){return b.apply(this,arguments)}function b(){return(b=e(t.mark(function e(a){var u,s,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},a.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),a=i(r,2),s=a[0]*a[1],l=e.duration,c=0;c<s;c++){var p,d=Math.round((t*s+c)*l);u[d]=o(o({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},n(p,"left","-60px"),n(p,"border","1px solid transparent"),n(p,"borderRadius","4px"),p)})}}),s=Object.keys(u).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r.throttle(function(e){return f(e,u,s)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",r.throttle(function(e){return f(e,u,s)},500))}),e.abrupt("return",u);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var g=function(){var r=e(t.mark(function e(r,n){var a,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return a=e.sent,e.next=5,a.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=i(t,2),n=r[0],a=r[1];n&&a&&(l[n.trim().toLowerCase()]=a.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function v(e,t){return x.apply(this,arguments)}function x(){return(x=e(t.mark(function e(n,u){var o,l,c,p,d,f,m,b,g,v,x,w,E,j,N,T,A,O,I,S,P,M,R,q,$,B,D,L,C,U,X,_,F,W,z,G,V,H,J,K,Q,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,fe,me;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=u,o=r.getPlayer(u),l=n.split("/"),c=l.findIndex(function(e){return"dash"===e.toLowerCase()}),p=h(-1!==c?l.slice(0,c+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),w=(null==o?void 0:o.duration())||(null===(d=a.getCurrentVideo())||void 0===d||null===(f=d.video)||void 0===f?void 0:f.runtime),E=(null==x||null===(m=x.querySelector("MPD > BaseURL"))||void 0===m?void 0:m.textContent)||p+"/",j=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<j.length)){e.next=72;break}if(("image"!==(T=j[N]).getAttribute("contentType")||"image/png"!==T.getAttribute("mimeType"))&&"image/jpeg"!==T.getAttribute("mimeType")){e.next=69;break}if(O=T.getElementsByTagName("SegmentTemplate")[0],I=null===(A=O.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!O||!I){e.next=48;break}if(M=I.getElementsByTagName("S"),R=parseInt(null===(S=M[0])||void 0===S?void 0:S.getAttribute("t")),q=parseInt(null===(P=M[0])||void 0===P?void 0:P.getAttribute("d")),$=T.getElementsByTagName("Representation")[0],B=$.getElementsByTagName("EssentialProperty")[0],D=B.getAttribute("value"),L=null==D?void 0:D.split("x"),C=i(L,2),U=C[0],X=C[1],!O){e.next=46;break}if(O.getAttribute("media"),_=O.getAttribute("timescale"),F=(_?q/_:q)/(U*X),W=$.getAttribute("id"),z=Math.round(w/F),G=Math.ceil(z/(U*X)),V=O.getAttribute("media"),parseInt(O.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],N=0;N<G;N++)K="/"==(J=V)[0]?new URL(p).origin:p+"/",H.push({duration:F,layout:D,uri:K+J.replace("$Time$",R+N*q).replace("$RepresentationID$",W)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(Q=T.getElementsByTagName("Representation")[0],Y=Q.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=i(ee,2),re=te[0],ne=te[1],!O){e.next=69;break}if(O.getAttribute("media"),ie=O.getAttribute("duration"),ae=O.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=Q.getAttribute("id"),se=Math.round(w/ue),le=Math.ceil(se/(re*ne)),ce=O.getAttribute("media"),pe=parseInt(O.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],fe=y(ce),N=0;N<le;N++)me=fe?k(fe,N+pe):ce,de.push({duration:ue,layout:Z,uri:E+me.replace("$Number$",N+pe).replace("$RepresentationID$",oe)});return e.abrupt("return",de);case 69:N++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function y(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function w(){return(w=e(t.mark(function e(n){var i,a,u,o,s,l,c,d,f,b,h,x,y,k,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=r.getPlayer(n),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,p(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return f=(null==d?void 0:d[0])||null,b=f.uri,h=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,g(h,b);case 12:return x=e.sent,e.next=15,m(x);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,v(c,n);case 22:if(!((null==(k=e.sent)?void 0:k.length)>0)){e.next=28;break}return e.next=26,m(k);case 26:w=e.sent,s.thumbnails(w);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}exports.initiateTrickplay=function(e){return w.apply(this,arguments)};
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-75e1dd47.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/regenerator"),o=require("video.js"),l=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/get"),u=require("@babel/runtime/helpers/inherits"),s=require("@babel/runtime/helpers/possibleConstructorReturn"),d=require("@babel/runtime/helpers/getPrototypeOf"),c=require("./util-c398b90f.js"),v=require("./captions-80f6eb66.js"),p=require("./renditions-d28715a3.js"),f=require("./resolution-948774b8.js"),m=require("./skin-c97f0eea.js"),g=require("./browser-77c57718.js"),h=require("./localisation-56e0a999.js"),y=require("@babel/runtime/helpers/typeof");require("@viewlift/comscore/index.js");var b=require("@babel/runtime/helpers/toConsumableArray"),w=require("@babel/runtime/helpers/slicedToArray"),k=require("@viewlift/sse");function S(e,n,t,i){var o=a(d(1&i?e.prototype:e),n,t);return 2&i&&"function"==typeof o?function(e){return o.apply(t,e)}:o}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}require("axios"),require("md5"),require("js-cookie"),require("@babel/runtime/helpers/assertThisInitialized");var T=o.getComponent("TextTrackSettings"),D=o.dom,I=[{value:"12",label:"12px"},{value:"14",label:"14px"},{value:"16",label:"16px"},{value:"18",label:"18px"},{value:"20",label:"20px"},{value:"24",label:"24px"},{value:"28",label:"28px"},{value:"32",label:"32px"}],C=I.map(function(e){return e.value}),O="16",P="vlp-caption-font-size-px",j="vlp-caption-font-size-style",x=".vjs-font-percent > select",R=function(e){return-1!==C.indexOf(e)?e:O},A=null;T?(A=function(){u(i,T);var e,n,t=(e=i,n=E(),function(){var t,i=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments);return s(this,t)});function i(e,n){var o;return l(this,i),(o=t.call(this,e,n)).customUiReady_=!0,o.applyCustomFontSizeUI_(),o}return r(i,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(x);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);I.forEach(function(n){e.appendChild(D.createEl("option",{value:n.value,textContent:n.label}))}),e.value=O}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$(x);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=R(e);if("undefined"!=typeof document){var t=document.getElementById(j);t||((t=document.createElement("style")).id=j,document.head.appendChild(t)),t.textContent=[".vjs-text-track-cue,",".vjs-text-track-cue > div,",".vjs-text-track-display-ttml,",".vjs-text-track-display-ttml span,",".vjs-text-track-display-ttml div","{ font-size: ".concat(n,"px !important; line-height: normal !important; }")].join(" ")}}},{key:"restoreCustomFontSize_",value:function(){var e=null;try{e=window.localStorage.getItem(P)}catch(e){}var n=R(e),t=this.$(x);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=S(i,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(S(i,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$(x);e&&(e.value=O),this.applyFontSize_(O)}}},{key:"saveSettings",value:function(){if(S(i,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$(x);if(e)try{window.localStorage.setItem(P,R(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){S(i,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),i}(),o.registerComponent("TextTrackSettings",A)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var L=function(e){return new Promise(function(n,t){if(N(e))t("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}})},N=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},M=function(e,n,t){var i=m.getPlayer(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var o=parseFloat(n)/100;i.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},_=function(e){var n=m.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},B=function(){var e=t(i.mark(function e(n){var t,l,r,a,u;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=m.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,L("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(o),e.finish(13);case 16:(u=o.getTech("chromecast"))&&!u.prototype.seeking&&(u.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==g.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),V=function(e,n){var t=m.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,i,l,r,a,u=this.el(),s=o.dom.getPointerPosition(u,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(l=i.framework)||void 0===l||null===(r=l.CastContext)||void 0===r||null===(a=r.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}})};var U=function(){var e=t(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),L("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),q=function(){var n=t(i.mark(function n(){return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.comscoreInstanceManager.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),F=function(){var e=t(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),H=function(){var e=t(i.mark(function e(){var n;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(o),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),z=function(){var e=t(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-84cce26a.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),G=function(){var e=t(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-072614bc.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),Y=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){L("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(o)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(o)})},loadAdsLibrary:U,loadEMELibrary:F,loadMuxPlugin:H,loadDvrSeekbar:z,loadContribDash:G,loadComscorePlugin:q});function K(e){return W.apply(this,arguments)}function W(){return(W=t(i.mark(function e(n){var t;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,U();case 3:t&&"Safari"==g.detectBrowser()&&Promise.resolve().then(function(){return Y}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $(e){return J.apply(this,arguments)}function J(){return(J=t(i.mark(function e(n){var t,o,l,r,a,u,s,d,c,v;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=m.getPlayer(n.playerId),e.next=3,q();case 3:v.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.endpoint,applicationName:(null==n||null===(l=n.comscore)||void 0===l?void 0:l.applicationName)||(null===(r=window)||void 0===r?void 0:r.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1,persistentLabels:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.persistentLabels)||{},metadata:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function X(e,n){return Q.apply(this,arguments)}function Q(){return(Q=t(i.mark(function e(n,t){var o,l,r,a,u,s,d,c,v,p,f,m,h,y;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==t?void 0:t.contentType)||"video",p=null==t||null===(o=t[v])||void 0===o?void 0:o.drmEnabled,null==t||null===(l=t[v])||void 0===l||null===(r=l.liveDetails)||void 0===r||r.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==t||null===(a=t[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==n||null===(d=n.comscore)||void 0===d?void 0:d.enable)||!1,h=!(null==n||null===(c=n.analytics)||void 0===c||!c.muxKey),e.prev=7,e.next=10,Promise.allSettled([p?"Safari"==g.detectBrowser()?F():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?G():F():"Safari"!=g.detectBrowser()&&f?G():null,m?$(n):null,h?H():null,B(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}},e,null,[[7,12]])}))).apply(this,arguments)}function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ee(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var ne=new Set,te=null,ie=function(n,t,i,o){var l,r,a,u,s,d,c,v={},p=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(l=n[p])||void 0===l?void 0:l.id)||"Null",v["c3.cm.contentType"]=de(n),v[null==i||null===(r=i.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==n||!n.linearchannel),v[null==i||null===(a=i.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),v[null==i||null===(u=i.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),v["c3.cm.categoryType"]=ae(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=n[p])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(d=n[p])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[i.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=ue(n),v["c3.cm.genreList"]=le(n),v["c3.cm.genre"]=oe(n),v["c3.cm.channel"]=re(n,o);var f=pe(e.getCurrentSeries(),n);return v=ee(ee({},v),f)},oe=function(e){var n,t,i,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(i=t.primaryCategory)||void 0===i?void 0:i.title)||"Null"},le=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},re=function(e,n){var t,i,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null===(i=((null==e||null===(t=e[o])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===i?void 0:i.title)||"NULL"},ae=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},ue=function(e){var n,t,i=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[i])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},se=function(e,n){var t,i,o=(n||{}).epg;if(o&&null!=o&&o.enable&&null!=o&&o.programTitle)return o.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(i=t.gist)||void 0===i?void 0:i.title)||"Null";return"".concat(r)},de=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ce,ve,pe=function(n,t){var i,o,l,r,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(i=t.video)||void 0===i||null===(o=i.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(l=n[s-1])||void 0===l||null===(r=l.episodes)||void 0===r||null===(a=r[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},fe=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},me=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ge=function(){var n=t(i.mark(function n(t,o){var l,r,a,u,s,d,c,v,p,f,g,h;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=(null==o?void 0:o.convivaConfig)||{},r=l.trackConvivaPlayerEvent,a=l.paymentHandler,u=l.tveProvider,s=l.enable,d=l.appName,v=(c=o||{}).token,p=c.epg,s){n.next=4;break}return n.abrupt("return");case 4:if(f=m.getPlayer(t),"function"==typeof(g=r)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,g("getConvivaObject");case 10:if(h=n.sent){n.next=13;break}return n.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var i=fe(t.keySystem);g("contentInfo",{DRMEnabled:i})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var n,t;te&&te!==f.currentSrc()&&g("playbackEnded"),g("setPlayer",f),ne.clear(),te=f.currentSrc();var i=me(f.currentType()),l=e.getCurrentVideo(),r=ie(l,f,h,p);r[null==h||null===(n=h.Constants)||void 0===n?void 0:n.PLAYER_NAME]=d||"WEB",r[null==h||null===(t=h.Constants)||void 0===t?void 0:t.ASSET_NAME]=se(l,o),r.authToken=v||"NULL",r.streamType=i,r.D2CType=a||"NONE",r.subscriberType=u?"MVPD":"FREE"!==a?"D2C":"FREE",r["c3.cm.affiliate"]=u||"NULL",he.setData(r),g("contentInfo",r)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),f.on("play",function(){ne.has(f.currentSrc())||(ne.add(f.currentSrc()),g("playbackStarted",null))}),f.on("ended",function(){ne.has(f.currentSrc())&&ne.delete(f.currentSrc()),g("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==ne||ne.clear(),g("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}(),he=(ce={},{setData:function(e){ce=ee(ee({},ce),e)},getData:function(){return ce}}),ye=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-6f0565a1.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-a4b65803.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-e8eb3086.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-fb847fdd.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-99d701a6.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-e33cb58b.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-a9044066.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-336912db.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&Promise.resolve().then(function(){return require("./skin-23bdc8bd.js")}).then(function(t){t.initialiseSkin(e,n)})};function be(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function we(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?be(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):be(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var ke=[],Se=0,Ee=null;function Te(){ve=null,ke=[],Se=0,Ee=null}function De(t,i,o){var l,r,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==i||null===(l=i.watchHistory)||void 0===l||l.apiVersion;var c=null==i||null===(r=i.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(t.currentTime()),p=Math.floor(t.duration());null==i||null===(a=i.watchHistory)||void 0===a||a.xapiKey;var f=(null==i||null===(u=i.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==i||null===(s=i.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(t.currentTime()),h=d?100:Math.floor(v/p*100),y={};m?function(t,i,o){var l=i?"watchhistory-data-".concat(i):"watchhistory-data-guest-".concat(o),r=Ie(l),a=(new Date).getTime(),u=e.getCurrentVideo(),s=(null==u?void 0:u.video)||{},d=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return we(we({},e),{},n({},t,s[t]))},{}),c=r.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ve});c<0?r.push(we(we({content:d},t),{},{addedDate:a,updateDate:a})):r[c]=we(we(we({},r[c]),t),{},{updateDate:a});localStorage.setItem("".concat(l),JSON.stringify(r))}(y={completed:d,watchedTime:g,watchedPercentage:h},c,i.siteOwner):(y=we(we({videoId:ve,watchedTime:g,watchedPercentage:h,doneWatching:d,profileId:c},Ee&&{seriesId:Ee}),f&&{originalObjectId:f}),e.saveWatchHistory(y).then(function(e){}).catch(function(e){})),Se=v+o}function Ie(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Ce(e,n,t){var i=Ie(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return i&&Array.isArray(i)&&(o=i.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),o}var Oe=!1,Pe=function(n,t){var i,o,l=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(i=n[l])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!Oe){var r=je(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(r,t);return a&&e.loadVideo(t,a),Oe=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function je(e,n,t){if(Array.isArray(e))return e.map(function(e){return je(e,n,t)});if(null!==e&&"object"===y(e)){var i={};return Object.keys(e).forEach(function(o){o===n&&void 0!==e[t]?i[o]=e[t]:o===t&&void 0!==e[n]?i[o]=e[n]:i[o]=je(e[o],n,t)}),i}return e}function xe(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Re(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Re(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function Re(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}function Ae(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Le(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ae(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var Ne=function(n,t,i,o){var l,r,a,u,s,d=o.res,c=o.sres,p=m.getPlayer(n),f=(null==d?void 0:d.contentType)||"video",h=(null==d||null===(l=d[f])||void 0===l?void 0:l.drmEnabled)||!1,b=!(null==d||null===(r=d[f])||void 0===r||null===(a=r.streamingInfo)||void 0===a||!a.isLiveStream)||"linearchannel"===f,w=(null==d||null===(u=d[f])||void 0===u||null===(s=u.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;e.setCurrentVideo(d),e.videoReplayTracker.set(d),p&&(p.on("loadstart",function(){b?i.resolve({status:!0,msg:"Video Loaded",response:d}):i.resolve(Le({status:!0,msg:"Player Initialised"},c?{seriesResponse:c,response:d}:{response:d}))}),p.on("loadeddata",function(){var i,o,l,r=v.getCaptions(n);if(null==r||r.map(function(e){return v.disableCaptions(n,e.id)}),w&&"Safari"===g.detectBrowser())try{var a;null==p||null===(a=p.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==p||!p.muted())&&M(n,sessionStorage.getItem("volume")||"100");var u=e.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var s,c,f=Le(Le({},t),d);!function(e,n,t){var i,o,l;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(Ee=null==n||null===(o=n.series)||void 0===o?void 0:o.id),ke=[],Se=0,ve=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=m.getPlayer(e);a&&(a.on("dispose",Te),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());ke.includes(Se)||(e!=Se||e<r?e>Se&&(Se=e+r):(ke.push(e),De(a,n,r)))}}),a.one("ended",function(){De(a,n,r,!0)}))}(n,f,null==u||null===(s=u.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=p&&p.mux){var h,y,b,k,S,E,T=(null===(h=e.getCurrentVideo())||void 0===h?void 0:h.video)||(null==d?void 0:d.video),D=null==T?void 0:T.gist,I={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(b=window)||void 0===b?void 0:b.vl_player_version,video_id:null==D?void 0:D.id,video_title:null==D?void 0:D.title,video_series:null==T||null===(k=T.series)||void 0===k?void 0:k.title,video_stream_type:null!=T&&null!==(S=T.streamingInfo)&&void 0!==S&&S.isLiveStream?"live":"video",viewer_user_id:null==t||null===(E=t.analytics)||void 0===E?void 0:E.userId};p.mux({debug:!1,data:I})}}),p.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];p.trigger("subtitlechanged",n)}),p.on("subtitlechanged",function(e,n){var t,i,o,l,r,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),p.tech_.on("retryplaylist",function(){b&&Pe(d,n)}),p.on("error",function(){var t,o;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&b)?Pe(d,n):(e.handleError(n,(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(o=p.error())||void 0===o?void 0:o.message)||"Some error occured",response:d}))}),p.one("play",function(){var n,i,o,l,r;if(null===(n=window)||void 0===n||null===(i=n.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(l=o.adsConfig)||void 0===l||!l.vodAdClientSideTracking){if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable){var a,u,s,d=null===(a=e.getCurrentVideo())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,c=e.getSeriesWatchMap(),v=(null==c?void 0:c.get(d))||{t:0,p:0},f=v.t,m=v.p;f&&m<95&&setTimeout(function(){p.currentTime(f)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=p&&p.dvrSeekbar)try{p.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),p.on("volumechange",function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),p.on("chromecastDisconnected",function(){if(b){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}}),p.one("loadeddata",function(){var e,n=(null==p||null===(e=p.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),i=(n.language||n.label||"").toUpperCase();return t<i?-1:t>i?1:0}),"object"==y(p.dash)){var t,i,o,l=null==p||null===(t=p.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),r=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=xe(n);try{for(a.s();!(o=a.n()).done;){var u=o.value;if(r&&(null==u?void 0:u.id)=="dash-audio-".concat(r.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,d=xe(n);try{for(d.s();!(s=d.n()).done;){var c,v,f,m=s.value;if(("Chrome"==g.detectBrowser()||"Edge"==g.detectBrowser()&&(null!==(c=navigator)&&void 0!==c&&null!==(v=c.userAgent)&&void 0!==v&&v.includes("Macintosh")||!h))&&null!=m&&null!==(f=m.label)&&void 0!==f&&f.includes("5.1"))p.audioTracks().removeTrack(m);else{if("main"==m.kind){m.enabled=!0;break}m.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function Me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function _e(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Me(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var Be={debug:5,info:4,warn:3,error:2,fatal:1,none:0,off:0,DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1,NONE:0,OFF:0},Ve=function(l,r,a,u){var s,d,c,p,f,h,y,b,w,k,S,E,T,D,I,C,O,P,j,x,R,A,L,N,M,_,B,U,q,F,H,z,G,Y,K,W,$,J,Q=r.res,Z=void 0===Q?null:Q,ee=r.sres,ne=void 0===ee?null:ee,te=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||""),i=t.get("loglevel")||null;return{playerDebug:"true"===t.get("playerdebug"),logLevel:i,dashLogLevel:null!=i&&null!=Be[i]?Be[i]:5}}catch(e){return{playerDebug:!1,logLevel:null,dashLogLevel:5}}}(),ie=te.playerDebug,oe=te.logLevel,le=te.dashLogLevel;ie&&(console.log("[PLAYER DEBUG] config:",a),console.log("[PLAYER DEBUG] entitlement (res):",Z),ne&&console.log("[PLAYER DEBUG] series response (sres):",ne));var re=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],ae=(null===(s=Z)||void 0===s?void 0:s.contentType)||"video",ue=m.impolicy16x9(null===(d=Z)||void 0===d||null===(c=d[ae])||void 0===c||null===(p=c.gist)||void 0===p?void 0:p.videoImageUrl)||m.impolicy16x9(null===(f=Z)||void 0===f||null===(h=f[ae])||void 0===h||null===(y=h.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),se=(null===(w=Z)||void 0===w||null===(k=w[ae])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,de=!(null===(E=Z)||void 0===E||null===(T=E[ae])||void 0===T||null===(D=T.streamingInfo)||void 0===D||!D.isLiveStream)||"linearchannel"===ae,ce=(null===(I=Z)||void 0===I||null===(C=I.ads)||void 0===C||null===(O=C.preRoll)||void 0===O||null===(P=O.adTags)||void 0===P||null===(j=P.web)||void 0===j?void 0:j.active)&&(null===(x=Z)||void 0===x||null===(R=x.ads)||void 0===R||null===(A=R.preRoll)||void 0===A||null===(L=A.adTags)||void 0===L||null===(N=L.web)||void 0===N?void 0:N.url);Z=_e(_e({},Z),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ve=(null==a||null===(M=a.customData)||void 0===M?void 0:M.ads)||{},pe=(null===(_=Z)||void 0===_||null===(B=_[ae])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==ve?void 0:ve.vodAdSticherProvider)||!1,fe=!(null===(U=Z)||void 0===U||null===(q=U[ae])||void 0===q||!q.isSSAIEnabled)&&"TRANSMIT"==(null==ve?void 0:ve.liveAdSticherProvider)&&!(null==ve||!ve.liveAdClientSideTracking),me=(null==a?void 0:a.latency)||6,be=(null==a?void 0:a.skin_settings)||{},we=($={enableSmoothSeeking:!0,controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==a.skin,liveui:se},n($,"autoplay",null==a?void 0:a.autoplay),n($,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!ce),n($,"loop",(null==a?void 0:a.loop)||!1),n($,"audioPosterMode",null==a?void 0:a.audioPosterMode),n($,"html5",_e(_e({dash:_e(_e({},!o.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:_e(_e({},((null==a?void 0:a.debugConfig)&&(null==a||null===(F=a.debugConfig)||void 0===F?void 0:F.enable)||ie)&&{debug:{logLevel:le}}),{},{streaming:{delay:{liveDelay:me},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:_e({},"IE"==g.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:_e(_e(_e(_e({},(null==a?void 0:a.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==a?void 0:a.initialBandwidth)/1e3}}),(null==a?void 0:a.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==a?void 0:a.maxBitrate)/1e3}}),(null==a?void 0:a.minBitrate)&&{minBitrate:{audio:-1,video:(null==a?void 0:a.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}})}),vhs:_e(_e(_e({},(null==a?void 0:a.initialBandwidth)&&{bandwidth:a.initialBandwidth}),{},{liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==a||!a.initialBandwidth},(null==a||null===(H=a.customData)||void 0===H?void 0:H.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(z=null==a?void 0:a.enableLowInitialPlaylist)&&void 0!==z&&z},((null==a?void 0:a.debugConfig)&&(null==a||null===(G=a.debugConfig)||void 0===G?void 0:G.enable)||ie)&&{debug:!0}),debug:(null==a?void 0:a.debugConfig)&&(null==a||null===(Y=a.debugConfig)||void 0===Y?void 0:Y.enable)||ie||!1,nativeTextTracks:"Safari"==g.detectBrowser()},0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),n($,"poster",ue),n($,"techOrder",re),n($,"chromecast",{requestCustomDataFn:function(n){var t,i,o=m.getPlayer(l),r=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),u=function(e,n,t){var i,o,l,r,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,h,y,b,w,k,S;f.isDrmEnabled=!0;var E=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,T=(null==E?void 0:E.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);f.licenseUrl=T;var D=(null==E?void 0:E.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=D}var I=(null==e||null===(i=e[p])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=I;var C=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=C;var O=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=O;var P=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=P,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(Z,n,r);return _e(_e({},u),{},{transmitTrackingUrl:e.trackingUrlManager.get()||null,convivaMetaData:_e({customerKey:(null==a||null===(t=a.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==a||null===(i=a.convivaConfig)||void 0===i?void 0:i.debug)||!1},he.getData())})},modifyLoadRequestFn:function(e){var n,t,i,o,r,a=m.getPlayer(l),u=(null==a?void 0:a.currentSource())||{};!(null===(n=Z)||void 0===n||null===(t=n[ae])||void 0===t||null===(i=t.streamingInfo)||void 0===i||null===(o=i.videoAssets)||void 0===o?void 0:o.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(r=u.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),$);if(!o.getPlayers()[l]){(null!=a&&a.debugConfig&&null!=a&&null!==(J=a.debugConfig)&&void 0!==J&&J.enable||ie)&&o.log.level(oe||"debug");var ke=o(l,we,function(){var n=t(i.mark(function n(){var t,r,s,d,c,p,f,m,g,h,y,b,w,k,S,E,T,D,I,C,O,P;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ke),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,X(a,Z);case 5:if(null!=a&&a.debugConfig&&null!=a&&null!==(t=a.debugConfig)&&void 0!==t&&t.enable||ie){try{o.log.level(oe||"debug")}catch(e){}(w=function(){try{var e,n,t;null==ke||null===(e=ke.dash)||void 0===e||null===(n=e.mediaPlayer)||void 0===n||null===(t=n.updateSettings)||void 0===t||t.call(n,{debug:{logLevel:le}})}catch(e){}})(),ke.one("loadedmetadata",w)}if(k=null===(r=Z)||void 0===r||null===(s=r[ae])||void 0===s||null===(d=s.liveDetails)||void 0===d?void 0:d.startOverTime,de&&u.resolve(_e({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:Z}:{response:Z})),e.inititateBeacon(l,{analyticsCb:null==a?void 0:a.analyticsCb,analyticsEventParams:null==a?void 0:a.analyticsEventParams,userId:null==a?void 0:a.userId}),ge(l,a),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),se&&V(l,k),!ce||null!=a&&null!==(c=a.customData)&&void 0!==c&&c.disableAds||e.initialiseAdvertisement(l,ce,Z),S=e.getSource(Z,l),console.log(S),ie&&(console.log("[PLAYER DEBUG] source:",S),console.log("[PLAYER DEBUG] videojs options:",we)),null!=a&&a.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,a.nearestClusterUrl)),!pe){n.next=23;break}return n.next=20,e.getSGAIEnabledSource(l,Z);case 20:S=n.sent,n.next=27;break;case 23:if(!fe){n.next=27;break}return n.next=26,e.getTransmitEnabledSource(S,Z,l);case 26:S=n.sent;case 27:S?e.loadVideo(l,S):(u.reject({status:!1,msg:"Incompatible / Missing Source",response:Z}),e.handleError(l,"Incompatible / Missing Source")),((null===(p=Z)||void 0===p||null===(f=p[ae])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=Z)||void 0===h||null===(y=h[ae])||void 0===y||null===(b=y.closedCaptions)||void 0===b?void 0:b.length)>0)&&(P=(null===(T=Z)||void 0===T||null===(D=T[ae])||void 0===D||null===(I=D.contentDetails)||void 0===I?void 0:I.closedCaptions)||(null===(C=Z)||void 0===C||null===(O=C[ae])||void 0===O?void 0:O.closedCaptions),E=P.filter(function(e){return"VTT"===e.format}),v.addCaptions(l,E)),null!=a&&a.disableControls?e.disableControls(l):ye(l,_e(_e(_e({},a),we),{},{liveVideo:de,isDvrEnabled:se,res:Z,sres:ne})),Ne(l,_e(_e(_e({},a),we),{},{liveVideo:de}),u,{res:Z,sres:ne});case 31:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function Ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function qe(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ue(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var Fe,He=function(e,n){var t=n.resolve,i=n.reject,o=null==e?void 0:e.playerId,l=ze(e);Ve(o,{res:l},e,{resolve:t,reject:i})},ze=function(n){var t,i,o,l,r,a,u,s,d,c,v,p,f,m=null==n?void 0:n.streamingInfo,g=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,h=(null==n||null===(i=n.streamingInfo)||void 0===i?void 0:i.isDrmEnabled)||null,y=(null==n||null===(o=n.streamingInfo)||void 0===o||null===(l=o.ads)||void 0===l?void 0:l.url)||null,w=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,E=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],T=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,D=null==n?void 0:n.token,I=e.getDecodedToken(D);null==I||I.site;var C=null==I?void 0:I.siteId,O=(null==n||null===(p=n.customData)||void 0===p||null===(f=p.comscore)||void 0===f?void 0:f.video)||null,P=qe(qe({id:"".concat(C,"_external")},!h&&{directPlaybackUrl:null==g?void 0:g.url}),{},{video:qe(qe(qe(qe(qe({drmEnabled:h,streamingInfo:qe(qe({videoAssets:qe(qe({},S&&{drmProvider:S}),{},{widevine:null==g?void 0:g.widevine,fairPlay:null==g?void 0:g.fairPlay,playReady:null==g?void 0:g.playReady})},(null==m?void 0:m.isDvrEnabled)&&{isLiveStream:!0}),(null==O?void 0:O.isLiveStream)&&{isLiveStream:null==O?void 0:O.isLiveStream})},T&&{isSSAIEnabled:T}),{},{metadata:E,liveDetails:{isDvrEnabled:null==m?void 0:m.isDvrEnabled},gist:qe(qe(qe({},w&&{videoImageUrl:w}),(null==O?void 0:O.videoId)&&{id:null==O?void 0:O.videoId}),(null==O?void 0:O.videoTitle)&&{title:null==O?void 0:O.videoTitle}),contentDetails:qe({},(null==k?void 0:k.length)>0&&{closedCaptions:b(k)})},(null==O?void 0:O.runtime)&&{runtime:null==O?void 0:O.runtime}),(null==O?void 0:O.publishDate)&&{publishDate:null==O?void 0:O.publishDate}),(null==O?void 0:O.platform)&&{platform:null==O?void 0:O.platform}),(null==O?void 0:O.series)&&{series:null==O?void 0:O.series}),ads:{preRoll:{adTags:{web:qe(qe({},y&&{active:!0}),y&&{url:y})}}}});return O&&(null!=O&&O.isDvrEnabled&&(P.video.liveDetails=qe(qe({},P.video.liveDetails),{},{isDvrEnabled:null==O?void 0:O.isDvrEnabled})),null!=O&&O.metadata&&(P.video.metadata=[].concat(b(P.video.metadata),b(null==O?void 0:O.metadata)))),P},Ge=null,Ye=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),i=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),o=i>0&&t>4?i:0,l=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),i=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(i-=1),i<0&&(t-=1),t}(new Date,new Date(n));return[l>0&&o>0?l:0,o,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},Ke=function(e){var n,t=w(e,8),i=t[0],o=t[1],l=t[2],r=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=i>=1?" ".concat(i," Year"):o>=1?" ".concat(o," month"):l>=1?" ".concat(l," week"):r>=1?" ".concat(r," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n)},We=(Fe={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return Fe},set:function(e){Fe={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function $e(e,n,t,i){if(e){var o=function(){var e,o,r=null===(e=We.get())||void 0===e?void 0:e.scheduleStartTimeMs,a=null===(o=We.get())||void 0===o?void 0:o.scheduleEndTimeMs,u=Date.now();if(u-a>0){var s=document.getElementsByClassName("error-message")[0];return s&&(s.textContent=h.getLocalisation("eventEnded")||"Game has ended",i.textContent=""),clearInterval(l),void(null==t||t())}var d=r-u;if(d/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,i]),void(null==t||t());var c=Ye(d,r);null==n||n([].concat(b(c),[i]))};o();var l=setInterval(o,1e3);return l}}var Je=function(e,n,t){var i,o,l,r,a,u,s,d,c=null==n||null===(i=n.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(r=l.data)||void 0===r?void 0:r.errorMessage)||(null==n?void 0:n.message)||null;We.set({startDateTime:null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,endDateTime:null==n||null===(s=n.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.scheduleEndDate}),function(e,n,t,i){var o,l,r=Date.now(),a=null===(o=We.get())||void 0===o?void 0:o.scheduleStartTimeMs,u=null===(l=We.get())||void 0===l?void 0:l.scheduleEndTimeMs,s=function(e,n,t,i){var o;e<0?o=h.getLocalisation("eventNotStarted")||i||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(o=h.getLocalisation("eventEnded")||i||"Game has ended");return o||i}(r-a,r-u,n,t);if(document.getElementsByClassName("error-container")[0]){var d=document.getElementsByClassName("error-message")[0];d&&(d.textContent="".concat(s));var c=document.getElementsByClassName("error-timer-message")[0];c&&$e(Math.abs(a),Ke,i,c)}else{var v=document.getElementById(e).parentElement;if(v){var p=document.createElement("div");p.className="error-container";var f=document.createElement("div");f.className="error-message";var m=document.createElement("div");m.className="error-timer-message",f.textContent="".concat(s),p.appendChild(f),p.appendChild(m),v.append(p),$e(Math.abs(a),Ke,i,m)}}}(e,c,v,t)};function Xe(n,t){var i=t.scheduleEndDate,o=t.scheduleStartDate;We.set({startDateTime:o,endDateTime:i}),Ge&&clearInterval(Ge),Ge=setInterval(function(){var t,i=Date.now(),o=null===(t=We.get())||void 0===t?void 0:t.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",o),o&&i>o){var l;console.log("Game ended");var r=m.getPlayer(n);if(e.isPlayerInitialised(n)&&r){var a;r.dispose(),console.log("Player disposed");var u=null===(a=document.getElementsByClassName("vl-container"))||void 0===a?void 0:a[0],s=document.createElement("video");s.id=n,s.className="video-js",s.style.width="100%",s.style.height="100%",u&&u.appendChild(s)}var d=h.getLocalisation("eventEnded")||"Game has ended",c=null===(l=document.getElementsByClassName("error-container"))||void 0===l?void 0:l[0];if(c){var v=c.querySelector(".error-message");v&&(v.textContent=d)}else{var p=document.getElementById(n),f=null==p?void 0:p.parentElement;if(f){(c=document.createElement("div")).className="error-container";var g=document.createElement("div");g.className="error-message",g.textContent=d,c.appendChild(g),f.append(c)}}clearInterval(Ge)}},1e3)}function Qe(e,n){return Ze.apply(this,arguments)}function Ze(){return(Ze=t(i.mark(function n(t,o){var l,r,a,u,s,d,c,v,p;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.resolve,u=o.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,c=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:v=n.sent,p=!1===(null==t||null===(l=t.customData)||void 0===l||null===(r=l.ads)||void 0===r?void 0:r.isSSAIEnabled),e.getVideoDetails(s,v,p).then(function(n){var i,o,l,r,p,f,m,g,h,y;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(o=i.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(null==n?void 0:n.data);var b=null==n||null===(r=n.data)||void 0===r||null===(p=r.video)||void 0===p||null===(f=p.gist)||void 0===f?void 0:f.scheduleEndDate,w=null==n||null===(m=n.data)||void 0===m||null===(g=m.video)||void 0===g||null===(h=g.gist)||void 0===h?void 0:h.scheduleStartDate;Xe(d,{scheduleEndDate:b,scheduleStartDate:w});var k,S=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(y=t.watchHistory)&&void 0!==y&&y.enable&&!c)if((null===(k=t.watchHistory)||void 0===k?void 0:k.saveOffline)||!1){var E,T,D,I=Ce((null===(E=t.watchHistory)||void 0===E?void 0:E.profileId)||"",s,null==t?void 0:t.siteOwner);if(I&&I.length)t.watchHistoryResumeTime=(null===(T=I[0])||void 0===T?void 0:T.watchedTime)||null,t.watchedPercentage=(null===(D=I[0])||void 0===D?void 0:D.watchedPercentage)||null;S.contentType="video",Ve(d,{res:S},t,{resolve:a,reject:u})}else e.getVideoInfo(s,v).then(function(e){var n,i,o,l,r,a;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(o=window)||void 0===o||null===(l=o.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,S.contentType="video"}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}).finally(function(){Ve(d,{res:S},t,{resolve:a,reject:u})});else Ve(d,{res:S},t,{resolve:a,reject:u})}).catch(function(n){var i,o,l=(null==t||null===(i=t.event)||void 0===i?void 0:i.showScheduleTimer)||!1,r=(null==t||null===(o=t.event)||void 0===o?void 0:o.onCountdownComplete)||null;l&&Je(d,n,r),e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function en(e,n){return nn.apply(this,arguments)}function nn(){return(nn=t(i.mark(function n(t,o){var l,r,a,u,s,d,c,v;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.resolve,u=o.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(l=t.customData)||void 0===l||null===(r=l.ads)||void 0===r?void 0:r.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Ve(d,{res:n},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,videoId)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function tn(e,n){return on.apply(this,arguments)}function on(){return(on=t(i.mark(function n(t,o){var l,r,a,u,s,d,c;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=o.resolve,a=o.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(d)),c=null==t||null===(l=t.series)||void 0===l?void 0:l.id,e.getSeriesDetails(c,u).then(function(n){var i,o,l,d=n.data,v=n.data.seasons;e.setCurrentSeries(v);var p=videoId||(null==v||null===(i=v[0])||void 0===i||null===(o=i.episodes)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.id);e.createSeriesWatchMap(c,u),e.getVideoDetails(p,u).then(function(n){var i,o,l;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(o=i.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(n.data),Ve(s,{res:null==n?void 0:n.data,sres:d},t,{resolve:r,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}var ln,rn=function(n){var t=n.site,i=n.sseBaseUrl,o=n.sseEndpoint,l=n.debug,r=void 0!==l&&l;return k.createSSETransport({site:t,sseBaseUrl:i,getToken:e.getToken,sseEndpoint:o,onOpen:function(e){var n=e.userId,t=e.endpoint;r&&console.log("SSE Connected:",n,t)},onMessage:function(n){var t,i,o,l,a,u,s,d,c,v;if(r&&console.log("SSE Message:",n),(null===(t=e.getCurrentVideo())||void 0===t||null===(i=t.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id)===(null==n||null===(l=n.payload)||void 0===l?void 0:l.id)&&"GAME_STATE_CHANGE"===(null==n?void 0:n.notificationType)){var p=1e3*(null==n||null===(a=n.payload)||void 0===a||null===(u=a.states)||void 0===u||null===(s=u.live)||void 0===s?void 0:s.startDateTime),f=1e3*(null==n||null===(d=n.payload)||void 0===d||null===(c=d.states)||void 0===c||null===(v=c.end)||void 0===v?void 0:v.endDateTime);p&&f&&(console.log("Setting schedule timer",p,f),We.set({startDateTime:p,endDateTime:f}))}},onReconnectAttempt:function(e){r&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;r&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){r&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){r&&console.error("SSE Error:",e,n)},onClose:function(){r&&console.log("SSE Closed")}})},an=function(e){var n=e.enable,t=e.site,i=e.sseBaseUrl,o=e.sseEndpoint,l=e.debug;if(n){var r=rn({site:t,sseBaseUrl:i,sseEndpoint:o,debug:void 0!==l&&l});return r._sseBaseUrl=i,r._site=t,r._sseEndpoint=o,r}};function un(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function sn(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?un(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):un(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:c.onTimeUpdate,getVideoDuration:c.getVideoDuration,onVideoEnded:c.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=t(i.mark(function t(o,l){var r,a,u,s,d,c,v,p,f,g,y,b,w,k,S,E,T,D,I,C,O,P,j,x,R,A,N,M,_,B,V,U;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=3;break}return o({status:!0,msg:"Player already initialised",skipped:!0}),t.abrupt("return");case 3:if(I=(null==n?void 0:n.videoSourceUrl)||!1,C=null==n?void 0:n.asat,O=(null==n||null===(r=n.epg)||void 0===r?void 0:r.enable)||!1,P=null==n?void 0:n.videoId,j=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,x=(null==n?void 0:n.streamingInfo)||!1,window.videoId=P,R=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=18;break}if(sessionStorage.setItem("vlp_token",R),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),R&&!e.isTokenExpired(R)){t.next=17;break}return l({status:!1,msg:"".concat(R?"Token is expired !":"Missing Authorization Token"),response:{token:R}}),t.abrupt("return");case 17:ln=JSON.parse(atob(R.split(".")[1]));case 18:return window.siteName=null===(u=ln)||void 0===u?void 0:u.site,window.siteId=null===(s=ln)||void 0===s?void 0:s.siteId,n.isAnonymousUser=!(null===(d=ln)||void 0===d||!d.anonymousId),n.siteOwner=(null===(c=ln)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=ln)||void 0===v?void 0:v.userId)||null,e.setUserId((null===(p=ln)||void 0===p?void 0:p.userId)||(null===(f=ln)||void 0===f?void 0:f.anonymousId)||null),window.watchHistory=n.watchHistory||null,A=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,N=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(M=null==n?void 0:n.errors)&&(window.customErrors=M),window.customData=null==n?void 0:n.customData,h.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!m.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),e.playerConfigManager.setConfig(n),t.next=37,K(n);case 37:N&&L("https://www.googletagmanager.com/gtag/js?id=".concat(N)).then(function(){return e.runGtag(N)}).catch(function(e){}),(_=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(A)))&&_.addEventListener("contextmenu",function(e){return e.preventDefault()}),(B=an({enable:null==n||null===(k=n.sse)||void 0===k?void 0:k.enable,site:null==n||null===(S=n.sse)||void 0===S?void 0:S.siteName,sseBaseUrl:null==n||null===(E=n.sse)||void 0===E?void 0:E.sseBaseUrl,sseEndpoint:null==n||null===(T=n.sse)||void 0===T?void 0:T.sseEndpoint,debug:null==n||null===(D=n.sse)||void 0===D?void 0:D.debug}))&&!B.isConnectionActive()&&B.connect(),I?(U={directPlaybackUrl:I,id:V="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},C?e.getVideoDetails(V,R).then(function(e){var t=(null==e?void 0:e.data)||{};Ve(A,{res:sn(sn({},t),U)},n,{resolve:o,reject:l})}).catch(function(n){e.initiateErrorHandling(n,A,l,V)}):Ve(A,{res:U},n,{resolve:o,reject:l})):x?He(n,{resolve:o,reject:l}):j?tn(n,{resolve:o,reject:l}):O?en(n,{resolve:o,reject:l}):Qe(n,{resolve:o,reject:l});case 43:case"end":return t.stop()}},t)}));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:p.getRenditions,skip:e.skip,getPlayer:m.getPlayer,play:e.play,pause:e.pause,detectBrowser:g.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:c.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:v.enableCaptions,disableCaptions:v.disableCaptions,getCaptions:v.getCaptions,playSelectedResolution:f.playSelectedResolution,getSource:e.getSource,setVolume:M,getVolume:_,disableControls:e.disableControls,setPlaybackSpeed:c.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,getSsaiEvents:e.getSsaiEvents,playerEvents:c.playerEvents,onReplay:c.onReplay}};
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-b0efda72.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/regenerator"),o=require("video.js"),l=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/get"),u=require("@babel/runtime/helpers/inherits"),s=require("@babel/runtime/helpers/possibleConstructorReturn"),d=require("@babel/runtime/helpers/getPrototypeOf"),c=require("./index-8c9f1a67.js"),v=require("./captions-80f6eb66.js"),p=require("./renditions-d28715a3.js"),f=require("./resolution-948774b8.js"),m=require("./skin-c97f0eea.js"),g=require("./browser-77c57718.js"),y=require("./localisation-56e0a999.js"),h=require("@babel/runtime/helpers/typeof");require("@viewlift/comscore/index.js");var b=require("@babel/runtime/helpers/toConsumableArray"),w=require("@viewlift/sse");function k(e,n,t,i){var o=a(d(1&i?e.prototype:e),n,t);return 2&i&&"function"==typeof o?function(e){return o.apply(t,e)}:o}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}require("axios"),require("md5"),require("js-cookie"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/assertThisInitialized");var E=o.getComponent("TextTrackSettings"),I=o.dom,T=[{value:"12",label:"12px"},{value:"14",label:"14px"},{value:"16",label:"16px"},{value:"18",label:"18px"},{value:"20",label:"20px"},{value:"24",label:"24px"},{value:"28",label:"28px"},{value:"32",label:"32px"}],O=T.map(function(e){return e.value}),P="16",j="vlp-caption-font-size-px",D="vlp-caption-font-size-style",C=".vjs-font-percent > select",x=function(e){return-1!==O.indexOf(e)?e:P},R=null;E?(R=function(){u(i,E);var e,n,t=(e=i,n=S(),function(){var t,i=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments);return s(this,t)});function i(e,n){var o;return l(this,i),(o=t.call(this,e,n)).customUiReady_=!0,o.applyCustomFontSizeUI_(),o}return r(i,[{key:"applyCustomFontSizeUI_",value:function(){this.replaceFontSizeOptions_(),this.bindFontSizeChange_(),this.restoreCustomFontSize_()}},{key:"replaceFontSizeOptions_",value:function(){var e=this.$(C);if(e){for(;e.firstChild;)e.removeChild(e.firstChild);T.forEach(function(n){e.appendChild(I.createEl("option",{value:n.value,textContent:n.label}))}),e.value=P}}},{key:"bindFontSizeChange_",value:function(){var e=this,n=this.$(C);n&&this.on(n,"change",function(){return e.applyFontSize_(n.value)})}},{key:"applyFontSize_",value:function(e){var n=x(e);if("undefined"!=typeof document){var t=document.getElementById(D);t||((t=document.createElement("style")).id=D,document.head.appendChild(t)),t.textContent=[".vjs-text-track-cue,",".vjs-text-track-cue > div,",".vjs-text-track-display-ttml,",".vjs-text-track-display-ttml span,",".vjs-text-track-display-ttml div","{ font-size: ".concat(n,"px !important; line-height: normal !important; }")].join(" ")}}},{key:"restoreCustomFontSize_",value:function(){var e=null;try{e=window.localStorage.getItem(j)}catch(e){}var n=x(e),t=this.$(C);t&&(t.value=n),this.applyFontSize_(n)}},{key:"getValues",value:function(){var e=k(i,"getValues",this,3)([]);return e&&delete e.fontPercent,e||{}}},{key:"setDefaults",value:function(){if(k(i,"setDefaults",this,3)([]),this.customUiReady_){var e=this.$(C);e&&(e.value=P),this.applyFontSize_(P)}}},{key:"saveSettings",value:function(){if(k(i,"saveSettings",this,3)([]),this.options_&&this.options_.persistTextTrackSettings){var e=this.$(C);if(e)try{window.localStorage.setItem(j,x(e.value))}catch(e){}}}},{key:"handleLanguagechange",value:function(){k(i,"handleLanguagechange",this,3)([]),this.applyCustomFontSizeUI_()}}]),i}(),o.registerComponent("TextTrackSettings",R)):console.warn("[vlp] CustomTextTrackSettings: video.js TextTrackSettings is not registered; skipping override.");var A=function(e){return new Promise(function(n,t){if(L(e))t("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}})},L=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},_=function(e,n,t){var i=m.getPlayer(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var o=parseFloat(n)/100;i.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},N=function(e){var n=m.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},V=function(){var e=t(i.mark(function e(n){var t,l,r,a,u;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=m.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,A("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(o),e.finish(13);case 16:(u=o.getTech("chromecast"))&&!u.prototype.seeking&&(u.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==g.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),B=function(e,n){var t=m.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,i,l,r,a,u=this.el(),s=o.dom.getPointerPosition(u,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(l=i.framework)||void 0===l||null===(r=l.CastContext)||void 0===r||null===(a=r.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}})};var U=function(){var e=t(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),A("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),M=function(){var n=t(i.mark(function n(){return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.comscoreInstanceManager.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),q=function(){var e=t(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),H=function(){var e=t(i.mark(function e(){var n;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(o),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),F=function(){var e=t(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-84cce26a.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),z=function(){var e=t(i.mark(function e(){return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-072614bc.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),G=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){A("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(o)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(o)})},loadAdsLibrary:U,loadEMELibrary:q,loadMuxPlugin:H,loadDvrSeekbar:F,loadContribDash:z,loadComscorePlugin:M});function K(e){return W.apply(this,arguments)}function W(){return(W=t(i.mark(function e(n){var t;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,U();case 3:t&&"Safari"==g.detectBrowser()&&Promise.resolve().then(function(){return G}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Y(e){return $.apply(this,arguments)}function $(){return($=t(i.mark(function e(n){var t,o,l,r,a,u,s,d,c,v;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=m.getPlayer(n.playerId),e.next=3,M();case 3:v.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.endpoint,applicationName:(null==n||null===(l=n.comscore)||void 0===l?void 0:l.applicationName)||(null===(r=window)||void 0===r?void 0:r.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(s=n.comscore)||void 0===s?void 0:s.debug)||!1,persistentLabels:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.persistentLabels)||{},metadata:(null==n||null===(c=n.comscore)||void 0===c?void 0:c.metadata)||{}});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function J(e,n){return X.apply(this,arguments)}function X(){return(X=t(i.mark(function e(n,t){var o,l,r,a,u,s,d,c,v,p,f,m,y,h;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return v=(null==t?void 0:t.contentType)||"video",p=null==t||null===(o=t[v])||void 0===o?void 0:o.drmEnabled,null==t||null===(l=t[v])||void 0===l||null===(r=l.liveDetails)||void 0===r||r.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==t||null===(a=t[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==n||null===(d=n.comscore)||void 0===d?void 0:d.enable)||!1,y=!(null==n||null===(c=n.analytics)||void 0===c||!c.muxKey),e.prev=7,e.next=10,Promise.allSettled([p?"Safari"==g.detectBrowser()?q():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?z():q():"Safari"!=g.detectBrowser()&&f?z():null,m?Y(n):null,y?H():null,V(n)]);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),console.log("Error",e.t0);case 15:case"end":return e.stop()}},e,null,[[7,12]])}))).apply(this,arguments)}function Q(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Z(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Q(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var ee=new Set,ne=null,te=function(n,t,i,o){var l,r,a,u,s,d,c,v={},p=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(l=n[p])||void 0===l?void 0:l.id)||"Null",v["c3.cm.contentType"]=se(n),v[null==i||null===(r=i.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==n||!n.linearchannel),v[null==i||null===(a=i.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),v[null==i||null===(u=i.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),v["c3.cm.categoryType"]=re(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=n[p])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(d=n[p])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[i.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=ae(n),v["c3.cm.genreList"]=oe(n),v["c3.cm.genre"]=ie(n),v["c3.cm.channel"]=le(n,o);var f=ve(e.getCurrentSeries(),n);return v=Z(Z({},v),f)},ie=function(e){var n,t,i,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(i=t.primaryCategory)||void 0===i?void 0:i.title)||"Null"},oe=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},le=function(e,n){var t,i,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null===(i=((null==e||null===(t=e[o])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===i?void 0:i.title)||"NULL"},re=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},ae=function(e){var n,t,i=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[i])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},ue=function(e,n){var t,i,o=(n||{}).epg;if(o&&null!=o&&o.enable&&null!=o&&o.programTitle)return o.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(i=t.gist)||void 0===i?void 0:i.title)||"Null";return"".concat(r)},se=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var de,ce,ve=function(n,t){var i,o,l,r,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(i=t.video)||void 0===i||null===(o=i.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(l=n[s-1])||void 0===l||null===(r=l.episodes)||void 0===r||null===(a=r[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},pe=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},fe=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},me=function(){var n=t(i.mark(function n(t,o){var l,r,a,u,s,d,c,v,p,f,g,y;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=(null==o?void 0:o.convivaConfig)||{},r=l.trackConvivaPlayerEvent,a=l.paymentHandler,u=l.tveProvider,s=l.enable,d=l.appName,v=(c=o||{}).token,p=c.epg,s){n.next=4;break}return n.abrupt("return");case 4:if(f=m.getPlayer(t),"function"==typeof(g=r)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,g("getConvivaObject");case 10:if(y=n.sent){n.next=13;break}return n.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var i=pe(t.keySystem);g("contentInfo",{DRMEnabled:i})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var n,t;ne&&ne!==f.currentSrc()&&g("playbackEnded"),g("setPlayer",f),ee.clear(),ne=f.currentSrc();var i=fe(f.currentType()),l=e.getCurrentVideo(),r=te(l,f,y,p);r[null==y||null===(n=y.Constants)||void 0===n?void 0:n.PLAYER_NAME]=d||"WEB",r[null==y||null===(t=y.Constants)||void 0===t?void 0:t.ASSET_NAME]=ue(l,o),r.authToken=v||"NULL",r.streamType=i,r.D2CType=a||"NONE",r.subscriberType=u?"MVPD":"FREE"!==a?"D2C":"FREE",r["c3.cm.affiliate"]=u||"NULL",ge.setData(r),g("contentInfo",r)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),f.on("play",function(){ee.has(f.currentSrc())||(ee.add(f.currentSrc()),g("playbackStarted",null))}),f.on("ended",function(){ee.has(f.currentSrc())&&ee.delete(f.currentSrc()),g("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==ee||ee.clear(),g("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}(),ge=(de={},{setData:function(e){de=Z(Z({},de),e)},getData:function(){return de}}),ye=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-a193390e.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-a54370b0.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-90c61d0a.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-a7446a3b.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-b151359d.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-667cd458.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-3dd98a5f.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-24348af6.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&Promise.resolve().then(function(){return require("./skin-cfd6c675.js")}).then(function(t){t.initialiseSkin(e,n)})};function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function be(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?he(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):he(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var we=[],ke=0,Se=null;function Ee(){ce=null,we=[],ke=0,Se=null}function Ie(t,i,o){var l,r,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==i||null===(l=i.watchHistory)||void 0===l||l.apiVersion;var c=null==i||null===(r=i.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(t.currentTime()),p=Math.floor(t.duration());null==i||null===(a=i.watchHistory)||void 0===a||a.xapiKey;var f=(null==i||null===(u=i.video)||void 0===u?void 0:u.originalObjectId)||null,m=(null==i||null===(s=i.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(t.currentTime()),y=d?100:Math.floor(v/p*100),h={};m?function(t,i,o){var l=i?"watchhistory-data-".concat(i):"watchhistory-data-guest-".concat(o),r=Te(l),a=(new Date).getTime(),u=e.getCurrentVideo(),s=(null==u?void 0:u.video)||{},d=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return be(be({},e),{},n({},t,s[t]))},{}),c=r.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ce});c<0?r.push(be(be({content:d},t),{},{addedDate:a,updateDate:a})):r[c]=be(be(be({},r[c]),t),{},{updateDate:a});localStorage.setItem("".concat(l),JSON.stringify(r))}(h={completed:d,watchedTime:g,watchedPercentage:y},c,i.siteOwner):(h=be(be({videoId:ce,watchedTime:g,watchedPercentage:y,doneWatching:d,profileId:c},Se&&{seriesId:Se}),f&&{originalObjectId:f}),e.saveWatchHistory(h).then(function(e){}).catch(function(e){})),ke=v+o}function Te(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Oe(e,n,t){var i=Te(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return i&&Array.isArray(i)&&(o=i.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),o}var Pe=!1,je=function(n,t){var i,o,l=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(i=n[l])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!Pe){var r=De(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(r,t);return a&&e.loadVideo(t,a),Pe=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function De(e,n,t){if(Array.isArray(e))return e.map(function(e){return De(e,n,t)});if(null!==e&&"object"===h(e)){var i={};return Object.keys(e).forEach(function(o){o===n&&void 0!==e[t]?i[o]=e[t]:o===t&&void 0!==e[n]?i[o]=e[n]:i[o]=De(e[o],n,t)}),i}return e}function Ce(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return xe(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xe(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function xe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}function Re(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Ae(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Re(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var Le=function(n,t,i,o){var l,r,a,u,s,d=o.res,c=o.sres,p=m.getPlayer(n),f=(null==d?void 0:d.contentType)||"video",y=(null==d||null===(l=d[f])||void 0===l?void 0:l.drmEnabled)||!1,b=!(null==d||null===(r=d[f])||void 0===r||null===(a=r.streamingInfo)||void 0===a||!a.isLiveStream)||"linearchannel"===f,w=(null==d||null===(u=d[f])||void 0===u||null===(s=u.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1;e.setCurrentVideo(d),e.videoReplayTracker.set(d),p&&(p.on("loadstart",function(){b?i.resolve({status:!0,msg:"Video Loaded",response:d}):i.resolve(Ae({status:!0,msg:"Player Initialised"},c?{seriesResponse:c,response:d}:{response:d}))}),p.on("loadeddata",function(){var i,o,l,r=v.getCaptions(n);if(null==r||r.map(function(e){return v.disableCaptions(n,e.id)}),w&&"Safari"===g.detectBrowser())try{var a;null==p||null===(a=p.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==p||!p.muted())&&_(n,sessionStorage.getItem("volume")||"100");var u=e.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var s,c,f=Ae(Ae({},t),d);!function(e,n,t){var i,o,l;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(Se=null==n||null===(o=n.series)||void 0===o?void 0:o.id),we=[],ke=0,ce=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=m.getPlayer(e);a&&(a.on("dispose",Ee),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());we.includes(ke)||(e!=ke||e<r?e>ke&&(ke=e+r):(we.push(e),Ie(a,n,r)))}}),a.one("ended",function(){Ie(a,n,r,!0)}))}(n,f,null==u||null===(s=u.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=p&&p.mux){var y,h,b,k,S,E,I=(null===(y=e.getCurrentVideo())||void 0===y?void 0:y.video)||(null==d?void 0:d.video),T=null==I?void 0:I.gist,O={env_key:null==t||null===(h=t.analytics)||void 0===h?void 0:h.muxKey,player_name:"vl-web-player",player_version:null===(b=window)||void 0===b?void 0:b.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==I||null===(k=I.series)||void 0===k?void 0:k.title,video_stream_type:null!=I&&null!==(S=I.streamingInfo)&&void 0!==S&&S.isLiveStream?"live":"video",viewer_user_id:null==t||null===(E=t.analytics)||void 0===E?void 0:E.userId};p.mux({debug:!1,data:O})}}),p.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];p.trigger("subtitlechanged",n)}),p.on("subtitlechanged",function(e,n){var t,i,o,l,r,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),p.tech_.on("retryplaylist",function(){b&&je(d,n)}),p.on("error",function(){var t,o;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&b)?je(d,n):(e.handleError(n,(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(o=p.error())||void 0===o?void 0:o.message)||"Some error occured",response:d}))}),p.one("play",function(){var n,i,o,l,r;if(null===(n=window)||void 0===n||null===(i=n.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(l=o.adsConfig)||void 0===l||!l.vodAdClientSideTracking){if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable){var a,u,s,d=null===(a=e.getCurrentVideo())||void 0===a||null===(u=a.video)||void 0===u||null===(s=u.gist)||void 0===s?void 0:s.id,c=e.getSeriesWatchMap(),v=(null==c?void 0:c.get(d))||{t:0,p:0},f=v.t,m=v.p;f&&m<95&&setTimeout(function(){p.currentTime(f)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=p&&p.dvrSeekbar)try{p.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),p.on("volumechange",function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),p.on("chromecastDisconnected",function(){if(b){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}}),p.one("loadeddata",function(){var e,n=(null==p||null===(e=p.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),i=(n.language||n.label||"").toUpperCase();return t<i?-1:t>i?1:0}),"object"==h(p.dash)){var t,i,o,l=null==p||null===(t=p.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),r=null==l?void 0:l.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=Ce(n);try{for(a.s();!(o=a.n()).done;){var u=o.value;if(r&&(null==u?void 0:u.id)=="dash-audio-".concat(r.index)){u.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var s,d=Ce(n);try{for(d.s();!(s=d.n()).done;){var c,v,f,m=s.value;if(("Chrome"==g.detectBrowser()||"Edge"==g.detectBrowser()&&(null!==(c=navigator)&&void 0!==c&&null!==(v=c.userAgent)&&void 0!==v&&v.includes("Macintosh")||!y))&&null!=m&&null!==(f=m.label)&&void 0!==f&&f.includes("5.1"))p.audioTracks().removeTrack(m);else{if("main"==m.kind){m.enabled=!0;break}m.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}}))};function _e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Ne(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):_e(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var Ve={debug:5,info:4,warn:3,error:2,fatal:1,none:0,off:0,DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1,NONE:0,OFF:0},Be=function(l,r,a,u){var s,d,c,p,f,y,h,b,w,k,S,E,I,T,O,P,j,D,C,x,R,A,L,_,N,V,U,M,q,H,F,z,G,K,W,Y,$,X,Q=r.res,Z=void 0===Q?null:Q,ee=r.sres,ne=void 0===ee?null:ee,te=function(){try{var e,n,t=new URLSearchParams((null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.search)||""),i=t.get("loglevel")||null;return{playerDebug:"true"===t.get("playerdebug"),logLevel:i,dashLogLevel:null!=i&&null!=Ve[i]?Ve[i]:5}}catch(e){return{playerDebug:!1,logLevel:null,dashLogLevel:5}}}(),ie=te.playerDebug,oe=te.logLevel,le=te.dashLogLevel;ie&&(console.log("[PLAYER DEBUG] config:",a),console.log("[PLAYER DEBUG] entitlement (res):",Z),ne&&console.log("[PLAYER DEBUG] series response (sres):",ne));var re=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],ae=(null===(s=Z)||void 0===s?void 0:s.contentType)||"video",ue=m.impolicy16x9(null===(d=Z)||void 0===d||null===(c=d[ae])||void 0===c||null===(p=c.gist)||void 0===p?void 0:p.videoImageUrl)||m.impolicy16x9(null===(f=Z)||void 0===f||null===(y=f[ae])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),se=(null===(w=Z)||void 0===w||null===(k=w[ae])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,de=!(null===(E=Z)||void 0===E||null===(I=E[ae])||void 0===I||null===(T=I.streamingInfo)||void 0===T||!T.isLiveStream)||"linearchannel"===ae,ce=(null===(O=Z)||void 0===O||null===(P=O.ads)||void 0===P||null===(j=P.preRoll)||void 0===j||null===(D=j.adTags)||void 0===D||null===(C=D.web)||void 0===C?void 0:C.active)&&(null===(x=Z)||void 0===x||null===(R=x.ads)||void 0===R||null===(A=R.preRoll)||void 0===A||null===(L=A.adTags)||void 0===L||null===(_=L.web)||void 0===_?void 0:_.url);Z=Ne(Ne({},Z),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ve=(null==a||null===(N=a.customData)||void 0===N?void 0:N.ads)||{},pe=(null===(V=Z)||void 0===V||null===(U=V[ae])||void 0===U?void 0:U.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==ve?void 0:ve.vodAdSticherProvider)||!1,fe=!(null===(M=Z)||void 0===M||null===(q=M[ae])||void 0===q||!q.isSSAIEnabled)&&"TRANSMIT"==(null==ve?void 0:ve.liveAdSticherProvider)&&!(null==ve||!ve.liveAdClientSideTracking),he=(null==a?void 0:a.latency)||6,be=(null==a?void 0:a.skin_settings)||{},we=($={enableSmoothSeeking:!0,controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==a.skin,liveui:se},n($,"autoplay",null==a?void 0:a.autoplay),n($,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!ce),n($,"loop",(null==a?void 0:a.loop)||!1),n($,"audioPosterMode",null==a?void 0:a.audioPosterMode),n($,"html5",Ne(Ne({dash:Ne(Ne({},!o.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:Ne(Ne({},((null==a?void 0:a.debugConfig)&&(null==a||null===(H=a.debugConfig)||void 0===H?void 0:H.enable)||ie)&&{debug:{logLevel:le}}),{},{streaming:{delay:{liveDelay:he},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Ne({},"IE"==g.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:Ne(Ne(Ne(Ne({},(null==a?void 0:a.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==a?void 0:a.initialBandwidth)/1e3}}),(null==a?void 0:a.maxBitrate)&&{maxBitrate:{audio:-1,video:(null==a?void 0:a.maxBitrate)/1e3}}),(null==a?void 0:a.minBitrate)&&{minBitrate:{audio:-1,video:(null==a?void 0:a.minBitrate)/1e3}}),{},{rules:{throughputRule:{active:!0},bolaRule:{active:!1},insufficientBufferRule:{active:!1},switchHistoryRule:{active:!1},droppedFramesRule:{active:!1},abandonRequestsRule:{active:!1}},autoSwitchBitrate:{video:!0,audio:!0}})}})}),vhs:Ne(Ne(Ne({},(null==a?void 0:a.initialBandwidth)&&{bandwidth:a.initialBandwidth}),{},{liveRangeSafeTimeDelta:he,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==a||!a.initialBandwidth},(null==a||null===(F=a.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(z=null==a?void 0:a.enableLowInitialPlaylist)&&void 0!==z&&z},((null==a?void 0:a.debugConfig)&&(null==a||null===(G=a.debugConfig)||void 0===G?void 0:G.enable)||ie)&&{debug:!0}),debug:(null==a?void 0:a.debugConfig)&&(null==a||null===(K=a.debugConfig)||void 0===K?void 0:K.enable)||ie||!1,nativeTextTracks:"Safari"==g.detectBrowser()},0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(Y=a.customData)||void 0===Y?void 0:Y.nativeVideoTracks)&&{nativeVideoTracks:!1})),n($,"poster",ue),n($,"techOrder",re),n($,"chromecast",{requestCustomDataFn:function(n){var t,i,o=m.getPlayer(l),r=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),u=function(e,n,t){var i,o,l,r,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,h,b,w,k,S;f.isDrmEnabled=!0;var E=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==E?void 0:E.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=I;var T=(null==E?void 0:E.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=T}var O=(null==e||null===(i=e[p])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=O;var P=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=P;var j=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=j;var D=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=D,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(Z,n,r);return Ne(Ne({},u),{},{transmitTrackingUrl:e.trackingUrlManager.get()||null,convivaMetaData:Ne({customerKey:(null==a||null===(t=a.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==a||null===(i=a.convivaConfig)||void 0===i?void 0:i.debug)||!1},ge.getData())})},modifyLoadRequestFn:function(e){var n,t,i,o,r,a=m.getPlayer(l),u=(null==a?void 0:a.currentSource())||{};!(null===(n=Z)||void 0===n||null===(t=n[ae])||void 0===t||null===(i=t.streamingInfo)||void 0===i||null===(o=i.videoAssets)||void 0===o?void 0:o.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(r=u.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),$);if(!o.getPlayers()[l]){(null!=a&&a.debugConfig&&null!=a&&null!==(X=a.debugConfig)&&void 0!==X&&X.enable||ie)&&o.log.level(oe||"debug");var ke=o(l,we,function(){var n=t(i.mark(function n(){var t,r,s,d,c,p,f,m,g,y,h,b,w,k,S,E,I,T,O,P,j,D;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ke),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,J(a,Z);case 5:if(null!=a&&a.debugConfig&&null!=a&&null!==(t=a.debugConfig)&&void 0!==t&&t.enable||ie){try{o.log.level(oe||"debug")}catch(e){}(w=function(){try{var e,n,t;null==ke||null===(e=ke.dash)||void 0===e||null===(n=e.mediaPlayer)||void 0===n||null===(t=n.updateSettings)||void 0===t||t.call(n,{debug:{logLevel:le}})}catch(e){}})(),ke.one("loadedmetadata",w)}if(k=null===(r=Z)||void 0===r||null===(s=r[ae])||void 0===s||null===(d=s.liveDetails)||void 0===d?void 0:d.startOverTime,de&&u.resolve(Ne({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:Z}:{response:Z})),e.inititateBeacon(l,{analyticsCb:null==a?void 0:a.analyticsCb,analyticsEventParams:null==a?void 0:a.analyticsEventParams,userId:null==a?void 0:a.userId}),me(l,a),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),se&&B(l,k),!ce||null!=a&&null!==(c=a.customData)&&void 0!==c&&c.disableAds||e.initialiseAdvertisement(l,ce,Z),S=e.getSource(Z,l),console.log(S),ie&&(console.log("[PLAYER DEBUG] source:",S),console.log("[PLAYER DEBUG] videojs options:",we)),null!=a&&a.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,a.nearestClusterUrl)),!pe){n.next=23;break}return n.next=20,e.getSGAIEnabledSource(l,Z);case 20:S=n.sent,n.next=27;break;case 23:if(!fe){n.next=27;break}return n.next=26,e.getTransmitEnabledSource(S,Z,l);case 26:S=n.sent;case 27:S?e.loadVideo(l,S):(u.reject({status:!1,msg:"Incompatible / Missing Source",response:Z}),e.handleError(l,"Incompatible / Missing Source")),((null===(p=Z)||void 0===p||null===(f=p[ae])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=Z)||void 0===y||null===(h=y[ae])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(D=(null===(I=Z)||void 0===I||null===(T=I[ae])||void 0===T||null===(O=T.contentDetails)||void 0===O?void 0:O.closedCaptions)||(null===(P=Z)||void 0===P||null===(j=P[ae])||void 0===j?void 0:j.closedCaptions),E=D.filter(function(e){return"VTT"===e.format}),v.addCaptions(l,E)),null!=a&&a.disableControls?e.disableControls(l):ye(l,Ne(Ne(Ne({},a),we),{},{liveVideo:de,isDvrEnabled:se,res:Z,sres:ne})),Le(l,Ne(Ne(Ne({},a),we),{},{liveVideo:de}),u,{res:Z,sres:ne});case 31:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function Ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Me(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ue(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}var qe=function(e,n){var t=n.resolve,i=n.reject,o=null==e?void 0:e.playerId,l=He(e);Be(o,{res:l},e,{resolve:t,reject:i})},He=function(n){var t,i,o,l,r,a,u,s,d,c,v,p,f,m=null==n?void 0:n.streamingInfo,g=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,y=(null==n||null===(i=n.streamingInfo)||void 0===i?void 0:i.isDrmEnabled)||null,h=(null==n||null===(o=n.streamingInfo)||void 0===o||null===(l=o.ads)||void 0===l?void 0:l.url)||null,w=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,E=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],I=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,T=null==n?void 0:n.token,O=e.getDecodedToken(T);null==O||O.site;var P=null==O?void 0:O.siteId,j=(null==n||null===(p=n.customData)||void 0===p||null===(f=p.comscore)||void 0===f?void 0:f.video)||null,D=Me(Me({id:"".concat(P,"_external")},!y&&{directPlaybackUrl:null==g?void 0:g.url}),{},{video:Me(Me(Me(Me(Me({drmEnabled:y,streamingInfo:Me(Me({videoAssets:Me(Me({},S&&{drmProvider:S}),{},{widevine:null==g?void 0:g.widevine,fairPlay:null==g?void 0:g.fairPlay,playReady:null==g?void 0:g.playReady})},(null==m?void 0:m.isDvrEnabled)&&{isLiveStream:!0}),(null==j?void 0:j.isLiveStream)&&{isLiveStream:null==j?void 0:j.isLiveStream})},I&&{isSSAIEnabled:I}),{},{metadata:E,liveDetails:{isDvrEnabled:null==m?void 0:m.isDvrEnabled},gist:Me(Me(Me({},w&&{videoImageUrl:w}),(null==j?void 0:j.videoId)&&{id:null==j?void 0:j.videoId}),(null==j?void 0:j.videoTitle)&&{title:null==j?void 0:j.videoTitle}),contentDetails:Me({},(null==k?void 0:k.length)>0&&{closedCaptions:b(k)})},(null==j?void 0:j.runtime)&&{runtime:null==j?void 0:j.runtime}),(null==j?void 0:j.publishDate)&&{publishDate:null==j?void 0:j.publishDate}),(null==j?void 0:j.platform)&&{platform:null==j?void 0:j.platform}),(null==j?void 0:j.series)&&{series:null==j?void 0:j.series}),ads:{preRoll:{adTags:{web:Me(Me({},h&&{active:!0}),h&&{url:h})}}}});return j&&(null!=j&&j.isDvrEnabled&&(D.video.liveDetails=Me(Me({},D.video.liveDetails),{},{isDvrEnabled:null==j?void 0:j.isDvrEnabled})),null!=j&&j.metadata&&(D.video.metadata=[].concat(b(D.video.metadata),b(null==j?void 0:j.metadata)))),D};function Fe(e,n){return ze.apply(this,arguments)}function ze(){return(ze=t(i.mark(function n(t,o){var l,r,a,u,s,d,v,p,f;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.resolve,u=o.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,v=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:p=n.sent,f=!1===(null==t||null===(l=t.customData)||void 0===l||null===(r=l.ads)||void 0===r?void 0:r.isSSAIEnabled),e.getVideoDetails(s,p,f).then(function(n){var i,o,l,r,f,m,g,y,h,b;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(o=i.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(null==n?void 0:n.data);var w=null==n||null===(r=n.data)||void 0===r||null===(f=r.video)||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.scheduleEndDate,k=null==n||null===(g=n.data)||void 0===g||null===(y=g.video)||void 0===y||null===(h=y.gist)||void 0===h?void 0:h.scheduleStartDate;c.handlePlayerMessage(d,{scheduleEndDate:w,scheduleStartDate:k});var S,E=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(b=t.watchHistory)&&void 0!==b&&b.enable&&!v)if((null===(S=t.watchHistory)||void 0===S?void 0:S.saveOffline)||!1){var I,T,O,P=Oe((null===(I=t.watchHistory)||void 0===I?void 0:I.profileId)||"",s,null==t?void 0:t.siteOwner);if(P&&P.length)t.watchHistoryResumeTime=(null===(T=P[0])||void 0===T?void 0:T.watchedTime)||null,t.watchedPercentage=(null===(O=P[0])||void 0===O?void 0:O.watchedPercentage)||null;E.contentType="video",Be(d,{res:E},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then(function(e){var n,i,o,l,r,a;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(o=window)||void 0===o||null===(l=o.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,E.contentType="video"}).catch(function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}).finally(function(){Be(d,{res:E},t,{resolve:a,reject:u})});else Be(d,{res:E},t,{resolve:a,reject:u})}).catch(function(n){var i,o,l=(null==t||null===(i=t.event)||void 0===i?void 0:i.showScheduleTimer)||!1,r=(null==t||null===(o=t.event)||void 0===o?void 0:o.onCountdownComplete)||null;l&&c.handleCountdownTimer(d,n,r),e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ge(e,n){return Ke.apply(this,arguments)}function Ke(){return(Ke=t(i.mark(function n(t,o){var l,r,a,u,s,d,c,v;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.resolve,u=o.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(l=t.customData)||void 0===l||null===(r=l.ads)||void 0===r?void 0:r.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Be(d,{res:n},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,videoId)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function We(e,n){return Ye.apply(this,arguments)}function Ye(){return(Ye=t(i.mark(function n(t,o){var l,r,a,u,s,d,c;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=o.resolve,a=o.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(d)),c=null==t||null===(l=t.series)||void 0===l?void 0:l.id,e.getSeriesDetails(c,u).then(function(n){var i,o,l,d=n.data,v=n.data.seasons;e.setCurrentSeries(v);var p=videoId||(null==v||null===(i=v[0])||void 0===i||null===(o=i.episodes)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.id);e.createSeriesWatchMap(c,u),e.getVideoDetails(p,u).then(function(n){var i,o,l;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(o=i.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(n.data),Be(s,{res:null==n?void 0:n.data,sres:d},t,{resolve:r,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}var $e,Je=function(n){var t=n.site,i=n.sseBaseUrl,o=n.sseEndpoint,l=n.debug,r=void 0!==l&&l;return w.createSSETransport({site:t,sseBaseUrl:i,getToken:e.getToken,sseEndpoint:o,onOpen:function(e){var n=e.userId,t=e.endpoint;r&&console.log("SSE Connected:",n,t)},onMessage:function(n){var t,i,o,l,a,u,s,d,v,p;if(r&&console.log("SSE Message:",n),(null===(t=e.getCurrentVideo())||void 0===t||null===(i=t.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id)===(null==n||null===(l=n.payload)||void 0===l?void 0:l.id)&&"GAME_STATE_CHANGE"===(null==n?void 0:n.notificationType)){var f=1e3*(null==n||null===(a=n.payload)||void 0===a||null===(u=a.states)||void 0===u||null===(s=u.live)||void 0===s?void 0:s.startDateTime),m=1e3*(null==n||null===(d=n.payload)||void 0===d||null===(v=d.states)||void 0===v||null===(p=v.end)||void 0===p?void 0:p.endDateTime);f&&m&&(console.log("Setting schedule timer",f,m),c.scheduleTimerInstanceManager.set({startDateTime:f,endDateTime:m}))}},onReconnectAttempt:function(e){r&&console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;r&&console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){r&&console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){r&&console.error("SSE Error:",e,n)},onClose:function(){r&&console.log("SSE Closed")}})},Xe=function(e){var n=e.enable,t=e.site,i=e.sseBaseUrl,o=e.sseEndpoint,l=e.debug;if(n){var r=Je({site:t,sseBaseUrl:i,sseEndpoint:o,debug:void 0!==l&&l});return r._sseBaseUrl=i,r._site=t,r._sseEndpoint=o,r}};function Qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Ze(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Qe(Object(i)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})}return e}module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:c.onTimeUpdate,getVideoDuration:c.getVideoDuration,onVideoEnded:c.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=t(i.mark(function t(o,l){var r,a,u,s,d,c,v,p,f,g,h,b,w,k,S,E,I,T,O,P,j,D,C,x,R,L,_,N,V,B,U,M;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=3;break}return o({status:!0,msg:"Player already initialised",skipped:!0}),t.abrupt("return");case 3:if(O=(null==n?void 0:n.videoSourceUrl)||!1,P=null==n?void 0:n.asat,j=(null==n||null===(r=n.epg)||void 0===r?void 0:r.enable)||!1,D=null==n?void 0:n.videoId,C=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,x=(null==n?void 0:n.streamingInfo)||!1,window.videoId=D,R=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=18;break}if(sessionStorage.setItem("vlp_token",R),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),R&&!e.isTokenExpired(R)){t.next=17;break}return l({status:!1,msg:"".concat(R?"Token is expired !":"Missing Authorization Token"),response:{token:R}}),t.abrupt("return");case 17:$e=JSON.parse(atob(R.split(".")[1]));case 18:return window.siteName=null===(u=$e)||void 0===u?void 0:u.site,window.siteId=null===(s=$e)||void 0===s?void 0:s.siteId,n.isAnonymousUser=!(null===(d=$e)||void 0===d||!d.anonymousId),n.siteOwner=(null===(c=$e)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=$e)||void 0===v?void 0:v.userId)||null,e.setUserId((null===(p=$e)||void 0===p?void 0:p.userId)||(null===(f=$e)||void 0===f?void 0:f.anonymousId)||null),window.watchHistory=n.watchHistory||null,L=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,_=(null==n||null===(h=n.analytics)||void 0===h?void 0:h.gaId)||null,(N=null==n?void 0:n.errors)&&(window.customErrors=N),window.customData=null==n?void 0:n.customData,y.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!m.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),e.playerConfigManager.setConfig(n),t.next=37,K(n);case 37:_&&A("https://www.googletagmanager.com/gtag/js?id=".concat(_)).then(function(){return e.runGtag(_)}).catch(function(e){}),(V=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(L)))&&V.addEventListener("contextmenu",function(e){return e.preventDefault()}),(B=Xe({enable:null==n||null===(k=n.sse)||void 0===k?void 0:k.enable,site:null==n||null===(S=n.sse)||void 0===S?void 0:S.siteName,sseBaseUrl:null==n||null===(E=n.sse)||void 0===E?void 0:E.sseBaseUrl,sseEndpoint:null==n||null===(I=n.sse)||void 0===I?void 0:I.sseEndpoint,debug:null==n||null===(T=n.sse)||void 0===T?void 0:T.debug}))&&!B.isConnectionActive()&&B.connect(),O?(M={directPlaybackUrl:O,id:U="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},P?e.getVideoDetails(U,R).then(function(e){var t=(null==e?void 0:e.data)||{};Be(L,{res:Ze(Ze({},t),M)},n,{resolve:o,reject:l})}).catch(function(n){e.initiateErrorHandling(n,L,l,U)}):Be(L,{res:M},n,{resolve:o,reject:l})):x?qe(n,{resolve:o,reject:l}):C?We(n,{resolve:o,reject:l}):j?Ge(n,{resolve:o,reject:l}):Fe(n,{resolve:o,reject:l});case 43:case"end":return t.stop()}},t)}));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:p.getRenditions,skip:e.skip,getPlayer:m.getPlayer,play:e.play,pause:e.pause,detectBrowser:g.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:c.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:v.enableCaptions,disableCaptions:v.disableCaptions,getCaptions:v.getCaptions,playSelectedResolution:f.playSelectedResolution,getSource:e.getSource,setVolume:_,getVolume:N,disableControls:e.disableControls,setPlaybackSpeed:c.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,getSsaiEvents:e.getSsaiEvents,playerEvents:c.playerEvents,onReplay:c.onReplay}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-eb807ef0.js"),o=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-eb807ef0.js"),o=require("./generic-b0efda72.js"),l=require("./skin-c97f0eea.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-77c57718.js"),require("md5"),require("js-cookie"),require("./captions-80f6eb66.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var d=s.getComponent("Component"),u=function(){r(v,d);var u,m,p=(u=v,m=c(),function(){var e,t=n(u);if(m){var r=n(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function v(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,v),(r=p.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(v,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(i.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./multicamv2-1efdbdb9.js")}).then(function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),r=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=r.classList)&&void 0!==a&&a.contains("hidden")?(l.closeOpenDrawers(),r.classList.remove("hidden"),t.classList.add("open"),l.setUpdatedElHeight(e.playerId,r)):(r.classList.add("hidden"),t.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var n=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);r.style.height="".concat(n,"px"),a.style.overflow="hidden",s.dom.appendContent(t,r),this.addFunctionality(r)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=s.dom.createEl("div",{className:"stream-selector-head"}),n=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i.crossIconSvg())});n.onclick=function(){e.classList.add("hidden"),r.classList.remove("open")};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,a,n,l=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i.SelectedStream())});0==e&&(l.classList.add("selected"),l.style.border="2px solid #D2393B"),l.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");l.classList.add("selected"),l.style.border="2px solid #D2393B",o.load(t.playerId,t.streams[e].id).then(function(e){o.play(t.playerId),console.log(e)}).catch(function(e){console.log(e)})},l.style.backgroundImage="url(".concat(t.streams[e].img,")");var c=document.createElement("img");c.className="stream-thumbnail-image",c.src="".concat((null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img)||(null===(a=window)||void 0===a||null===(n=a.customData)||void 0===n?void 0:n.fallbackImage)),l.append(c),s.dom.appendContent(u,l),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(a,n),s.dom.appendContent(a,c),s.dom.appendContent(e,a),s.dom.appendContent(e,d),l.handleDrawerResizing(this.playerId,e)}}]),v}();exports.default=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-eb807ef0.js"),o=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),n=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),i=require("./icons-eb807ef0.js"),o=require("./generic-b0efda72.js"),l=require("./skin-c97f0eea.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-77c57718.js"),require("md5"),require("js-cookie"),require("./captions-80f6eb66.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var d=s.getComponent("Component"),u=function(){r(h,d);var u,m,p=(u=h,m=c(),function(){var e,t=a(u);if(m){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return n(this,e)});function h(t){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(r=p.call(this,t,n)).playerId=n.playerId,r.seriesData=n.sres,r.streams=n.streams,r.currentVideoData=n.res,r.initialiseStructure(),r.loadCSS(),r}return t(h,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(i.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./multicamv2-7a86b517.js")}).then(function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(l.closeOpenDrawers(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var r=document.getElementById(this.playerId);if(r){var n=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),r.style.overflow="hidden",s.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),n=s.dom.createEl("div",{className:"stream-selector-head"}),a=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i.crossIconSvg())});a.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,n=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i.SelectedStream())});0==e&&(n.classList.add("selected"),n.style.border="4px solid #D2393B"),n.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");n.classList.add("selected"),n.style.border="4px solid #D2393B",o.load(t.playerId,t.streams[e].id).then(function(e){o.play(t.playerId),console.log(e)}).catch(function(e){console.log(e)})},n.style.backgroundImage="url(".concat(t.streams[e].img,")");var a=document.createElement("img");a.className="stream-thumbnail-image",a.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),a.alt="No Thumbnail Available",n.append(a),s.dom.appendContent(u,n),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(n,a),s.dom.appendContent(n,c),s.dom.appendContent(e,n),s.dom.appendContent(e,d),l.getPlayer(this.playerId).on("fullscreenchange",function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")})}}]),h}();exports.default=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),t=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),l=require("./icons-eb807ef0.js"),s=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),t=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),l=require("./icons-eb807ef0.js"),s=require("./generic-b0efda72.js"),a=require("./skin-c97f0eea.js");function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-77c57718.js"),require("md5"),require("js-cookie"),require("./captions-80f6eb66.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var u=o.getComponent("Component"),c=function(){t(p,u);var s,a,c=(s=p,a=d(),function(){var e,n=i(s);if(a){var t=i(this).constructor;e=Reflect.construct(n,arguments,t)}else e=n.apply(this,arguments);return r(this,e)});function p(n){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,p),(t=c.call(this,n,r)).playerId=r.playerId,t.seriesData=r.sres,t.currentVideoData=r.res,t.initialiseStructure(),t.loadCSS(),t}return n(p,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"play-next"}),n=o.dom.createEl("div",{className:"play-next-icon",innerHTML:"".concat(l.PlayNextEpisodeSvg(window.controlsColor?window.controlsColor:"white"))});return o.dom.appendContent(e,n),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./nextEpisodeButton-b6e6586f.js")}).then(function(e){var n=document.createElement("style");n.id="multicam",n.append("".concat(e.default)),document.head.appendChild(n)})}},{key:"initialiseStructure",value:function(){var e=this.el(),n=o.dom.createEl("div",{className:"next-eps nextepisode-hidden"}),t=o.dom.createEl("div",{className:"next",innerHTML:"Next Episode"}),r=o.dom.createEl("div",{className:"nextep-meta-details next-margin"}),i=o.dom.createEl("div",{className:"next-eps-image"}),l=o.dom.createEl("div",{className:"next-eps-description"});o.dom.appendContent(r,i),o.dom.appendContent(r,l),o.dom.appendContent(n,t),o.dom.appendContent(n,r),this.toggleContentOnHover(e,n),o.dom.appendContent(e,n)}},{key:"toggleContentOnHover",value:function(e,n){e.addEventListener("mouseover",function(){o.dom.removeClass(n,"nextepisode-hidden")}),n.addEventListener("mouseover",function(){o.dom.removeClass(n,"nextepisode-hidden")}),e.addEventListener("mouseout",function(){o.dom.addClass(n,"nextepisode-hidden")}),n.addEventListener("mouseout",function(){o.dom.addClass(n,"nextepisode-hidden")})}}]),p}(),p=function(e,n){for(var t=-1,r=0;r<e.length;r++)for(var i=0;i<e[r].episodes.length;i++)if(e[r].episodes[i].id===n){t=r;break}return t},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;if(!(e&&n>=0))return{prevEp:null,nextEp:null};var t=e.episodes.length,r=n-1>=0?n-1:t-1,i=(n+1)%t,o=t>1?e.episodes[r]:null,l=t>1?e.episodes[i]:null;return r===i&&(0===r?l=null:o=null),{prevEp:o,nextEp:l,prevEpIdx:r,nextEpIdx:i}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,t=null;return e?(e.episodes.forEach(function(e,r){e.gist.id===n&&(t=r)}),t):null},h=function(e){var n,t;o.dom.$(".next-eps"),o.dom.$(".play-next").onclick=function(){var n;s.load("my-player",null==e||null===(n=e.gist)||void 0===n?void 0:n.id).then(function(e){s.setCurrentVideo(e.response)})};var r=o.dom.$(".next-eps-image"),i=a.parseHtmlString("<img src=".concat(null==e||null===(n=e.gist)||void 0===n?void 0:n.videoImageUrl," />")),l=null==i?void 0:i.firstChild;null==r||r.append(l);for(var d=o.dom.$(".next-eps-description"),u=a.parseHtmlString("<div class='next-eps-title'>".concat(null==e?void 0:e.title,"</div>\n <div class='next-eps-description-details'>").concat(null==e||null===(t=e.gist)||void 0===t?void 0:t.description,"</div>"));null!=u&&u.firstChild;)null==d||d.appendChild(u.firstChild)};exports.default=c,exports.initaliseFunctionality=function(e,n){var t=p(e,n.video.gist.id),r=m(e[t],n.video.gist.id),i=v(e[t],r);h(i.nextEp)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),a=require("video.js"),r=require("./icons-eb807ef0.js"),s=require("./generic-b0efda72.js"),c=require("./autoNextVideo-fe71c875.js"),d=require("./skin-c97f0eea.js");function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-77c57718.js"),require("md5"),require("js-cookie"),require("./captions-80f6eb66.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("./index-8c9f1a67.js"),require("./localisation-56e0a999.js");var p=a.getComponent("Component"),m=function(){l(h,p);var m,v,y=(m=h,v=u(),function(){var e,t=o(m);if(v){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return i(this,e)});function h(e){var n,l,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,h),(o=y.call(this,e,a)).playerId=a.playerId,o.seriesData=a.sres,o.videos=null==a||null===(n=a.playlist)||void 0===n?void 0:n.content,o.cb=(null==a||null===(l=a.playlist)||void 0===l?void 0:l.cb)||null,o.autoNext=(null==a||null===(i=a.playlist)||void 0===i?void 0:i.autoNext)||!1,o.currentVideoData=a.res,o.initialiseStructure(),o.loadCSS(),o.autoNext&&c.autoPlayNext({playerId:o.playerId,content:o.videos,cb:o.cb}),o}return n(h,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(r.EpisodesSvg())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./playlist-df87ca90.js")}).then(function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this.el(),t=a.dom.createEl("div",{className:"selection-container hidden"});a.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(d.closeOpenDrawers(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var l=window.getComputedStyle(n,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(l,"px"),a.dom.appendContent(e,t),n.style.overflow="hidden",this.addFunctionality(t)}}},{key:"addFunctionality",value:function(t){var n=this,l=this.el(),i=a.dom.createEl("div",{className:"playlist-selector-head"}),o=a.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(r.crossIconSvg())});o.onclick=function(){t.classList.add("hidden"),l.classList.remove("open"),t.style.right="-350px"};for(var c=a.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),u=a.dom.createEl("div",{className:"playlist-selector-content"}),p=function(t){var l,i,o=a.dom.createEl("div",{className:"playlist-container"}),r=a.dom.createEl("div",{className:"playlist-section",index:t}),c=a.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.title)||"")}),d=a.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});a.dom.appendContent(r,c),a.dom.appendContent(r,d),a.dom.appendContent(o,r),a.dom.appendContent(u,o);var p=a.dom.createEl("div",{className:"playlist-section-expanded hidden"}),m=a.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(i=n.videos[t])||void 0===i?void 0:i.description)||"")}),v=a.dom.createEl("div",{className:"playlist-image"});v.style.backgroundImage="url(".concat(n.videos[t].img,")"),a.dom.appendContent(p,v),a.dom.appendContent(p,m),a.dom.appendContent(o,p),a.dom.appendContent(u,o),p.onclick=function(e){e.stopPropagation(),s.setVideoIdx(t+1),s.load(n.playerId,n.videos[t].id).then(function(e){null!=n&&n.cb&&n.cb(e)}).catch(function(e){null!=n&&n.cb&&n.cb(e)})},r.onclick=function(t){var n,l,i,a=document.getElementsByClassName("playlist-selector-content")[0].childNodes,r=(a=e(a))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=r&&null!==(n=r.classList)&&void 0!==n&&n.contains("hidden")?(o.style.backgroundColor="#0000007d",null==r||null===(l=r.classList)||void 0===l||l.remove("hidden")):(null==r||null===(i=r.classList)||void 0===i||i.add("hidden"),o.style.backgroundColor="unset")}},m=0;m<this.videos.length;m++)p(m);a.dom.appendContent(i,o),a.dom.appendContent(i,c),a.dom.appendContent(t,i),a.dom.appendContent(t,u),d.getPlayer(this.playerId).on("fullscreenchange",function(){var e=document.getElementById(n.playerId);if(e){var l=window.getComputedStyle(e,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(l,"px")}})}}]),h}();exports.default=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/helpers/assertThisInitialized"),n=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),c=require("video.js"),d=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/helpers/assertThisInitialized"),n=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),c=require("video.js"),d=require("./generic-b0efda72.js"),u=require("./icons-eb807ef0.js"),p=require("./skin-c97f0eea.js");require("axios"),require("./browser-77c57718.js"),require("md5"),require("js-cookie"),require("./captions-80f6eb66.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js");var v=function(e){document.getElementById("".concat(e)).classList.add("vjs-waiting")};function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}var m,f=c.getComponent("Component"),g=function(){n(d,f);var e,l,c=(e=d,l=h(),function(){var i,t=a(e);if(l){var s=a(this).constructor;i=Reflect.construct(t,arguments,s)}else i=t.apply(this,arguments);return r(this,i)});function d(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(this,d),t=c.call(this,e,n),o(s(t),"seriesData",[]),t.seriesData=n.seriesData,m=n.playerId,y(t.el(),t.seriesData),t.loadCSS(),t}return t(d,[{key:"createEl",value:function(){var e=document.createElement("div");return e.classList.add("vjs-season-list"),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./series-9c237975.js")}).then(function(e){var i=document.createElement("style");i.id="series",i.append("".concat(e.default)),document.head.appendChild(i)})}}]),d}();function b(){return(b=e(l.mark(function e(i,t,s,n){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d.pause(m),v(m),d.load(m,t).then(function(e){d.setCurrentVideo(e.response),d.play(m)});case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function y(e,i){for(var t='<div class="hover-div"></div>\n '.concat(u.EpisodesSvg(),'\n <div class="player-season-list-container on-click-toggle">\n <div id="season-list" class="season-list">\n <div class="season-list-head">seasons</div>\n <div class="season-name-container">\n ').concat(function(e){return e.map(function(e,i){return'<div\n class="season-title-sdk"\n key='.concat("title-".concat(e.title),'\n > <div class="season-container">\n ',e.title,"\n </div>\n </div>\n ")}).join("")}(i),'\n </div>\n </div>\n <div id="episode-list" class="episode-list hide-container"><div id="episodes-back-btn" class="episodes-back-btn" >\n <svg class=\'icon icon-backward\' height="22px" width="22px" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0.383092 19.5818C-0.0882695 19.0669 -0.124672 18.2566 0.273985 17.6961L0.382714 17.5615L7.30134 9.99714L0.383092 2.43893C-0.0882694 1.92406 -0.124672 1.11374 0.273985 0.553232L0.382714 0.418625C0.853882 -0.0964584 1.59542 -0.136236 2.10835 0.299398L2.23153 0.418213L11 9.99608L2.23191 19.5814C1.72148 20.1394 0.893733 20.1396 0.383092 19.5818Z" fill="white"/>\n </svg>\n <span>Episodes<span></div> <div id="episode-container" class="episode-container"> </div></div>\n </div>');null!=e&&e.firstChild;)e.removeChild(e.firstChild);for(var s=p.parseHtmlString(t);null!=s&&s.firstChild;)e.appendChild(s.firstChild)}exports.customSeasonList=y,exports.handleSeasonChange=function(e,i,t,s){var n=document.getElementById("season-list"),r=document.getElementById("episode-list"),a=document.getElementById("episode-container");e.id;for(var o=e.episodes.map(function(e,i){return'\n <div id="episode-wrapper" class="episode-wrapper">\n <div class="episode-title" id="episode-title">\n <div class="details-wrapper">\n <div id="title-wrapper" class="title-wrapper">'.concat(i+1," ").concat(e.title,' </div>\n <div class="progress-bar-div">\n <div id="progress-div" class="progress-div"></div>\n </div>\n </div>\n <div class="meta-details">\n <div class="episode-image lazy" style="width:124px; height: 70px;">\n <img src=').concat(e.gist.videoImageUrl,' alt="').concat(e.title,'\'s cover"></img>\n </div>\n <div class="description-wrapper">').concat(e.gist.description,"</div>\n </div>\n </div>\n </div>")}).join("");null!=a&&a.firstChild;)a.removeChild(a.firstChild);for(var l=p.parseHtmlString(o);null!=l&&l.firstChild;)a.appendChild(l.firstChild);!function(e){d.getSeriesWatchHistory(e).then(function(e){var i=e.data,t=document.querySelectorAll("#progress-div");t&&i.map(function(e,i){e&&e.watchedPercentage&&t[i]&&(t[i].style.width=e.watchedPercentage+"px")})}).catch(function(e){})}(s),n.classList.toggle("hide-container"),r.classList.toggle("hide-container");var c=document.querySelectorAll(".details-wrapper"),u=document.querySelectorAll("#episode-title"),v=document.querySelectorAll(".meta-details"),h=document.querySelector("#episodes-back-btn"),m=e.id,f=e.episodes;h.addEventListener("click",function(){return function(e,i){e.classList.remove("hide-container"),i.classList.add("hide-container")}(n,r)});for(var g=function(i){c[i].addEventListener("click",function(){return function(e,i,t){var s=i.querySelector(".meta-details");i.classList.toggle("episode-active"),s.classList.toggle("metadetails-active"),t.forEach(function(i,s){s!==e&&(t[s].classList.remove("episode-active"),t[s].querySelector(".meta-details").classList.remove("metadetails-active"))})}(i,u[i],u)}),v[i].addEventListener("click",function(){return function(e,i,t,s){return b.apply(this,arguments)}(i,f[i].id,t,u)}),e.episodes[i].id==m&&u[i].classList.add("highlight-active-eps")},y=0;y<c.length;y++)g(y)},exports.seriesModule=g;
|