@viewlift/player-backup 1.0.154-backup → 1.0.155-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
@@ -1,7 +1,6 @@
1
1
 
2
2
 
3
3
 
4
-
5
4
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
6
5
  height: 0.7em;
7
6
  position: absolute;
@@ -143,6 +142,7 @@
143
142
 
144
143
 
145
144
 
145
+
146
146
  .video-js .tvProviderImage {
147
147
  position: absolute;
148
148
  right: 1rem;
@@ -171,6 +171,10 @@
171
171
 
172
172
 
173
173
 
174
+
175
+
176
+
177
+
174
178
  .video-js .multicamera-parent.default{
175
179
  height: 345px;
176
180
  position: absolute;
@@ -249,10 +253,6 @@
249
253
  align-content: baseline;
250
254
  }
251
255
 
252
-
253
-
254
-
255
-
256
256
  /* nextep */
257
257
  .next-ep-preview{
258
258
  position: absolute;
@@ -313,38 +313,6 @@
313
313
  margin-left: 8px;
314
314
  }
315
315
  }
316
- /* a wrapper element that tracks the mouse vertically */
317
- .vjs-thumbnail-holder {
318
- position: absolute;
319
- left: -1000px;
320
- }
321
-
322
- /* the thumbnail image itself */
323
- .vjs-thumbnail {
324
- position: absolute;
325
- left: 0;
326
- bottom: 1.3em;
327
- opacity: 0;
328
- transition: opacity .2s ease;
329
- -webkit-transition: opacity .2s ease;
330
- -moz-transition: opacity .2s ease;
331
- -mz-transition: opacity .2s ease;
332
- }
333
-
334
- /* fade in the thumbnail when hovering over the progress bar */
335
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
336
- .vjs-progress-control:hover .vjs-thumbnail,
337
- .vjs-progress-control.fake-active .vjs-thumbnail,
338
- .vjs-progress-control:active .vjs-thumbnail {
339
- opacity: 1;
340
- }
341
-
342
- /* ... but hide the thumbnail when hovering directly over it */
343
- .vjs-progress-control:hover .vjs-thumbnail:hover,
344
- .vjs-progress-control:active .vjs-thumbnail:active {
345
- opacity: 0;
346
- }
347
-
348
316
  .video-js.vjs-quality-menu {
349
317
  display: block;
350
318
  }
@@ -415,6 +383,38 @@
415
383
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
416
384
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
417
385
  }
386
+ /* a wrapper element that tracks the mouse vertically */
387
+ .vjs-thumbnail-holder {
388
+ position: absolute;
389
+ left: -1000px;
390
+ }
391
+
392
+ /* the thumbnail image itself */
393
+ .vjs-thumbnail {
394
+ position: absolute;
395
+ left: 0;
396
+ bottom: 1.3em;
397
+ opacity: 0;
398
+ transition: opacity .2s ease;
399
+ -webkit-transition: opacity .2s ease;
400
+ -moz-transition: opacity .2s ease;
401
+ -mz-transition: opacity .2s ease;
402
+ }
403
+
404
+ /* fade in the thumbnail when hovering over the progress bar */
405
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
406
+ .vjs-progress-control:hover .vjs-thumbnail,
407
+ .vjs-progress-control.fake-active .vjs-thumbnail,
408
+ .vjs-progress-control:active .vjs-thumbnail {
409
+ opacity: 1;
410
+ }
411
+
412
+ /* ... but hide the thumbnail when hovering directly over it */
413
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
414
+ .vjs-progress-control:active .vjs-thumbnail:active {
415
+ opacity: 0;
416
+ }
417
+
418
418
  .vjs-poster {
419
419
  display: inline-block;
420
420
  vertical-align: middle;
@@ -0,0 +1 @@
1
+ "use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./skin-aef573bd.js"),a=require("./generic-cffdd8af.js"),l=require("./autoNextVideo-5cba144d.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 k.apply(this,arguments)}function k(){return(k=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,k,T,I,P,A,L,B;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 o=e.sent,e.next=7,o.text();case 7:l=e.sent,u=new DOMParser,s=u.parseFromString(l,"application/xml"),c=null===(r=a.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i?void 0:i.runtime,p=s.getElementsByTagName("AdaptationSet"),m=0;case 13:if(!(m<p.length)){e.next=37;break}if(("image"!==(f=p[m]).getAttribute("contentType")||"image/png"!==f.getAttribute("mimeType"))&&"image/jpeg"!==f.getAttribute("mimeType")){e.next=34;break}if(g=f.getElementsByTagName("SegmentTemplate")[0],h=f.getElementsByTagName("Representation")[0],x=h.getElementsByTagName("EssentialProperty")[0],y=x.getAttribute("value"),b=null==y?void 0:y.split("x"),w=v(b,2),E=w[0],C=w[1],!g){e.next=34;break}for(g.getAttribute("media"),N=g.getAttribute("duration"),k=g.getAttribute("timescale"),T=N/(k||N/(E*C)),I=h.getAttribute("id"),P=Math.round(c/T),A=Math.ceil(P/E*C),L=g.getAttribute("media"),B=[],m=0;m<A;m++)B.push({duration:T,layout:y,uri:n+"/"+L.replace("$Number$",m).replace("$RepresentationID$",I)});return e.abrupt("return",B);case 34:m++,e.next=13;break;case 37:return console.log("No trickplay segment found."),e.abrupt("return",null);case 41:e.prev=41,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 44:case"end":return e.stop()}}),e,null,[[1,41]])})))).apply(this,arguments)}function T(){return(T=c(d.mark((function e(t){var n,r,i,a,l,u,s,c,p,v,m;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.getPlayer(t),r=n.currentSource(),null==(i=r.src)||!i.includes("m3u8")){e.next=18;break}return e.next=5,y(i);case 5:if(!((null==(a=e.sent)?void 0:a.length)>0)){e.next=16;break}return l=(null==a?void 0:a[0])||null,u=l.uri,s=i.substring(0,i.lastIndexOf("/"))+"/",e.next=11,C(s,u);case 11:return c=e.sent,e.next=14,w(c);case 14:p=e.sent,n.thumbnails(p);case 16:e.next=27;break;case 18:if(null==i||!i.includes("mpd")){e.next=27;break}return e.next=21,N(i);case 21:if(!((null==(v=e.sent)?void 0:v.length)>0)){e.next=27;break}return e.next=25,w(v);case 25:m=e.sent,n.thumbnails(m);case 27: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,k,T;(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],P=null===(h=document.getElementsByClassName("next-ep-img"))||void 0===h?void 0:h[0],A=null===(x=document.getElementsByClassName("next-ep-content"))||void 0===x?void 0:x[0],L=null===(y=p[0])||void 0===y?void 0:y.title;(null===(b=L)||void 0===b?void 0:b.length)>60&&(L=L.substr(0,60)+"..."),I.textContent="".concat(L),P.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===(k=window)||void 0===k||null===(T=k.customData)||void 0===T?void 0:T.fallbackImage),A.onclick=function(){return f(e)}}else{var B,M,j,O,S,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===(j=M.gist)||void 0===j||null===(O=j.imageGist)||void 0===O?void 0:O.r16x9)||(null==p||null===(S=p[0])||void 0===S?void 0:S.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 T.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-cffdd8af.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("./skin-aef573bd.js"),l=require("./browser-77c57718.js"),a=require("@babel/runtime/helpers/typeof"),s=require("./util-197a4f7c.js"),u=require("./captions-37b81672.js"),d=require("./renditions-fd408798.js"),c=require("./resolution-c59e995e.js"),v=require("./localisation-56e0a999.js");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 i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}}))},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(){var e=n(i.mark((function e(n){var t,a,s,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.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 u=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,u.default(o),e.finish(14);case 17:null!==(s=window)&&void 0!==s&&s.cast?null==a||a.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.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"==l.detectBrowser()?null==a||a.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)}}(),y=function(e,n){var t=r.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,i,r,l,a,s=this.el(),u=o.dom.getPointerPosition(s,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(r=i.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function w(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?h(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var b=[],k=0,O=null;function S(n,i,o){var r,l,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==i||null===(r=i.watchHistory)||void 0===r||r.apiVersion;var c=null==i||null===(l=i.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(n.currentTime()),f=Math.floor(n.duration());null==i||null===(a=i.watchHistory)||void 0===a||a.xapiKey;var m=(null==i||null===(s=i.video)||void 0===s?void 0:s.originalObjectId)||null,g=(null==i||null===(u=i.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(n.currentTime()),h=d?100:Math.floor(v/f*100),b={};g?function(n,i,o){var r=i?"watchhistory-data-".concat(i):"watchhistory-data-guest-".concat(o),l=P(r),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},d=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return w(w({},e),{},t({},n,u[n]))}),{}),c=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));c<0?l.push(w(w({content:d},n),{},{addedDate:a,updateDate:a})):l[c]=w(w(w({},l[c]),n),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(b={completed:d,watchedTime:y,watchedPercentage:h},c,i.siteOwner):(b=w(w({videoId:p,watchedTime:y,watchedPercentage:h,doneWatching:d,profileId:c},O&&{seriesId:O}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then((function(e){})).catch((function(e){}))),k=v+o}function P(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function j(e,n,t){var i=P(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),o}var T=function(e,n,t){var i=r.getPlayer(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var o=parseFloat(n)/100;i.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},I=function(e){var n=r.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},C=!1,E=function(n,t){var i,o,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(i=n[r])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!C){var l=D(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),C=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function D(e,n,t){if(Array.isArray(e))return e.map((function(e){return D(e,n,t)}));if(null!==e&&"object"===a(e)){var i={};return Object.keys(e).forEach((function(o){o===n&&void 0!==e[t]?i[o]=e[t]:o===t&&void 0!==e[n]?i[o]=e[n]:i[o]=D(e[o],n,t)})),i}return e}function x(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function R(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?x(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var V=function(n,t,i,o){var l,a,s=o.res,u=o.sres,d=r.getPlayer(n),c=(null==s?void 0:s.contentType)||"video",v=(null==s||null===(l=s[c])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;e.setCurrentVideo(s),d&&(d.on("loadstart",(function(){v?i.resolve({status:!0,msg:"Video Loaded",response:s}):i.resolve(R({status:!0,msg:"Player Initialised"},u?{seriesResponse:u,response:s}:{response:s}))})),d.on("loadeddata",(function(){var i,o,l;(null==d||!d.muted())&&T(n,sessionStorage.getItem("volume")||"100");var a=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var u,c,v=R(R({},t),s);!function(e,n,t){var i,o,l;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(O=null==n||null===(o=n.series)||void 0===o?void 0:o.id),b=[],k=0,p=t;var a=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,s=r.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());b.includes(k)||(e==k?(b.push(e),S(s,n,a)):e>k&&(k=e+a))})),s.one("ended",(function(){S(s,n,a,!0)})))}(n,v,null==a||null===(u=a.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=d&&d.mux){var f,m,g,y,h,w,P=(null===(f=e.getCurrentVideo())||void 0===f?void 0:f.video)||(null==s?void 0:s.video),j=null==P?void 0:P.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==j?void 0:j.id,video_title:null==j?void 0:j.title,video_series:null==P||null===(y=P.series)||void 0===y?void 0:y.title,video_stream_type:null!=P&&null!==(h=P.streamingInfo)&&void 0!==h&&h.isLiveStream?"live":"video",viewer_user_id:null==t||null===(w=t.analytics)||void 0===w?void 0:w.userId};d.mux({debug:!1,data:I})}})),d.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];d.trigger("subtitlechanged",n)})),d.on("subtitlechanged",(function(e,n){var t,i,o,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.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===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),d.tech_.on("retryplaylist",(function(){v&&E(s,n)})),d.on("error",(function(){var t,o;(console.log("ERROR",d.error(),d.error().code),4===d.error().code&&v)?E(s,n):(e.handleError(n,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==d||null===(o=d.error())||void 0===o?void 0:o.message)||"Some error occured",response:s}))})),d.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var i,o,r,l=null===(i=e.getCurrentVideo())||void 0===i||null===(o=i.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){d.currentTime(u)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){if(v){d.currentSource();for(var e=d.textTracks(),n=e.length-1;n>=0;n--)d.removeRemoteTextTrack(e[n])}})))},A=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-99c6bb9d.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-189f672a.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-750721af.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-bdd20d25.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-a2185e84.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-56e3f5ce.js")})).then((function(t){t.initialiseSkin(e,n)}))};var N=function(){var e=n(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),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)}}(),_=function(){var e=n(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),L=function(){var e=n(i.mark((function e(){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(o),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),q=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(o)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},loadAdsLibrary:N,loadEMELibrary:_,loadMuxPlugin:L});function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function M(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?H(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):H(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var B=new Set,U=null,F=function(n,t,i){var o,r,l,a,s,u,d,c,v,p={};p[null==i||null===(o=i.Constants)||void 0===o?void 0:o.ASSET_NAME]=z(n),p["c3.cm.id"]=(null==n||null===(r=n.linearchannel)||void 0===r?void 0:r.id)||(null==n||null===(l=n.video)||void 0===l?void 0:l.id)||"",p["c3.cm.contentType"]=K(n),p[null==i||null===(a=i.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==n||!n.linearchannel),p[null==i||null===(s=i.Constants)||void 0===s?void 0:s.STREAM_URL]=t.currentSrc(),p[null==i||null===(u=i.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NA":e.getUserId(),p["c3.cm.categoryType"]=W(n),p[null==i||null===(d=i.Constants)||void 0===d?void 0:d.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.encoding="",p.screenResolution="",p.DRMEnabled=(null==n||null===(c=n.video)||void 0===c?void 0:c.drmEnabled)||(null==n||null===(v=n.linearchannel)||void 0===v?void 0:v.drmEnabled)||"None",p.subscriberType="",p.DAIStream=G(),p[i.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NA";var f=Y(e.getCurrentSeries(),n);return p=M(M({},p),f)},W=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===(i=t[0])||void 0===i?void 0:i.title)||"Null";var n,t,i},G=function(e){var n,t,i=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[i])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},z=function(e){var n,t,i,o,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===(i=e[r])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id)||"Null";return"[".concat(a,"] ").concat(l)},K=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var J,Y=function(n,t){var i,o,r,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(),d=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(i=t.video)||void 0===i||null===(o=i.series)||void 0===o?void 0:o.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(r=n[u-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},X=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 t=n(i.mark((function n(t,o){var l,a,s,u,d;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!=o&&null!==(l=o.convivaConfig)&&void 0!==l&&l.enable){n.next=2;break}return n.abrupt("return");case 2:if(s=r.getPlayer(t),"function"==typeof(u=null==o||null===(a=o.convivaConfig)||void 0===a?void 0:a.trackConvivaPlayerEvent)){n.next=6;break}return n.abrupt("return");case 6:if(!(u instanceof Promise)){n.next=12;break}return n.next=9,u("getConvivaObject");case 9:d=n.sent,n.next=13;break;case 12:d=u("getConvivaObject");case 13:if(d){n.next=15;break}return n.abrupt("return");case 15:s.ready((function(){var e=s.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var i=X(t.keySystem);u("contentInfo",{DRMEnabled:i})}else u("contentInfo",{DRMEnabled:"None"})})),n||u("contentInfo",{DRMEnabled:"None"})})),s.on("loadstart",(function(){U&&U!==s.currentSrc()&&u("playbackEnded"),u("setPlayer",s),B.clear(),U=s.currentSrc();var n=Q(s.currentType()),t=e.getCurrentVideo(),i=F(t,s,d);i.authToken=(null==o?void 0:o.token)||"NA",i.streamType=n,u("contentInfo",i)})),s.on("play",(function(){B.has(s.currentSrc())||(B.add(s.currentSrc()),u("playbackStarted",null))})),s.on("ended",(function(){B.has(s.currentSrc())&&B.delete(s.currentSrc()),u("playbackEnded")})),s.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&u("initAdSensor",{player:s,adsLoader:null==e?void 0:e.adsLoader})})),s.on("dispose",(function(){null==B||B.clear(),u("playbackEnded")}));case 21:case"end":return n.stop()}}),n)})));return function(e,n){return t.apply(this,arguments)}}();function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ee(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?$(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var ne=function(l,a,s,d){var c,v,p,f,m,h,w,b,k,O,S,P,j,T,I,C,E,D,x,R,N,q,H,M,B,U,F,W,G,z,K,J,Y,X=a.res,Q=void 0===X?null:X,$=a.sres,ne=void 0===$?null:$;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(p=v.framework)||void 0===p||null===(f=p.CastContext)||void 0===f||null===(m=f.getInstance())||void 0===m||m.S;var te=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],ie=(null===(h=Q)||void 0===h?void 0:h.contentType)||"video",oe=r.impolicy16x9(null===(w=Q)||void 0===w||null===(b=w[ie])||void 0===b||null===(k=b.gist)||void 0===k?void 0:k.videoImageUrl)||r.impolicy16x9(null===(O=Q)||void 0===O||null===(S=O[ie])||void 0===S||null===(P=S.gist)||void 0===P||null===(j=P.imageGist)||void 0===j?void 0:j.r16x9),re=(null===(T=Q)||void 0===T||null===(I=T[ie])||void 0===I||null===(C=I.liveDetails)||void 0===C?void 0:C.isDvrEnabled)||!1,le=(null===(E=Q)||void 0===E||null===(D=E[ie])||void 0===D||null===(x=D.streamingInfo)||void 0===x?void 0:x.isLiveStream)||!1,ae=(null===(R=Q)||void 0===R||null===(N=R.ads)||void 0===N||null===(q=N.preRoll)||void 0===q||null===(H=q.adTags)||void 0===H||null===(M=H.web)||void 0===M?void 0:M.active)&&(null===(B=Q)||void 0===B||null===(U=B.ads)||void 0===U||null===(F=U.preRoll)||void 0===F||null===(W=F.adTags)||void 0===W||null===(G=W.web)||void 0===G?void 0:G.url);Q=ee(ee({},Q),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var se=(Y={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:re},t(Y,"autoplay",null==s?void 0:s.autoplay),t(Y,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!ae),t(Y,"loop",(null==s?void 0:s.loop)||!1),t(Y,"audioPosterMode",null==s?void 0:s.audioPosterMode),t(Y,"html5",ee(ee({vhs:ee(ee({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==s||null===(z=s.customData)||void 0===z?void 0:z.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==s||null===(K=s.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(J=s.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(Y,"poster",oe),t(Y,"techOrder",te),t(Y,"chromecast",{requestCustomDataFn:function(e){var n=r.getPlayer(l),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 i,o,r,l,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){f.isDrmEnabled=!0;var m=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;f.licenseUrl=m;var g=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=g}var y=(null==e||null===(i=e[p])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=y;var h=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=h;var w=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=w;var b=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=b,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(Q,e,t)}}),Y);if(!o.getPlayers()[l])var ue=o(l,se,function(){var t=n(i.mark((function n(){var t,r,a,c,v,p,f,m,h,w,b,k,O,S,P,j,T,I,C,E,D,x,R,N;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ue),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,g(s);case 5:if(null!=s&&null!==(t=s.analytics)&&void 0!==t&&t.muxKey&&L(),le&&d.resolve(ee({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:Q}:{response:Q})),e.inititateBeacon(l,null==s?void 0:s.analyticsCb),Z(l,s),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),P=null===(r=Q)||void 0===r||null===(a=r[ie])||void 0===a?void 0:a.drmEnabled,j=null===(c=Q)||void 0===c||null===(v=c[ie])||void 0===v||null===(p=v.liveDetails)||void 0===p?void 0:p.startOverTime,!P){n.next=15;break}return n.next=15,_();case 15:re&&y(l,j),!ae||null!=s&&null!==(f=s.customData)&&void 0!==f&&f.disableAds||e.initialiseAdvertisement(l,ae,Q),T=e.getSource(Q,l),console.log(T),null!=s&&s.nearestClusterUrl&&(T=e.getUpdatedClusterSource(T,s.nearestClusterUrl)),T?e.loadVideo(l,T):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Q}),e.handleError(l,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Q)||void 0===m||null===(h=m[ie])||void 0===h||null===(w=h.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[ie])||void 0===O||null===(S=O.closedCaptions)||void 0===S?void 0:S.length)>0)&&(N=(null===(C=Q)||void 0===C||null===(E=C[ie])||void 0===E||null===(D=E.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(x=Q)||void 0===x||null===(R=x[ie])||void 0===R?void 0:R.closedCaptions),I=N.filter((function(e){return"VTT"===e.format})),u.addCaptions(l,I)),null!=s&&s.disableControls?e.disableControls(l):A(l,ee(ee(ee({},s),se),{},{liveVideo:le,isDvrEnabled:re,res:Q,sres:ne})),V(l,ee(ee(ee({},s),se),{},{liveVideo:le}),d,{res:Q,sres:ne});case 24:case"end":return n.stop()}}),n)})));return function(){return t.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:s.onTimeUpdate,getVideoDuration:s.getVideoDuration,onVideoEnded:s.onVideoEnded,init:function(t){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(i.mark((function n(o,a){var s,u,d,c,p,m,g,y,h,w,b,k,O,S,P,T,I,C,E,D,x,R,V,A,_,L,H;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.isPlayerInitialised(null==t?void 0:t.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(b=(null==t?void 0:t.videoSourceUrl)||!1,k=null==t?void 0:t.asat,O=(null==t||null===(s=t.epg)||void 0===s?void 0:s.enable)||!1,S=null==t?void 0:t.videoId,P=(null==t||null===(u=t.series)||void 0===u?void 0:u.enable)||!1,window.videoId=S,T=null==t?void 0:t.token,!e.token_authentication_enabled(t)){n.next=15;break}if(e.refreshTokenManager().set(null==t?void 0:t.refreshToken),T&&!e.isTokenExpired(T)){n.next=14;break}return a({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),n.abrupt("return");case 14:J=JSON.parse(atob(T.split(".")[1]));case 15:return t.isAnonymousUser=!(null===(d=J)||void 0===d||!d.anonymousId),t.siteOwner=(null===(c=J)||void 0===c?void 0:c.site)||null,t.userId=(null===(p=J)||void 0===p?void 0:p.userId)||null,window.sessionStorage.setItem("uid",null===(m=J)||void 0===m?void 0:m.userId),window.watchHistory=t.watchHistory||null,sessionStorage.setItem("vlp_token",T),I=null==t?void 0:t.playerId,t.chromecastReceiverId=null!=t&&null!==(g=t.series)&&void 0!==g&&g.enable?null:null==t?void 0:t.chromecastReceiverId,C=null==t?void 0:t.airplay,E=(null==t||null===(y=t.analytics)||void 0===y?void 0:y.gaId)||null,(D=null==t?void 0:t.errors)&&(window.customErrors=D),window.customData=null==t?void 0:t.customData,v.setLocalisation(null==t||null===(h=t.customData)||void 0===h?void 0:h.localisation),e.baseUrlManager.set(t.apiBaseUrl),null!=t&&t.skin&&!r.isNotAValidSkin(t.skin)||(t.skin="VL_ONE"),n.next=33,N();case 33:C&&"Safari"==l.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),E&&f("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e.runGtag(E)})).catch((function(e){})),(x=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I)))&&x.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b?(V={directPlaybackUrl:b,id:R="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},k?e.getVideoDetails(R,T).then((function(e){ne(I,{res:ee(ee({},e),V)},t,{resolve:o,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,R)})):ne(I,{res:V},t,{resolve:o,reject:a})):P?(_=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(_)),L=null==t||null===(A=t.series)||void 0===A?void 0:A.id,e.getSeriesDetails(L,T).then((function(n){var i,r,l,s=n.data,u=n.data.seasons;e.setCurrentSeries(u);var d=S||(null==u||null===(i=u[0])||void 0===i||null===(r=i.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);e.createSeriesWatchMap(L,T),e.getVideoDetails(d,T).then((function(n){var i,r,l;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(r=i.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(n.data),ne(I,{res:null==n?void 0:n.data,sres:s},t,{resolve:o,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,S)}))})).catch((function(n){e.initiateErrorHandling(n,I,a)}))):O?(H=null==t?void 0:t.epg,e.getLinearChannelDetails(H,T).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==H?void 0:H.channelId,ne(I,{res:n},t,{resolve:o,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,S)}))):e.getVideoDetails(S,T).then((function(n){var i,r,l,s;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(r=i.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(null==n?void 0:n.data);var u,d=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(s=t.watchHistory)&&void 0!==s&&s.enable)if((null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,p,f=j((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",S,null==t?void 0:t.siteOwner);if(f&&f.length)t.watchHistoryResumeTime=(null===(v=f[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(p=f[0])||void 0===p?void 0:p.watchedPercentage)||null;d.contentType="video",ne(I,{res:d},t,{resolve:o,reject:a})}else e.getVideoInfo(S,T).then((function(e){var n,i,r,l,s,u;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(r=window)||void 0===r||null===(l=r.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,t.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",ne(I,{res:d},t,{resolve:o,reject:a})})).catch((function(e){var n,i,r,l;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(r=window)||void 0===r||null===(l=r.watchHistory)||void 0===l||l.cb(e)),ne(I,{res:d},t,{resolve:o,reject:a})}));else ne(I,{res:d},t,{resolve:o,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,S)}));case 38:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:d.getRenditions,skip:e.skip,getPlayer:r.getPlayer,play:e.play,pause:e.pause,detectBrowser:l.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:s.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:u.enableCaptions,disableCaptions:u.disableCaptions,getCaptions:u.getCaptions,playSelectedResolution:c.playSelectedResolution,getSource:e.getSource,setVolume:T,getVolume:I,disableControls:e.disableControls,setPlaybackSpeed:s.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-cffdd8af.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("./skin-aef573bd.js"),l=require("./browser-77c57718.js"),a=require("@babel/runtime/helpers/typeof"),s=require("./util-197a4f7c.js"),u=require("./captions-37b81672.js"),d=require("./renditions-fd408798.js"),c=require("./resolution-c59e995e.js"),v=require("./localisation-56e0a999.js");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 i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}}))},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(){var e=n(i.mark((function e(n){var t,a,s,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.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 u=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,u.default(o),e.finish(14);case 17:null!==(s=window)&&void 0!==s&&s.cast?null==a||a.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.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"==l.detectBrowser()?null==a||a.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)}}(),y=function(e,n){var t=r.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,i,r,l,a,s=this.el(),u=o.dom.getPointerPosition(s,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(r=i.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function w(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?h(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var b=[],k=0,O=null;function S(n,i,o){var r,l,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==i||null===(r=i.watchHistory)||void 0===r||r.apiVersion;var c=null==i||null===(l=i.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(n.currentTime()),f=Math.floor(n.duration());null==i||null===(a=i.watchHistory)||void 0===a||a.xapiKey;var m=(null==i||null===(s=i.video)||void 0===s?void 0:s.originalObjectId)||null,g=(null==i||null===(u=i.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(n.currentTime()),h=d?100:Math.floor(v/f*100),b={};g?function(n,i,o){var r=i?"watchhistory-data-".concat(i):"watchhistory-data-guest-".concat(o),l=P(r),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},d=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return w(w({},e),{},t({},n,u[n]))}),{}),c=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));c<0?l.push(w(w({content:d},n),{},{addedDate:a,updateDate:a})):l[c]=w(w(w({},l[c]),n),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(b={completed:d,watchedTime:y,watchedPercentage:h},c,i.siteOwner):(b=w(w({videoId:p,watchedTime:y,watchedPercentage:h,doneWatching:d,profileId:c},O&&{seriesId:O}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then((function(e){})).catch((function(e){}))),k=v+o}function P(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function j(e,n,t){var i=P(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),o}var T=function(e,n,t){var i=r.getPlayer(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var o=parseFloat(n)/100;i.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},I=function(e){var n=r.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},C=!1,E=function(n,t){var i,o,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(i=n[r])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!C){var l=D(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),C=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function D(e,n,t){if(Array.isArray(e))return e.map((function(e){return D(e,n,t)}));if(null!==e&&"object"===a(e)){var i={};return Object.keys(e).forEach((function(o){o===n&&void 0!==e[t]?i[o]=e[t]:o===t&&void 0!==e[n]?i[o]=e[n]:i[o]=D(e[o],n,t)})),i}return e}function x(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function R(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?x(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var V=function(n,t,i,o){var l,a,s=o.res,u=o.sres,d=r.getPlayer(n),c=(null==s?void 0:s.contentType)||"video",v=(null==s||null===(l=s[c])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;e.setCurrentVideo(s),d&&(d.on("loadstart",(function(){v?i.resolve({status:!0,msg:"Video Loaded",response:s}):i.resolve(R({status:!0,msg:"Player Initialised"},u?{seriesResponse:u,response:s}:{response:s}))})),d.on("loadeddata",(function(){var i,o,l;(null==d||!d.muted())&&T(n,sessionStorage.getItem("volume")||"100");var a=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var u,c,v=R(R({},t),s);!function(e,n,t){var i,o,l;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(O=null==n||null===(o=n.series)||void 0===o?void 0:o.id),b=[],k=0,p=t;var a=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,s=r.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());b.includes(k)||(e==k?(b.push(e),S(s,n,a)):e>k&&(k=e+a))})),s.one("ended",(function(){S(s,n,a,!0)})))}(n,v,null==a||null===(u=a.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=d&&d.mux){var f,m,g,y,h,w,P=(null===(f=e.getCurrentVideo())||void 0===f?void 0:f.video)||(null==s?void 0:s.video),j=null==P?void 0:P.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==j?void 0:j.id,video_title:null==j?void 0:j.title,video_series:null==P||null===(y=P.series)||void 0===y?void 0:y.title,video_stream_type:null!=P&&null!==(h=P.streamingInfo)&&void 0!==h&&h.isLiveStream?"live":"video",viewer_user_id:null==t||null===(w=t.analytics)||void 0===w?void 0:w.userId};d.mux({debug:!1,data:I})}})),d.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];d.trigger("subtitlechanged",n)})),d.on("subtitlechanged",(function(e,n){var t,i,o,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.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===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),d.tech_.on("retryplaylist",(function(){v&&E(s,n)})),d.on("error",(function(){var t,o;(console.log("ERROR",d.error(),d.error().code),4===d.error().code&&v)?E(s,n):(e.handleError(n,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==d||null===(o=d.error())||void 0===o?void 0:o.message)||"Some error occured",response:s}))})),d.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var i,o,r,l=null===(i=e.getCurrentVideo())||void 0===i||null===(o=i.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){d.currentTime(u)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){if(v){d.currentSource();for(var e=d.textTracks(),n=e.length-1;n>=0;n--)d.removeRemoteTextTrack(e[n])}})))},A=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-99c6bb9d.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-189f672a.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-9f099a08.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-bdd20d25.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-a2185e84.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-a2c1fe1a.js")})).then((function(t){t.initialiseSkin(e,n)}))};var N=function(){var e=n(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),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)}}(),_=function(){var e=n(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),L=function(){var e=n(i.mark((function e(){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(o),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),q=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(o)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},loadAdsLibrary:N,loadEMELibrary:_,loadMuxPlugin:L});function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function M(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?H(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):H(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var B=new Set,U=null,F=function(n,t,i){var o,r,l,a,s,u,d,c,v,p={};p[null==i||null===(o=i.Constants)||void 0===o?void 0:o.ASSET_NAME]=z(n),p["c3.cm.id"]=(null==n||null===(r=n.linearchannel)||void 0===r?void 0:r.id)||(null==n||null===(l=n.video)||void 0===l?void 0:l.id)||"",p["c3.cm.contentType"]=K(n),p[null==i||null===(a=i.Constants)||void 0===a?void 0:a.IS_LIVE]=!(null==n||!n.linearchannel),p[null==i||null===(s=i.Constants)||void 0===s?void 0:s.STREAM_URL]=t.currentSrc(),p[null==i||null===(u=i.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NA":e.getUserId(),p["c3.cm.categoryType"]=W(n),p[null==i||null===(d=i.Constants)||void 0===d?void 0:d.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.encoding="",p.screenResolution="",p.DRMEnabled=(null==n||null===(c=n.video)||void 0===c?void 0:c.drmEnabled)||(null==n||null===(v=n.linearchannel)||void 0===v?void 0:v.drmEnabled)||"None",p.subscriberType="",p.DAIStream=G(),p[i.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NA";var f=Y(e.getCurrentSeries(),n);return p=M(M({},p),f)},W=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===(i=t[0])||void 0===i?void 0:i.title)||"Null";var n,t,i},G=function(e){var n,t,i=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[i])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},z=function(e){var n,t,i,o,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===(i=e[r])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id)||"Null";return"[".concat(a,"] ").concat(l)},K=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var J,Y=function(n,t){var i,o,r,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(),d=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(i=t.video)||void 0===i||null===(o=i.series)||void 0===o?void 0:o.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(r=n[u-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},X=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 t=n(i.mark((function n(t,o){var l,a,s,u,d;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!=o&&null!==(l=o.convivaConfig)&&void 0!==l&&l.enable){n.next=2;break}return n.abrupt("return");case 2:if(s=r.getPlayer(t),"function"==typeof(u=null==o||null===(a=o.convivaConfig)||void 0===a?void 0:a.trackConvivaPlayerEvent)){n.next=6;break}return n.abrupt("return");case 6:if(!(u instanceof Promise)){n.next=12;break}return n.next=9,u("getConvivaObject");case 9:d=n.sent,n.next=13;break;case 12:d=u("getConvivaObject");case 13:if(d){n.next=15;break}return n.abrupt("return");case 15:s.ready((function(){var e=s.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var i=X(t.keySystem);u("contentInfo",{DRMEnabled:i})}else u("contentInfo",{DRMEnabled:"None"})})),n||u("contentInfo",{DRMEnabled:"None"})})),s.on("loadstart",(function(){U&&U!==s.currentSrc()&&u("playbackEnded"),u("setPlayer",s),B.clear(),U=s.currentSrc();var n=Q(s.currentType()),t=e.getCurrentVideo(),i=F(t,s,d);i.authToken=(null==o?void 0:o.token)||"NA",i.streamType=n,u("contentInfo",i)})),s.on("play",(function(){B.has(s.currentSrc())||(B.add(s.currentSrc()),u("playbackStarted",null))})),s.on("ended",(function(){B.has(s.currentSrc())&&B.delete(s.currentSrc()),u("playbackEnded")})),s.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&u("initAdSensor",{player:s,adsLoader:null==e?void 0:e.adsLoader})})),s.on("dispose",(function(){null==B||B.clear(),u("playbackEnded")}));case 21:case"end":return n.stop()}}),n)})));return function(e,n){return t.apply(this,arguments)}}();function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ee(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?$(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var ne=function(l,a,s,d){var c,v,p,f,m,h,w,b,k,O,S,P,j,T,I,C,E,D,x,R,N,q,H,M,B,U,F,W,G,z,K,J,Y,X=a.res,Q=void 0===X?null:X,$=a.sres,ne=void 0===$?null:$;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(p=v.framework)||void 0===p||null===(f=p.CastContext)||void 0===f||null===(m=f.getInstance())||void 0===m||m.S;var te=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],ie=(null===(h=Q)||void 0===h?void 0:h.contentType)||"video",oe=r.impolicy16x9(null===(w=Q)||void 0===w||null===(b=w[ie])||void 0===b||null===(k=b.gist)||void 0===k?void 0:k.videoImageUrl)||r.impolicy16x9(null===(O=Q)||void 0===O||null===(S=O[ie])||void 0===S||null===(P=S.gist)||void 0===P||null===(j=P.imageGist)||void 0===j?void 0:j.r16x9),re=(null===(T=Q)||void 0===T||null===(I=T[ie])||void 0===I||null===(C=I.liveDetails)||void 0===C?void 0:C.isDvrEnabled)||!1,le=(null===(E=Q)||void 0===E||null===(D=E[ie])||void 0===D||null===(x=D.streamingInfo)||void 0===x?void 0:x.isLiveStream)||!1,ae=(null===(R=Q)||void 0===R||null===(N=R.ads)||void 0===N||null===(q=N.preRoll)||void 0===q||null===(H=q.adTags)||void 0===H||null===(M=H.web)||void 0===M?void 0:M.active)&&(null===(B=Q)||void 0===B||null===(U=B.ads)||void 0===U||null===(F=U.preRoll)||void 0===F||null===(W=F.adTags)||void 0===W||null===(G=W.web)||void 0===G?void 0:G.url);Q=ee(ee({},Q),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var se=(Y={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:re},t(Y,"autoplay",null==s?void 0:s.autoplay),t(Y,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!ae),t(Y,"loop",(null==s?void 0:s.loop)||!1),t(Y,"audioPosterMode",null==s?void 0:s.audioPosterMode),t(Y,"html5",ee(ee({vhs:ee(ee({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==s||null===(z=s.customData)||void 0===z?void 0:z.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==s||null===(K=s.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(J=s.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(Y,"poster",oe),t(Y,"techOrder",te),t(Y,"chromecast",{requestCustomDataFn:function(e){var n=r.getPlayer(l),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 i,o,r,l,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){f.isDrmEnabled=!0;var m=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;f.licenseUrl=m;var g=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=g}var y=(null==e||null===(i=e[p])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=y;var h=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=h;var w=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=w;var b=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=b,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(Q,e,t)}}),Y);if(!o.getPlayers()[l])var ue=o(l,se,function(){var t=n(i.mark((function n(){var t,r,a,c,v,p,f,m,h,w,b,k,O,S,P,j,T,I,C,E,D,x,R,N;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ue),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,g(s);case 5:if(null!=s&&null!==(t=s.analytics)&&void 0!==t&&t.muxKey&&L(),le&&d.resolve(ee({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:Q}:{response:Q})),e.inititateBeacon(l,null==s?void 0:s.analyticsCb),Z(l,s),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),P=null===(r=Q)||void 0===r||null===(a=r[ie])||void 0===a?void 0:a.drmEnabled,j=null===(c=Q)||void 0===c||null===(v=c[ie])||void 0===v||null===(p=v.liveDetails)||void 0===p?void 0:p.startOverTime,!P){n.next=15;break}return n.next=15,_();case 15:re&&y(l,j),!ae||null!=s&&null!==(f=s.customData)&&void 0!==f&&f.disableAds||e.initialiseAdvertisement(l,ae,Q),T=e.getSource(Q,l),console.log(T),null!=s&&s.nearestClusterUrl&&(T=e.getUpdatedClusterSource(T,s.nearestClusterUrl)),T?e.loadVideo(l,T):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Q}),e.handleError(l,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Q)||void 0===m||null===(h=m[ie])||void 0===h||null===(w=h.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[ie])||void 0===O||null===(S=O.closedCaptions)||void 0===S?void 0:S.length)>0)&&(N=(null===(C=Q)||void 0===C||null===(E=C[ie])||void 0===E||null===(D=E.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(x=Q)||void 0===x||null===(R=x[ie])||void 0===R?void 0:R.closedCaptions),I=N.filter((function(e){return"VTT"===e.format})),u.addCaptions(l,I)),null!=s&&s.disableControls?e.disableControls(l):A(l,ee(ee(ee({},s),se),{},{liveVideo:le,isDvrEnabled:re,res:Q,sres:ne})),V(l,ee(ee(ee({},s),se),{},{liveVideo:le}),d,{res:Q,sres:ne});case 24:case"end":return n.stop()}}),n)})));return function(){return t.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:s.onTimeUpdate,getVideoDuration:s.getVideoDuration,onVideoEnded:s.onVideoEnded,init:function(t){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(i.mark((function n(o,a){var s,u,d,c,p,m,g,y,h,w,b,k,O,S,P,T,I,C,E,D,x,R,V,A,_,L,H;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.isPlayerInitialised(null==t?void 0:t.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(b=(null==t?void 0:t.videoSourceUrl)||!1,k=null==t?void 0:t.asat,O=(null==t||null===(s=t.epg)||void 0===s?void 0:s.enable)||!1,S=null==t?void 0:t.videoId,P=(null==t||null===(u=t.series)||void 0===u?void 0:u.enable)||!1,window.videoId=S,T=null==t?void 0:t.token,!e.token_authentication_enabled(t)){n.next=15;break}if(e.refreshTokenManager().set(null==t?void 0:t.refreshToken),T&&!e.isTokenExpired(T)){n.next=14;break}return a({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),n.abrupt("return");case 14:J=JSON.parse(atob(T.split(".")[1]));case 15:return t.isAnonymousUser=!(null===(d=J)||void 0===d||!d.anonymousId),t.siteOwner=(null===(c=J)||void 0===c?void 0:c.site)||null,t.userId=(null===(p=J)||void 0===p?void 0:p.userId)||null,window.sessionStorage.setItem("uid",null===(m=J)||void 0===m?void 0:m.userId),window.watchHistory=t.watchHistory||null,sessionStorage.setItem("vlp_token",T),I=null==t?void 0:t.playerId,t.chromecastReceiverId=null!=t&&null!==(g=t.series)&&void 0!==g&&g.enable?null:null==t?void 0:t.chromecastReceiverId,C=null==t?void 0:t.airplay,E=(null==t||null===(y=t.analytics)||void 0===y?void 0:y.gaId)||null,(D=null==t?void 0:t.errors)&&(window.customErrors=D),window.customData=null==t?void 0:t.customData,v.setLocalisation(null==t||null===(h=t.customData)||void 0===h?void 0:h.localisation),e.baseUrlManager.set(t.apiBaseUrl),null!=t&&t.skin&&!r.isNotAValidSkin(t.skin)||(t.skin="VL_ONE"),n.next=33,N();case 33:C&&"Safari"==l.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),E&&f("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e.runGtag(E)})).catch((function(e){})),(x=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I)))&&x.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b?(V={directPlaybackUrl:b,id:R="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},k?e.getVideoDetails(R,T).then((function(e){ne(I,{res:ee(ee({},e),V)},t,{resolve:o,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,R)})):ne(I,{res:V},t,{resolve:o,reject:a})):P?(_=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(_)),L=null==t||null===(A=t.series)||void 0===A?void 0:A.id,e.getSeriesDetails(L,T).then((function(n){var i,r,l,s=n.data,u=n.data.seasons;e.setCurrentSeries(u);var d=S||(null==u||null===(i=u[0])||void 0===i||null===(r=i.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);e.createSeriesWatchMap(L,T),e.getVideoDetails(d,T).then((function(n){var i,r,l;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(r=i.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(n.data),ne(I,{res:null==n?void 0:n.data,sres:s},t,{resolve:o,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,S)}))})).catch((function(n){e.initiateErrorHandling(n,I,a)}))):O?(H=null==t?void 0:t.epg,e.getLinearChannelDetails(H,T).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==H?void 0:H.channelId,ne(I,{res:n},t,{resolve:o,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,S)}))):e.getVideoDetails(S,T).then((function(n){var i,r,l,s;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(r=i.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(null==n?void 0:n.data);var u,d=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(s=t.watchHistory)&&void 0!==s&&s.enable)if((null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,p,f=j((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",S,null==t?void 0:t.siteOwner);if(f&&f.length)t.watchHistoryResumeTime=(null===(v=f[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(p=f[0])||void 0===p?void 0:p.watchedPercentage)||null;d.contentType="video",ne(I,{res:d},t,{resolve:o,reject:a})}else e.getVideoInfo(S,T).then((function(e){var n,i,r,l,s,u;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(r=window)||void 0===r||null===(l=r.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,t.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",ne(I,{res:d},t,{resolve:o,reject:a})})).catch((function(e){var n,i,r,l;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(r=window)||void 0===r||null===(l=r.watchHistory)||void 0===l||l.cb(e)),ne(I,{res:d},t,{resolve:o,reject:a})}));else ne(I,{res:d},t,{resolve:o,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,S)}));case 38:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:d.getRenditions,skip:e.skip,getPlayer:r.getPlayer,play:e.play,pause:e.pause,detectBrowser:l.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:s.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:u.enableCaptions,disableCaptions:u.disableCaptions,getCaptions:u.getCaptions,playSelectedResolution:c.playSelectedResolution,getSource:e.getSource,setVolume:T,getVolume:I,disableControls:e.disableControls,setPlaybackSpeed:s.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
@@ -1 +1 @@
1
- "use strict";var e=require("./features-1b7b8fad.js"),l=require("./icons-0ea2e662.js"),i=require("./skin-aef573bd.js"),r=require("./renditions-fd408798.js"),n=require("./captions-37b81672.js"),o=require("./index-46e46130.js"),t=require("./browser-77c57718.js");function u(l,u){var a=i.getPlayer(l);a&&(a.on("loadeddata",(function(){var i,d,s,v,c,p,m;(null===(i=r.getRenditions(l))||void 0===i?void 0:i.length)>0&&e.addSettingsButtonV2(l,u),(null===(d=n.getCaptions(l))||void 0===d?void 0:d.length)>0&&e.addCaptionButton(l,u),!(null!=u&&null!==(s=u.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!=u&&u.liveVideo||o.addNextEpPreview(l,u),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"))}(a.duration(),(null==u?void 0:u.liveVideo)||!1),null!=u&&u.liveVideo||t.isMobile()||o.initiateTrickplay(l)})),a.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-cffdd8af.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-5cba144d.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-4209bc32.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),u(r,n),function(e,r){var n,o,t,u,a,d,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===(u=s.controlBar)||void 0===u||null===(a=u.getChild("FullscreenToggle"))||void 0===a||null===(d=a.el())||void 0===d||d.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,u,a,d;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===(u=r.playlist)||void 0===u||null===(a=u.content)||void 0===a?void 0:a.length)>0&&e.addPlaylistSelector(i,null==r?void 0:r.playlist);null!=r&&null!==(d=r.series)&&void 0!==d&&d.enable&&e.addSeriesSelectorV2_DEFAULTV2_TEMP(i,r)}(r,n),o.addTVProviderImage(r,n)};
1
+ "use strict";var e=require("./features-1b7b8fad.js"),l=require("./icons-0ea2e662.js"),i=require("./skin-aef573bd.js"),r=require("./renditions-fd408798.js"),n=require("./captions-37b81672.js"),o=require("./index-6417e661.js"),t=require("./browser-77c57718.js");function u(l,u){var a=i.getPlayer(l);a&&(a.on("loadeddata",(function(){var i,d,s,v,c,p,m;(null===(i=r.getRenditions(l))||void 0===i?void 0:i.length)>0&&e.addSettingsButtonV2(l,u),(null===(d=n.getCaptions(l))||void 0===d?void 0:d.length)>0&&e.addCaptionButton(l,u),!(null!=u&&null!==(s=u.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!=u&&u.liveVideo||o.addNextEpPreview(l,u),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"))}(a.duration(),(null==u?void 0:u.liveVideo)||!1),null!=u&&u.liveVideo||t.isMobile()||o.initiateTrickplay(l)})),a.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-cffdd8af.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-5cba144d.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-4209bc32.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),u(r,n),function(e,r){var n,o,t,u,a,d,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===(u=s.controlBar)||void 0===u||null===(a=u.getChild("FullscreenToggle"))||void 0===a||null===(d=a.el())||void 0===d||d.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,u,a,d;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===(u=r.playlist)||void 0===u||null===(a=u.content)||void 0===a?void 0:a.length)>0&&e.addPlaylistSelector(i,null==r?void 0:r.playlist);null!=r&&null!==(d=r.series)&&void 0!==d&&d.enable&&e.addSeriesSelectorV2_DEFAULTV2_TEMP(i,r)}(r,n),o.addTVProviderImage(r,n)};
@@ -1 +1 @@
1
- "use strict";var e=require("./features-1b7b8fad.js"),r=require("./skin-aef573bd.js"),i=require("./index-46e46130.js"),l=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var a=require("video.js"),o=require("./keyboardShortcuts-6130f6da.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-cffdd8af.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-5cba144d.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-1b7b8fad.js"),r=require("./skin-aef573bd.js"),i=require("./index-6417e661.js"),l=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var a=require("video.js"),o=require("./keyboardShortcuts-6130f6da.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-cffdd8af.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-5cba144d.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()};
package/esm/bundle.css CHANGED
@@ -1,7 +1,6 @@
1
1
 
2
2
 
3
3
 
4
-
5
4
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
6
5
  height: 0.7em;
7
6
  position: absolute;
@@ -143,6 +142,7 @@
143
142
 
144
143
 
145
144
 
145
+
146
146
  .video-js .tvProviderImage {
147
147
  position: absolute;
148
148
  right: 1rem;
@@ -171,6 +171,10 @@
171
171
 
172
172
 
173
173
 
174
+
175
+
176
+
177
+
174
178
  .video-js .multicamera-parent.default{
175
179
  height: 345px;
176
180
  position: absolute;
@@ -249,10 +253,6 @@
249
253
  align-content: baseline;
250
254
  }
251
255
 
252
-
253
-
254
-
255
-
256
256
  /* nextep */
257
257
  .next-ep-preview{
258
258
  position: absolute;
@@ -313,38 +313,6 @@
313
313
  margin-left: 8px;
314
314
  }
315
315
  }
316
- /* a wrapper element that tracks the mouse vertically */
317
- .vjs-thumbnail-holder {
318
- position: absolute;
319
- left: -1000px;
320
- }
321
-
322
- /* the thumbnail image itself */
323
- .vjs-thumbnail {
324
- position: absolute;
325
- left: 0;
326
- bottom: 1.3em;
327
- opacity: 0;
328
- transition: opacity .2s ease;
329
- -webkit-transition: opacity .2s ease;
330
- -moz-transition: opacity .2s ease;
331
- -mz-transition: opacity .2s ease;
332
- }
333
-
334
- /* fade in the thumbnail when hovering over the progress bar */
335
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
336
- .vjs-progress-control:hover .vjs-thumbnail,
337
- .vjs-progress-control.fake-active .vjs-thumbnail,
338
- .vjs-progress-control:active .vjs-thumbnail {
339
- opacity: 1;
340
- }
341
-
342
- /* ... but hide the thumbnail when hovering directly over it */
343
- .vjs-progress-control:hover .vjs-thumbnail:hover,
344
- .vjs-progress-control:active .vjs-thumbnail:active {
345
- opacity: 0;
346
- }
347
-
348
316
  .video-js.vjs-quality-menu {
349
317
  display: block;
350
318
  }
@@ -415,6 +383,38 @@
415
383
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
416
384
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
417
385
  }
386
+ /* a wrapper element that tracks the mouse vertically */
387
+ .vjs-thumbnail-holder {
388
+ position: absolute;
389
+ left: -1000px;
390
+ }
391
+
392
+ /* the thumbnail image itself */
393
+ .vjs-thumbnail {
394
+ position: absolute;
395
+ left: 0;
396
+ bottom: 1.3em;
397
+ opacity: 0;
398
+ transition: opacity .2s ease;
399
+ -webkit-transition: opacity .2s ease;
400
+ -moz-transition: opacity .2s ease;
401
+ -mz-transition: opacity .2s ease;
402
+ }
403
+
404
+ /* fade in the thumbnail when hovering over the progress bar */
405
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
406
+ .vjs-progress-control:hover .vjs-thumbnail,
407
+ .vjs-progress-control.fake-active .vjs-thumbnail,
408
+ .vjs-progress-control:active .vjs-thumbnail {
409
+ opacity: 1;
410
+ }
411
+
412
+ /* ... but hide the thumbnail when hovering directly over it */
413
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
414
+ .vjs-progress-control:active .vjs-thumbnail:active {
415
+ opacity: 0;
416
+ }
417
+
418
418
  .vjs-poster {
419
419
  display: inline-block;
420
420
  vertical-align: middle;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-2882ecc4.js";import{N as n,i as r,g as i}from"./generic-25166c8d.js";import{s as o}from"./autoNextVideo-dc4a9620.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,L;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var A=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)+"..."),A.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===(L=T.customData)||void 0===L?void 0:L.fallbackImage),I.onclick=function(){return x(i)}}else{var P,j,O,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===(P=m[0])||void 0===P?void 0:P.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(j=m[0])||void 0===j||null===(O=j.gist)||void 0===O||null===(S=O.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 L(e){return A.apply(this,arguments)}function A(){return(A=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,L,A,B,I;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 a=e.sent,e.next=7,a.text();case 7:l=e.sent,u=new DOMParser,c=u.parseFromString(l,"application/xml"),p=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,m=c.getElementsByTagName("AdaptationSet"),v=0;case 13:if(!(v<m.length)){e.next=36;break}if(("image"!==(f=m[v]).getAttribute("contentType")||"image/png"!==f.getAttribute("mimeType"))&&"image/jpeg"!==f.getAttribute("mimeType")){e.next=33;break}if(h=f.getElementsByTagName("SegmentTemplate")[0],g=f.getElementsByTagName("Representation")[0],x=g.getElementsByTagName("EssentialProperty")[0],y=x.getAttribute("value"),b=null==y?void 0:y.split("x"),w=d(b,2),E=w[0],C=w[1],!h){e.next=33;break}for(h.getAttribute("media"),N=h.getAttribute("duration"),k=N/(N/(E*C)),T=g.getAttribute("id"),L=Math.round(p/k),A=Math.ceil(L/9),B=h.getAttribute("media"),I=[],v=0;v<A;v++)I.push({duration:k,layout:y,uri:n+"/"+B.replace("$Number$",v).replace("$RepresentationID$",T)});return e.abrupt("return",I);case 33:v++,e.next=13;break;case 36:return console.log("No trickplay segment found."),e.abrupt("return",null);case 40:e.prev=40,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 43:case"end":return e.stop()}}),e,null,[[1,40]])})))).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;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t(n),i=r.currentSource(),null==(o=i.src)||!o.includes("m3u8")){e.next=18;break}return e.next=5,E(o);case 5:if(!((null==(a=e.sent)?void 0:a.length)>0)){e.next=16;break}return l=(null==a?void 0:a[0])||null,u=l.uri,c=o.substring(0,o.lastIndexOf("/"))+"/",e.next=11,T(c,u);case 11:return d=e.sent,e.next=14,N(d);case 14:p=e.sent,r.thumbnails(p);case 16:e.next=27;break;case 18:if(null==o||!o.includes("mpd")){e.next=27;break}return e.next=21,L(o);case 21:if(!((null==(m=e.sent)?void 0:m.length)>0)){e.next=27;break}return e.next=25,N(m);case 25:v=e.sent,r.thumbnails(v);case 27: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-2882ecc4.js";import{N as n,i as r,g as i}from"./generic-25166c8d.js";import{s as o}from"./autoNextVideo-dc4a9620.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 P,j,O,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===(P=m[0])||void 0===P?void 0:P.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(j=m[0])||void 0===j||null===(O=j.gist)||void 0===O||null===(S=O.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;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 a=e.sent,e.next=7,a.text();case 7:l=e.sent,u=new DOMParser,c=u.parseFromString(l,"application/xml"),p=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,m=c.getElementsByTagName("AdaptationSet"),v=0;case 13:if(!(v<m.length)){e.next=37;break}if(("image"!==(f=m[v]).getAttribute("contentType")||"image/png"!==f.getAttribute("mimeType"))&&"image/jpeg"!==f.getAttribute("mimeType")){e.next=34;break}if(h=f.getElementsByTagName("SegmentTemplate")[0],g=f.getElementsByTagName("Representation")[0],x=g.getElementsByTagName("EssentialProperty")[0],y=x.getAttribute("value"),b=null==y?void 0:y.split("x"),w=d(b,2),E=w[0],C=w[1],!h){e.next=34;break}for(h.getAttribute("media"),N=h.getAttribute("duration"),k=h.getAttribute("timescale"),T=N/(k||N/(E*C)),A=g.getAttribute("id"),L=Math.round(p/T),B=Math.ceil(L/E*C),I=h.getAttribute("media"),M=[],v=0;v<B;v++)M.push({duration:T,layout:y,uri:n+"/"+I.replace("$Number$",v).replace("$RepresentationID$",A)});return e.abrupt("return",M);case 34:v++,e.next=13;break;case 37:return console.log("No trickplay segment found."),e.abrupt("return",null);case 41:e.prev=41,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 44:case"end":return e.stop()}}),e,null,[[1,41]])})))).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;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t(n),i=r.currentSource(),null==(o=i.src)||!o.includes("m3u8")){e.next=18;break}return e.next=5,E(o);case 5:if(!((null==(a=e.sent)?void 0:a.length)>0)){e.next=16;break}return l=(null==a?void 0:a[0])||null,u=l.uri,c=o.substring(0,o.lastIndexOf("/"))+"/",e.next=11,T(c,u);case 11:return d=e.sent,e.next=14,N(d);case 14:p=e.sent,r.thumbnails(p);case 16:e.next=27;break;case 18:if(null==o||!o.includes("mpd")){e.next=27;break}return e.next=21,A(o);case 21:if(!((null==(m=e.sent)?void 0:m.length)>0)){e.next=27;break}return e.next=25,N(m);case 25:v=e.sent,r.thumbnails(v);case 27: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,l as o,b as i,c as l,h as r,d as a,e as s,f as u,i as c,j as d,k as v,m as p,p as m,n as f,r as y,o as g,q as h,t as w,u as b,v as k,w as O,x as j,y as S,z as T,A as P,B as I,C as x,D as E,E as D,F as C,G as R,H as A,I as N,J as _,K as V,L,M as H}from"./generic-25166c8d.js";import M from"@babel/runtime/helpers/asyncToGenerator";import B from"@babel/runtime/helpers/defineProperty";import U from"@babel/runtime/regenerator";import F from"video.js";import{g as z,i as G,a as K}from"./skin-2882ecc4.js";import{d as q}from"./browser-d4613b36.js";import J from"@babel/runtime/helpers/typeof";import{o as W,g as Y,a as X,s as Q,b as Z}from"./util-6f289757.js";import{e as $,d as ee,g as ne,a as te}from"./captions-6cc39cdc.js";import{g as oe}from"./renditions-c0f96578.js";import{playSelectedResolution as ie}from"./resolution-00449d8d.js";import{s as le}from"./localisation-0bf399a1.js";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 re,ae=function(e){return new Promise((function(n,t){if(se(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)}}))},se=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ue=function(){var e=M(U.mark((function e(n){var t,o,i,l;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=z(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 l=e.sent,e.prev=6,e.next=9,ae("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,l.default(F),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"==q()?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)}}(),ce=function(e,n){var t=z(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=F.dom.getPointerPosition(a,n).x;F.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===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.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()}}))};function de(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 ve(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?de(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):de(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pe=[],me=0,fe=null;function ye(t,o,i){var l,r,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(l=o.watchHistory)||void 0===l||l.apiVersion;var d=null==o||null===(r=o.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(t.currentTime()),p=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var m=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,f=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(t.currentTime()),g=c?100:Math.floor(v/p*100),h={};f?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),l=ge(i),r=(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 ve(ve({},e),{},B({},n,s[n]))}),{}),c=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===re}));c<0?l.push(ve(ve({content:u},e),{},{addedDate:r,updateDate:r})):l[c]=ve(ve(ve({},l[c]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(h={completed:c,watchedTime:y,watchedPercentage:g},d,o.siteOwner):(h=ve(ve({videoId:re,watchedTime:y,watchedPercentage:g,doneWatching:c,profileId:d},fe&&{seriesId:fe}),m&&{originalObjectId:m}),e(h).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 he(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 we=function(e,n,t){var o=z(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,"'")})},be=function(e){var n=z(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ke=!1,Oe=function(e,n){var i,l,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(i=e[r])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.secondaryVideoAssets)||null)&&!ke){var a=je(e,"videoAssets","secondaryVideoAssets"),s=t(a,n);return s&&o(n,s),ke=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function je(e,n,t){if(Array.isArray(e))return e.map((function(e){return je(e,n,t)}));if(null!==e&&"object"===J(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]=je(e[i],n,t)})),o}return e}function Se(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 Te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Pe=function(e,t,o,s){var u,c,d=s.res,v=s.sres,p=z(e),m=(null==d?void 0:d.contentType)||"video",f=(null==d||null===(u=d[m])||void 0===u||null===(c=u.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;i(d),p&&(p.on("loadstart",(function(){f?o.resolve({status:!0,msg:"Video Loaded",response:d}):o.resolve(Te({status:!0,msg:"Player Initialised"},v?{seriesResponse:v,response:d}:{response:d}))})),p.on("loadeddata",(function(){var o,i,r;(null==p||!p.muted())&&we(e,sessionStorage.getItem("volume")||"100");var a=n();if(l(),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,u,c=Te(Te({},t),d);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(fe=null==n||null===(i=n.series)||void 0===i?void 0:i.id),pe=[],me=0,re=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=z(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());pe.includes(me)||(e==me?(pe.push(e),ye(a,n,r)):e>me&&(me=e+r))})),a.one("ended",(function(){ye(a,n,r,!0)})))}(e,c,null==a||null===(s=a.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=p&&p.mux){var v,m,f,y,g,h,w=(null===(v=n())||void 0===v?void 0:v.video)||(null==d?void 0:d.video),b=null==w?void 0:w.gist,k={env_key:null==t||null===(m=t.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(f=window)||void 0===f?void 0:f.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!==(g=w.streamingInfo)&&void 0!==g&&g.isLiveStream?"live":"video",viewer_user_id:null==t||null===(h=t.analytics)||void 0===h?void 0:h.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,l,r,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===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,m=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 f,y=m.getMediaSession(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(f)}})),p.tech_.on("retryplaylist",(function(){f&&Oe(d,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&f)?Oe(d,e):(r(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:d}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,l,r=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,s=a(),u=(null==s?void 0:s.get(r))||{t:0,p:0},c=u.t,d=u.p;c&&d<95&&setTimeout((function(){p.currentTime(c)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),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(f){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))},Ie=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-0548ad42.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-3614d96c.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-0f5f2ac6.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-587d35fb.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-2e10a78f.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-76eae17f.js").then((function(t){t.initialiseSkin(e,n)}))};var xe=function(){var e=M(U.mark((function e(){return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ae("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)}}(),Ee=function(){var e=M(U.mark((function e(){return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){F.getPlugin("eme")||F.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),De=function(){var e=M(U.mark((function e(){var n;return U.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(F),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)}}(),Ce=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(F)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(F)}))},loadAdsLibrary:xe,loadEMELibrary:Ee,loadMuxPlugin:De});function Re(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 Ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Re(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Re(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ne=new Set,_e=null,Ve=function(e,n,t){var o,i,l,r,a,u,d,v,p,m={};m[null==t||null===(o=t.Constants)||void 0===o?void 0:o.ASSET_NAME]=Me(e),m["c3.cm.id"]=(null==e||null===(i=e.linearchannel)||void 0===i?void 0:i.id)||(null==e||null===(l=e.video)||void 0===l?void 0:l.id)||"",m["c3.cm.contentType"]=Be(e),m[null==t||null===(r=t.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),m[null==t||null===(a=t.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),m[null==t||null===(u=t.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===s()?"NA":s(),m["c3.cm.categoryType"]=Le(e),m[null==t||null===(d=t.Constants)||void 0===d?void 0:d.PLAYER_NAME]="VL_WEB_PLAYER",m["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"}}(),m.encoding="",m.screenResolution="",m.DRMEnabled=(null==e||null===(v=e.video)||void 0===v?void 0:v.drmEnabled)||(null==e||null===(p=e.linearchannel)||void 0===p?void 0:p.drmEnabled)||"None",m.subscriberType="",m.DAIStream=He(),m[t.Constants.DEFAULT_RESOURCE]="AKAMAI",m["c3.cm.brand"]="NA";var f=Fe(c(),e);return m=Ae(Ae({},m),f)},Le=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},He=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"},Me=function(e){var n,t,o,i,l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[l])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(o=e[l])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id)||"Null";return"[".concat(a,"] ").concat(r)},Be=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Ue,Fe=function(e,n){var t,o,i,l,r,a={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return a;var s=d(),c=u();return a["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",a["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",a["c3.cm.showTitle"]=(null==e||null===(i=e[s-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(r=l[c-1])||void 0===r?void 0:r.title)||"Null",a["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",a},ze=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"}},Ge=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ke=function(){var e=M(U.mark((function e(t,o){var i,l,r,a,s;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=o&&null!==(i=o.convivaConfig)&&void 0!==i&&i.enable){e.next=2;break}return e.abrupt("return");case 2:if(r=z(t),"function"==typeof(a=null==o||null===(l=o.convivaConfig)||void 0===l?void 0:l.trackConvivaPlayerEvent)){e.next=6;break}return e.abrupt("return");case 6:if(!(a instanceof Promise)){e.next=12;break}return e.next=9,a("getConvivaObject");case 9:s=e.sent,e.next=13;break;case 12:s=a("getConvivaObject");case 13:if(s){e.next=15;break}return e.abrupt("return");case 15:r.ready((function(){var e=r.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=ze(t.keySystem);a("contentInfo",{DRMEnabled:o})}else a("contentInfo",{DRMEnabled:"None"})})),n||a("contentInfo",{DRMEnabled:"None"})})),r.on("loadstart",(function(){_e&&_e!==r.currentSrc()&&a("playbackEnded"),a("setPlayer",r),Ne.clear(),_e=r.currentSrc();var e=Ge(r.currentType()),t=n(),i=Ve(t,r,s);i.authToken=(null==o?void 0:o.token)||"NA",i.streamType=e,a("contentInfo",i)})),r.on("play",(function(){Ne.has(r.currentSrc())||(Ne.add(r.currentSrc()),a("playbackStarted",null))})),r.on("ended",(function(){Ne.has(r.currentSrc())&&Ne.delete(r.currentSrc()),a("playbackEnded")})),r.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&a("initAdSensor",{player:r,adsLoader:null==e?void 0:e.adsLoader})})),r.on("dispose",(function(){null==Ne||Ne.clear(),a("playbackEnded")}));case 21:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();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 Je(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){B(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 We=function(e,n,i,l){var a,s,u,c,d,v,p,m,f,y,g,h,w,b,O,j,S,T,P,I,x,E,A,N,_,V,L,H,G,q,J,W,Y,X=n.res,Q=void 0===X?null:X,Z=n.sres,$=void 0===Z?null:Z;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||d.S;var ee=null!=i&&i.chromecastReceiverId?["chromecast","html5"]:["html5"],ne=(null===(v=Q)||void 0===v?void 0:v.contentType)||"video",oe=K(null===(p=Q)||void 0===p||null===(m=p[ne])||void 0===m||null===(f=m.gist)||void 0===f?void 0:f.videoImageUrl)||K(null===(y=Q)||void 0===y||null===(g=y[ne])||void 0===g||null===(h=g.gist)||void 0===h||null===(w=h.imageGist)||void 0===w?void 0:w.r16x9),ie=(null===(b=Q)||void 0===b||null===(O=b[ne])||void 0===O||null===(j=O.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,le=(null===(S=Q)||void 0===S||null===(T=S[ne])||void 0===T||null===(P=T.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,re=(null===(I=Q)||void 0===I||null===(x=I.ads)||void 0===x||null===(E=x.preRoll)||void 0===E||null===(A=E.adTags)||void 0===A||null===(N=A.web)||void 0===N?void 0:N.active)&&(null===(_=Q)||void 0===_||null===(V=_.ads)||void 0===V||null===(L=V.preRoll)||void 0===L||null===(H=L.adTags)||void 0===H||null===(G=H.web)||void 0===G?void 0:G.url);Q=Je(Je({},Q),{},{audioAssetSource:null==i?void 0:i.audioAssetSource});var ae=(Y={enableSmoothSeeking:!0,controls:0!=(null==i?void 0:i.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==i?void 0:i.muted)||!1,autoplay:(null==i?void 0:i.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==i.skin,liveui:ie},B(Y,"autoplay",null==i?void 0:i.autoplay),B(Y,"normalizeAutoplay",(null==i?void 0:i.autoplay)&&!re),B(Y,"loop",(null==i?void 0:i.loop)||!1),B(Y,"audioPosterMode",null==i?void 0:i.audioPosterMode),B(Y,"html5",Je(Je({vhs:Je(Je({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==i?void 0:i.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==i||null===(q=i.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==i||null===(J=i.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==i||null===(W=i.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),B(Y,"poster",oe),B(Y,"techOrder",ee),B(Y,"chromecast",{requestCustomDataFn:function(n){var t=z(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,l,r,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){m.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var y=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=y}var g=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=g;var h=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;m.duration=h;var w=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=w;var b=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return m.mediaImage=b,m.subTitles=t,m.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Q,n,o)}}),Y);if(!F.getPlayers()[e])var se=F(e,ae,function(){var n=M(U.mark((function n(){var a,s,u,c,d,v,p,m,f,y,g,h,w,b,O,j,S,T,P,I,x,E,A,N;return U.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(se),console.log(F.VERSION),console.log(F.getPlugins()),n.next=5,ue(i);case 5:if(null!=i&&null!==(a=i.analytics)&&void 0!==a&&a.muxKey&&De(),le&&l.resolve(Je({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:Q}:{response:Q})),R(e,null==i?void 0:i.analyticsCb),Ke(e,i),/Android/i.test(navigator.userAgent)&&(F.options.vhs.overrideNative=!0),O=null===(s=Q)||void 0===s||null===(u=s[ne])||void 0===u?void 0:u.drmEnabled,j=null===(c=Q)||void 0===c||null===(d=c[ne])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.startOverTime,!O){n.next=15;break}return n.next=15,Ee();case 15:ie&&ce(e,j),!re||null!=i&&null!==(p=i.customData)&&void 0!==p&&p.disableAds||D(e,re,Q),S=t(Q,e),console.log(S),null!=i&&i.nearestClusterUrl&&(S=C(S,i.nearestClusterUrl)),S?o(e,S):(l.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Q}),r(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Q)||void 0===m||null===(f=m[ne])||void 0===f||null===(y=f.contentDetails)||void 0===y||null===(g=y.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=Q)||void 0===h||null===(w=h[ne])||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0)&&(N=(null===(P=Q)||void 0===P||null===(I=P[ne])||void 0===I||null===(x=I.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(E=Q)||void 0===E||null===(A=E[ne])||void 0===A?void 0:A.closedCaptions),T=N.filter((function(e){return"VTT"===e.format})),te(e,T)),null!=i&&i.disableControls?k(e):Ie(e,Je(Je(Je({},i),ae),{},{liveVideo:le,isDvrEnabled:ie,res:Q,sres:$})),Pe(e,Je(Je(Je({},i),ae),{},{liveVideo:le}),l,{res:Q,sres:$});case 24:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ye(){return{loadVideoInstantly:v,onTimeUpdate:W,getVideoDuration:Y,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=M(U.mark((function n(t,o){var l,r,a,s,u,c,d,v,p,m,f,y,h,w,b,k,O,D,C,R,M,B,F,z,K,J,W;return U.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!g(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,y=null==e?void 0:e.asat,h=(null==e||null===(l=e.epg)||void 0===l?void 0:l.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,!I(e)){n.next=15;break}if(x().set(null==e?void 0:e.refreshToken),k&&!E(k)){n.next=14;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 14:Ue=JSON.parse(atob(k.split(".")[1]));case 15:return e.isAnonymousUser=!(null===(a=Ue)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=Ue)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=Ue)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=Ue)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k),O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(d=e.series)&&void 0!==d&&d.enable?null:null==e?void 0:e.chromecastReceiverId,D=null==e?void 0:e.airplay,C=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,(R=null==e?void 0:e.errors)&&(window.customErrors=R),window.customData=null==e?void 0:e.customData,le(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),P.set(e.apiBaseUrl),null!=e&&e.skin&&!G(e.skin)||(e.skin="VL_ONE"),n.next=33,xe();case 33:D&&"Safari"==q()&&Promise.resolve().then((function(){return Ce})).then((function(e){e.importAirplay()})),C&&ae("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then((function(){return A(C)})).catch((function(e){})),(M=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(O)))&&M.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(F={directPlaybackUrl:f,id:B="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?j(B,k).then((function(n){We(O,{res:Je(Je({},n),F)},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,B)})):We(O,{res:F},e,{resolve:t,reject:o})):b?(K=sessionStorage.getItem("season-idx")||0,L.set(parseInt(K)),J=null==e||null===(z=e.series)||void 0===z?void 0:z.id,N(J,k).then((function(n){var l,r,a,s=n.data,u=n.data.seasons;H(u);var c=w||(null==u||null===(l=u[0])||void 0===l||null===(r=l.episodes)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.id);_(J,k),j(c,k).then((function(n){var l,r,a;window.contentType=null==n||null===(l=n.data)||void 0===l||null===(r=l.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.contentType,i(n.data),We(O,{res:null==n?void 0:n.data,sres:s},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}))})).catch((function(e){T(e,O,o)}))):h?(W=null==e?void 0:e.epg,V(W,k).then((function(n){var i=null==n?void 0:n.data;i.contentType="linearchannel",i.channelId=null==W?void 0:W.channelId,We(O,{res:i},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}))):j(w,k).then((function(n){var l,r,a,s;window.contentType=null==n||null===(l=n.data)||void 0===l||null===(r=l.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.contentType,i(null==n?void 0:n.data);var u,c=null==n?void 0:n.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(u=e.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var d,v,p,m=he((null===(d=e.watchHistory)||void 0===d?void 0:d.profileId)||"",w,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;c.contentType="video",We(O,{res:c},e,{resolve:t,reject:o})}else S(w,k).then((function(n){var i,l,r,a,s,u;null!==(i=window)&&void 0!==i&&null!==(l=i.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(s=n.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,c.contentType="video",We(O,{res:c},e,{resolve:t,reject:o})})).catch((function(n){var i,l,r,a;null!==(i=window)&&void 0!==i&&null!==(l=i.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(n)),We(O,{res:c},e,{resolve:t,reject:o})}));else We(O,{res:c},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}));case 38:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:p,getPlayer:z,play:m,pause:f,detectBrowser:q,rewind:y,loadVideo:o,seekToTimeStamp:Q,isPlayerInitialised:g,load:h,authenticateLC:w,dispose:b,enableCaptions:$,disableCaptions:ee,getCaptions:ne,playSelectedResolution:ie,getSource:t,setVolume:we,getVolume:be,disableControls:k,setPlaybackSpeed:Z,getEntitlementData:O}}export{Ye as default};
1
+ import"video.js/dist/video-js.min.css";import{s as e,g as n,a as t,l as o,b as i,c as l,h as r,d as a,e as s,f as u,i as c,j as d,k as v,m as p,p as m,n as f,r as y,o as g,q as h,t as w,u as b,v as k,w as O,x as j,y as S,z as T,A as P,B as I,C as x,D as E,E as D,F as C,G as R,H as A,I as N,J as _,K as V,L,M as H}from"./generic-25166c8d.js";import M from"@babel/runtime/helpers/asyncToGenerator";import B from"@babel/runtime/helpers/defineProperty";import U from"@babel/runtime/regenerator";import F from"video.js";import{g as z,i as G,a as K}from"./skin-2882ecc4.js";import{d as q}from"./browser-d4613b36.js";import J from"@babel/runtime/helpers/typeof";import{o as W,g as Y,a as X,s as Q,b as Z}from"./util-6f289757.js";import{e as $,d as ee,g as ne,a as te}from"./captions-6cc39cdc.js";import{g as oe}from"./renditions-c0f96578.js";import{playSelectedResolution as ie}from"./resolution-00449d8d.js";import{s as le}from"./localisation-0bf399a1.js";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 re,ae=function(e){return new Promise((function(n,t){if(se(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)}}))},se=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ue=function(){var e=M(U.mark((function e(n){var t,o,i,l;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=z(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 l=e.sent,e.prev=6,e.next=9,ae("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,l.default(F),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"==q()?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)}}(),ce=function(e,n){var t=z(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=F.dom.getPointerPosition(a,n).x;F.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===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.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()}}))};function de(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 ve(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?de(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):de(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pe=[],me=0,fe=null;function ye(t,o,i){var l,r,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(l=o.watchHistory)||void 0===l||l.apiVersion;var d=null==o||null===(r=o.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(t.currentTime()),p=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var m=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,f=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(t.currentTime()),g=c?100:Math.floor(v/p*100),h={};f?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),l=ge(i),r=(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 ve(ve({},e),{},B({},n,s[n]))}),{}),c=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===re}));c<0?l.push(ve(ve({content:u},e),{},{addedDate:r,updateDate:r})):l[c]=ve(ve(ve({},l[c]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(h={completed:c,watchedTime:y,watchedPercentage:g},d,o.siteOwner):(h=ve(ve({videoId:re,watchedTime:y,watchedPercentage:g,doneWatching:c,profileId:d},fe&&{seriesId:fe}),m&&{originalObjectId:m}),e(h).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 he(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 we=function(e,n,t){var o=z(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,"'")})},be=function(e){var n=z(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ke=!1,Oe=function(e,n){var i,l,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(i=e[r])||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.secondaryVideoAssets)||null)&&!ke){var a=je(e,"videoAssets","secondaryVideoAssets"),s=t(a,n);return s&&o(n,s),ke=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function je(e,n,t){if(Array.isArray(e))return e.map((function(e){return je(e,n,t)}));if(null!==e&&"object"===J(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]=je(e[i],n,t)})),o}return e}function Se(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 Te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Pe=function(e,t,o,s){var u,c,d=s.res,v=s.sres,p=z(e),m=(null==d?void 0:d.contentType)||"video",f=(null==d||null===(u=d[m])||void 0===u||null===(c=u.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;i(d),p&&(p.on("loadstart",(function(){f?o.resolve({status:!0,msg:"Video Loaded",response:d}):o.resolve(Te({status:!0,msg:"Player Initialised"},v?{seriesResponse:v,response:d}:{response:d}))})),p.on("loadeddata",(function(){var o,i,r;(null==p||!p.muted())&&we(e,sessionStorage.getItem("volume")||"100");var a=n();if(l(),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,u,c=Te(Te({},t),d);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(fe=null==n||null===(i=n.series)||void 0===i?void 0:i.id),pe=[],me=0,re=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=z(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());pe.includes(me)||(e==me?(pe.push(e),ye(a,n,r)):e>me&&(me=e+r))})),a.one("ended",(function(){ye(a,n,r,!0)})))}(e,c,null==a||null===(s=a.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=p&&p.mux){var v,m,f,y,g,h,w=(null===(v=n())||void 0===v?void 0:v.video)||(null==d?void 0:d.video),b=null==w?void 0:w.gist,k={env_key:null==t||null===(m=t.analytics)||void 0===m?void 0:m.muxKey,player_name:"vl-web-player",player_version:null===(f=window)||void 0===f?void 0:f.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!==(g=w.streamingInfo)&&void 0!==g&&g.isLiveStream?"live":"video",viewer_user_id:null==t||null===(h=t.analytics)||void 0===h?void 0:h.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,l,r,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===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,m=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 f,y=m.getMediaSession(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(f)}})),p.tech_.on("retryplaylist",(function(){f&&Oe(d,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&f)?Oe(d,e):(r(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:d}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,l,r=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,s=a(),u=(null==s?void 0:s.get(r))||{t:0,p:0},c=u.t,d=u.p;c&&d<95&&setTimeout((function(){p.currentTime(c)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),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(f){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))},Ie=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-0548ad42.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-3614d96c.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-2175d18c.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-587d35fb.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-2e10a78f.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-88d32fd9.js").then((function(t){t.initialiseSkin(e,n)}))};var xe=function(){var e=M(U.mark((function e(){return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ae("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)}}(),Ee=function(){var e=M(U.mark((function e(){return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){F.getPlugin("eme")||F.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),De=function(){var e=M(U.mark((function e(){var n;return U.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(F),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)}}(),Ce=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(F)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(F)}))},loadAdsLibrary:xe,loadEMELibrary:Ee,loadMuxPlugin:De});function Re(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 Ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Re(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Re(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ne=new Set,_e=null,Ve=function(e,n,t){var o,i,l,r,a,u,d,v,p,m={};m[null==t||null===(o=t.Constants)||void 0===o?void 0:o.ASSET_NAME]=Me(e),m["c3.cm.id"]=(null==e||null===(i=e.linearchannel)||void 0===i?void 0:i.id)||(null==e||null===(l=e.video)||void 0===l?void 0:l.id)||"",m["c3.cm.contentType"]=Be(e),m[null==t||null===(r=t.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),m[null==t||null===(a=t.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),m[null==t||null===(u=t.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===s()?"NA":s(),m["c3.cm.categoryType"]=Le(e),m[null==t||null===(d=t.Constants)||void 0===d?void 0:d.PLAYER_NAME]="VL_WEB_PLAYER",m["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"}}(),m.encoding="",m.screenResolution="",m.DRMEnabled=(null==e||null===(v=e.video)||void 0===v?void 0:v.drmEnabled)||(null==e||null===(p=e.linearchannel)||void 0===p?void 0:p.drmEnabled)||"None",m.subscriberType="",m.DAIStream=He(),m[t.Constants.DEFAULT_RESOURCE]="AKAMAI",m["c3.cm.brand"]="NA";var f=Fe(c(),e);return m=Ae(Ae({},m),f)},Le=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},He=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"},Me=function(e){var n,t,o,i,l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[l])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.title)||"Null",a=(null==e||null===(o=e[l])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id)||"Null";return"[".concat(a,"] ").concat(r)},Be=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Ue,Fe=function(e,n){var t,o,i,l,r,a={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return a;var s=d(),c=u();return a["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",a["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",a["c3.cm.showTitle"]=(null==e||null===(i=e[s-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(r=l[c-1])||void 0===r?void 0:r.title)||"Null",a["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",a},ze=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"}},Ge=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ke=function(){var e=M(U.mark((function e(t,o){var i,l,r,a,s;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=o&&null!==(i=o.convivaConfig)&&void 0!==i&&i.enable){e.next=2;break}return e.abrupt("return");case 2:if(r=z(t),"function"==typeof(a=null==o||null===(l=o.convivaConfig)||void 0===l?void 0:l.trackConvivaPlayerEvent)){e.next=6;break}return e.abrupt("return");case 6:if(!(a instanceof Promise)){e.next=12;break}return e.next=9,a("getConvivaObject");case 9:s=e.sent,e.next=13;break;case 12:s=a("getConvivaObject");case 13:if(s){e.next=15;break}return e.abrupt("return");case 15:r.ready((function(){var e=r.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=ze(t.keySystem);a("contentInfo",{DRMEnabled:o})}else a("contentInfo",{DRMEnabled:"None"})})),n||a("contentInfo",{DRMEnabled:"None"})})),r.on("loadstart",(function(){_e&&_e!==r.currentSrc()&&a("playbackEnded"),a("setPlayer",r),Ne.clear(),_e=r.currentSrc();var e=Ge(r.currentType()),t=n(),i=Ve(t,r,s);i.authToken=(null==o?void 0:o.token)||"NA",i.streamType=e,a("contentInfo",i)})),r.on("play",(function(){Ne.has(r.currentSrc())||(Ne.add(r.currentSrc()),a("playbackStarted",null))})),r.on("ended",(function(){Ne.has(r.currentSrc())&&Ne.delete(r.currentSrc()),a("playbackEnded")})),r.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&a("initAdSensor",{player:r,adsLoader:null==e?void 0:e.adsLoader})})),r.on("dispose",(function(){null==Ne||Ne.clear(),a("playbackEnded")}));case 21:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}();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 Je(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){B(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 We=function(e,n,i,l){var a,s,u,c,d,v,p,m,f,y,g,h,w,b,O,j,S,T,P,I,x,E,A,N,_,V,L,H,G,q,J,W,Y,X=n.res,Q=void 0===X?null:X,Z=n.sres,$=void 0===Z?null:Z;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||d.S;var ee=null!=i&&i.chromecastReceiverId?["chromecast","html5"]:["html5"],ne=(null===(v=Q)||void 0===v?void 0:v.contentType)||"video",oe=K(null===(p=Q)||void 0===p||null===(m=p[ne])||void 0===m||null===(f=m.gist)||void 0===f?void 0:f.videoImageUrl)||K(null===(y=Q)||void 0===y||null===(g=y[ne])||void 0===g||null===(h=g.gist)||void 0===h||null===(w=h.imageGist)||void 0===w?void 0:w.r16x9),ie=(null===(b=Q)||void 0===b||null===(O=b[ne])||void 0===O||null===(j=O.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,le=(null===(S=Q)||void 0===S||null===(T=S[ne])||void 0===T||null===(P=T.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,re=(null===(I=Q)||void 0===I||null===(x=I.ads)||void 0===x||null===(E=x.preRoll)||void 0===E||null===(A=E.adTags)||void 0===A||null===(N=A.web)||void 0===N?void 0:N.active)&&(null===(_=Q)||void 0===_||null===(V=_.ads)||void 0===V||null===(L=V.preRoll)||void 0===L||null===(H=L.adTags)||void 0===H||null===(G=H.web)||void 0===G?void 0:G.url);Q=Je(Je({},Q),{},{audioAssetSource:null==i?void 0:i.audioAssetSource});var ae=(Y={enableSmoothSeeking:!0,controls:0!=(null==i?void 0:i.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==i?void 0:i.muted)||!1,autoplay:(null==i?void 0:i.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==i.skin,liveui:ie},B(Y,"autoplay",null==i?void 0:i.autoplay),B(Y,"normalizeAutoplay",(null==i?void 0:i.autoplay)&&!re),B(Y,"loop",(null==i?void 0:i.loop)||!1),B(Y,"audioPosterMode",null==i?void 0:i.audioPosterMode),B(Y,"html5",Je(Je({vhs:Je(Je({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==i?void 0:i.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==i||null===(q=i.customData)||void 0===q?void 0:q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==i||null===(J=i.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==i||null===(W=i.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),B(Y,"poster",oe),B(Y,"techOrder",ee),B(Y,"chromecast",{requestCustomDataFn:function(n){var t=z(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,l,r,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){m.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var y=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=y}var g=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=g;var h=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;m.duration=h;var w=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=w;var b=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return m.mediaImage=b,m.subTitles=t,m.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Q,n,o)}}),Y);if(!F.getPlayers()[e])var se=F(e,ae,function(){var n=M(U.mark((function n(){var a,s,u,c,d,v,p,m,f,y,g,h,w,b,O,j,S,T,P,I,x,E,A,N;return U.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(se),console.log(F.VERSION),console.log(F.getPlugins()),n.next=5,ue(i);case 5:if(null!=i&&null!==(a=i.analytics)&&void 0!==a&&a.muxKey&&De(),le&&l.resolve(Je({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:Q}:{response:Q})),R(e,null==i?void 0:i.analyticsCb),Ke(e,i),/Android/i.test(navigator.userAgent)&&(F.options.vhs.overrideNative=!0),O=null===(s=Q)||void 0===s||null===(u=s[ne])||void 0===u?void 0:u.drmEnabled,j=null===(c=Q)||void 0===c||null===(d=c[ne])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.startOverTime,!O){n.next=15;break}return n.next=15,Ee();case 15:ie&&ce(e,j),!re||null!=i&&null!==(p=i.customData)&&void 0!==p&&p.disableAds||D(e,re,Q),S=t(Q,e),console.log(S),null!=i&&i.nearestClusterUrl&&(S=C(S,i.nearestClusterUrl)),S?o(e,S):(l.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Q}),r(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Q)||void 0===m||null===(f=m[ne])||void 0===f||null===(y=f.contentDetails)||void 0===y||null===(g=y.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=Q)||void 0===h||null===(w=h[ne])||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0)&&(N=(null===(P=Q)||void 0===P||null===(I=P[ne])||void 0===I||null===(x=I.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(E=Q)||void 0===E||null===(A=E[ne])||void 0===A?void 0:A.closedCaptions),T=N.filter((function(e){return"VTT"===e.format})),te(e,T)),null!=i&&i.disableControls?k(e):Ie(e,Je(Je(Je({},i),ae),{},{liveVideo:le,isDvrEnabled:ie,res:Q,sres:$})),Pe(e,Je(Je(Je({},i),ae),{},{liveVideo:le}),l,{res:Q,sres:$});case 24:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ye(){return{loadVideoInstantly:v,onTimeUpdate:W,getVideoDuration:Y,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=M(U.mark((function n(t,o){var l,r,a,s,u,c,d,v,p,m,f,y,h,w,b,k,O,D,C,R,M,B,F,z,K,J,W;return U.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!g(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,y=null==e?void 0:e.asat,h=(null==e||null===(l=e.epg)||void 0===l?void 0:l.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,!I(e)){n.next=15;break}if(x().set(null==e?void 0:e.refreshToken),k&&!E(k)){n.next=14;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 14:Ue=JSON.parse(atob(k.split(".")[1]));case 15:return e.isAnonymousUser=!(null===(a=Ue)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=Ue)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=Ue)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=Ue)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k),O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(d=e.series)&&void 0!==d&&d.enable?null:null==e?void 0:e.chromecastReceiverId,D=null==e?void 0:e.airplay,C=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,(R=null==e?void 0:e.errors)&&(window.customErrors=R),window.customData=null==e?void 0:e.customData,le(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),P.set(e.apiBaseUrl),null!=e&&e.skin&&!G(e.skin)||(e.skin="VL_ONE"),n.next=33,xe();case 33:D&&"Safari"==q()&&Promise.resolve().then((function(){return Ce})).then((function(e){e.importAirplay()})),C&&ae("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then((function(){return A(C)})).catch((function(e){})),(M=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(O)))&&M.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(F={directPlaybackUrl:f,id:B="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?j(B,k).then((function(n){We(O,{res:Je(Je({},n),F)},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,B)})):We(O,{res:F},e,{resolve:t,reject:o})):b?(K=sessionStorage.getItem("season-idx")||0,L.set(parseInt(K)),J=null==e||null===(z=e.series)||void 0===z?void 0:z.id,N(J,k).then((function(n){var l,r,a,s=n.data,u=n.data.seasons;H(u);var c=w||(null==u||null===(l=u[0])||void 0===l||null===(r=l.episodes)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.id);_(J,k),j(c,k).then((function(n){var l,r,a;window.contentType=null==n||null===(l=n.data)||void 0===l||null===(r=l.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.contentType,i(n.data),We(O,{res:null==n?void 0:n.data,sres:s},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}))})).catch((function(e){T(e,O,o)}))):h?(W=null==e?void 0:e.epg,V(W,k).then((function(n){var i=null==n?void 0:n.data;i.contentType="linearchannel",i.channelId=null==W?void 0:W.channelId,We(O,{res:i},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}))):j(w,k).then((function(n){var l,r,a,s;window.contentType=null==n||null===(l=n.data)||void 0===l||null===(r=l.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.contentType,i(null==n?void 0:n.data);var u,c=null==n?void 0:n.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(u=e.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var d,v,p,m=he((null===(d=e.watchHistory)||void 0===d?void 0:d.profileId)||"",w,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;c.contentType="video",We(O,{res:c},e,{resolve:t,reject:o})}else S(w,k).then((function(n){var i,l,r,a,s,u;null!==(i=window)&&void 0!==i&&null!==(l=i.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(s=n.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,c.contentType="video",We(O,{res:c},e,{resolve:t,reject:o})})).catch((function(n){var i,l,r,a;null!==(i=window)&&void 0!==i&&null!==(l=i.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(n)),We(O,{res:c},e,{resolve:t,reject:o})}));else We(O,{res:c},e,{resolve:t,reject:o})})).catch((function(e){T(e,O,o,w)}));case 38:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:p,getPlayer:z,play:m,pause:f,detectBrowser:q,rewind:y,loadVideo:o,seekToTimeStamp:Q,isPlayerInitialised:g,load:h,authenticateLC:w,dispose:b,enableCaptions:$,disableCaptions:ee,getCaptions:ne,playSelectedResolution:ie,getSource:t,setVolume:we,getVolume:be,disableControls:k,setPlaybackSpeed:Z,getEntitlementData:O}}export{Ye as default};
@@ -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-eec2a5a0.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-2882ecc4.js";import{g as f}from"./renditions-c0f96578.js";import{g as b}from"./captions-6cc39cdc.js";import{a as g,i as y,b as j}from"./index-c58608d3.js";import{i as C,d as w}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-25166c8d.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-dc4a9620.js";import"./util-6f289757.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";function V(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()||y(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 k(l,e){c(l).addClass("skin_defaultv2"),function(){"Chrome"==w()&&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-54fd9894.js").then((function(l){var e=document.createElement("style");e.id="default_v2",e.append("".concat(l.default)),document.head.appendChild(e)}))}(),V(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),j(l,e)}export{k 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-eec2a5a0.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-2882ecc4.js";import{g as f}from"./renditions-c0f96578.js";import{g as b}from"./captions-6cc39cdc.js";import{a as g,i as y,b as j}from"./index-2027676e.js";import{i as C,d as w}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-25166c8d.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-dc4a9620.js";import"./util-6f289757.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";function V(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()||y(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 k(l,e){c(l).addClass("skin_defaultv2"),function(){"Chrome"==w()&&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-54fd9894.js").then((function(l){var e=document.createElement("style");e.id="default_v2",e.append("".concat(l.default)),document.head.appendChild(e)}))}(),V(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),j(l,e)}export{k as initialiseSkin};
@@ -1 +1 @@
1
- import{h as o,o as i,p as l,q as e}from"./features-eec2a5a0.js";import{g as r}from"./skin-2882ecc4.js";import{a,i as n,b as t}from"./index-c58608d3.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-c7ac48c1.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-25166c8d.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-6cc39cdc.js";import"./renditions-c0f96578.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-dc4a9620.js";import"./util-6f289757.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-eec2a5a0.js";import{g as r}from"./skin-2882ecc4.js";import{a,i as n,b as t}from"./index-2027676e.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-c7ac48c1.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-25166c8d.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-6cc39cdc.js";import"./renditions-c0f96578.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-dc4a9620.js";import"./util-6f289757.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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.154-backup",
3
+ "version": "1.0.155-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./skin-aef573bd.js"),a=require("./generic-cffdd8af.js"),l=require("./autoNextVideo-5cba144d.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 h(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 g(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",h(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 g(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,h,g,x;for(u in d=0,g=(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)+g,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+g,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+(h=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+h-f:p<h&&(p=h),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 k.apply(this,arguments)}function k(){return(k=c(d.mark((function e(t){var n,r,i,o,l,u,s,c,p,m,f,h,g,x,y,b,w,E,C,N,k,T,I,P,L,A;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 o=e.sent,e.next=7,o.text();case 7:l=e.sent,u=new DOMParser,s=u.parseFromString(l,"application/xml"),c=null===(r=a.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i?void 0:i.runtime,p=s.getElementsByTagName("AdaptationSet"),m=0;case 13:if(!(m<p.length)){e.next=36;break}if(("image"!==(f=p[m]).getAttribute("contentType")||"image/png"!==f.getAttribute("mimeType"))&&"image/jpeg"!==f.getAttribute("mimeType")){e.next=33;break}if(h=f.getElementsByTagName("SegmentTemplate")[0],g=f.getElementsByTagName("Representation")[0],x=g.getElementsByTagName("EssentialProperty")[0],y=x.getAttribute("value"),b=null==y?void 0:y.split("x"),w=v(b,2),E=w[0],C=w[1],!h){e.next=33;break}for(h.getAttribute("media"),N=h.getAttribute("duration"),k=N/(N/(E*C)),T=g.getAttribute("id"),I=Math.round(c/k),P=Math.ceil(I/9),L=h.getAttribute("media"),A=[],m=0;m<P;m++)A.push({duration:k,layout:y,uri:n+"/"+L.replace("$Number$",m).replace("$RepresentationID$",T)});return e.abrupt("return",A);case 33:m++,e.next=13;break;case 36:return console.log("No trickplay segment found."),e.abrupt("return",null);case 40:e.prev=40,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 43:case"end":return e.stop()}}),e,null,[[1,40]])})))).apply(this,arguments)}function T(){return(T=c(d.mark((function e(t){var n,r,i,a,l,u,s,c,p,v,m;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.getPlayer(t),r=n.currentSource(),null==(i=r.src)||!i.includes("m3u8")){e.next=18;break}return e.next=5,y(i);case 5:if(!((null==(a=e.sent)?void 0:a.length)>0)){e.next=16;break}return l=(null==a?void 0:a[0])||null,u=l.uri,s=i.substring(0,i.lastIndexOf("/"))+"/",e.next=11,C(s,u);case 11:return c=e.sent,e.next=14,w(c);case 14:p=e.sent,n.thumbnails(p);case 16:e.next=27;break;case 18:if(null==i||!i.includes("mpd")){e.next=27;break}return e.next=21,N(i);case 21:if(!((null==(v=e.sent)?void 0:v.length)>0)){e.next=27;break}return e.next=25,w(v);case 25:m=e.sent,n.thumbnails(m);case 27: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,h,g,x,y,b,w,E,C,N,k,T;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var I=null===(h=document.getElementsByClassName("next-ep-title"))||void 0===h?void 0:h[0],P=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],L=null===(x=document.getElementsByClassName("next-ep-content"))||void 0===x?void 0:x[0],A=null===(y=p[0])||void 0===y?void 0:y.title;(null===(b=A)||void 0===b?void 0:b.length)>60&&(A=A.substr(0,60)+"..."),I.textContent="".concat(A),P.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===(k=window)||void 0===k||null===(T=k.customData)||void 0===T?void 0:T.fallbackImage),L.onclick=function(){return f(e)}}else{var B,M,j,O,S,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===(j=M.gist)||void 0===j||null===(O=j.imageGist)||void 0===O?void 0:O.r16x9)||(null==p||null===(S=p[0])||void 0===S?void 0:S.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 T.apply(this,arguments)};