@viewlift/player-backup 1.0.170-backup → 1.0.172-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/bundle.css CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
 
5
+
5
6
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
6
7
  height: 0.7em;
7
8
  position: absolute;
@@ -142,7 +143,6 @@
142
143
  }
143
144
 
144
145
 
145
-
146
146
  /* CSS for videojs-dvr-seekbar */
147
147
 
148
148
  .video-js.vjs-dvr-seekbar {
@@ -316,7 +316,6 @@
316
316
 
317
317
 
318
318
 
319
-
320
319
  .video-js .multicamera-parent.default{
321
320
  height: 345px;
322
321
  position: absolute;
@@ -399,6 +398,7 @@
399
398
 
400
399
 
401
400
 
401
+
402
402
  /* nextep */
403
403
  .next-ep-preview{
404
404
  position: absolute;
@@ -459,38 +459,6 @@
459
459
  margin-left: 8px;
460
460
  }
461
461
  }
462
- /* a wrapper element that tracks the mouse vertically */
463
- .vjs-thumbnail-holder {
464
- position: absolute;
465
- left: -1000px;
466
- }
467
-
468
- /* the thumbnail image itself */
469
- .vjs-thumbnail {
470
- position: absolute;
471
- left: 0;
472
- bottom: 1.3em;
473
- opacity: 0;
474
- transition: opacity .2s ease;
475
- -webkit-transition: opacity .2s ease;
476
- -moz-transition: opacity .2s ease;
477
- -mz-transition: opacity .2s ease;
478
- }
479
-
480
- /* fade in the thumbnail when hovering over the progress bar */
481
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
482
- .vjs-progress-control:hover .vjs-thumbnail,
483
- .vjs-progress-control.fake-active .vjs-thumbnail,
484
- .vjs-progress-control:active .vjs-thumbnail {
485
- opacity: 1;
486
- }
487
-
488
- /* ... but hide the thumbnail when hovering directly over it */
489
- .vjs-progress-control:hover .vjs-thumbnail:hover,
490
- .vjs-progress-control:active .vjs-thumbnail:active {
491
- opacity: 0;
492
- }
493
-
494
462
  .video-js.vjs-quality-menu {
495
463
  display: block;
496
464
  }
@@ -561,6 +529,38 @@
561
529
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
562
530
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
563
531
  }
532
+ /* a wrapper element that tracks the mouse vertically */
533
+ .vjs-thumbnail-holder {
534
+ position: absolute;
535
+ left: -1000px;
536
+ }
537
+
538
+ /* the thumbnail image itself */
539
+ .vjs-thumbnail {
540
+ position: absolute;
541
+ left: 0;
542
+ bottom: 1.3em;
543
+ opacity: 0;
544
+ transition: opacity .2s ease;
545
+ -webkit-transition: opacity .2s ease;
546
+ -moz-transition: opacity .2s ease;
547
+ -mz-transition: opacity .2s ease;
548
+ }
549
+
550
+ /* fade in the thumbnail when hovering over the progress bar */
551
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
552
+ .vjs-progress-control:hover .vjs-thumbnail,
553
+ .vjs-progress-control.fake-active .vjs-thumbnail,
554
+ .vjs-progress-control:active .vjs-thumbnail {
555
+ opacity: 1;
556
+ }
557
+
558
+ /* ... but hide the thumbnail when hovering directly over it */
559
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
560
+ .vjs-progress-control:active .vjs-thumbnail:active {
561
+ opacity: 0;
562
+ }
563
+
564
564
  .vjs-poster {
565
565
  display: inline-block;
566
566
  vertical-align: middle;
@@ -1 +1 @@
1
- "use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./skin-aef573bd.js"),a=require("./generic-61978e4d.js"),l=require("./autoNextVideo-0e700dee.js"),u=require("@babel/runtime/helpers/typeof"),s=require("video.js"),c=require("@babel/runtime/helpers/asyncToGenerator"),d=require("@babel/runtime/regenerator"),p=require("@babel/runtime/helpers/defineProperty"),v=require("@babel/runtime/helpers/slicedToArray"),m=[],f=function(e,t){var n=o.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=a.getVideoIdx();l.switchToNext(i,e,m)}};function g(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function h(e){return x.apply(this,arguments)}function x(){return(x=c(d.mark((function e(t){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=v(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return b.apply(this,arguments)}function b(){return(b=c(d.mark((function e(t){var n,r;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",g(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function w(e){return E.apply(this,arguments)}function E(){return(E=c(d.mark((function e(t){var n,r;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return h(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},p(n,"left","-60px"),p(n,"border","1px solid transparent"),p(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}e={0:{src:"example-thumbnail.png"}},t=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===u(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},r=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},s.registerPlugin("thumbnails",(function(i){var o,a,l,u,s,c,d,p;function v(){document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",v),p()}a=t({},e,i),u=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=u.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(o=document.createElement("div")).className="vjs-thumbnail-holder",l=document.createElement("img"),o.appendChild(l),l.src=a[0].src,l.className="vjs-thumbnail",t(l.style,a[0].style),l.style.left||l.style.right||(l.onload=function(){l.style.left=-l.naturalWidth/2+"px"}),c=u.duration(),u.on("durationchange",(function(e){c=u.duration()})),u.on("loadedmetadata",(function(e){c=u.duration()})),(s=u.controlBar.progressControl).el().appendChild(o),d=function(e){var i,u,d,p,v,m,f,g,h,x;for(u in d=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=r(s.el()).getBoundingClientRect()).width||x.right)+h,m=e.pageX,e.changedTouches&&(m=e.changedTouches[0].pageX),p=m||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,p-=r(s.el()).getBoundingClientRect().left+h,i=Math.floor((p-s.el().offsetLeft)/s.width()*c),a)i>u&&(d=Math.max(d,u));(v=a[d]).src&&l.src!=v.src&&(l.src=v.src),v.style&&l.style!=v.style&&t(l.style,v.style),p+(g=function(e,t){var r;return t?parseFloat(t):"auto"!==(r=n(e)("clip"))&&"inherit"!==r&&4===(r=r.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(r[1])-parseFloat(r[3]):0}(l,v.width||a[0].width)/2)>f?p-=p+g-f:p<g&&(p=g),o.style.left=p+"px"},s.on("mousemove",d),s.on("touchmove",d),s.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",d),document.addEventListener("pointerup",v)})),p=function(e){o.style.left="-1000px"},s.on("mouseout",p),s.on("touchcancel",p),s.on("touchend",p),u.on("userinactive",p)}));var C=function(){var e=c(d.mark((function e(t,n){var r,i,o,a;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=v(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function N(e){return T.apply(this,arguments)}function T(){return(T=c(d.mark((function e(t){var n,r,i,o,l,u,s,c,p,m,f,g,h,x,y,b,w,E,C,N,T,k,I,A,L,P,B,M,S,j;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return u=e.sent,e.next=7,u.text();case 7:s=e.sent,c=new DOMParser,p=c.parseFromString(s,"application/xml"),m=null===(r=a.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i?void 0:i.runtime,f=(null==p||null===(o=p.getElementsByTagName("BaseURL"))||void 0===o||null===(l=o[0])||void 0===l?void 0:l.textContent)||n,g=p.getElementsByTagName("AdaptationSet"),h=0;case 14:if(!(h<g.length)){e.next=38;break}if(("image"!==(x=g[h]).getAttribute("contentType")||"image/png"!==x.getAttribute("mimeType"))&&"image/jpeg"!==x.getAttribute("mimeType")){e.next=35;break}if(y=x.getElementsByTagName("SegmentTemplate")[0],b=x.getElementsByTagName("Representation")[0],w=b.getElementsByTagName("EssentialProperty")[0],E=w.getAttribute("value"),C=null==E?void 0:E.split("x"),N=v(C,2),T=N[0],k=N[1],!y){e.next=35;break}for(y.getAttribute("media"),I=y.getAttribute("duration"),A=y.getAttribute("timescale"),L=I/(A||I/(T*k)),P=b.getAttribute("id"),B=Math.round(m/L),M=Math.ceil(B/T*k),S=y.getAttribute("media"),j=[],h=0;h<M;h++)j.push({duration:L,layout:E,uri:f+S.replace("$Number$",h).replace("$RepresentationID$",P)});return e.abrupt("return",j);case 35:h++,e.next=14;break;case 38:return console.log("No trickplay segment found."),e.abrupt("return",null);case 42:e.prev=42,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 45:case"end":return e.stop()}}),e,null,[[1,42]])})))).apply(this,arguments)}function k(){return(k=c(d.mark((function e(t){var n,r,i,a,l,u,s,c,p,v,m,f,g,h,x,b;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=o.getPlayer(t),s=u.currentSource(),c=s.src,c=null!==(n=c)&&void 0!==n&&n.includes("blob")?null===(r=window)||void 0===r||null===(i=r.player)||void 0===i?void 0:i.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,y(c);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return v=(null==p?void 0:p[0])||null,m=v.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,C(f,m);case 12:return g=e.sent,e.next=15,w(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,N(c);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,w(x);case 26:b=e.sent,u.thumbnails(b);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}exports.addNextEpPreview=function(e,t){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r;m=[];var l=a.getCurrentSeries();null==l||l.map((function(e){var t;return(t=m).push.apply(t,i(e.episodes))})),null==t||null===(r=t.series)||void 0===r||r.cb}else{var u,s;m=(null==t||null===(u=t.relatedVideos)||void 0===u?void 0:u.content)||[],null==t||null===(s=t.relatedVideos)||void 0===s||s.cb}var c=o.getPlayer(e);c.on("timeupdate",(function(){var e,t,n=Math.floor(c.currentTime()),r=c.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&a.getVideoIdx()<=(null===(t=m)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var d,p=m.filter((function(e,t){return t==a.getVideoIdx()}));if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var v,g,h,x,y,b,w,E,C,N,T,k;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var I=null===(g=document.getElementsByClassName("next-ep-title"))||void 0===g?void 0:g[0],A=null===(h=document.getElementsByClassName("next-ep-img"))||void 0===h?void 0:h[0],L=null===(x=document.getElementsByClassName("next-ep-content"))||void 0===x?void 0:x[0],P=null===(y=p[0])||void 0===y?void 0:y.title;(null===(b=P)||void 0===b?void 0:b.length)>60&&(P=P.substr(0,60)+"..."),I.textContent="".concat(P),A.src=(null===(w=p[0])||void 0===w||null===(E=w.gist)||void 0===E||null===(C=E.imageGist)||void 0===C?void 0:C.r16x9)||(null==p||null===(N=p[0])||void 0===N?void 0:N.img)||(null===(T=window)||void 0===T||null===(k=T.customData)||void 0===k?void 0:k.fallbackImage),L.onclick=function(){return f(e)}}else{var B,M,S,j,O,q,R,X,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(e).append(V);var D=document.createElement("div");D.className="next-ep-header",D.textContent="Next up";var F=null===(B=p[0])||void 0===B?void 0:B.title,U=document.createElement("img");U.className="next-ep-img",U.src=(null===(M=p[0])||void 0===M||null===(S=M.gist)||void 0===S||null===(j=S.imageGist)||void 0===j?void 0:j.r16x9)||(null==p||null===(O=p[0])||void 0===O?void 0:O.img)||(null===(q=window)||void 0===q||null===(R=q.customData)||void 0===R?void 0:R.fallbackImage);var G=document.createElement("div");G.className="next-ep-title",(null===(X=F)||void 0===X?void 0:X.length)>60&&(F=F.substr(0,60)+"..."),G.textContent="".concat(F);var $=document.createElement("div");$.className="next-ep-content",$.append(U),$.append(G),$.onclick=function(){return f(e)},V.append(D),V.append($)}},exports.addTVProviderImage=function(e,t){var n=o.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var i=document.createElement("div");i.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(r),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"}))}},exports.initiateTrickplay=function(e){return k.apply(this,arguments)};
1
+ "use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./skin-aef573bd.js"),a=require("./generic-61978e4d.js"),l=require("./autoNextVideo-0e700dee.js"),u=require("@babel/runtime/helpers/typeof"),s=require("video.js"),c=require("@babel/runtime/helpers/asyncToGenerator"),d=require("@babel/runtime/regenerator"),p=require("@babel/runtime/helpers/defineProperty"),v=require("@babel/runtime/helpers/slicedToArray"),m=[],f=function(e,t){var n=o.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=a.getVideoIdx();l.switchToNext(i,e,m)}};function g(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function h(e){return x.apply(this,arguments)}function x(){return(x=c(d.mark((function e(t){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=v(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return b.apply(this,arguments)}function b(){return(b=c(d.mark((function e(t){var n,r;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",g(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function w(e){return E.apply(this,arguments)}function E(){return(E=c(d.mark((function e(t){var n,r;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return h(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},p(n,"left","-60px"),p(n,"border","1px solid transparent"),p(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}e={0:{src:"example-thumbnail.png"}},t=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===u(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},r=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},s.registerPlugin("thumbnails",(function(i){var o,a,l,u,s,c,d,p;function v(){document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",v),p()}a=t({},e,i),u=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=u.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(o=document.createElement("div")).className="vjs-thumbnail-holder",l=document.createElement("img"),o.appendChild(l),l.src=a[0].src,l.className="vjs-thumbnail",t(l.style,a[0].style),l.style.left||l.style.right||(l.onload=function(){l.style.left=-l.naturalWidth/2+"px"}),c=u.duration(),u.on("durationchange",(function(e){c=u.duration()})),u.on("loadedmetadata",(function(e){c=u.duration()})),(s=u.controlBar.progressControl).el().appendChild(o),d=function(e){var i,u,d,p,v,m,f,g,h,x;for(u in d=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=r(s.el()).getBoundingClientRect()).width||x.right)+h,m=e.pageX,e.changedTouches&&(m=e.changedTouches[0].pageX),p=m||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,p-=r(s.el()).getBoundingClientRect().left+h,i=Math.floor((p-s.el().offsetLeft)/s.width()*c),a)i>u&&(d=Math.max(d,u));(v=a[d]).src&&l.src!=v.src&&(l.src=v.src),v.style&&l.style!=v.style&&t(l.style,v.style),p+(g=function(e,t){var r;return t?parseFloat(t):"auto"!==(r=n(e)("clip"))&&"inherit"!==r&&4===(r=r.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(r[1])-parseFloat(r[3]):0}(l,v.width||a[0].width)/2)>f?p-=p+g-f:p<g&&(p=g),o.style.left=p+"px"},s.on("mousemove",d),s.on("touchmove",d),s.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",d),document.addEventListener("pointerup",v)})),p=function(e){o.style.left="-1000px"},s.on("mouseout",p),s.on("touchcancel",p),s.on("touchend",p),u.on("userinactive",p)}));var C=function(){var e=c(d.mark((function e(t,n){var r,i,o,a;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=v(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function N(e){return T.apply(this,arguments)}function T(){return(T=c(d.mark((function e(t){var n,r,i,o,l,u,s,c,p,m,f,g,h,x,y,b,w,E,C,N,T,k,I,A,L,P,B,M,S,j;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return u=e.sent,e.next=7,u.text();case 7:s=e.sent,c=new DOMParser,p=c.parseFromString(s,"application/xml"),m=null===(r=a.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i?void 0:i.runtime,f=(null==p||null===(o=p.getElementsByTagName("BaseURL"))||void 0===o||null===(l=o[0])||void 0===l?void 0:l.textContent)||n+"/",g=p.getElementsByTagName("AdaptationSet"),h=0;case 14:if(!(h<g.length)){e.next=38;break}if(("image"!==(x=g[h]).getAttribute("contentType")||"image/png"!==x.getAttribute("mimeType"))&&"image/jpeg"!==x.getAttribute("mimeType")){e.next=35;break}if(y=x.getElementsByTagName("SegmentTemplate")[0],b=x.getElementsByTagName("Representation")[0],w=b.getElementsByTagName("EssentialProperty")[0],E=w.getAttribute("value"),C=null==E?void 0:E.split("x"),N=v(C,2),T=N[0],k=N[1],!y){e.next=35;break}for(y.getAttribute("media"),I=y.getAttribute("duration"),A=y.getAttribute("timescale"),L=I/(A||I/(T*k)),P=b.getAttribute("id"),B=Math.round(m/L),M=Math.ceil(B/T*k),S=y.getAttribute("media"),j=[],h=0;h<M;h++)j.push({duration:L,layout:E,uri:f+S.replace("$Number$",h).replace("$RepresentationID$",P)});return e.abrupt("return",j);case 35:h++,e.next=14;break;case 38:return console.log("No trickplay segment found."),e.abrupt("return",null);case 42:e.prev=42,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 45:case"end":return e.stop()}}),e,null,[[1,42]])})))).apply(this,arguments)}function k(){return(k=c(d.mark((function e(t){var n,r,i,a,l,u,s,c,p,v,m,f,g,h,x,b;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=o.getPlayer(t),s=u.currentSource(),c=s.src,c=null!==(n=c)&&void 0!==n&&n.includes("blob")?null===(r=window)||void 0===r||null===(i=r.player)||void 0===i?void 0:i.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,y(c);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return v=(null==p?void 0:p[0])||null,m=v.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,C(f,m);case 12:return g=e.sent,e.next=15,w(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,N(c);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,w(x);case 26:b=e.sent,u.thumbnails(b);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}exports.addNextEpPreview=function(e,t){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r;m=[];var l=a.getCurrentSeries();null==l||l.map((function(e){var t;return(t=m).push.apply(t,i(e.episodes))})),null==t||null===(r=t.series)||void 0===r||r.cb}else{var u,s;m=(null==t||null===(u=t.relatedVideos)||void 0===u?void 0:u.content)||[],null==t||null===(s=t.relatedVideos)||void 0===s||s.cb}var c=o.getPlayer(e);c.on("timeupdate",(function(){var e,t,n=Math.floor(c.currentTime()),r=c.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&a.getVideoIdx()<=(null===(t=m)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var d,p=m.filter((function(e,t){return t==a.getVideoIdx()}));if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var v,g,h,x,y,b,w,E,C,N,T,k;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var I=null===(g=document.getElementsByClassName("next-ep-title"))||void 0===g?void 0:g[0],A=null===(h=document.getElementsByClassName("next-ep-img"))||void 0===h?void 0:h[0],L=null===(x=document.getElementsByClassName("next-ep-content"))||void 0===x?void 0:x[0],P=null===(y=p[0])||void 0===y?void 0:y.title;(null===(b=P)||void 0===b?void 0:b.length)>60&&(P=P.substr(0,60)+"..."),I.textContent="".concat(P),A.src=(null===(w=p[0])||void 0===w||null===(E=w.gist)||void 0===E||null===(C=E.imageGist)||void 0===C?void 0:C.r16x9)||(null==p||null===(N=p[0])||void 0===N?void 0:N.img)||(null===(T=window)||void 0===T||null===(k=T.customData)||void 0===k?void 0:k.fallbackImage),L.onclick=function(){return f(e)}}else{var B,M,S,j,O,q,R,X,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(e).append(V);var D=document.createElement("div");D.className="next-ep-header",D.textContent="Next up";var F=null===(B=p[0])||void 0===B?void 0:B.title,U=document.createElement("img");U.className="next-ep-img",U.src=(null===(M=p[0])||void 0===M||null===(S=M.gist)||void 0===S||null===(j=S.imageGist)||void 0===j?void 0:j.r16x9)||(null==p||null===(O=p[0])||void 0===O?void 0:O.img)||(null===(q=window)||void 0===q||null===(R=q.customData)||void 0===R?void 0:R.fallbackImage);var G=document.createElement("div");G.className="next-ep-title",(null===(X=F)||void 0===X?void 0:X.length)>60&&(F=F.substr(0,60)+"..."),G.textContent="".concat(F);var $=document.createElement("div");$.className="next-ep-content",$.append(U),$.append(G),$.onclick=function(){return f(e)},V.append(D),V.append($)}},exports.addTVProviderImage=function(e,t){var n=o.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var i=document.createElement("div");i.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(r),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"}))}},exports.initiateTrickplay=function(e){return k.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-61978e4d.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("./util-197a4f7c.js"),l=require("./captions-37b81672.js"),a=require("./renditions-fd408798.js"),s=require("./resolution-c59e995e.js"),u=require("./skin-aef573bd.js"),c=require("./browser-77c57718.js"),d=require("./localisation-56e0a999.js"),v=require("@babel/runtime/helpers/typeof");require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p,f=function(e){return new Promise((function(n,t){if(m(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}}))},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},y=function(e,n,t){var r=u.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.volume(i),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,"'")})},g=function(e){var n=u.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var b=[],k=0,O=null;function P(t,r,i){var o,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(o=r.watchHistory)||void 0===o||o.apiVersion;var d=null==r||null===(l=r.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==r||null===(a=r.watchHistory)||void 0===a||a.xapiKey;var m=(null==r||null===(s=r.video)||void 0===s?void 0:s.originalObjectId)||null,y=(null==r||null===(u=r.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),h=c?100:Math.floor(v/f*100),b={};y?function(t,r,i){var o=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(i),l=S(o),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return w(w({},e),{},n({},t,u[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));d<0?l.push(w(w({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=w(w(w({},l[d]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:h},d,r.siteOwner):(b=w(w({videoId:p,watchedTime:g,watchedPercentage:h,doneWatching:c,profileId:d},O&&{seriesId:O}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then((function(e){})).catch((function(e){}))),k=v+i}function S(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function j(e,n,t){var r=S(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var T=function(){var e=t(r.mark((function e(n){var t,o,l,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=u.getPlayer(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return a=e.sent,e.prev=6,e.next=9,f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,a.default(i),e.finish(14);case 17:null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==c.detectBrowser()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),I=function(e,n){var t=u.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,r,o,l,a,s=this.el(),u=i.dom.getPointerPosition(s,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){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*u,v.seek()}}))};var E=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),f("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)}}(),x=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=t(r.mark((function e(){var n;return r.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(i),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)}}(),C=function(){var e=t(r.mark((function e(){return r.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-54c6c570.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)}}(),R=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:E,loadEMELibrary:x,loadMuxPlugin:D,loadDvrSeekbar:C});function V(e){return N.apply(this,arguments)}function N(){return(N=t(r.mark((function e(n){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,E();case 3:t&&"Safari"==c.detectBrowser()&&Promise.resolve().then((function(){return R})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e,n){return L.apply(this,arguments)}function L(){return L=t(r.mark((function e(n,t){var i,o,l,a,s,u,c,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t?void 0:t.contentType)||"video",s=null==t||null===(i=t[a])||void 0===i?void 0:i.drmEnabled,u=(null==t||null===(o=t[a])||void 0===o||null===(l=o.liveDetails)||void 0===l?void 0:l.isDvrEnabled)||!1,c=(null==n?void 0:n.showPositiveSeekbar)||!1,e.prev=4,e.next=7,Promise.allSettled([s?x():null,T(n),null!=n&&null!==(d=n.analytics)&&void 0!==d&&d.muxKey?D():null,u&&c?C():null]);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),console.log("Error",e.t0);case 12:case"end":return e.stop()}}),e,null,[[4,9]])}))),L.apply(this,arguments)}function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var H=new Set,M=null,U=function(n,t,r){var i,o,l,a,s,u,c,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p[null==r||null===(i=r.Constants)||void 0===i?void 0:i.ASSET_NAME]=K(n),p["c3.cm.id"]=(null===(o=n[f])||void 0===o?void 0:o.id)||"Null",p["c3.cm.contentType"]=J(n),p[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),p[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==r||null===(s=r.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=z(n),p[null==r||null===(u=r.Constants)||void 0===u?void 0:u.PLAYER_NAME]="VL_WEB_PLAYER",p["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"}}(),p.DRMEnabled=(null===(c=n[f])||void 0===c?void 0:c.drmEnabled)||"None",p.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[r.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=G(n),p["c3.cm.genreList"]=F(n),p["c3.cm.genre"]=B(n),p["c3.cm.channel"]=W(n);var m=X(e.getCurrentSeries(),n);return p=q(q({},p),m)},B=function(e){var n,t,r,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},F=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"},W=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"NULL":(null==e||null===(n=e[r])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"Null"},z=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(t=n.categories)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.title)||"Null";var n,t,r},G=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},K=function(e){var n,t,r,i,o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(r=e[o])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||"Null";return"[".concat(a,"] ").concat(l)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var X=function(n,t){var r,i,o,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),c=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(o=n[u-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},Y=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"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Z=function(){var n=t(r.mark((function n(t,i){var o,l,a,s,c,d,v,p,f;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(null==i?void 0:i.convivaConfig)||{},l=o.trackConvivaPlayerEvent,a=o.paymentHandler,s=o.tveProvider,c=o.enable,d=(i||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(v=u.getPlayer(t),"function"==typeof(p=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,p("getConvivaObject");case 10:if(f=n.sent){n.next=13;break}return n.abrupt("return");case 13:v.ready((function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=Y(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})})),n||p("contentInfo",{DRMEnabled:"None"})})),v.on("loadstart",(function(){M&&M!==v.currentSrc()&&p("playbackEnded"),p("setPlayer",v),H.clear(),M=v.currentSrc();var n=Q(v.currentType()),t=e.getCurrentVideo(),r=U(t,v,f);r.authToken=d||"NULL",r.streamType=n,r.D2CType=a||"NONE",r.subscriberType=s||(a?"D2C":"FREE"),r["c3.cm.affiliate"]=s||"NULL",p("contentInfo",r)})),v.on("loadedmetadata",(function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})})),v.on("play",(function(){H.has(v.currentSrc())||(H.add(v.currentSrc()),p("playbackStarted",null))})),v.on("ended",(function(){H.has(v.currentSrc())&&H.delete(v.currentSrc()),p("playbackEnded")})),v.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})})),v.on("dispose",(function(){null==H||H.clear(),p("playbackEnded")}));case 20:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),$=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-99078201.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-cd9dc93e.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-337e2fe5.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-bce101a3.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-7e7c4ce1.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-8eb170ef.js")})).then((function(t){t.initialiseSkin(e,n)}))},ee=!1,ne=function(n,t){var r,i,o=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[o])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ee){var l=te(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ee=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function te(e,n,t){if(Array.isArray(e))return e.map((function(e){return te(e,n,t)}));if(null!==e&&"object"===v(e)){var r={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=te(e[i],n,t)})),r}return e}function re(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var oe=function(n,t,r,i){var o,l,a=i.res,s=i.sres,c=u.getPlayer(n),d=(null==a?void 0:a.contentType)||"video",v=(null==a||null===(o=a[d])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;e.setCurrentVideo(a),c&&(c.on("loadstart",(function(){v?r.resolve({status:!0,msg:"Video Loaded",response:a}):r.resolve(ie({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a}))})),c.on("loadeddata",(function(){var r,i,o;(null==c||!c.muted())&&y(n,sessionStorage.getItem("volume")||"100");var l=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var s,d,v=ie(ie({},t),a);!function(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(O=null==n||null===(i=n.series)||void 0===i?void 0:i.id),b=[],k=0,p=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=u.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());b.includes(k)||(e==k?(b.push(e),P(a,n,l)):e>k&&(k=e+l))})),a.one("ended",(function(){P(a,n,l,!0)})))}(n,v,null==l||null===(s=l.video)||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.id)}if(null!=t&&null!==(o=t.analytics)&&void 0!==o&&o.muxKey&&null!=c&&c.mux){var f,m,g,h,w,S,j=(null===(f=e.getCurrentVideo())||void 0===f?void 0:f.video)||(null==a?void 0:a.video),T=null==j?void 0:j.gist,I={env_key:null==t||null===(m=t.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==j||null===(h=j.series)||void 0===h?void 0:h.title,video_stream_type:null!=j&&null!==(w=j.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==t||null===(S=t.analytics)||void 0===S?void 0:S.userId};c.mux({debug:!1,data:I})}})),c.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];c.trigger("subtitlechanged",n)})),c.on("subtitlechanged",(function(e,n){var t,r,i,o,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(o=i.CastContext)||void 0===o||null===(l=o.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),c.tech_.on("retryplaylist",(function(){v&&ne(a,n)})),c.on("error",(function(){var t,i;(console.log("ERROR",c.error(),c.error().code),4===c.error().code&&v)?ne(a,n):(e.handleError(n,(null==c||null===(t=c.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==c||null===(i=c.error())||void 0===i?void 0:i.message)||"Some error occured",response:a}))})),c.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r,i,o,l=null===(r=e.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,d=s.p;u&&d<95&&setTimeout((function(){c.currentTime(u)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){c.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0);if(null!=c&&c.dvrSeekbar)try{c.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}})),c.on("volumechange",(function(){var e=100*c.volume().toFixed(2);c.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),c.on("chromecastDisconnected",(function(){if(v){c.currentSource();for(var e=c.textTracks(),n=e.length-1;n>=0;n--)c.removeRemoteTextTrack(e[n])}})))};function le(e){return ae.apply(this,arguments)}function ae(){return(ae=t(r.mark((function e(n){var t,i,o,l,a,s,u,c,d,v,p,m;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f("https://cdn.dashjs.org/latest/dash.all.min.js");case 2:o=this.el().querySelector("video")||this.el(),l=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),a=(null==n?void 0:n.keySystems)&&(null==n||null===(i=n.keySystems)||void 0===i?void 0:i["com.widevine.alpha"]),l&&o?(l.initialize(o,n.src,!0),a&&(d=null===(s=n.keySystems["com.widevine.alpha"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.microsoft.playready"])||void 0===u?void 0:u.url,p=null===(c=n.keySystems["com.widevine.alpha"])||void 0===c?void 0:c.licenseHeaders["X-AxDRM-Message"],m={"com.widevine.alpha":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":p}},"com.microsoft.playready":{serverURL:v,httpRequestHeaders:{"X-AxDRM-Message":p}}},l.setProtectionData(m))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ce,de=function(o,a,s,d){var v,p,f,m,y,g,h,w,b,k,O,P,S,j,T,E,x,D,C,R,V,N,L,_,q,H,M,U,B=a.res,F=void 0===B?null:B,W=a.sres,z=void 0===W?null:W,G=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],K=(null===(v=F)||void 0===v?void 0:v.contentType)||"video",J=u.impolicy16x9(null===(p=F)||void 0===p||null===(f=p[K])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(y=F)||void 0===y||null===(g=y[K])||void 0===g||null===(h=g.gist)||void 0===h||null===(w=h.imageGist)||void 0===w?void 0:w.r16x9),X=(null===(b=F)||void 0===b||null===(k=b[K])||void 0===k||null===(O=k.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,Y=(null===(P=F)||void 0===P||null===(S=P[K])||void 0===S||null===(j=S.streamingInfo)||void 0===j?void 0:j.isLiveStreafm)||!1,Q=(null===(T=F)||void 0===T||null===(E=T.ads)||void 0===E||null===(x=E.preRoll)||void 0===x||null===(D=x.adTags)||void 0===D||null===(C=D.web)||void 0===C?void 0:C.active)&&(null===(R=F)||void 0===R||null===(V=R.ads)||void 0===V||null===(N=V.preRoll)||void 0===N||null===(L=N.adTags)||void 0===L||null===(_=L.web)||void 0===_?void 0:_.url);F=ue(ue({},F),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var ee=(U={enableSmoothSeeking:!0,controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==s.skin,liveui:X},n(U,"autoplay",null==s?void 0:s.autoplay),n(U,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!Q),n(U,"loop",(null==s?void 0:s.loop)||!1),n(U,"audioPosterMode",null==s?void 0:s.audioPosterMode),n(U,"html5",ue(ue({vhs:ue(ue({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==s||null===(q=s.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0}),nativeTextTracks:!0},0==(null==s||null===(H=s.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(M=s.customData)||void 0===M?void 0:M.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(U,"poster",J),n(U,"techOrder",G),n(U,"chromecast",{requestCustomDataFn:function(e){var n=getPlayer(o),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var r,i,o,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,g=null==y?void 0:y.url;f.licenseUrl=g;var h=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=h}var w=(null==e||null===(r=e[p])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(o=e[p])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;f.duration=b;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(F,e,t)}}),U);if(!i.getPlayers()[o])var ne=i(o,ee,function(){var n=t(r.mark((function n(){var t,a,u,v,p,f,m,y,g,h,w,b,k,O,P,S,j,T,E,x,D,C;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ne),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,A(s,F);case 5:O=null===(t=F)||void 0===t||null===(a=t[K])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,Y&&d.resolve(ue({status:!0,msg:"Player Initialised"},z?{seriesResponse:z,response:F}:{response:F})),e.inititateBeacon(o,null==s?void 0:s.analyticsCb),Z(o,s),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),X&&I(o,O),!Q||null!=s&&null!==(v=s.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(o,Q,F),P=e.getSource(F,o),console.log(P),null!=s&&s.nearestClusterUrl&&(P=e.getUpdatedClusterSource(P,s.nearestClusterUrl)),"Chrome"==c.detectBrowser()&&(null===(p=F)||void 0===p||null===(f=p.video)||void 0===f?void 0:f.isSSAIEnabled)?le.call(this,P):P?e.loadVideo(o,P):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:F}),e.handleError(o,"Incompatible / Missing Source")),((null===(m=F)||void 0===m||null===(y=m[K])||void 0===y||null===(g=y.contentDetails)||void 0===g||null===(h=g.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(w=F)||void 0===w||null===(b=w[K])||void 0===b||null===(k=b.closedCaptions)||void 0===k?void 0:k.length)>0)&&(C=(null===(j=F)||void 0===j||null===(T=j[K])||void 0===T||null===(E=T.contentDetails)||void 0===E?void 0:E.closedCaptions)||(null===(x=F)||void 0===x||null===(D=x[K])||void 0===D?void 0:D.closedCaptions),S=C.filter((function(e){return"VTT"===e.format})),l.addCaptions(o,S)),null!=s&&s.disableControls?e.disableControls(o):$(o,ue(ue(ue({},s),ee),{},{liveVideo:Y,isDvrEnabled:X,res:F,sres:z})),oe(o,ue(ue(ue({},s),ee),{},{liveVideo:Y}),d,{res:F,sres:z});case 20:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function ve(e,n){return pe.apply(this,arguments)}function pe(){return(pe=t(r.mark((function n(t,i){var o,l,a,s,u,c;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.resolve,l=i.reject,a=null==t?void 0:t.videoId,s=null==t?void 0:t.playerId,u=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:c=n.sent,e.getVideoDetails(a,c).then((function(n){var r,i,d,v;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(d=i.gist)||void 0===d?void 0:d.contentType,e.setCurrentVideo(null==n?void 0:n.data);var p,f=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(v=t.watchHistory)&&void 0!==v&&v.enable&&!u)if((null===(p=t.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,h=j((null===(m=t.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==t?void 0:t.siteOwner);if(h&&h.length)t.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",de(s,{res:f},t,{resolve:o,reject:l})}else e.getVideoInfo(a,c).then((function(e){var n,r,i,o,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,r,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(e))})).finally((function(){de(s,{res:f},t,{resolve:o,reject:l})}));else de(s,{res:f},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,a)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function fe(e,n){return me.apply(this,arguments)}function me(){return(me=t(r.mark((function n(t,i){var o,l,a,s,u;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.resolve,l=i.reject,n.next=3,e.getToken();case 3:a=n.sent,s=null==t?void 0:t.playerId,u=null==t?void 0:t.epg,e.getLinearChannelDetails(u,a).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,de(s,{res:n},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,videoId)}));case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function ye(e,n){return ge.apply(this,arguments)}function ge(){return(ge=t(r.mark((function n(t,i){var o,l,a,s,u,c,d;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:s=n.sent,u=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(c)),d=null==t||null===(o=t.series)||void 0===o?void 0:o.id,e.getSeriesDetails(d,s).then((function(n){var r,i,o,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var p=videoId||(null==v||null===(r=v[0])||void 0===r||null===(i=r.episodes)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.id);e.createSeriesWatchMap(d,s),e.getVideoDetails(p,s).then((function(n){var r,i,o;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(n.data),de(u,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,u,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,u,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:o.onTimeUpdate,getVideoDuration:o.getVideoDuration,onVideoEnded:o.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),console.log("%c Handlers added ","background: #bdf369; color: #000"),new Promise(function(){var i=t(r.mark((function t(i,o){var l,a,s,c,v,p,m,y,g,h,w,b,k,O,P,S,j,T,I,E,x,D;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(w=(null==n?void 0:n.videoSourceUrl)||!1,b=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,P=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=O,S=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=16;break}if(sessionStorage.setItem("vlp_token",S),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),S&&!e.isTokenExpired(S)){t.next=15;break}return o({status:!1,msg:"".concat(S?"Token is expired !":"Missing Authorization Token"),response:{token:S}}),t.abrupt("return");case 15:ce=JSON.parse(atob(S.split(".")[1]));case 16:n.isAnonymousUser=!(null===(s=ce)||void 0===s||!s.anonymousId),n.siteOwner=(null===(c=ce)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=ce)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(p=ce)||void 0===p?void 0:p.userId),window.watchHistory=n.watchHistory||null,j=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(m=n.series)&&void 0!==m&&m.enable?null:null==n?void 0:n.chromecastReceiverId,T=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(I=null==n?void 0:n.errors)&&(window.customErrors=I),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(g=n.customData)||void 0===g?void 0:g.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),V(n),T&&f("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then((function(){return e.runGtag(T)})).catch((function(e){})),(E=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(D={directPlaybackUrl:w,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(x,S).then((function(e){de(j,{res:we(we({},e),D)},n,{resolve:i,reject:o})})).catch((function(n){e.initiateErrorHandling(n,j,o,x)})):de(j,{res:D},n,{resolve:i,reject:o})):P?ye(n,{resolve:i,reject:o}):k?fe(n,{resolve:i,reject:o}):ve(n,{resolve:i,reject:o});case 35:case"end":return t.stop()}}),t)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:u.getPlayer,play:e.play,pause:e.pause,detectBrowser:c.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:o.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:g,disableControls:e.disableControls,setPlaybackSpeed:o.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-61978e4d.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("./util-197a4f7c.js"),l=require("./captions-37b81672.js"),a=require("./renditions-fd408798.js"),s=require("./resolution-c59e995e.js"),u=require("./skin-aef573bd.js"),c=require("./browser-77c57718.js"),d=require("./localisation-56e0a999.js"),v=require("@babel/runtime/helpers/typeof");require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p,f=function(e){return new Promise((function(n,t){if(m(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}}))},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},y=function(e,n,t){var r=u.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.volume(i),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,"'")})},g=function(e){var n=u.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var b=[],k=0,O=null;function P(t,r,i){var o,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(o=r.watchHistory)||void 0===o||o.apiVersion;var d=null==r||null===(l=r.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==r||null===(a=r.watchHistory)||void 0===a||a.xapiKey;var m=(null==r||null===(s=r.video)||void 0===s?void 0:s.originalObjectId)||null,y=(null==r||null===(u=r.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),h=c?100:Math.floor(v/f*100),b={};y?function(t,r,i){var o=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(i),l=S(o),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return w(w({},e),{},n({},t,u[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));d<0?l.push(w(w({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=w(w(w({},l[d]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:h},d,r.siteOwner):(b=w(w({videoId:p,watchedTime:g,watchedPercentage:h,doneWatching:c,profileId:d},O&&{seriesId:O}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then((function(e){})).catch((function(e){}))),k=v+i}function S(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function j(e,n,t){var r=S(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var T=function(){var e=t(r.mark((function e(n){var t,o,l,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=u.getPlayer(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return a=e.sent,e.prev=6,e.next=9,f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,a.default(i),e.finish(14);case 17:null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==c.detectBrowser()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),I=function(e,n){var t=u.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,r,o,l,a,s=this.el(),u=i.dom.getPointerPosition(s,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){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*u,v.seek()}}))};var E=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),f("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)}}(),x=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=t(r.mark((function e(){var n;return r.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(i),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)}}(),C=function(){var e=t(r.mark((function e(){return r.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-54c6c570.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)}}(),R=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:E,loadEMELibrary:x,loadMuxPlugin:D,loadDvrSeekbar:C});function V(e){return N.apply(this,arguments)}function N(){return(N=t(r.mark((function e(n){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,E();case 3:t&&"Safari"==c.detectBrowser()&&Promise.resolve().then((function(){return R})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e,n){return L.apply(this,arguments)}function L(){return L=t(r.mark((function e(n,t){var i,o,l,a,s,u,c,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t?void 0:t.contentType)||"video",s=null==t||null===(i=t[a])||void 0===i?void 0:i.drmEnabled,u=(null==t||null===(o=t[a])||void 0===o||null===(l=o.liveDetails)||void 0===l?void 0:l.isDvrEnabled)||!1,c=(null==n?void 0:n.showPositiveSeekbar)||!1,e.prev=4,e.next=7,Promise.allSettled([s?x():null,T(n),null!=n&&null!==(d=n.analytics)&&void 0!==d&&d.muxKey?D():null,u&&c?C():null]);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),console.log("Error",e.t0);case 12:case"end":return e.stop()}}),e,null,[[4,9]])}))),L.apply(this,arguments)}function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var H=new Set,M=null,U=function(n,t,r){var i,o,l,a,s,u,c,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p[null==r||null===(i=r.Constants)||void 0===i?void 0:i.ASSET_NAME]=K(n),p["c3.cm.id"]=(null===(o=n[f])||void 0===o?void 0:o.id)||"Null",p["c3.cm.contentType"]=J(n),p[null==r||null===(l=r.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),p[null==r||null===(a=r.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==r||null===(s=r.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=z(n),p[null==r||null===(u=r.Constants)||void 0===u?void 0:u.PLAYER_NAME]="VL_WEB_PLAYER",p["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"}}(),p.DRMEnabled=(null===(c=n[f])||void 0===c?void 0:c.drmEnabled)||"None",p.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[r.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=G(n),p["c3.cm.genreList"]=F(n),p["c3.cm.genre"]=B(n),p["c3.cm.channel"]=W(n);var m=X(e.getCurrentSeries(),n);return p=q(q({},p),m)},B=function(e){var n,t,r,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},F=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"},W=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"NULL":(null==e||null===(n=e[r])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"Null"},z=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(t=n.categories)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.title)||"Null";var n,t,r},G=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},K=function(e){var n,t,r,i,o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(r=e[o])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.id)||"Null";return"[".concat(a,"] ").concat(l)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var X=function(n,t){var r,i,o,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),c=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(o=n[u-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},Y=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"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Z=function(){var n=t(r.mark((function n(t,i){var o,l,a,s,c,d,v,p,f;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(null==i?void 0:i.convivaConfig)||{},l=o.trackConvivaPlayerEvent,a=o.paymentHandler,s=o.tveProvider,c=o.enable,d=(i||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(v=u.getPlayer(t),"function"==typeof(p=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,p("getConvivaObject");case 10:if(f=n.sent){n.next=13;break}return n.abrupt("return");case 13:v.ready((function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=Y(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})})),n||p("contentInfo",{DRMEnabled:"None"})})),v.on("loadstart",(function(){M&&M!==v.currentSrc()&&p("playbackEnded"),p("setPlayer",v),H.clear(),M=v.currentSrc();var n=Q(v.currentType()),t=e.getCurrentVideo(),r=U(t,v,f);r.authToken=d||"NULL",r.streamType=n,r.D2CType=a||"NONE",r.subscriberType=s||(a?"D2C":"FREE"),r["c3.cm.affiliate"]=s||"NULL",p("contentInfo",r)})),v.on("loadedmetadata",(function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})})),v.on("play",(function(){H.has(v.currentSrc())||(H.add(v.currentSrc()),p("playbackStarted",null))})),v.on("ended",(function(){H.has(v.currentSrc())&&H.delete(v.currentSrc()),p("playbackEnded")})),v.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})})),v.on("dispose",(function(){null==H||H.clear(),p("playbackEnded")}));case 20:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),$=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-99078201.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-cd9dc93e.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-f9ebb9a6.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-bce101a3.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-7e7c4ce1.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-bcd269a3.js")})).then((function(t){t.initialiseSkin(e,n)}))},ee=!1,ne=function(n,t){var r,i,o=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[o])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ee){var l=te(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ee=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function te(e,n,t){if(Array.isArray(e))return e.map((function(e){return te(e,n,t)}));if(null!==e&&"object"===v(e)){var r={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=te(e[i],n,t)})),r}return e}function re(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var oe=function(n,t,r,i){var o,l,a=i.res,s=i.sres,c=u.getPlayer(n),d=(null==a?void 0:a.contentType)||"video",v=(null==a||null===(o=a[d])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;e.setCurrentVideo(a),c&&(c.on("loadstart",(function(){v?r.resolve({status:!0,msg:"Video Loaded",response:a}):r.resolve(ie({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a}))})),c.on("loadeddata",(function(){var r,i,o;(null==c||!c.muted())&&y(n,sessionStorage.getItem("volume")||"100");var l=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var s,d,v=ie(ie({},t),a);!function(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(O=null==n||null===(i=n.series)||void 0===i?void 0:i.id),b=[],k=0,p=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=u.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());b.includes(k)||(e==k?(b.push(e),P(a,n,l)):e>k&&(k=e+l))})),a.one("ended",(function(){P(a,n,l,!0)})))}(n,v,null==l||null===(s=l.video)||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.id)}if(null!=t&&null!==(o=t.analytics)&&void 0!==o&&o.muxKey&&null!=c&&c.mux){var f,m,g,h,w,S,j=(null===(f=e.getCurrentVideo())||void 0===f?void 0:f.video)||(null==a?void 0:a.video),T=null==j?void 0:j.gist,I={env_key:null==t||null===(m=t.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==j||null===(h=j.series)||void 0===h?void 0:h.title,video_stream_type:null!=j&&null!==(w=j.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==t||null===(S=t.analytics)||void 0===S?void 0:S.userId};c.mux({debug:!1,data:I})}})),c.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];c.trigger("subtitlechanged",n)})),c.on("subtitlechanged",(function(e,n){var t,r,i,o,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(o=i.CastContext)||void 0===o||null===(l=o.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),c.tech_.on("retryplaylist",(function(){v&&ne(a,n)})),c.on("error",(function(){var t,i;(console.log("ERROR",c.error(),c.error().code),4===c.error().code&&v)?ne(a,n):(e.handleError(n,(null==c||null===(t=c.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==c||null===(i=c.error())||void 0===i?void 0:i.message)||"Some error occured",response:a}))})),c.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r,i,o,l=null===(r=e.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,d=s.p;u&&d<95&&setTimeout((function(){c.currentTime(u)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){c.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0);if(null!=c&&c.dvrSeekbar)try{c.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}})),c.on("volumechange",(function(){var e=100*c.volume().toFixed(2);c.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),c.on("chromecastDisconnected",(function(){if(v){c.currentSource();for(var e=c.textTracks(),n=e.length-1;n>=0;n--)c.removeRemoteTextTrack(e[n])}})))};function le(e){return ae.apply(this,arguments)}function ae(){return(ae=t(r.mark((function e(n){var t,i,o,l,a,s,u,c,d,v,p,m;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f("https://cdn.dashjs.org/latest/dash.all.min.js");case 2:o=this.el().querySelector("video")||this.el(),l=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),a=(null==n?void 0:n.keySystems)&&(null==n||null===(i=n.keySystems)||void 0===i?void 0:i["com.widevine.alpha"]),l&&o?(l.initialize(o,n.src,!0),a&&(d=null===(s=n.keySystems["com.widevine.alpha"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.microsoft.playready"])||void 0===u?void 0:u.url,p=null===(c=n.keySystems["com.widevine.alpha"])||void 0===c?void 0:c.licenseHeaders["X-AxDRM-Message"],m={"com.widevine.alpha":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":p}},"com.microsoft.playready":{serverURL:v,httpRequestHeaders:{"X-AxDRM-Message":p}}},l.setProtectionData(m))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ce,de=function(o,a,s,d){var v,p,f,m,y,g,h,w,b,k,O,P,S,j,T,E,x,D,C,R,V,N,L,_,q,H,M,U,B,F,W=a.res,z=void 0===W?null:W,G=a.sres,K=void 0===G?null:G,J=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],X=(null===(v=z)||void 0===v?void 0:v.contentType)||"video",Y=u.impolicy16x9(null===(p=z)||void 0===p||null===(f=p[X])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(y=z)||void 0===y||null===(g=y[X])||void 0===g||null===(h=g.gist)||void 0===h||null===(w=h.imageGist)||void 0===w?void 0:w.r16x9),Q=(null===(b=z)||void 0===b||null===(k=b[X])||void 0===k||null===(O=k.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,ee=(null===(P=z)||void 0===P||null===(S=P[X])||void 0===S||null===(j=S.streamingInfo)||void 0===j?void 0:j.isLiveStreafm)||!1,ne=(null===(T=z)||void 0===T||null===(E=T.ads)||void 0===E||null===(x=E.preRoll)||void 0===x||null===(D=x.adTags)||void 0===D||null===(C=D.web)||void 0===C?void 0:C.active)&&(null===(R=z)||void 0===R||null===(V=R.ads)||void 0===V||null===(N=V.preRoll)||void 0===N||null===(L=N.adTags)||void 0===L||null===(_=L.web)||void 0===_?void 0:_.url);z=ue(ue({},z),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var te="Chrome"==c.detectBrowser()&&(null===(q=z)||void 0===q||null===(H=q.video)||void 0===H?void 0:H.isSSAIEnabled),re=(F={enableSmoothSeeking:!0,controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==s.skin,liveui:Q},n(F,"autoplay",null==s?void 0:s.autoplay),n(F,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!ne),n(F,"loop",(null==s?void 0:s.loop)||!1),n(F,"audioPosterMode",null==s?void 0:s.audioPosterMode),n(F,"html5",ue(ue({vhs:ue(ue({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==s||null===(M=s.customData)||void 0===M?void 0:M.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0}),nativeTextTracks:!!te},0==(null==s||null===(U=s.customData)||void 0===U?void 0:U.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(B=s.customData)||void 0===B?void 0:B.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(F,"poster",Y),n(F,"techOrder",J),n(F,"chromecast",{requestCustomDataFn:function(e){var n=getPlayer(o),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var r,i,o,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,g=null==y?void 0:y.url;f.licenseUrl=g;var h=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=h}var w=(null==e||null===(r=e[p])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(o=e[p])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;f.duration=b;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(z,e,t)}}),F);if(!i.getPlayers()[o])var ie=i(o,re,function(){var n=t(r.mark((function n(){var t,a,u,c,v,p,f,m,y,g,h,w,b,k,O,P,S,j,T,E;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ie),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,A(s,z);case 5:w=null===(t=z)||void 0===t||null===(a=t[X])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ee&&d.resolve(ue({status:!0,msg:"Player Initialised"},K?{seriesResponse:K,response:z}:{response:z})),e.inititateBeacon(o,null==s?void 0:s.analyticsCb),Z(o,s),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),Q&&I(o,w),!ne||null!=s&&null!==(c=s.customData)&&void 0!==c&&c.disableAds||e.initialiseAdvertisement(o,ne,z),b=e.getSource(z,o),console.log(b),null!=s&&s.nearestClusterUrl&&(b=e.getUpdatedClusterSource(b,s.nearestClusterUrl)),te?le.call(this,b):b?e.loadVideo(o,b):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:z}),e.handleError(o,"Incompatible / Missing Source")),((null===(v=z)||void 0===v||null===(p=v[X])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(m=f.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=z)||void 0===y||null===(g=y[X])||void 0===g||null===(h=g.closedCaptions)||void 0===h?void 0:h.length)>0)&&(E=(null===(O=z)||void 0===O||null===(P=O[X])||void 0===P||null===(S=P.contentDetails)||void 0===S?void 0:S.closedCaptions)||(null===(j=z)||void 0===j||null===(T=j[X])||void 0===T?void 0:T.closedCaptions),k=E.filter((function(e){return"VTT"===e.format})),l.addCaptions(o,k)),null!=s&&s.disableControls?e.disableControls(o):$(o,ue(ue(ue({},s),re),{},{liveVideo:ee,isDvrEnabled:Q,res:z,sres:K})),oe(o,ue(ue(ue({},s),re),{},{liveVideo:ee}),d,{res:z,sres:K});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function ve(e,n){return pe.apply(this,arguments)}function pe(){return(pe=t(r.mark((function n(t,i){var o,l,a,s,u,c;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.resolve,l=i.reject,a=null==t?void 0:t.videoId,s=null==t?void 0:t.playerId,u=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:c=n.sent,e.getVideoDetails(a,c).then((function(n){var r,i,d,v;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(d=i.gist)||void 0===d?void 0:d.contentType,e.setCurrentVideo(null==n?void 0:n.data);var p,f=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(v=t.watchHistory)&&void 0!==v&&v.enable&&!u)if((null===(p=t.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,h=j((null===(m=t.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==t?void 0:t.siteOwner);if(h&&h.length)t.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",de(s,{res:f},t,{resolve:o,reject:l})}else e.getVideoInfo(a,c).then((function(e){var n,r,i,o,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,r,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(e))})).finally((function(){de(s,{res:f},t,{resolve:o,reject:l})}));else de(s,{res:f},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,a)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function fe(e,n){return me.apply(this,arguments)}function me(){return(me=t(r.mark((function n(t,i){var o,l,a,s,u;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.resolve,l=i.reject,n.next=3,e.getToken();case 3:a=n.sent,s=null==t?void 0:t.playerId,u=null==t?void 0:t.epg,e.getLinearChannelDetails(u,a).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,de(s,{res:n},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,videoId)}));case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function ye(e,n){return ge.apply(this,arguments)}function ge(){return(ge=t(r.mark((function n(t,i){var o,l,a,s,u,c,d;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:s=n.sent,u=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(c)),d=null==t||null===(o=t.series)||void 0===o?void 0:o.id,e.getSeriesDetails(d,s).then((function(n){var r,i,o,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var p=videoId||(null==v||null===(r=v[0])||void 0===r||null===(i=r.episodes)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.id);e.createSeriesWatchMap(d,s),e.getVideoDetails(p,s).then((function(n){var r,i,o;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(n.data),de(u,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,u,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,u,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:o.onTimeUpdate,getVideoDuration:o.getVideoDuration,onVideoEnded:o.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),console.log("%c Handlers added ","background: #bdf369; color: #000"),new Promise(function(){var i=t(r.mark((function t(i,o){var l,a,s,c,v,p,m,y,g,h,w,b,k,O,P,S,j,T,I,E,x,D;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(w=(null==n?void 0:n.videoSourceUrl)||!1,b=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,P=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=O,S=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=16;break}if(sessionStorage.setItem("vlp_token",S),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),S&&!e.isTokenExpired(S)){t.next=15;break}return o({status:!1,msg:"".concat(S?"Token is expired !":"Missing Authorization Token"),response:{token:S}}),t.abrupt("return");case 15:ce=JSON.parse(atob(S.split(".")[1]));case 16:n.isAnonymousUser=!(null===(s=ce)||void 0===s||!s.anonymousId),n.siteOwner=(null===(c=ce)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=ce)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(p=ce)||void 0===p?void 0:p.userId),window.watchHistory=n.watchHistory||null,j=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(m=n.series)&&void 0!==m&&m.enable?null:null==n?void 0:n.chromecastReceiverId,T=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(I=null==n?void 0:n.errors)&&(window.customErrors=I),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(g=n.customData)||void 0===g?void 0:g.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),V(n),T&&f("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then((function(){return e.runGtag(T)})).catch((function(e){})),(E=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(D={directPlaybackUrl:w,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(x,S).then((function(e){de(j,{res:we(we({},e),D)},n,{resolve:i,reject:o})})).catch((function(n){e.initiateErrorHandling(n,j,o,x)})):de(j,{res:D},n,{resolve:i,reject:o})):P?ye(n,{resolve:i,reject:o}):k?fe(n,{resolve:i,reject:o}):ve(n,{resolve:i,reject:o});case 35:case"end":return t.stop()}}),t)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:u.getPlayer,play:e.play,pause:e.pause,detectBrowser:c.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:o.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:g,disableControls:e.disableControls,setPlaybackSpeed:o.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
@@ -1 +1 @@
1
- "use strict";var e=require("./features-60b6a83e.js"),r=require("./skin-aef573bd.js"),i=require("./index-97b0b73e.js"),l=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var a=require("video.js"),o=require("./keyboardShortcuts-65ac75f6.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./generic-61978e4d.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./captions-37b81672.js"),require("./renditions-fd408798.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/toConsumableArray"),require("./autoNextVideo-0e700dee.js"),require("./util-197a4f7c.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray");function n(a,o){var n=r.getPlayer(a);n&&(n.on("loadeddata",(function(){var e,n,u,t,d;!function(e){var i=r.getPlayer(e);i&&i.qualityMenu({useResolutionLabels:!0})}(a),!(null!=o&&null!==(e=o.series)&&void 0!==e&&e.enable||null!==(n=window)&&void 0!==n&&null!==(u=n.app_data)&&void 0!==u&&null!==(t=u.appcmsMain)&&void 0!==t&&null!==(d=t.features)&&void 0!==d&&d.auto_play)||null!=o&&o.liveVideo||i.addNextEpPreview(a,o),null!=o&&o.liveVideo||l.isMobile()||i.initiateTrickplay(a)})),n.one("play",(function(){var r,i,l,o;null!==(r=window)&&void 0!==r&&null!==(i=r.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(a,null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}var u=function(){var e,r,i,l,o,n,u,t,d,s,v,c,b=a.dom.$(".vjs-play-progress"),p=a.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");p&&(p.style.color="".concat(null===(e=window)||void 0===e||null===(r=e.app_data)||void 0===r||null===(i=r.appcmsMain)||void 0===i||null===(l=i.brand)||void 0===l||null===(o=l.cta)||void 0===o||null===(n=o.primary)||void 0===n?void 0:n.backgroundColor)),b&&(b.style.background="".concat(null===(u=window)||void 0===u||null===(t=u.app_data)||void 0===t||null===(d=t.appcmsMain)||void 0===d||null===(s=d.brand)||void 0===s||null===(v=s.cta)||void 0===v||null===(c=v.primary)||void 0===c?void 0:c.backgroundColor))};exports.initialiseSkin=function(l,a){r.getPlayer(l).addClass("skin_vlone"),n(l,a),function(r,l){var a,n,u,t;(null==l||null===(a=l.relatedVideos)||void 0===a||null===(n=a.content)||void 0===n?void 0:n.length)>0&&e.addVideoSelector(r,null==l?void 0:l.relatedVideos);null!=l&&null!==(u=l.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(r,l);(null==l||null===(t=l.streams)||void 0===t?void 0:t.length)>1&&e.addMulticamSelector(r,null==l?void 0:l.streams);i.addTVProviderImage(r,l),o.initialiseKeyboardEvents(r,l)}(l,a),u()};
1
+ "use strict";var e=require("./features-60b6a83e.js"),r=require("./skin-aef573bd.js"),i=require("./index-924a8bef.js"),l=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var a=require("video.js"),o=require("./keyboardShortcuts-65ac75f6.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./generic-61978e4d.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./captions-37b81672.js"),require("./renditions-fd408798.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/toConsumableArray"),require("./autoNextVideo-0e700dee.js"),require("./util-197a4f7c.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray");function n(a,o){var n=r.getPlayer(a);n&&(n.on("loadeddata",(function(){var e,n,u,t,d;!function(e){var i=r.getPlayer(e);i&&i.qualityMenu({useResolutionLabels:!0})}(a),!(null!=o&&null!==(e=o.series)&&void 0!==e&&e.enable||null!==(n=window)&&void 0!==n&&null!==(u=n.app_data)&&void 0!==u&&null!==(t=u.appcmsMain)&&void 0!==t&&null!==(d=t.features)&&void 0!==d&&d.auto_play)||null!=o&&o.liveVideo||i.addNextEpPreview(a,o),null!=o&&o.liveVideo||l.isMobile()||i.initiateTrickplay(a)})),n.one("play",(function(){var r,i,l,o;null!==(r=window)&&void 0!==r&&null!==(i=r.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(a,null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}var u=function(){var e,r,i,l,o,n,u,t,d,s,v,c,b=a.dom.$(".vjs-play-progress"),p=a.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");p&&(p.style.color="".concat(null===(e=window)||void 0===e||null===(r=e.app_data)||void 0===r||null===(i=r.appcmsMain)||void 0===i||null===(l=i.brand)||void 0===l||null===(o=l.cta)||void 0===o||null===(n=o.primary)||void 0===n?void 0:n.backgroundColor)),b&&(b.style.background="".concat(null===(u=window)||void 0===u||null===(t=u.app_data)||void 0===t||null===(d=t.appcmsMain)||void 0===d||null===(s=d.brand)||void 0===s||null===(v=s.cta)||void 0===v||null===(c=v.primary)||void 0===c?void 0:c.backgroundColor))};exports.initialiseSkin=function(l,a){r.getPlayer(l).addClass("skin_vlone"),n(l,a),function(r,l){var a,n,u,t;(null==l||null===(a=l.relatedVideos)||void 0===a||null===(n=a.content)||void 0===n?void 0:n.length)>0&&e.addVideoSelector(r,null==l?void 0:l.relatedVideos);null!=l&&null!==(u=l.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(r,l);(null==l||null===(t=l.streams)||void 0===t?void 0:t.length)>1&&e.addMulticamSelector(r,null==l?void 0:l.streams);i.addTVProviderImage(r,l),o.initialiseKeyboardEvents(r,l)}(l,a),u()};
@@ -1 +1 @@
1
- "use strict";var e=require("./features-60b6a83e.js"),l=require("./icons-0ea2e662.js"),i=require("./skin-aef573bd.js"),r=require("./renditions-fd408798.js"),n=require("./captions-37b81672.js"),o=require("./index-97b0b73e.js"),t=require("./browser-77c57718.js");function d(l,d){var u=i.getPlayer(l);u&&(u.on("loadeddata",(function(){var i,a,s,v,c,p,m;(null===(i=r.getRenditions(l))||void 0===i?void 0:i.length)>0&&e.addSettingsButtonV2(l,d),(null===(a=n.getCaptions(l))||void 0===a?void 0:a.length)>0&&e.addCaptionButton(l,d),!(null!=d&&null!==(s=d.series)&&void 0!==s&&s.enable||null!==(v=window)&&void 0!==v&&null!==(c=v.app_data)&&void 0!==c&&null!==(p=c.appcmsMain)&&void 0!==p&&null!==(m=p.features)&&void 0!==m&&m.auto_play)||null!=d&&d.liveVideo||o.addNextEpPreview(l,d),function(e,l){var i,r=Math.floor(e/60),n=null===(i=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===i?void 0:i[0];n&&(n.style.marginRight=r>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],t=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(t[0].style.display="block",n&&(n.style.marginRight="56px"))}(u.duration(),(null==d?void 0:d.liveVideo)||!1),null!=d&&d.liveVideo||t.isMobile()||o.initiateTrickplay(l)})),u.one("play",(function(){var i,r,n,o;null!==(i=window)&&void 0!==i&&null!==(r=i.customData)&&void 0!==r&&r.iframeOverlayUrl&&e.addOutputtingOverlay(l,null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("./generic-61978e4d.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/toConsumableArray"),require("./autoNextVideo-0e700dee.js"),require("./util-197a4f7c.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),exports.initialiseSkin=function(r,n){i.getPlayer(r).addClass("skin_defaultv2"),function(){"Chrome"==t.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));Promise.resolve().then((function(){return require("./skin-87c06e34.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),d(r,n),function(e,r){var n,o,t,d,u,a,s=i.getPlayer(e);null==s||null===(n=s.controlBar)||void 0===n||null===(o=n.getChild("FullscreenToggle"))||void 0===o||null===(t=o.el())||void 0===t||t.appendChild(i.createIconMarkup(l.MinimizeSvg(window.controlsColor))),null==s||null===(d=s.controlBar)||void 0===d||null===(u=d.getChild("FullscreenToggle"))||void 0===u||null===(a=u.el())||void 0===a||a.appendChild(i.createIconMarkup(l.MaximizeSvg(window.controlsColor)));var v=document.getElementsByClassName("vjs-time-control");r.liveVideo&&v[0]&&(v[0].style.display="none")}(r,n),function(i,r){var n,o,t,d,u,a;0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)&&e.addSkipButton(i,"defaultV2",l.SkipSvgV2());(0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)||1==(null==r?void 0:r.liveui))&&e.addRewindButton(i,"defaultV2",l.RewindSvgV2());r.liveVideo||e.addSlowMotion(i);(null==r||null===(n=r.relatedVideos)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector_DEFAULTV2_TEMP(i,null==r?void 0:r.relatedVideos);(null==r||null===(t=r.streams)||void 0===t?void 0:t.length)>1&&e.addMulticamSelector_DEFAULTV2_TEMP(i,null==r?void 0:r.streams);(null==r||null===(d=r.playlist)||void 0===d||null===(u=d.content)||void 0===u?void 0:u.length)>0&&e.addPlaylistSelector(i,null==r?void 0:r.playlist);null!=r&&null!==(a=r.series)&&void 0!==a&&a.enable&&e.addSeriesSelectorV2_DEFAULTV2_TEMP(i,r)}(r,n),o.addTVProviderImage(r,n)};
1
+ "use strict";var e=require("./features-60b6a83e.js"),l=require("./icons-0ea2e662.js"),i=require("./skin-aef573bd.js"),r=require("./renditions-fd408798.js"),n=require("./captions-37b81672.js"),o=require("./index-924a8bef.js"),t=require("./browser-77c57718.js");function d(l,d){var u=i.getPlayer(l);u&&(u.on("loadeddata",(function(){var i,a,s,v,c,p,m;(null===(i=r.getRenditions(l))||void 0===i?void 0:i.length)>0&&e.addSettingsButtonV2(l,d),(null===(a=n.getCaptions(l))||void 0===a?void 0:a.length)>0&&e.addCaptionButton(l,d),!(null!=d&&null!==(s=d.series)&&void 0!==s&&s.enable||null!==(v=window)&&void 0!==v&&null!==(c=v.app_data)&&void 0!==c&&null!==(p=c.appcmsMain)&&void 0!==p&&null!==(m=p.features)&&void 0!==m&&m.auto_play)||null!=d&&d.liveVideo||o.addNextEpPreview(l,d),function(e,l){var i,r=Math.floor(e/60),n=null===(i=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===i?void 0:i[0];n&&(n.style.marginRight=r>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],t=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(t[0].style.display="block",n&&(n.style.marginRight="56px"))}(u.duration(),(null==d?void 0:d.liveVideo)||!1),null!=d&&d.liveVideo||t.isMobile()||o.initiateTrickplay(l)})),u.one("play",(function(){var i,r,n,o;null!==(i=window)&&void 0!==i&&null!==(r=i.customData)&&void 0!==r&&r.iframeOverlayUrl&&e.addOutputtingOverlay(l,null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("./generic-61978e4d.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/toConsumableArray"),require("./autoNextVideo-0e700dee.js"),require("./util-197a4f7c.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),exports.initialiseSkin=function(r,n){i.getPlayer(r).addClass("skin_defaultv2"),function(){"Chrome"==t.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));Promise.resolve().then((function(){return require("./skin-87c06e34.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),d(r,n),function(e,r){var n,o,t,d,u,a,s=i.getPlayer(e);null==s||null===(n=s.controlBar)||void 0===n||null===(o=n.getChild("FullscreenToggle"))||void 0===o||null===(t=o.el())||void 0===t||t.appendChild(i.createIconMarkup(l.MinimizeSvg(window.controlsColor))),null==s||null===(d=s.controlBar)||void 0===d||null===(u=d.getChild("FullscreenToggle"))||void 0===u||null===(a=u.el())||void 0===a||a.appendChild(i.createIconMarkup(l.MaximizeSvg(window.controlsColor)));var v=document.getElementsByClassName("vjs-time-control");r.liveVideo&&v[0]&&(v[0].style.display="none")}(r,n),function(i,r){var n,o,t,d,u,a;0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)&&e.addSkipButton(i,"defaultV2",l.SkipSvgV2());(0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)||1==(null==r?void 0:r.liveui))&&e.addRewindButton(i,"defaultV2",l.RewindSvgV2());r.liveVideo||e.addSlowMotion(i);(null==r||null===(n=r.relatedVideos)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector_DEFAULTV2_TEMP(i,null==r?void 0:r.relatedVideos);(null==r||null===(t=r.streams)||void 0===t?void 0:t.length)>1&&e.addMulticamSelector_DEFAULTV2_TEMP(i,null==r?void 0:r.streams);(null==r||null===(d=r.playlist)||void 0===d||null===(u=d.content)||void 0===u?void 0:u.length)>0&&e.addPlaylistSelector(i,null==r?void 0:r.playlist);null!=r&&null!==(a=r.series)&&void 0!==a&&a.enable&&e.addSeriesSelectorV2_DEFAULTV2_TEMP(i,r)}(r,n),o.addTVProviderImage(r,n)};
package/esm/bundle.css CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
 
5
+
5
6
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
6
7
  height: 0.7em;
7
8
  position: absolute;
@@ -142,7 +143,6 @@
142
143
  }
143
144
 
144
145
 
145
-
146
146
  /* CSS for videojs-dvr-seekbar */
147
147
 
148
148
  .video-js.vjs-dvr-seekbar {
@@ -316,7 +316,6 @@
316
316
 
317
317
 
318
318
 
319
-
320
319
  .video-js .multicamera-parent.default{
321
320
  height: 345px;
322
321
  position: absolute;
@@ -399,6 +398,7 @@
399
398
 
400
399
 
401
400
 
401
+
402
402
  /* nextep */
403
403
  .next-ep-preview{
404
404
  position: absolute;
@@ -459,38 +459,6 @@
459
459
  margin-left: 8px;
460
460
  }
461
461
  }
462
- /* a wrapper element that tracks the mouse vertically */
463
- .vjs-thumbnail-holder {
464
- position: absolute;
465
- left: -1000px;
466
- }
467
-
468
- /* the thumbnail image itself */
469
- .vjs-thumbnail {
470
- position: absolute;
471
- left: 0;
472
- bottom: 1.3em;
473
- opacity: 0;
474
- transition: opacity .2s ease;
475
- -webkit-transition: opacity .2s ease;
476
- -moz-transition: opacity .2s ease;
477
- -mz-transition: opacity .2s ease;
478
- }
479
-
480
- /* fade in the thumbnail when hovering over the progress bar */
481
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
482
- .vjs-progress-control:hover .vjs-thumbnail,
483
- .vjs-progress-control.fake-active .vjs-thumbnail,
484
- .vjs-progress-control:active .vjs-thumbnail {
485
- opacity: 1;
486
- }
487
-
488
- /* ... but hide the thumbnail when hovering directly over it */
489
- .vjs-progress-control:hover .vjs-thumbnail:hover,
490
- .vjs-progress-control:active .vjs-thumbnail:active {
491
- opacity: 0;
492
- }
493
-
494
462
  .video-js.vjs-quality-menu {
495
463
  display: block;
496
464
  }
@@ -561,6 +529,38 @@
561
529
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
562
530
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
563
531
  }
532
+ /* a wrapper element that tracks the mouse vertically */
533
+ .vjs-thumbnail-holder {
534
+ position: absolute;
535
+ left: -1000px;
536
+ }
537
+
538
+ /* the thumbnail image itself */
539
+ .vjs-thumbnail {
540
+ position: absolute;
541
+ left: 0;
542
+ bottom: 1.3em;
543
+ opacity: 0;
544
+ transition: opacity .2s ease;
545
+ -webkit-transition: opacity .2s ease;
546
+ -moz-transition: opacity .2s ease;
547
+ -mz-transition: opacity .2s ease;
548
+ }
549
+
550
+ /* fade in the thumbnail when hovering over the progress bar */
551
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
552
+ .vjs-progress-control:hover .vjs-thumbnail,
553
+ .vjs-progress-control.fake-active .vjs-thumbnail,
554
+ .vjs-progress-control:active .vjs-thumbnail {
555
+ opacity: 1;
556
+ }
557
+
558
+ /* ... but hide the thumbnail when hovering directly over it */
559
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
560
+ .vjs-progress-control:active .vjs-thumbnail:active {
561
+ opacity: 0;
562
+ }
563
+
564
564
  .vjs-poster {
565
565
  display: inline-block;
566
566
  vertical-align: middle;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-612c987b.js";import{O as n,c as r,g as i}from"./generic-d124edfc.js";import{s as o}from"./autoNextVideo-12394cdf.js";import a from"@babel/runtime/helpers/typeof";import l from"video.js";import u from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import c from"@babel/runtime/helpers/defineProperty";import d from"@babel/runtime/helpers/slicedToArray";var p,m,v,f,h=[],g=function(i,o){var a;if(null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable){var l;h=[];var u=r();null==u||u.map((function(t){var n;return(n=h).push.apply(n,e(t.episodes))})),null==o||null===(l=o.series)||void 0===l||l.cb}else{var s,c;h=(null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content)||[],null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(i);d.on("timeupdate",(function(){var e,t,r=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=h)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var p,m=h.filter((function(e,t){return t==n()}));if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,f,g,y,b,w,E,C,N,k,T,A;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var L=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],B=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],I=null===(y=document.getElementsByClassName("next-ep-content"))||void 0===y?void 0:y[0],M=null===(b=m[0])||void 0===b?void 0:b.title;(null===(w=M)||void 0===w?void 0:w.length)>60&&(M=M.substr(0,60)+"..."),L.textContent="".concat(M),B.src=(null===(E=m[0])||void 0===E||null===(C=E.gist)||void 0===C||null===(N=C.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(T=window)||void 0===T||null===(A=T.customData)||void 0===A?void 0:A.fallbackImage),I.onclick=function(){return x(i)}}else{var O,P,j,S,R,X,D,F,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(i).append(U);var G=document.createElement("div");G.className="next-ep-header",G.textContent="Next up";var $=null===(O=m[0])||void 0===O?void 0:O.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(P=m[0])||void 0===P||null===(j=P.gist)||void 0===j||null===(S=j.imageGist)||void 0===S?void 0:S.r16x9)||(null==m||null===(R=m[0])||void 0===R?void 0:R.img)||(null===(X=window)||void 0===X||null===(D=X.customData)||void 0===D?void 0:D.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(F=$)||void 0===F?void 0:F.length)>60&&($=$.substr(0,60)+"..."),W.textContent="".concat($);var _=document.createElement("div");_.className="next-ep-content",_.append(V),_.append(W),_.onclick=function(){return x(i)},U.append(G),U.append(_)}},x=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,h)}};function y(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function b(e){return w.apply(this,arguments)}function w(){return(w=u(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=d(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return C.apply(this,arguments)}function C(){return(C=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",y(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function N(e){return k.apply(this,arguments)}function k(){return(k=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return b(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},c(n,"left","-60px"),c(n,"border","1px solid transparent"),c(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}p={0:{src:"example-thumbnail.png"}},m=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===a(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},v=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},f=function e(t){return"HTML"!==t.nodeName&&"static"===v(t)("position")?e(t.offsetParent):t},l.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=m({},p,e),i=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=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",m(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,h,g,x;for(l in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((x=f(o.el()).getBoundingClientRect()).width||x.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(o.el()).getBoundingClientRect().left+g,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&m(r.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=v(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+h-p:s<h&&(s=h),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var T=function(){var e=u(s.mark((function e(t,n){var r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=d(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function A(e){return L.apply(this,arguments)}function L(){return(L=u(s.mark((function e(t){var n,r,o,a,l,u,c,p,m,v,f,h,g,x,y,b,w,E,C,N,k,T,A,L,B,I,M,O,P,j;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return u=e.sent,e.next=7,u.text();case 7:c=e.sent,p=new DOMParser,m=p.parseFromString(c,"application/xml"),v=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,f=(null==m||null===(a=m.getElementsByTagName("BaseURL"))||void 0===a||null===(l=a[0])||void 0===l?void 0:l.textContent)||n,h=m.getElementsByTagName("AdaptationSet"),g=0;case 14:if(!(g<h.length)){e.next=38;break}if(("image"!==(x=h[g]).getAttribute("contentType")||"image/png"!==x.getAttribute("mimeType"))&&"image/jpeg"!==x.getAttribute("mimeType")){e.next=35;break}if(y=x.getElementsByTagName("SegmentTemplate")[0],b=x.getElementsByTagName("Representation")[0],w=b.getElementsByTagName("EssentialProperty")[0],E=w.getAttribute("value"),C=null==E?void 0:E.split("x"),N=d(C,2),k=N[0],T=N[1],!y){e.next=35;break}for(y.getAttribute("media"),A=y.getAttribute("duration"),L=y.getAttribute("timescale"),B=A/(L||A/(k*T)),I=b.getAttribute("id"),M=Math.round(v/B),O=Math.ceil(M/k*T),P=y.getAttribute("media"),j=[],g=0;g<O;g++)j.push({duration:B,layout:E,uri:f+P.replace("$Number$",g).replace("$RepresentationID$",I)});return e.abrupt("return",j);case 35:g++,e.next=14;break;case 38:return console.log("No trickplay segment found."),e.abrupt("return",null);case 42:e.prev=42,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 45:case"end":return e.stop()}}),e,null,[[1,42]])})))).apply(this,arguments)}function B(e){return I.apply(this,arguments)}function I(){return(I=u(s.mark((function e(n){var r,i,o,a,l,u,c,d,p,m,v,f,h,g,x,y;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():d,null===(a=d)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,E(d);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,T(f,v);case 12:return h=e.sent,e.next=15,N(h);case 15:g=e.sent,u.thumbnails(g);case 17:e.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,A(d);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,N(x);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{g as a,M as b,B as i};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-612c987b.js";import{O as n,c as r,g as i}from"./generic-d124edfc.js";import{s as o}from"./autoNextVideo-12394cdf.js";import a from"@babel/runtime/helpers/typeof";import l from"video.js";import u from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import c from"@babel/runtime/helpers/defineProperty";import d from"@babel/runtime/helpers/slicedToArray";var p,m,v,f,h=[],g=function(i,o){var a;if(null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable){var l;h=[];var u=r();null==u||u.map((function(t){var n;return(n=h).push.apply(n,e(t.episodes))})),null==o||null===(l=o.series)||void 0===l||l.cb}else{var s,c;h=(null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content)||[],null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(i);d.on("timeupdate",(function(){var e,t,r=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=h)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var p,m=h.filter((function(e,t){return t==n()}));if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,f,g,y,b,w,E,C,N,k,T,A;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var L=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],B=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],I=null===(y=document.getElementsByClassName("next-ep-content"))||void 0===y?void 0:y[0],M=null===(b=m[0])||void 0===b?void 0:b.title;(null===(w=M)||void 0===w?void 0:w.length)>60&&(M=M.substr(0,60)+"..."),L.textContent="".concat(M),B.src=(null===(E=m[0])||void 0===E||null===(C=E.gist)||void 0===C||null===(N=C.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(T=window)||void 0===T||null===(A=T.customData)||void 0===A?void 0:A.fallbackImage),I.onclick=function(){return x(i)}}else{var O,P,j,S,R,X,D,F,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(i).append(U);var G=document.createElement("div");G.className="next-ep-header",G.textContent="Next up";var $=null===(O=m[0])||void 0===O?void 0:O.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(P=m[0])||void 0===P||null===(j=P.gist)||void 0===j||null===(S=j.imageGist)||void 0===S?void 0:S.r16x9)||(null==m||null===(R=m[0])||void 0===R?void 0:R.img)||(null===(X=window)||void 0===X||null===(D=X.customData)||void 0===D?void 0:D.fallbackImage);var W=document.createElement("div");W.className="next-ep-title",(null===(F=$)||void 0===F?void 0:F.length)>60&&($=$.substr(0,60)+"..."),W.textContent="".concat($);var _=document.createElement("div");_.className="next-ep-content",_.append(V),_.append(W),_.onclick=function(){return x(i)},U.append(G),U.append(_)}},x=function(e,r){var i=t(e),a=Math.floor(i.currentTime());if(Math.floor(i.duration())!=a){i.pause(e);var l=n();o(l,e,h)}};function y(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function b(e){return w.apply(this,arguments)}function w(){return(w=u(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=d(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return C.apply(this,arguments)}function C(){return(C=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",y(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function N(e){return k.apply(this,arguments)}function k(){return(k=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return b(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},c(n,"left","-60px"),c(n,"border","1px solid transparent"),c(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}p={0:{src:"example-thumbnail.png"}},m=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===a(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},v=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},f=function e(t){return"HTML"!==t.nodeName&&"static"===v(t)("position")?e(t.offsetParent):t},l.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=m({},p,e),i=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=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",m(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,h,g,x;for(l in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((x=f(o.el()).getBoundingClientRect()).width||x.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=f(o.el()).getBoundingClientRect().left+g,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&m(r.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=v(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+h-p:s<h&&(s=h),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){console.log(e),document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var T=function(){var e=u(s.mark((function e(t,n){var r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=d(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function A(e){return L.apply(this,arguments)}function L(){return(L=u(s.mark((function e(t){var n,r,o,a,l,u,c,p,m,v,f,h,g,x,y,b,w,E,C,N,k,T,A,L,B,I,M,O,P,j;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return u=e.sent,e.next=7,u.text();case 7:c=e.sent,p=new DOMParser,m=p.parseFromString(c,"application/xml"),v=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,f=(null==m||null===(a=m.getElementsByTagName("BaseURL"))||void 0===a||null===(l=a[0])||void 0===l?void 0:l.textContent)||n+"/",h=m.getElementsByTagName("AdaptationSet"),g=0;case 14:if(!(g<h.length)){e.next=38;break}if(("image"!==(x=h[g]).getAttribute("contentType")||"image/png"!==x.getAttribute("mimeType"))&&"image/jpeg"!==x.getAttribute("mimeType")){e.next=35;break}if(y=x.getElementsByTagName("SegmentTemplate")[0],b=x.getElementsByTagName("Representation")[0],w=b.getElementsByTagName("EssentialProperty")[0],E=w.getAttribute("value"),C=null==E?void 0:E.split("x"),N=d(C,2),k=N[0],T=N[1],!y){e.next=35;break}for(y.getAttribute("media"),A=y.getAttribute("duration"),L=y.getAttribute("timescale"),B=A/(L||A/(k*T)),I=b.getAttribute("id"),M=Math.round(v/B),O=Math.ceil(M/k*T),P=y.getAttribute("media"),j=[],g=0;g<O;g++)j.push({duration:B,layout:E,uri:f+P.replace("$Number$",g).replace("$RepresentationID$",I)});return e.abrupt("return",j);case 35:g++,e.next=14;break;case 38:return console.log("No trickplay segment found."),e.abrupt("return",null);case 42:e.prev=42,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 45:case"end":return e.stop()}}),e,null,[[1,42]])})))).apply(this,arguments)}function B(e){return I.apply(this,arguments)}function I(){return(I=u(s.mark((function e(n){var r,i,o,a,l,u,c,d,p,m,v,f,h,g,x,y;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),c=u.currentSource(),d=c.src,d=null!==(r=d)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():d,null===(a=d)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,E(d);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,T(f,v);case 12:return h=e.sent,e.next=15,N(h);case 15:g=e.sent,u.thumbnails(g);case 17:e.next=28;break;case 19:if(null===(l=d)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,A(d);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,N(x);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{g as a,M as b,B as i};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import{s as e,g as n,a as t,b as o,c as i,d as r,e as l,l as a,f as s,h as u,i as c,j as d,k as v,m as p,n as f,o as m,p as y,q as h,r as g,t as w,u as b,v as k,w as O,x as j,y as S,z as P,A as T,B as I,C as x,D,E,F as C,G as R,H as N,I as A,J as L,K as _,L as V,M,N as H}from"./generic-d124edfc.js";import U from"@babel/runtime/helpers/defineProperty";import B from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/regenerator";import z from"video.js";import{o as q,g as K,a as G,s as J,b as W}from"./util-435845ca.js";import{a as X,e as Y,d as Q,g as Z}from"./captions-59c404fa.js";import{g as $}from"./renditions-16e1a2db.js";import{playSelectedResolution as ee}from"./resolution-a5e1082b.js";import{g as ne,i as te,a as oe}from"./skin-612c987b.js";import{d as ie}from"./browser-d4613b36.js";import{s as re}from"./localisation-0bf399a1.js";import le from"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var ae,se=function(e){return new Promise((function(n,t){if(ue(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},ue=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ce=function(e,n,t){var o=ne(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),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,"'")})},de=function(e){var n=ne(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ve(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ve(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var fe=[],me=0,ye=null;function he(t,o,i){var r,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(r=o.watchHistory)||void 0===r||r.apiVersion;var d=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),p=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var f=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,m=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(t.currentTime()),h=c?100:Math.floor(v/p*100),g={};m?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=ge(i),l=(new Date).getTime(),a=n(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return pe(pe({},e),{},U({},n,s[n]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ae}));c<0?r.push(pe(pe({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=pe(pe(pe({},r[c]),e),{},{updateDate:l});localStorage.setItem("".concat(i),JSON.stringify(r))}(g={completed:c,watchedTime:y,watchedPercentage:h},d,o.siteOwner):(g=pe(pe({videoId:ae,watchedTime:y,watchedPercentage:h,doneWatching:c,profileId:d},ye&&{seriesId:ye}),f&&{originalObjectId:f}),e(g).then((function(e){})).catch((function(e){}))),me=v+i}function ge(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function we(e,n,t){var o=ge(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var be=function(){var e=B(F.mark((function e(n){var t,o,i,r;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=ne(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return r=e.sent,e.prev=6,e.next=9,se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,r.default(z),e.finish(14);case 17:null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==ie()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),ke=function(e,n){var t=ne(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var Oe=function(){var e=B(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),se("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)}}(),je=function(){var e=B(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=B(F.mark((function e(){var n;return F.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(z),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)}}(),Pe=function(){var e=B(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-0b54f83d.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)}}(),Te=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},loadAdsLibrary:Oe,loadEMELibrary:je,loadMuxPlugin:Se,loadDvrSeekbar:Pe});function Ie(e){return xe.apply(this,arguments)}function xe(){return(xe=B(F.mark((function e(n){var t;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,Oe();case 3:t&&"Safari"==ie()&&Promise.resolve().then((function(){return Te})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(e,n){return Ee.apply(this,arguments)}function Ee(){return Ee=B(F.mark((function e(n,t){var o,i,r,l,a,s,u,c;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=(null==t?void 0:t.contentType)||"video",a=null==t||null===(o=t[l])||void 0===o?void 0:o.drmEnabled,s=(null==t||null===(i=t[l])||void 0===i||null===(r=i.liveDetails)||void 0===r?void 0:r.isDvrEnabled)||!1,u=(null==n?void 0:n.showPositiveSeekbar)||!1,e.prev=4,e.next=7,Promise.allSettled([a?je():null,be(n),null!=n&&null!==(c=n.analytics)&&void 0!==c&&c.muxKey?Se():null,s&&u?Pe():null]);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),console.log("Error",e.t0);case 12:case"end":return e.stop()}}),e,null,[[4,9]])}))),Ee.apply(this,arguments)}function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Re(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ce(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ne=new Set,Ae=null,Le=function(e,n,o){var r,l,a,s,u,c,d,v,p,f={},m=(null==e?void 0:e.contentType)||"video";f[null==o||null===(r=o.Constants)||void 0===r?void 0:r.ASSET_NAME]=Be(e),f["c3.cm.id"]=(null===(l=e[m])||void 0===l?void 0:l.id)||"Null",f["c3.cm.contentType"]=Fe(e),f[null==o||null===(a=o.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==e||!e.linearchannel),f[null==o||null===(s=o.Constants)||void 0===s?void 0:s.STREAM_URL]=n.currentSrc(),f[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===t()?"NULL":t(),f["c3.cm.categoryType"]=He(e),f[null==o||null===(c=o.Constants)||void 0===c?void 0:c.PLAYER_NAME]="VL_WEB_PLAYER",f["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"}}(),f.DRMEnabled=(null===(d=e[m])||void 0===d?void 0:d.drmEnabled)||"None",f.DAIStream=null!==(v=e[m])&&void 0!==v&&null!==(p=v.gist)&&void 0!==p&&p.isSSAIEnabled?"YES":"NO",f[o.Constants.DEFAULT_RESOURCE]="AKAMAI",f["c3.cm.brand"]="NULL",f.CDVREnabled=Ue(e),f["c3.cm.genreList"]=Ve(e),f["c3.cm.genre"]=_e(e),f["c3.cm.channel"]=Me(e);var y=ze(i(),e);return f=Re(Re({},f),y)},_e=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},Ve=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"},Me=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"NULL":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"Null"},He=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(t=n.categories)||void 0===t||null===(o=t[0])||void 0===o?void 0:o.title)||"Null";var n,t,o},Ue=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Be=function(e){var n,t,o,i,r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(o=e[r])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id)||"Null";return"[".concat(a,"] ").concat(l)},Fe=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ze=function(e,n){var t,i,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=r(),d=o();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(i=t.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},qe=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"}},Ke=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 e=B(F.mark((function e(t,o){var i,r,l,a,s,u,c,d,v;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(c=ne(t),"function"==typeof(d=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,d("getConvivaObject");case 10:if(v=e.sent){e.next=13;break}return e.abrupt("return");case 13:c.ready((function(){var e=c.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=qe(t.keySystem);d("contentInfo",{DRMEnabled:o})}else d("contentInfo",{DRMEnabled:"None"})})),n||d("contentInfo",{DRMEnabled:"None"})})),c.on("loadstart",(function(){Ae&&Ae!==c.currentSrc()&&d("playbackEnded"),d("setPlayer",c),Ne.clear(),Ae=c.currentSrc();var e=Ke(c.currentType()),t=n(),o=Le(t,c,v);o.authToken=u||"NULL",o.streamType=e,o.D2CType=l||"NONE",o.subscriberType=a||(l?"D2C":"FREE"),o["c3.cm.affiliate"]=a||"NULL",d("contentInfo",o)})),c.on("loadedmetadata",(function(){var e,n=c.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),d("contentInfo",{screenResolution:e})})),c.on("play",(function(){Ne.has(c.currentSrc())||(Ne.add(c.currentSrc()),d("playbackStarted",null))})),c.on("ended",(function(){Ne.has(c.currentSrc())&&Ne.delete(c.currentSrc()),d("playbackEnded")})),c.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&d("initAdSensor",{player:c,adsLoader:null==e?void 0:e.adsLoader})})),c.on("dispose",(function(){null==Ne||Ne.clear(),d("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Je=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-902b958f.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-c365cec9.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-de1d8699.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-cfc53537.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-0795ef1f.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-82f7aedc.js").then((function(t){t.initialiseSkin(e,n)}))},We=!1,Xe=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!We){var r=Ye(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),We=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Ye(e,n,t){if(Array.isArray(e))return e.map((function(e){return Ye(e,n,t)}));if(null!==e&&"object"===le(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Ye(e[i],n,t)})),o}return e}function Qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qe(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $e=function(e,t,o,i){var r,l,a=i.res,v=i.sres,p=ne(e),f=(null==a?void 0:a.contentType)||"video",m=(null==a||null===(r=a[f])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;s(a),p&&(p.on("loadstart",(function(){m?o.resolve({status:!0,msg:"Video Loaded",response:a}):o.resolve(Ze({status:!0,msg:"Player Initialised"},v?{seriesResponse:v,response:a}:{response:a}))})),p.on("loadeddata",(function(){var o,i,r;(null==p||!p.muted())&&ce(e,sessionStorage.getItem("volume")||"100");var l=n();if(u(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var s,c,d=Ze(Ze({},t),a);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ye=null==n||null===(i=n.series)||void 0===i?void 0:i.id),fe=[],me=0,ae=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=ne(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());fe.includes(me)||(e==me?(fe.push(e),he(a,n,l)):e>me&&(me=e+l))})),a.one("ended",(function(){he(a,n,l,!0)})))}(e,d,null==l||null===(s=l.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=p&&p.mux){var v,f,m,y,h,g,w=(null===(v=n())||void 0===v?void 0:v.video)||(null==a?void 0:a.video),b=null==w?void 0:w.gist,k={env_key:null==t||null===(f=t.analytics)||void 0===f?void 0:f.muxKey,player_name:"vl-web-player",player_version:null===(m=window)||void 0===m?void 0:m.vl_player_version,video_id:null==b?void 0:b.id,video_title:null==b?void 0:b.title,video_series:null==w||null===(y=w.series)||void 0===y?void 0:y.title,video_stream_type:null!=w&&null!==(h=w.streamingInfo)&&void 0!==h&&h.isLiveStream?"live":"video",viewer_user_id:null==t||null===(g=t.analytics)||void 0===g?void 0:g.userId};p.mux({debug:!1,data:k})}})),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,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),h=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),p.tech_.on("retryplaylist",(function(){m&&Xe(a,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&m)?Xe(a,e):(c(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),o.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:a}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,r,l=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=d(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){p.currentTime(u)}),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(m){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))};function en(e){return nn.apply(this,arguments)}function nn(){return(nn=B(F.mark((function e(n){var t,o,i,r,l,a,s,u,c,d,v,p;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,se("https://cdn.dashjs.org/latest/dash.all.min.js");case 2:i=this.el().querySelector("video")||this.el(),r=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),l=(null==n?void 0:n.keySystems)&&(null==n||null===(o=n.keySystems)||void 0===o?void 0:o["com.widevine.alpha"]),r&&i?(r.initialize(i,n.src,!0),l&&(c=null===(a=n.keySystems["com.widevine.alpha"])||void 0===a?void 0:a.url,d=null===(s=n.keySystems["com.microsoft.playready"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.widevine.alpha"])||void 0===u?void 0:u.licenseHeaders["X-AxDRM-Message"],p={"com.widevine.alpha":{serverURL:c,httpRequestHeaders:{"X-AxDRM-Message":v}},"com.microsoft.playready":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":v}}},r.setProtectionData(p))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function on(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tn(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var rn,ln=function(e,n,t,o){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,P,T,I,x,D,E,C,R,N,A,L,_,V,M,H=n.res,q=void 0===H?null:H,K=n.sres,G=void 0===K?null:K,J=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],W=(null===(i=q)||void 0===i?void 0:i.contentType)||"video",Y=te(null===(r=q)||void 0===r||null===(s=r[W])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||te(null===(d=q)||void 0===d||null===(y=d[W])||void 0===y||null===(h=y.gist)||void 0===h||null===(g=h.imageGist)||void 0===g?void 0:g.r16x9),Q=(null===(w=q)||void 0===w||null===(b=w[W])||void 0===b||null===(k=b.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,Z=(null===(O=q)||void 0===O||null===(j=O[W])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,$=(null===(P=q)||void 0===P||null===(T=P.ads)||void 0===T||null===(I=T.preRoll)||void 0===I||null===(x=I.adTags)||void 0===x||null===(D=x.web)||void 0===D?void 0:D.active)&&(null===(E=q)||void 0===E||null===(C=E.ads)||void 0===C||null===(R=C.preRoll)||void 0===R||null===(N=R.adTags)||void 0===N||null===(A=N.web)||void 0===A?void 0:A.url);q=on(on({},q),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var ee=(M={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:Q},U(M,"autoplay",null==t?void 0:t.autoplay),U(M,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!$),U(M,"loop",(null==t?void 0:t.loop)||!1),U(M,"audioPosterMode",null==t?void 0:t.audioPosterMode),U(M,"html5",on(on({vhs:on(on({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==t||null===(L=t.customData)||void 0===L?void 0:L.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0}),nativeTextTracks:!0},0==(null==t||null===(_=t.customData)||void 0===_?void 0:_.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(V=t.customData)||void 0===V?void 0:V.nativeVideoTracks)&&{nativeVideoTracks:!1})),U(M,"poster",Y),U(M,"techOrder",J),U(M,"chromecast",{requestCustomDataFn:function(n){var t=getPlayer(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,h=null==y?void 0:y.url;f.licenseUrl=h;var g=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=g}var w=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=b;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(q,n,o)}}),M);if(!z.getPlayers()[e])var ne=z(e,ee,function(){var n=B(F.mark((function n(){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,P,T,I,x,D,E,C,R;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ne),console.log(z.VERSION),console.log(z.getPlugins()),n.next=5,De(t,q);case 5:S=null===(i=q)||void 0===i||null===(r=i[W])||void 0===r||null===(s=r.liveDetails)||void 0===s?void 0:s.startOverTime,Z&&o.resolve(on({status:!0,msg:"Player Initialised"},G?{seriesResponse:G,response:q}:{response:q})),v(e,null==t?void 0:t.analyticsCb),Ge(e,t),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),Q&&ke(e,S),!$||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||p(e,$,q),P=l(q,e),console.log(P),null!=t&&t.nearestClusterUrl&&(P=f(P,t.nearestClusterUrl)),"Chrome"==ie()&&(null===(d=q)||void 0===d||null===(y=d.video)||void 0===y?void 0:y.isSSAIEnabled)?en.call(this,P):P?a(e,P):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:q}),c(e,"Incompatible / Missing Source")),((null===(h=q)||void 0===h||null===(g=h[W])||void 0===g||null===(w=g.contentDetails)||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0||(null===(k=q)||void 0===k||null===(O=k[W])||void 0===O||null===(j=O.closedCaptions)||void 0===j?void 0:j.length)>0)&&(R=(null===(I=q)||void 0===I||null===(x=I[W])||void 0===x||null===(D=x.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(E=q)||void 0===E||null===(C=E[W])||void 0===C?void 0:C.closedCaptions),T=R.filter((function(e){return"VTT"===e.format})),X(e,T)),null!=t&&t.disableControls?m(e):Je(e,on(on(on({},t),ee),{},{liveVideo:Z,isDvrEnabled:Q,res:q,sres:G})),$e(e,on(on(on({},t),ee),{},{liveVideo:Z}),o,{res:q,sres:G});case 20:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function an(e,n){return sn.apply(this,arguments)}function sn(){return(sn=B(F.mark((function e(n,t){var o,i,r,l,a,u;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,r=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,w();case 6:u=e.sent,y(r,u).then((function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,s(null==e?void 0:e.data);var p,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,w=we((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(w&&w.length)n.watchHistoryResumeTime=(null===(y=w[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=w[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",ln(l,{res:f},n,{resolve:o,reject:i})}else h(r,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){ln(l,{res:f},n,{resolve:o,reject:i})}));else ln(l,{res:f},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function un(e,n){return cn.apply(this,arguments)}function cn(){return(cn=B(F.mark((function e(n,t){var o,i,r,l,a;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,w();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,b(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,ln(l,{res:t},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dn(e,n){return vn.apply(this,arguments)}function vn(){return(vn=B(F.mark((function e(n,t){var o,i,r,l,a,u,c;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,r=t.reject,e.next=3,w();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,j.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,k(c,l).then((function(e){var t,o,u,d=e.data,v=e.data.seasons;S(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);O(c,l),y(p,l).then((function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,s(e.data),ln(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:r})})).catch((function(e){g(e,a,r,videoId)}))})).catch((function(e){g(e,a,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pn(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function mn(){return{loadVideoInstantly:P,onTimeUpdate:q,getVideoDuration:K,onVideoEnded:G,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),console.log("%c Handlers added ","background: #bdf369; color: #000"),new Promise(function(){var n=B(F.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,h,w,b,k,O,j,S,P,T,I;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!E(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(f=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,w=null==e?void 0:e.videoId,b=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=w,k=null==e?void 0:e.token,!V(e)){n.next=16;break}if(sessionStorage.setItem("vlp_token",k),M().set(null==e?void 0:e.refreshToken),k&&!H(k)){n.next=15;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 15:rn=JSON.parse(atob(k.split(".")[1]));case 16:e.isAnonymousUser=!(null===(l=rn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=rn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=rn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=rn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,j=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(S=null==e?void 0:e.errors)&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,re(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),L.set(e.apiBaseUrl),null!=e&&e.skin&&!oe(e.skin)||(e.skin="VL_ONE"),Ie(e),j&&se("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return _(j)})).catch((function(e){})),(P=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(O)))&&P.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(I={directPlaybackUrl:f,id:T="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?y(T,k).then((function(n){ln(O,{res:fn(fn({},n),I)},e,{resolve:t,reject:o})})).catch((function(e){g(e,O,o,T)})):ln(O,{res:I},e,{resolve:t,reject:o})):b?dn(e,{resolve:t,reject:o}):h?un(e,{resolve:t,reject:o}):an(e,{resolve:t,reject:o});case 35:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:$,skip:T,getPlayer:ne,play:I,pause:x,detectBrowser:ie,rewind:D,loadVideo:a,seekToTimeStamp:J,isPlayerInitialised:E,load:C,authenticateLC:R,dispose:N,enableCaptions:Y,disableCaptions:Q,getCaptions:Z,playSelectedResolution:ee,getSource:l,setVolume:ce,getVolume:de,disableControls:m,setPlaybackSpeed:W,getEntitlementData:A}}export{mn as default};
1
+ import"video.js/dist/video-js.min.css";import{s as e,g as n,a as t,b as o,c as i,d as r,e as l,l as a,f as s,h as u,i as c,j as d,k as v,m as p,n as f,o as m,p as y,q as h,r as g,t as w,u as b,v as k,w as O,x as j,y as S,z as P,A as T,B as I,C as x,D,E,F as C,G as R,H as N,I as A,J as L,K as _,L as V,M,N as H}from"./generic-d124edfc.js";import U from"@babel/runtime/helpers/defineProperty";import B from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/regenerator";import z from"video.js";import{o as q,g as K,a as G,s as J,b as W}from"./util-435845ca.js";import{a as X,e as Y,d as Q,g as Z}from"./captions-59c404fa.js";import{g as $}from"./renditions-16e1a2db.js";import{playSelectedResolution as ee}from"./resolution-a5e1082b.js";import{g as ne,i as te,a as oe}from"./skin-612c987b.js";import{d as ie}from"./browser-d4613b36.js";import{s as re}from"./localisation-0bf399a1.js";import le from"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var ae,se=function(e){return new Promise((function(n,t){if(ue(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},ue=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ce=function(e,n,t){var o=ne(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),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,"'")})},de=function(e){var n=ne(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ve(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ve(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var fe=[],me=0,ye=null;function he(t,o,i){var r,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(r=o.watchHistory)||void 0===r||r.apiVersion;var d=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),p=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var f=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,m=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(t.currentTime()),h=c?100:Math.floor(v/p*100),g={};m?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=ge(i),l=(new Date).getTime(),a=n(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return pe(pe({},e),{},U({},n,s[n]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ae}));c<0?r.push(pe(pe({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=pe(pe(pe({},r[c]),e),{},{updateDate:l});localStorage.setItem("".concat(i),JSON.stringify(r))}(g={completed:c,watchedTime:y,watchedPercentage:h},d,o.siteOwner):(g=pe(pe({videoId:ae,watchedTime:y,watchedPercentage:h,doneWatching:c,profileId:d},ye&&{seriesId:ye}),f&&{originalObjectId:f}),e(g).then((function(e){})).catch((function(e){}))),me=v+i}function ge(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function we(e,n,t){var o=ge(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var be=function(){var e=B(F.mark((function e(n){var t,o,i,r;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=ne(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return r=e.sent,e.prev=6,e.next=9,se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,r.default(z),e.finish(14);case 17:null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=n&&n.airplay&&"Safari"==ie()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return e.stop()}}),e,null,[[6,11,14,17]])})));return function(n){return e.apply(this,arguments)}}(),ke=function(e,n){var t=ne(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var Oe=function(){var e=B(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),se("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)}}(),je=function(){var e=B(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=B(F.mark((function e(){var n;return F.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(z),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)}}(),Pe=function(){var e=B(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-0b54f83d.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)}}(),Te=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},loadAdsLibrary:Oe,loadEMELibrary:je,loadMuxPlugin:Se,loadDvrSeekbar:Pe});function Ie(e){return xe.apply(this,arguments)}function xe(){return(xe=B(F.mark((function e(n){var t;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,Oe();case 3:t&&"Safari"==ie()&&Promise.resolve().then((function(){return Te})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(e,n){return Ee.apply(this,arguments)}function Ee(){return Ee=B(F.mark((function e(n,t){var o,i,r,l,a,s,u,c;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=(null==t?void 0:t.contentType)||"video",a=null==t||null===(o=t[l])||void 0===o?void 0:o.drmEnabled,s=(null==t||null===(i=t[l])||void 0===i||null===(r=i.liveDetails)||void 0===r?void 0:r.isDvrEnabled)||!1,u=(null==n?void 0:n.showPositiveSeekbar)||!1,e.prev=4,e.next=7,Promise.allSettled([a?je():null,be(n),null!=n&&null!==(c=n.analytics)&&void 0!==c&&c.muxKey?Se():null,s&&u?Pe():null]);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),console.log("Error",e.t0);case 12:case"end":return e.stop()}}),e,null,[[4,9]])}))),Ee.apply(this,arguments)}function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Re(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ce(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ne=new Set,Ae=null,Le=function(e,n,o){var r,l,a,s,u,c,d,v,p,f={},m=(null==e?void 0:e.contentType)||"video";f[null==o||null===(r=o.Constants)||void 0===r?void 0:r.ASSET_NAME]=Be(e),f["c3.cm.id"]=(null===(l=e[m])||void 0===l?void 0:l.id)||"Null",f["c3.cm.contentType"]=Fe(e),f[null==o||null===(a=o.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==e||!e.linearchannel),f[null==o||null===(s=o.Constants)||void 0===s?void 0:s.STREAM_URL]=n.currentSrc(),f[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===t()?"NULL":t(),f["c3.cm.categoryType"]=He(e),f[null==o||null===(c=o.Constants)||void 0===c?void 0:c.PLAYER_NAME]="VL_WEB_PLAYER",f["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"}}(),f.DRMEnabled=(null===(d=e[m])||void 0===d?void 0:d.drmEnabled)||"None",f.DAIStream=null!==(v=e[m])&&void 0!==v&&null!==(p=v.gist)&&void 0!==p&&p.isSSAIEnabled?"YES":"NO",f[o.Constants.DEFAULT_RESOURCE]="AKAMAI",f["c3.cm.brand"]="NULL",f.CDVREnabled=Ue(e),f["c3.cm.genreList"]=Ve(e),f["c3.cm.genre"]=_e(e),f["c3.cm.channel"]=Me(e);var y=ze(i(),e);return f=Re(Re({},f),y)},_e=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},Ve=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"},Me=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"NULL":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"Null"},He=function(e){return null!=e&&e.linearchannel?"Linear":null!=e&&e.video&&(null==e||null===(n=e.video)||void 0===n||null===(t=n.categories)||void 0===t||null===(o=t[0])||void 0===o?void 0:o.title)||"Null";var n,t,o},Ue=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Be=function(e){var n,t,o,i,r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(o=e[r])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id)||"Null";return"[".concat(a,"] ").concat(l)},Fe=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ze=function(e,n){var t,i,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=r(),d=o();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(i=t.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},qe=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"}},Ke=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 e=B(F.mark((function e(t,o){var i,r,l,a,s,u,c,d,v;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(c=ne(t),"function"==typeof(d=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,d("getConvivaObject");case 10:if(v=e.sent){e.next=13;break}return e.abrupt("return");case 13:c.ready((function(){var e=c.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=qe(t.keySystem);d("contentInfo",{DRMEnabled:o})}else d("contentInfo",{DRMEnabled:"None"})})),n||d("contentInfo",{DRMEnabled:"None"})})),c.on("loadstart",(function(){Ae&&Ae!==c.currentSrc()&&d("playbackEnded"),d("setPlayer",c),Ne.clear(),Ae=c.currentSrc();var e=Ke(c.currentType()),t=n(),o=Le(t,c,v);o.authToken=u||"NULL",o.streamType=e,o.D2CType=l||"NONE",o.subscriberType=a||(l?"D2C":"FREE"),o["c3.cm.affiliate"]=a||"NULL",d("contentInfo",o)})),c.on("loadedmetadata",(function(){var e,n=c.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),d("contentInfo",{screenResolution:e})})),c.on("play",(function(){Ne.has(c.currentSrc())||(Ne.add(c.currentSrc()),d("playbackStarted",null))})),c.on("ended",(function(){Ne.has(c.currentSrc())&&Ne.delete(c.currentSrc()),d("playbackEnded")})),c.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&d("initAdSensor",{player:c,adsLoader:null==e?void 0:e.adsLoader})})),c.on("dispose",(function(){null==Ne||Ne.clear(),d("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Je=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-902b958f.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-c365cec9.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-41a6a250.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-cfc53537.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-0795ef1f.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-1d9d096c.js").then((function(t){t.initialiseSkin(e,n)}))},We=!1,Xe=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!We){var r=Ye(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),We=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Ye(e,n,t){if(Array.isArray(e))return e.map((function(e){return Ye(e,n,t)}));if(null!==e&&"object"===le(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Ye(e[i],n,t)})),o}return e}function Qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qe(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $e=function(e,t,o,i){var r,l,a=i.res,v=i.sres,p=ne(e),f=(null==a?void 0:a.contentType)||"video",m=(null==a||null===(r=a[f])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;s(a),p&&(p.on("loadstart",(function(){m?o.resolve({status:!0,msg:"Video Loaded",response:a}):o.resolve(Ze({status:!0,msg:"Player Initialised"},v?{seriesResponse:v,response:a}:{response:a}))})),p.on("loadeddata",(function(){var o,i,r;(null==p||!p.muted())&&ce(e,sessionStorage.getItem("volume")||"100");var l=n();if(u(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var s,c,d=Ze(Ze({},t),a);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ye=null==n||null===(i=n.series)||void 0===i?void 0:i.id),fe=[],me=0,ae=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=ne(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());fe.includes(me)||(e==me?(fe.push(e),he(a,n,l)):e>me&&(me=e+l))})),a.one("ended",(function(){he(a,n,l,!0)})))}(e,d,null==l||null===(s=l.video)||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=p&&p.mux){var v,f,m,y,h,g,w=(null===(v=n())||void 0===v?void 0:v.video)||(null==a?void 0:a.video),b=null==w?void 0:w.gist,k={env_key:null==t||null===(f=t.analytics)||void 0===f?void 0:f.muxKey,player_name:"vl-web-player",player_version:null===(m=window)||void 0===m?void 0:m.vl_player_version,video_id:null==b?void 0:b.id,video_title:null==b?void 0:b.title,video_series:null==w||null===(y=w.series)||void 0===y?void 0:y.title,video_stream_type:null!=w&&null!==(h=w.streamingInfo)&&void 0!==h&&h.isLiveStream?"live":"video",viewer_user_id:null==t||null===(g=t.analytics)||void 0===g?void 0:g.userId};p.mux({debug:!1,data:k})}})),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,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),h=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),p.tech_.on("retryplaylist",(function(){m&&Xe(a,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&m)?Xe(a,e):(c(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),o.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:a}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,r,l=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=d(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){p.currentTime(u)}),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(m){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))};function en(e){return nn.apply(this,arguments)}function nn(){return(nn=B(F.mark((function e(n){var t,o,i,r,l,a,s,u,c,d,v,p;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,se("https://cdn.dashjs.org/latest/dash.all.min.js");case 2:i=this.el().querySelector("video")||this.el(),r=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),l=(null==n?void 0:n.keySystems)&&(null==n||null===(o=n.keySystems)||void 0===o?void 0:o["com.widevine.alpha"]),r&&i?(r.initialize(i,n.src,!0),l&&(c=null===(a=n.keySystems["com.widevine.alpha"])||void 0===a?void 0:a.url,d=null===(s=n.keySystems["com.microsoft.playready"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.widevine.alpha"])||void 0===u?void 0:u.licenseHeaders["X-AxDRM-Message"],p={"com.widevine.alpha":{serverURL:c,httpRequestHeaders:{"X-AxDRM-Message":v}},"com.microsoft.playready":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":v}}},r.setProtectionData(p))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function on(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tn(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var rn,ln=function(e,n,t,o){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,P,T,I,x,D,E,C,R,N,A,L,_,V,M,H,q,K=n.res,G=void 0===K?null:K,J=n.sres,W=void 0===J?null:J,Y=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],Q=(null===(i=G)||void 0===i?void 0:i.contentType)||"video",Z=te(null===(r=G)||void 0===r||null===(s=r[Q])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||te(null===(d=G)||void 0===d||null===(y=d[Q])||void 0===y||null===(h=y.gist)||void 0===h||null===(g=h.imageGist)||void 0===g?void 0:g.r16x9),$=(null===(w=G)||void 0===w||null===(b=w[Q])||void 0===b||null===(k=b.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,ee=(null===(O=G)||void 0===O||null===(j=O[Q])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,ne=(null===(P=G)||void 0===P||null===(T=P.ads)||void 0===T||null===(I=T.preRoll)||void 0===I||null===(x=I.adTags)||void 0===x||null===(D=x.web)||void 0===D?void 0:D.active)&&(null===(E=G)||void 0===E||null===(C=E.ads)||void 0===C||null===(R=C.preRoll)||void 0===R||null===(N=R.adTags)||void 0===N||null===(A=N.web)||void 0===A?void 0:A.url);G=on(on({},G),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var oe="Chrome"==ie()&&(null===(L=G)||void 0===L||null===(_=L.video)||void 0===_?void 0:_.isSSAIEnabled),re=(q={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:$},U(q,"autoplay",null==t?void 0:t.autoplay),U(q,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!ne),U(q,"loop",(null==t?void 0:t.loop)||!1),U(q,"audioPosterMode",null==t?void 0:t.audioPosterMode),U(q,"html5",on(on({vhs:on(on({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==t||null===(V=t.customData)||void 0===V?void 0:V.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0}),nativeTextTracks:!!oe},0==(null==t||null===(M=t.customData)||void 0===M?void 0:M.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(H=t.customData)||void 0===H?void 0:H.nativeVideoTracks)&&{nativeVideoTracks:!1})),U(q,"poster",Z),U(q,"techOrder",Y),U(q,"chromecast",{requestCustomDataFn:function(n){var t=getPlayer(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,h=null==y?void 0:y.url;f.licenseUrl=h;var g=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=g}var w=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=b;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(G,n,o)}}),q);if(!z.getPlayers()[e])var le=z(e,re,function(){var n=B(F.mark((function n(){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,P,T,I,x,D,E;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(le),console.log(z.VERSION),console.log(z.getPlugins()),n.next=5,De(t,G);case 5:O=null===(i=G)||void 0===i||null===(r=i[Q])||void 0===r||null===(s=r.liveDetails)||void 0===s?void 0:s.startOverTime,ee&&o.resolve(on({status:!0,msg:"Player Initialised"},W?{seriesResponse:W,response:G}:{response:G})),v(e,null==t?void 0:t.analyticsCb),Ge(e,t),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),$&&ke(e,O),!ne||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||p(e,ne,G),j=l(G,e),console.log(j),null!=t&&t.nearestClusterUrl&&(j=f(j,t.nearestClusterUrl)),oe?en.call(this,j):j?a(e,j):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:G}),c(e,"Incompatible / Missing Source")),((null===(d=G)||void 0===d||null===(y=d[Q])||void 0===y||null===(h=y.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(w=G)||void 0===w||null===(b=w[Q])||void 0===b||null===(k=b.closedCaptions)||void 0===k?void 0:k.length)>0)&&(E=(null===(P=G)||void 0===P||null===(T=P[Q])||void 0===T||null===(I=T.contentDetails)||void 0===I?void 0:I.closedCaptions)||(null===(x=G)||void 0===x||null===(D=x[Q])||void 0===D?void 0:D.closedCaptions),S=E.filter((function(e){return"VTT"===e.format})),X(e,S)),null!=t&&t.disableControls?m(e):Je(e,on(on(on({},t),re),{},{liveVideo:ee,isDvrEnabled:$,res:G,sres:W})),$e(e,on(on(on({},t),re),{},{liveVideo:ee}),o,{res:G,sres:W});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function an(e,n){return sn.apply(this,arguments)}function sn(){return(sn=B(F.mark((function e(n,t){var o,i,r,l,a,u;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,r=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,w();case 6:u=e.sent,y(r,u).then((function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,s(null==e?void 0:e.data);var p,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,w=we((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(w&&w.length)n.watchHistoryResumeTime=(null===(y=w[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=w[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",ln(l,{res:f},n,{resolve:o,reject:i})}else h(r,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){ln(l,{res:f},n,{resolve:o,reject:i})}));else ln(l,{res:f},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function un(e,n){return cn.apply(this,arguments)}function cn(){return(cn=B(F.mark((function e(n,t){var o,i,r,l,a;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,w();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,b(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,ln(l,{res:t},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dn(e,n){return vn.apply(this,arguments)}function vn(){return(vn=B(F.mark((function e(n,t){var o,i,r,l,a,u,c;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,r=t.reject,e.next=3,w();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,j.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,k(c,l).then((function(e){var t,o,u,d=e.data,v=e.data.seasons;S(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);O(c,l),y(p,l).then((function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,s(e.data),ln(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:r})})).catch((function(e){g(e,a,r,videoId)}))})).catch((function(e){g(e,a,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pn(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function mn(){return{loadVideoInstantly:P,onTimeUpdate:q,getVideoDuration:K,onVideoEnded:G,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),console.log("%c Handlers added ","background: #bdf369; color: #000"),new Promise(function(){var n=B(F.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,h,w,b,k,O,j,S,P,T,I;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!E(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(f=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,w=null==e?void 0:e.videoId,b=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=w,k=null==e?void 0:e.token,!V(e)){n.next=16;break}if(sessionStorage.setItem("vlp_token",k),M().set(null==e?void 0:e.refreshToken),k&&!H(k)){n.next=15;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 15:rn=JSON.parse(atob(k.split(".")[1]));case 16:e.isAnonymousUser=!(null===(l=rn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=rn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=rn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=rn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,j=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(S=null==e?void 0:e.errors)&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,re(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),L.set(e.apiBaseUrl),null!=e&&e.skin&&!oe(e.skin)||(e.skin="VL_ONE"),Ie(e),j&&se("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return _(j)})).catch((function(e){})),(P=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(O)))&&P.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(I={directPlaybackUrl:f,id:T="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?y(T,k).then((function(n){ln(O,{res:fn(fn({},n),I)},e,{resolve:t,reject:o})})).catch((function(e){g(e,O,o,T)})):ln(O,{res:I},e,{resolve:t,reject:o})):b?dn(e,{resolve:t,reject:o}):h?un(e,{resolve:t,reject:o}):an(e,{resolve:t,reject:o});case 35:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:$,skip:T,getPlayer:ne,play:I,pause:x,detectBrowser:ie,rewind:D,loadVideo:a,seekToTimeStamp:J,isPlayerInitialised:E,load:C,authenticateLC:R,dispose:N,enableCaptions:Y,disableCaptions:Q,getCaptions:Z,playSelectedResolution:ee,getSource:l,setVolume:ce,getVolume:de,disableControls:m,setPlaybackSpeed:W,getEntitlementData:A}}export{mn as default};
@@ -1 +1 @@
1
- import{h as o,o as i,p as l,q as e}from"./features-dc22eda2.js";import{g as r}from"./skin-612c987b.js";import{a,i as n,b as t}from"./index-08ddf166.js";import{i as s}from"./browser-d4613b36.js";import"videojs-contrib-quality-menu";import u from"video.js";import{i as d}from"./keyboardShortcuts-8bb85a01.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./generic-d124edfc.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-59c404fa.js";import"./renditions-16e1a2db.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-12394cdf.js";import"./util-435845ca.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";function p(i,l){var e=r(i);e&&(e.on("loadeddata",(function(){var o,e,t,u,d;!function(o){var i=r(o);i&&i.qualityMenu({useResolutionLabels:!0})}(i),!(null!=l&&null!==(o=l.series)&&void 0!==o&&o.enable||null!==(e=window)&&void 0!==e&&null!==(t=e.app_data)&&void 0!==t&&null!==(u=t.appcmsMain)&&void 0!==u&&null!==(d=u.features)&&void 0!==d&&d.auto_play)||null!=l&&l.liveVideo||a(i,l),null!=l&&l.liveVideo||s()||n(i)})),e.one("play",(function(){var l,e,r,a;null!==(l=window)&&void 0!==l&&null!==(e=l.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(i,null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.iframeOverlayUrl)})))}function m(o,a){r(o).addClass("skin_vlone"),p(o,a),function(o,r){var a,n,s,u;(null==r||null===(a=r.relatedVideos)||void 0===a||null===(n=a.content)||void 0===n?void 0:n.length)>0&&i(o,null==r?void 0:r.relatedVideos);null!=r&&null!==(s=r.series)&&void 0!==s&&s.enable&&l(o,r);(null==r||null===(u=r.streams)||void 0===u?void 0:u.length)>1&&e(o,null==r?void 0:r.streams);t(o,r),d(o,r)}(o,a),v()}var v=function(){var o,i,l,e,r,a,n,t,s,d,p,m,v=u.dom.$(".vjs-play-progress"),b=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");b&&(b.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(l=i.appcmsMain)||void 0===l||null===(e=l.brand)||void 0===e||null===(r=e.cta)||void 0===r||null===(a=r.primary)||void 0===a?void 0:a.backgroundColor)),v&&(v.style.background="".concat(null===(n=window)||void 0===n||null===(t=n.app_data)||void 0===t||null===(s=t.appcmsMain)||void 0===s||null===(d=s.brand)||void 0===d||null===(p=d.cta)||void 0===p||null===(m=p.primary)||void 0===m?void 0:m.backgroundColor))};export{m as initialiseSkin};
1
+ import{h as o,o as i,p as l,q as e}from"./features-dc22eda2.js";import{g as r}from"./skin-612c987b.js";import{a,i as n,b as t}from"./index-1ba17a06.js";import{i as s}from"./browser-d4613b36.js";import"videojs-contrib-quality-menu";import u from"video.js";import{i as d}from"./keyboardShortcuts-8bb85a01.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./generic-d124edfc.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-59c404fa.js";import"./renditions-16e1a2db.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-12394cdf.js";import"./util-435845ca.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";function p(i,l){var e=r(i);e&&(e.on("loadeddata",(function(){var o,e,t,u,d;!function(o){var i=r(o);i&&i.qualityMenu({useResolutionLabels:!0})}(i),!(null!=l&&null!==(o=l.series)&&void 0!==o&&o.enable||null!==(e=window)&&void 0!==e&&null!==(t=e.app_data)&&void 0!==t&&null!==(u=t.appcmsMain)&&void 0!==u&&null!==(d=u.features)&&void 0!==d&&d.auto_play)||null!=l&&l.liveVideo||a(i,l),null!=l&&l.liveVideo||s()||n(i)})),e.one("play",(function(){var l,e,r,a;null!==(l=window)&&void 0!==l&&null!==(e=l.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(i,null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.iframeOverlayUrl)})))}function m(o,a){r(o).addClass("skin_vlone"),p(o,a),function(o,r){var a,n,s,u;(null==r||null===(a=r.relatedVideos)||void 0===a||null===(n=a.content)||void 0===n?void 0:n.length)>0&&i(o,null==r?void 0:r.relatedVideos);null!=r&&null!==(s=r.series)&&void 0!==s&&s.enable&&l(o,r);(null==r||null===(u=r.streams)||void 0===u?void 0:u.length)>1&&e(o,null==r?void 0:r.streams);t(o,r),d(o,r)}(o,a),v()}var v=function(){var o,i,l,e,r,a,n,t,s,d,p,m,v=u.dom.$(".vjs-play-progress"),b=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");b&&(b.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(l=i.appcmsMain)||void 0===l||null===(e=l.brand)||void 0===e||null===(r=e.cta)||void 0===r||null===(a=r.primary)||void 0===a?void 0:a.backgroundColor)),v&&(v.style.background="".concat(null===(n=window)||void 0===n||null===(t=n.app_data)||void 0===t||null===(s=t.appcmsMain)||void 0===s||null===(d=s.brand)||void 0===d||null===(p=d.cta)||void 0===p||null===(m=p.primary)||void 0===m?void 0:m.backgroundColor))};export{m as initialiseSkin};
@@ -1 +1 @@
1
- import{f as l,g as e,h as o,d as i,e as n,i as t,j as a,k as r,l as s,m as d}from"./features-dc22eda2.js";import{M as u,a as m,c as v,d as p}from"./icons-79ad4d7d.js";import{g as c,b as h}from"./skin-612c987b.js";import{g as f}from"./renditions-16e1a2db.js";import{g as b}from"./captions-59c404fa.js";import{a as g,i as j,b as y}from"./index-08ddf166.js";import{i as C,d as V}from"./browser-d4613b36.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./generic-d124edfc.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-12394cdf.js";import"./util-435845ca.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";function w(i,n){var t=c(i);t&&(t.on("loadeddata",(function(){var o,a,r,s,d,u,m;(null===(o=f(i))||void 0===o?void 0:o.length)>0&&l(i,n),(null===(a=b(i))||void 0===a?void 0:a.length)>0&&e(i,n),!(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable||null!==(s=window)&&void 0!==s&&null!==(d=s.app_data)&&void 0!==d&&null!==(u=d.appcmsMain)&&void 0!==u&&null!==(m=u.features)&&void 0!==m&&m.auto_play)||null!=n&&n.liveVideo||g(i,n),function(l,e){var o,i=Math.floor(l/60),n=null===(o=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===o?void 0:o[0];n&&(n.style.marginRight=i>60?"56px":"41px");var t=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");e&&t.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",n&&(n.style.marginRight="56px"))}(t.duration(),(null==n?void 0:n.liveVideo)||!1),null!=n&&n.liveVideo||C()||j(i)})),t.one("play",(function(){var l,e,n,t;null!==(l=window)&&void 0!==l&&null!==(e=l.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(i,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)})))}function x(l,e){c(l).addClass("skin_defaultv2"),function(){"Chrome"==V()&&import("./chromett-a3cbb2e1.js").then((function(l){var e=document.createElement("style");e.id="chromett",e.append("".concat(l.default)),document.head.appendChild(e)}));import("./skin-e4b35c14.js").then((function(l){var e=document.createElement("style");e.id="default_v2",e.append("".concat(l.default)),document.head.appendChild(e)}))}(),w(l,e),function(l,e){var o,i,n,t,a,r,s=c(l);null==s||null===(o=s.controlBar)||void 0===o||null===(i=o.getChild("FullscreenToggle"))||void 0===i||null===(n=i.el())||void 0===n||n.appendChild(h(u(window.controlsColor))),null==s||null===(t=s.controlBar)||void 0===t||null===(a=t.getChild("FullscreenToggle"))||void 0===a||null===(r=a.el())||void 0===r||r.appendChild(h(m(window.controlsColor)));var d=document.getElementsByClassName("vjs-time-control");e.liveVideo&&d[0]&&(d[0].style.display="none")}(l,e),function(l,e){var o,u,m,c,h,f;0==(null==e?void 0:e.liveVideo)&&0==(null==e?void 0:e.liveui)&&i(l,"defaultV2",v());(0==(null==e?void 0:e.liveVideo)&&0==(null==e?void 0:e.liveui)||1==(null==e?void 0:e.liveui))&&n(l,"defaultV2",p());e.liveVideo||t(l);(null==e||null===(o=e.relatedVideos)||void 0===o||null===(u=o.content)||void 0===u?void 0:u.length)>0&&a(l,null==e?void 0:e.relatedVideos);(null==e||null===(m=e.streams)||void 0===m?void 0:m.length)>1&&r(l,null==e?void 0:e.streams);(null==e||null===(c=e.playlist)||void 0===c||null===(h=c.content)||void 0===h?void 0:h.length)>0&&s(l,null==e?void 0:e.playlist);null!=e&&null!==(f=e.series)&&void 0!==f&&f.enable&&d(l,e)}(l,e),y(l,e)}export{x as initialiseSkin};
1
+ import{f as l,g as e,h as o,d as i,e as n,i as t,j as a,k as r,l as s,m as d}from"./features-dc22eda2.js";import{M as u,a as m,c as v,d as p}from"./icons-79ad4d7d.js";import{g as c,b as h}from"./skin-612c987b.js";import{g as f}from"./renditions-16e1a2db.js";import{g as b}from"./captions-59c404fa.js";import{a as g,i as j,b as y}from"./index-1ba17a06.js";import{i as C,d as V}from"./browser-d4613b36.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./generic-d124edfc.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-12394cdf.js";import"./util-435845ca.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";function w(i,n){var t=c(i);t&&(t.on("loadeddata",(function(){var o,a,r,s,d,u,m;(null===(o=f(i))||void 0===o?void 0:o.length)>0&&l(i,n),(null===(a=b(i))||void 0===a?void 0:a.length)>0&&e(i,n),!(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable||null!==(s=window)&&void 0!==s&&null!==(d=s.app_data)&&void 0!==d&&null!==(u=d.appcmsMain)&&void 0!==u&&null!==(m=u.features)&&void 0!==m&&m.auto_play)||null!=n&&n.liveVideo||g(i,n),function(l,e){var o,i=Math.floor(l/60),n=null===(o=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===o?void 0:o[0];n&&(n.style.marginRight=i>60?"56px":"41px");var t=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");e&&t.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",n&&(n.style.marginRight="56px"))}(t.duration(),(null==n?void 0:n.liveVideo)||!1),null!=n&&n.liveVideo||C()||j(i)})),t.one("play",(function(){var l,e,n,t;null!==(l=window)&&void 0!==l&&null!==(e=l.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(i,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)})))}function x(l,e){c(l).addClass("skin_defaultv2"),function(){"Chrome"==V()&&import("./chromett-a3cbb2e1.js").then((function(l){var e=document.createElement("style");e.id="chromett",e.append("".concat(l.default)),document.head.appendChild(e)}));import("./skin-e4b35c14.js").then((function(l){var e=document.createElement("style");e.id="default_v2",e.append("".concat(l.default)),document.head.appendChild(e)}))}(),w(l,e),function(l,e){var o,i,n,t,a,r,s=c(l);null==s||null===(o=s.controlBar)||void 0===o||null===(i=o.getChild("FullscreenToggle"))||void 0===i||null===(n=i.el())||void 0===n||n.appendChild(h(u(window.controlsColor))),null==s||null===(t=s.controlBar)||void 0===t||null===(a=t.getChild("FullscreenToggle"))||void 0===a||null===(r=a.el())||void 0===r||r.appendChild(h(m(window.controlsColor)));var d=document.getElementsByClassName("vjs-time-control");e.liveVideo&&d[0]&&(d[0].style.display="none")}(l,e),function(l,e){var o,u,m,c,h,f;0==(null==e?void 0:e.liveVideo)&&0==(null==e?void 0:e.liveui)&&i(l,"defaultV2",v());(0==(null==e?void 0:e.liveVideo)&&0==(null==e?void 0:e.liveui)||1==(null==e?void 0:e.liveui))&&n(l,"defaultV2",p());e.liveVideo||t(l);(null==e||null===(o=e.relatedVideos)||void 0===o||null===(u=o.content)||void 0===u?void 0:u.length)>0&&a(l,null==e?void 0:e.relatedVideos);(null==e||null===(m=e.streams)||void 0===m?void 0:m.length)>1&&r(l,null==e?void 0:e.streams);(null==e||null===(c=e.playlist)||void 0===c||null===(h=c.content)||void 0===h?void 0:h.length)>0&&s(l,null==e?void 0:e.playlist);null!=e&&null!==(f=e.series)&&void 0!==f&&f.enable&&d(l,e)}(l,e),y(l,e)}export{x as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.170-backup",
3
+ "version": "1.0.172-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {