@viewlift/player-backup 1.0.136-backup → 1.0.138-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/bundle.css CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
 
4
4
 
5
-
6
5
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
7
6
  height: 0.7em;
8
7
  position: absolute;
@@ -144,6 +143,7 @@
144
143
  }
145
144
 
146
145
 
146
+
147
147
  .video-js .tvProviderImage {
148
148
  position: absolute;
149
149
  right: 1rem;
@@ -172,6 +172,8 @@
172
172
 
173
173
 
174
174
 
175
+
176
+
175
177
  .video-js .multicamera-parent.default{
176
178
  height: 345px;
177
179
  position: absolute;
@@ -252,8 +254,6 @@
252
254
 
253
255
 
254
256
 
255
-
256
-
257
257
  /* nextep */
258
258
  .next-ep-preview{
259
259
  position: absolute;
@@ -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-cdde2bcb.js"),l=require("./autoNextVideo-2220fa0e.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"),m=require("@babel/runtime/helpers/slicedToArray"),v=[],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,v)}};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=m(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)}})));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 m(){document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",m),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,m,v,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,v=e.pageX,e.changedTouches&&(v=e.changedTouches[0].pageX),p=v||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));(m=a[d]).src&&l.src!=m.src&&(l.src=m.src),m.style&&l.style!=m.style&&t(l.style,m.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,m.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",m)})),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=m(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,v,f,h,g,x,y,b,w,E,C,N,k;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=34;break}if("image"!==(v=p[m]).getAttribute("contentType")||"image/png"!==v.getAttribute("mimeType")){e.next=31;break}if(f=v.getElementsByTagName("SegmentTemplate")[0],h=v.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],x=g.getAttribute("value"),!f){e.next=31;break}for(f.getAttribute("media"),y=f.getAttribute("duration"),b=f.getAttribute("timescale"),w=y/b,E=Math.round(c/w),C=Math.ceil(E/9),N=f.getAttribute("media"),k=[],m=0;m<C;m++)k.push({duration:w,layout:x,uri:n+"/"+N.replace("$Number$",m)});return e.abrupt("return",k);case 31:m++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).apply(this,arguments)}function T(){return(T=c(d.mark((function e(t){var n,r,i,a,l,u,s,c,p,m,v;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==(m=e.sent)?void 0:m.length)>0)){e.next=27;break}return e.next=25,w(m);case 25:v=e.sent,n.thumbnails(v);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;v=[];var l=a.getCurrentSeries();null==l||l.map((function(e){var t;return(t=v).push.apply(t,i(e.episodes))})),null==t||null===(r=t.series)||void 0===r||r.cb}else{var u,s;v=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=v)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var d,p=v.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 m,h,g,x,y,b,w,E,C,N,k,T;(null===(m=document.getElementsByClassName("next-ep-preview"))||void 0===m?void 0:m[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,O,S,j,q,X,R,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(e).append(V);var F=document.createElement("div");F.className="next-ep-header",F.textContent="Next up";var D=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===(O=M.gist)||void 0===O||null===(S=O.imageGist)||void 0===S?void 0:S.r16x9)||(null==p||null===(j=p[0])||void 0===j?void 0:j.img)||(null===(q=window)||void 0===q||null===(X=q.customData)||void 0===X?void 0:X.fallbackImage);var G=document.createElement("div");G.className="next-ep-title",(null===(R=D)||void 0===R?void 0:R.length)>60&&(D=D.substr(0,60)+"..."),G.textContent="".concat(D);var W=document.createElement("div");W.className="next-ep-content",W.append(U),W.append(G),W.onclick=function(){return f(e)},V.append(F),V.append(W)}},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-cdde2bcb.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/regenerator"),i=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,m=function(e){return new Promise((function(n,t){if(f(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)}}))},f=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(){var e=n(o.mark((function e(n){var t,a,s,u;return o.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,m("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(i),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:"new"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"new"==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:"new"==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)}}(),h=function(e,n){var t=r.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,r,l,a,s=this.el(),u=i.dom.getPointerPosition(s,n).x;i.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===(o=t.cast)||void 0===o||null===(r=o.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 y(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 w(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?y(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):y(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var b=[],k=0,P=null;function O(n,o,i){var r,l,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(r=o.watchHistory)||void 0===r||r.apiVersion;var c=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(n.currentTime()),m=Math.floor(n.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var f=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,g=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,h=Math.floor(n.currentTime()),y=d?100:Math.floor(v/m*100),b={};g?function(n,o,i){var r=o?"watchhistory-data-".concat(o):"watchhistory-data-guest-".concat(i),l=j(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:h,watchedPercentage:y},c,o.siteOwner):(b=w(w({videoId:p,watchedTime:h,watchedPercentage:y,doneWatching:d,profileId:c},P&&{seriesId:P}),f&&{originalObjectId:f}),e.saveWatchHistory(b).then((function(e){})).catch((function(e){}))),k=v+i}function j(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function T(e,n,t){var o=j(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 I=function(e,n,t){var o=r.getPlayer(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,"'")})},S=function(e){var n=r.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},C=!1,D=function(n,t){var o,i,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[r])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!C){var l=x(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 x(e,n,t){if(Array.isArray(e))return e.map((function(e){return x(e,n,t)}));if(null!==e&&"object"===a(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]=x(e[i],n,t)})),o}return e}function E(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 V(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?E(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):E(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var R=function(n,t,o,i){var l,a,s=i.res,u=i.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?o.resolve({status:!0,msg:"Video Loaded",response:s}):o.resolve(V({status:!0,msg:"Player Initialised"},u?{seriesResponse:u,response:s}:{response:s}))})),d.on("loadeddata",(function(){var o,i;(null==d||!d.muted())&&I(n,sessionStorage.getItem("volume")||"100");var l=e.getCurrentVideo();if(e.clearError(),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 a,u,c=V(V({},t),s);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(P=null==n||null===(i=n.series)||void 0===i?void 0:i.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),O(s,n,a)):e>k&&(k=e+a))})),s.one("ended",(function(){O(s,n,a,!0)})))}(n,c,null==l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id)}})),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,o,i,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===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=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 f,g=m.getMediaSession(),h=g.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}})),d.tech_.on("retryplaylist",(function(){v&&D(s,n)})),d.on("error",(function(){var t,i;(console.log("ERROR",d.error(),d.error().code),4===d.error().code&&v)?D(s,n):(e.handleError(n,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.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 o,i,r,l=null===(o=e.getCurrentVideo())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.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])}})))},q=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-1b2c61f6.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-e6f4cd9a.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-839ea006.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-4d54559c.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-1d28c277.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-fb561053.js")})).then((function(t){t.initialiseSkin(e,n)}))};var A,H=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),m("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)}}(),B=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),L=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:H,loadEMELibrary:B}),M=function(n,t){var o=new Map;e.getSeriesWatchHistory({videoId:n,token:t}).then((function(n){n.data.map((function(e){o.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),e.setSeriesWatchMap(o)})).catch((function(e){return console.log(e)}))};function _(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 N(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?_(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):_(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var U=function(l,a,s,d){var c,v,p,m,f,y,w,b,k,P,O,j,T,I,S,C,D,x,E,V,A,H,L,M,_,U,z,F,J,W,G,X,K,Q=a.res,Y=void 0===Q?null:Q,Z=a.sres,$=void 0===Z?null:Z;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(p=v.framework)||void 0===p||null===(m=p.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f||f.S;var ee=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],ne=(null===(y=Y)||void 0===y?void 0:y.contentType)||"video",te=r.impolicy16x9(null===(w=Y)||void 0===w||null===(b=w[ne])||void 0===b||null===(k=b.gist)||void 0===k?void 0:k.videoImageUrl)||r.impolicy16x9(null===(P=Y)||void 0===P||null===(O=P[ne])||void 0===O||null===(j=O.gist)||void 0===j||null===(T=j.imageGist)||void 0===T?void 0:T.r16x9),oe=(null===(I=Y)||void 0===I||null===(S=I[ne])||void 0===S||null===(C=S.liveDetails)||void 0===C?void 0:C.isDvrEnabled)||!1,ie=(null===(D=Y)||void 0===D||null===(x=D[ne])||void 0===x||null===(E=x.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,re=(null===(V=Y)||void 0===V||null===(A=V.ads)||void 0===A||null===(H=A.preRoll)||void 0===H||null===(L=H.adTags)||void 0===L||null===(M=L.web)||void 0===M?void 0:M.active)&&(null===(_=Y)||void 0===_||null===(U=_.ads)||void 0===U||null===(z=U.preRoll)||void 0===z||null===(F=z.adTags)||void 0===F||null===(J=F.web)||void 0===J?void 0:J.url);Y=N(N({},Y),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var le=(K={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:!0},muteToggle:"multiplayer"==s.skin,liveui:oe},t(K,"autoplay",null==s?void 0:s.autoplay),t(K,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!re),t(K,"loop",(null==s?void 0:s.loop)||!1),t(K,"audioPosterMode",null==s?void 0:s.audioPosterMode),t(K,"html5",N(N({vhs:N(N({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==s||null===(W=s.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==s||null===(G=s.customData)||void 0===G?void 0:G.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(X=s.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(K,"poster",te),t(K,"techOrder",ee),t(K,"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 o,i,r,l,a,s,u,d,c,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 g=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=g}var h=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=h;var y=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=y;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===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=b,m.subTitles=t,m.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Y,e,t)}}),K);if(!i.getPlayers()[l])var ae=i(l,le,function(){var t=n(o.mark((function n(){var t,r,a,c,v,p,m,f,y,w,b,k,P,O,j,T,I,S,C,D,x,E,V;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ae),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,g(s);case 5:if(ie&&d.resolve(N({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:Y}:{response:Y})),e.inititateBeacon(l),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),O=null===(t=Y)||void 0===t||null===(r=t[ne])||void 0===r?void 0:r.drmEnabled,j=null===(a=Y)||void 0===a||null===(c=a[ne])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!O){n.next=13;break}return n.next=13,B();case 13:oe&&h(l,j),!re||null!=s&&null!==(p=s.customData)&&void 0!==p&&p.disableAds||e.initialiseAdvertisement(l,re,Y),T=e.getSource(Y,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:Y}),e.handleError(l,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Y)||void 0===m||null===(f=m[ne])||void 0===f||null===(y=f.contentDetails)||void 0===y||null===(w=y.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(b=Y)||void 0===b||null===(k=b[ne])||void 0===k||null===(P=k.closedCaptions)||void 0===P?void 0:P.length)>0)&&(V=(null===(S=Y)||void 0===S||null===(C=S[ne])||void 0===C||null===(D=C.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(x=Y)||void 0===x||null===(E=x[ne])||void 0===E?void 0:E.closedCaptions),I=V.filter((function(e){return"VTT"===e.format})),u.addCaptions(l,I)),null!=s&&s.disableControls?e.disableControls(l):q(l,N(N(N({},s),le),{},{liveVideo:ie,isDvrEnabled:oe,res:Y,sres:$})),R(l,N(N(N({},s),le),{},{liveVideo:ie}),d,{res:Y,sres:$});case 22: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 i=n(o.mark((function n(i,a){var s,u,d,c,p,f,g,h,y,w,b,k,P,O,j,I,S,C,D,x,E,V,R,q,B,_;return o.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(w=(null==t?void 0:t.videoSourceUrl)||!1,b=null==t?void 0:t.asat,k=(null==t||null===(s=t.epg)||void 0===s?void 0:s.enable)||!1,P=null==t?void 0:t.videoId,O=(null==t||null===(u=t.series)||void 0===u?void 0:u.enable)||!1,window.videoId=P,j=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),j&&!e.isTokenExpired(j)){n.next=14;break}return a({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 14:A=JSON.parse(atob(j.split(".")[1]));case 15:return t.isAnonymousUser=!(null===(d=A)||void 0===d||!d.anonymousId),t.siteOwner=(null===(c=A)||void 0===c?void 0:c.site)||null,t.userId=(null===(p=A)||void 0===p?void 0:p.userId)||null,window.sessionStorage.setItem("uid",null===(f=A)||void 0===f?void 0:f.userId),window.watchHistory=t.watchHistory||null,sessionStorage.setItem("vlp_token",j),I=null==t?void 0:t.playerId,t.chromecastReceiverId=null!=t&&t.series?null:null==t?void 0:t.chromecastReceiverId,S=null==t?void 0:t.airplay,C=(null==t||null===(g=t.analytics)||void 0===g?void 0:g.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,H();case 33:S&&"Safari"==l.detectBrowser()&&Promise.resolve().then((function(){return L})).then((function(e){e.importAirplay()})),C&&m("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then((function(){return e.runGtag(C)})).catch((function(e){})),(x=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(I)))&&x.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(V={directPlaybackUrl:w,id:E="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(E,j).then((function(e){U(I,{res:N(N({},e),V)},t,{resolve:i,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,E)})):U(I,{res:V},t,{resolve:i,reject:a})):O?(q=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(q)),B=null==t||null===(R=t.series)||void 0===R?void 0:R.id,e.getSeriesDetails(B,j).then((function(n){var o,r,l,s=n.data,u=n.data.seasons;e.setCurrentSeries(u);var d=P||(null==u||null===(o=u[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);M(B,j),e.getVideoDetails(d,j).then((function(n){var o,r,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(n.data),U(I,{res:null==n?void 0:n.data,sres:s},t,{resolve:i,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,P)}))})).catch((function(n){e.initiateErrorHandling(n,I,a)}))):k?(_=null==t?void 0:t.epg,e.getLinearChannelDetails(_,j).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==_?void 0:_.channelId,U(I,{res:n},t,{resolve:i,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,P)}))):e.getVideoDetails(P,j).then((function(n){var o,r,l,s;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.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,m=T((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",P,null==t?void 0:t.siteOwner);if(m&&m.length)t.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;d.contentType="video",U(I,{res:d},t,{resolve:i,reject:a})}else e.getVideoInfo(P,j).then((function(e){var n,o,r,l,s,u;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.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",U(I,{res:d},t,{resolve:i,reject:a})})).catch((function(e){var n,o,r,l;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(l=r.watchHistory)||void 0===l||l.cb(e)),U(I,{res:d},t,{resolve:i,reject:a})}));else U(I,{res:d},t,{resolve:i,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,P)}));case 38:case"end":return n.stop()}}),n)})));return function(e,n){return i.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:I,getVolume:S,disableControls:e.disableControls,setPlaybackSpeed:s.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-cdde2bcb.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/regenerator"),i=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,m=function(e){return new Promise((function(n,t){if(f(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)}}))},f=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(){var e=n(o.mark((function e(n){var t,a,s,u;return o.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,m("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(i),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:"new"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"new"==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:"new"==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)}}(),h=function(e,n){var t=r.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,r,l,a,s=this.el(),u=i.dom.getPointerPosition(s,n).x;i.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===(o=t.cast)||void 0===o||null===(r=o.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 y(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 w(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?y(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):y(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var b=[],k=0,P=null;function O(n,o,i){var r,l,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(r=o.watchHistory)||void 0===r||r.apiVersion;var c=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(n.currentTime()),m=Math.floor(n.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var f=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,g=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,h=Math.floor(n.currentTime()),y=d?100:Math.floor(v/m*100),b={};g?function(n,o,i){var r=o?"watchhistory-data-".concat(o):"watchhistory-data-guest-".concat(i),l=j(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:h,watchedPercentage:y},c,o.siteOwner):(b=w(w({videoId:p,watchedTime:h,watchedPercentage:y,doneWatching:d,profileId:c},P&&{seriesId:P}),f&&{originalObjectId:f}),e.saveWatchHistory(b).then((function(e){})).catch((function(e){}))),k=v+i}function j(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function T(e,n,t){var o=j(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 I=function(e,n,t){var o=r.getPlayer(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,"'")})},S=function(e){var n=r.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},C=!1,D=function(n,t){var o,i,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[r])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!C){var l=x(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 x(e,n,t){if(Array.isArray(e))return e.map((function(e){return x(e,n,t)}));if(null!==e&&"object"===a(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]=x(e[i],n,t)})),o}return e}function E(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 V(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?E(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):E(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var R=function(n,t,o,i){var l,a,s=i.res,u=i.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?o.resolve({status:!0,msg:"Video Loaded",response:s}):o.resolve(V({status:!0,msg:"Player Initialised"},u?{seriesResponse:u,response:s}:{response:s}))})),d.on("loadeddata",(function(){var o,i;(null==d||!d.muted())&&I(n,sessionStorage.getItem("volume")||"100");var l=e.getCurrentVideo();if(e.clearError(),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 a,u,c=V(V({},t),s);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(P=null==n||null===(i=n.series)||void 0===i?void 0:i.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),O(s,n,a)):e>k&&(k=e+a))})),s.one("ended",(function(){O(s,n,a,!0)})))}(n,c,null==l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id)}})),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,o,i,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===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=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 f,g=m.getMediaSession(),h=g.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}})),d.tech_.on("retryplaylist",(function(){v&&D(s,n)})),d.on("error",(function(){var t,i;(console.log("ERROR",d.error(),d.error().code),4===d.error().code&&v)?D(s,n):(e.handleError(n,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.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 o,i,r,l=null===(o=e.getCurrentVideo())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.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])}})))},q=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-1b2c61f6.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-e6f4cd9a.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-d5857518.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-4d54559c.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-1d28c277.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-d981d0d7.js")})).then((function(t){t.initialiseSkin(e,n)}))};var A,H=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),m("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)}}(),B=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),L=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:H,loadEMELibrary:B}),M=function(n,t){var o=new Map;e.getSeriesWatchHistory({videoId:n,token:t}).then((function(n){n.data.map((function(e){o.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),e.setSeriesWatchMap(o)})).catch((function(e){return console.log(e)}))};function _(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 N(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?_(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):_(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var U=function(l,a,s,d){var c,v,p,m,f,y,w,b,k,P,O,j,T,I,S,C,D,x,E,V,A,H,L,M,_,U,z,F,J,W,G,X,K,Q=a.res,Y=void 0===Q?null:Q,Z=a.sres,$=void 0===Z?null:Z;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(p=v.framework)||void 0===p||null===(m=p.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f||f.S;var ee=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],ne=(null===(y=Y)||void 0===y?void 0:y.contentType)||"video",te=r.impolicy16x9(null===(w=Y)||void 0===w||null===(b=w[ne])||void 0===b||null===(k=b.gist)||void 0===k?void 0:k.videoImageUrl)||r.impolicy16x9(null===(P=Y)||void 0===P||null===(O=P[ne])||void 0===O||null===(j=O.gist)||void 0===j||null===(T=j.imageGist)||void 0===T?void 0:T.r16x9),oe=(null===(I=Y)||void 0===I||null===(S=I[ne])||void 0===S||null===(C=S.liveDetails)||void 0===C?void 0:C.isDvrEnabled)||!1,ie=(null===(D=Y)||void 0===D||null===(x=D[ne])||void 0===x||null===(E=x.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,re=(null===(V=Y)||void 0===V||null===(A=V.ads)||void 0===A||null===(H=A.preRoll)||void 0===H||null===(L=H.adTags)||void 0===L||null===(M=L.web)||void 0===M?void 0:M.active)&&(null===(_=Y)||void 0===_||null===(U=_.ads)||void 0===U||null===(z=U.preRoll)||void 0===z||null===(F=z.adTags)||void 0===F||null===(J=F.web)||void 0===J?void 0:J.url);Y=N(N({},Y),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var le=(K={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:!0},muteToggle:"multiplayer"==s.skin,liveui:oe},t(K,"autoplay",null==s?void 0:s.autoplay),t(K,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!re),t(K,"loop",(null==s?void 0:s.loop)||!1),t(K,"audioPosterMode",null==s?void 0:s.audioPosterMode),t(K,"html5",N(N({vhs:N(N({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==s||null===(W=s.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==s||null===(G=s.customData)||void 0===G?void 0:G.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(X=s.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(K,"poster",te),t(K,"techOrder",ee),t(K,"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 o,i,r,l,a,s,u,d,c,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 g=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=g}var h=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=h;var y=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=y;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===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=b,m.subTitles=t,m.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Y,e,t)}}),K);if(!i.getPlayers()[l])var ae=i(l,le,function(){var t=n(o.mark((function n(){var t,r,a,c,v,p,m,f,y,w,b,k,P,O,j,T,I,S,C,D,x,E,V;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ae),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,g(s);case 5:if(ie&&d.resolve(N({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:Y}:{response:Y})),e.inititateBeacon(l),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),O=null===(t=Y)||void 0===t||null===(r=t[ne])||void 0===r?void 0:r.drmEnabled,j=null===(a=Y)||void 0===a||null===(c=a[ne])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!O){n.next=13;break}return n.next=13,B();case 13:oe&&h(l,j),!re||null!=s&&null!==(p=s.customData)&&void 0!==p&&p.disableAds||e.initialiseAdvertisement(l,re,Y),T=e.getSource(Y,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:Y}),e.handleError(l,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Y)||void 0===m||null===(f=m[ne])||void 0===f||null===(y=f.contentDetails)||void 0===y||null===(w=y.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(b=Y)||void 0===b||null===(k=b[ne])||void 0===k||null===(P=k.closedCaptions)||void 0===P?void 0:P.length)>0)&&(V=(null===(S=Y)||void 0===S||null===(C=S[ne])||void 0===C||null===(D=C.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(x=Y)||void 0===x||null===(E=x[ne])||void 0===E?void 0:E.closedCaptions),I=V.filter((function(e){return"VTT"===e.format})),u.addCaptions(l,I)),null!=s&&s.disableControls?e.disableControls(l):q(l,N(N(N({},s),le),{},{liveVideo:ie,isDvrEnabled:oe,res:Y,sres:$})),R(l,N(N(N({},s),le),{},{liveVideo:ie}),d,{res:Y,sres:$});case 22: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 i=n(o.mark((function n(i,a){var s,u,d,c,p,f,g,h,y,w,b,k,P,O,j,I,S,C,D,x,E,V,R,q,B,_;return o.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(w=(null==t?void 0:t.videoSourceUrl)||!1,b=null==t?void 0:t.asat,k=(null==t||null===(s=t.epg)||void 0===s?void 0:s.enable)||!1,P=null==t?void 0:t.videoId,O=(null==t||null===(u=t.series)||void 0===u?void 0:u.enable)||!1,window.videoId=P,j=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),j&&!e.isTokenExpired(j)){n.next=14;break}return a({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 14:A=JSON.parse(atob(j.split(".")[1]));case 15:return t.isAnonymousUser=!(null===(d=A)||void 0===d||!d.anonymousId),t.siteOwner=(null===(c=A)||void 0===c?void 0:c.site)||null,t.userId=(null===(p=A)||void 0===p?void 0:p.userId)||null,window.sessionStorage.setItem("uid",null===(f=A)||void 0===f?void 0:f.userId),window.watchHistory=t.watchHistory||null,sessionStorage.setItem("vlp_token",j),I=null==t?void 0:t.playerId,t.chromecastReceiverId=null!=t&&t.series?null:null==t?void 0:t.chromecastReceiverId,S=null==t?void 0:t.airplay,C=(null==t||null===(g=t.analytics)||void 0===g?void 0:g.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,H();case 33:S&&"Safari"==l.detectBrowser()&&Promise.resolve().then((function(){return L})).then((function(e){e.importAirplay()})),C&&m("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then((function(){return e.runGtag(C)})).catch((function(e){})),(x=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(I)))&&x.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(V={directPlaybackUrl:w,id:E="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(E,j).then((function(e){U(I,{res:N(N({},e),V)},t,{resolve:i,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,E)})):U(I,{res:V},t,{resolve:i,reject:a})):O?(q=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(q)),B=null==t||null===(R=t.series)||void 0===R?void 0:R.id,e.getSeriesDetails(B,j).then((function(n){var o,r,l,s=n.data,u=n.data.seasons;e.setCurrentSeries(u);var d=P||(null==u||null===(o=u[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);M(B,j),e.getVideoDetails(d,j).then((function(n){var o,r,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,e.setCurrentVideo(n.data),U(I,{res:null==n?void 0:n.data,sres:s},t,{resolve:i,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,P)}))})).catch((function(n){e.initiateErrorHandling(n,I,a)}))):k?(_=null==t?void 0:t.epg,e.getLinearChannelDetails(_,j).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==_?void 0:_.channelId,U(I,{res:n},t,{resolve:i,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,P)}))):e.getVideoDetails(P,j).then((function(n){var o,r,l,s;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.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,m=T((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",P,null==t?void 0:t.siteOwner);if(m&&m.length)t.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;d.contentType="video",U(I,{res:d},t,{resolve:i,reject:a})}else e.getVideoInfo(P,j).then((function(e){var n,o,r,l,s,u;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.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",U(I,{res:d},t,{resolve:i,reject:a})})).catch((function(e){var n,o,r,l;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(l=r.watchHistory)||void 0===l||l.cb(e)),U(I,{res:d},t,{resolve:i,reject:a})}));else U(I,{res:d},t,{resolve:i,reject:a})})).catch((function(n){e.initiateErrorHandling(n,I,a,P)}));case 38:case"end":return n.stop()}}),n)})));return function(e,n){return i.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:I,getVolume:S,disableControls:e.disableControls,setPlaybackSpeed:s.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
@@ -1 +1 @@
1
- "use strict";var e=require("./features-c3f24777.js"),l=require("./icons-0ea2e662.js"),i=require("./skin-aef573bd.js"),r=require("./renditions-fd408798.js"),n=require("./captions-37b81672.js"),o=require("./index-e01e3a8c.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-cdde2bcb.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-2220fa0e.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-c3f24777.js"),l=require("./icons-0ea2e662.js"),i=require("./skin-aef573bd.js"),r=require("./renditions-fd408798.js"),n=require("./captions-37b81672.js"),o=require("./index-b89a764b.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-cdde2bcb.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-2220fa0e.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-c3f24777.js"),r=require("./skin-aef573bd.js"),i=require("./index-e01e3a8c.js"),l=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var a=require("video.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-cdde2bcb.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-2220fa0e.js"),require("./util-197a4f7c.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray");function o(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 n=function(){var e,r,i,l,o,n,u,t,d,s,v,c,p=a.dom.$(".vjs-play-progress"),b=a.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");b&&(b.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)),p&&(p.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"),o(l,a),function(r,l){var a,o,n,u;(null==l||null===(a=l.relatedVideos)||void 0===a||null===(o=a.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(r,null==l?void 0:l.relatedVideos);null!=l&&null!==(n=l.series)&&void 0!==n&&n.enable&&e.addSeriesSelectorV2(r,l);(null==l||null===(u=l.streams)||void 0===u?void 0:u.length)>1&&e.addMulticamSelector(r,null==l?void 0:l.streams);i.addTVProviderImage(r,l)}(l,a),n()};
1
+ "use strict";var e=require("./features-c3f24777.js"),r=require("./skin-aef573bd.js"),i=require("./index-b89a764b.js"),l=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var a=require("video.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-cdde2bcb.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-2220fa0e.js"),require("./util-197a4f7c.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray");function o(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 n=function(){var e,r,i,l,o,n,u,t,d,s,v,c,p=a.dom.$(".vjs-play-progress"),b=a.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");b&&(b.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)),p&&(p.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"),o(l,a),function(r,l){var a,o,n,u;(null==l||null===(a=l.relatedVideos)||void 0===a||null===(o=a.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(r,null==l?void 0:l.relatedVideos);null!=l&&null!==(n=l.series)&&void 0!==n&&n.enable&&e.addSeriesSelectorV2(r,l);(null==l||null===(u=l.streams)||void 0===u?void 0:u.length)>1&&e.addMulticamSelector(r,null==l?void 0:l.streams);i.addTVProviderImage(r,l)}(l,a),n()};
package/esm/bundle.css CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
 
4
4
 
5
-
6
5
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
7
6
  height: 0.7em;
8
7
  position: absolute;
@@ -144,6 +143,7 @@
144
143
  }
145
144
 
146
145
 
146
+
147
147
  .video-js .tvProviderImage {
148
148
  position: absolute;
149
149
  right: 1rem;
@@ -172,6 +172,8 @@
172
172
 
173
173
 
174
174
 
175
+
176
+
175
177
  .video-js .multicamera-parent.default{
176
178
  height: 345px;
177
179
  position: absolute;
@@ -252,8 +254,6 @@
252
254
 
253
255
 
254
256
 
255
-
256
-
257
257
  /* nextep */
258
258
  .next-ep-preview{
259
259
  position: absolute;
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-2882ecc4.js";import{K as n,L as r,g as i}from"./generic-ab80b8ea.js";import{s as o}from"./autoNextVideo-b11763cb.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,O,j,S,X,R,F,D,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 V=null===(P=m[0])||void 0===P?void 0:P.title,W=document.createElement("img");W.className="next-ep-img",W.src=(null===(O=m[0])||void 0===O||null===(j=O.gist)||void 0===j||null===(S=j.imageGist)||void 0===S?void 0:S.r16x9)||(null==m||null===(X=m[0])||void 0===X?void 0:X.img)||(null===(R=window)||void 0===R||null===(F=R.customData)||void 0===F?void 0:F.fallbackImage);var $=document.createElement("div");$.className="next-ep-title",(null===(D=V)||void 0===D?void 0:D.length)>60&&(V=V.substr(0,60)+"..."),$.textContent="".concat(V);var H=document.createElement("div");H.className="next-ep-content",H.append(W),H.append($),H.onclick=function(){return x(i)},U.append(G),U.append(H)}},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)}})));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,d,p,m,v,f,h,g,x,y,b,w,E,C,N,k;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"),d=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,p=c.getElementsByTagName("AdaptationSet"),m=0;case 13:if(!(m<p.length)){e.next=34;break}if("image"!==(v=p[m]).getAttribute("contentType")||"image/png"!==v.getAttribute("mimeType")){e.next=31;break}if(f=v.getElementsByTagName("SegmentTemplate")[0],h=v.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],x=g.getAttribute("value"),!f){e.next=31;break}for(f.getAttribute("media"),y=f.getAttribute("duration"),b=f.getAttribute("timescale"),w=y/b,E=Math.round(d/w),C=Math.ceil(E/9),N=f.getAttribute("media"),k=[],m=0;m<C;m++)k.push({duration:w,layout:x,uri:n+"/"+N.replace("$Number$",m)});return e.abrupt("return",k);case 31:m++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).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};
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 r,h as l,d as a,e as s,f as u,i as c,j as d,p as v,k as m,r as p,m as f,n as h,o as g,q as w,t as y,u as b,v as k,w as O,x as j,y as T,z as I,A as P,B as S,C as D,D as C,E as x,F as R,G as E,H as A,I as V,J as H}from"./generic-ab80b8ea.js";import B from"@babel/runtime/helpers/asyncToGenerator";import L from"@babel/runtime/helpers/defineProperty";import _ from"@babel/runtime/regenerator";import N from"video.js";import{g as M,i as U,a as q}from"./skin-2882ecc4.js";import{d as z}from"./browser-d4613b36.js";import F from"@babel/runtime/helpers/typeof";import{o as J,g as G,a as X,s as K,b as Q}from"./util-6f289757.js";import{e as W,d as Y,g as Z,a as $}from"./captions-6cc39cdc.js";import{g as ee}from"./renditions-c0f96578.js";import{playSelectedResolution as ne}from"./resolution-00449d8d.js";import{s as te}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 oe,ie=function(e){return new Promise((function(n,t){if(re(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)}}))},re=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},le=function(){var e=B(_.mark((function e(n){var t,o,i,r;return _.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=M(null==n?void 0:n.playerId),console.log(n),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=21;break}return e.next=5,import("@silvermine/videojs-chromecast");case 5:return r=e.sent,e.prev=6,e.next=9,ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:return e.prev=14,r.default(N),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:"new"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"new"==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"==z()?null==o||o.airPlay({addButtonToControlBar:"new"==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)}}(),ae=function(e,n){var t=M(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=N.dom.getPointerPosition(a,n).x;N.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};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 ue(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){L(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 ce=[],de=0,ve=null;function me(t,o,i){var r,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(r=o.watchHistory)||void 0===r||r.apiVersion;var d=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),m=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var p=(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,h=Math.floor(t.currentTime()),g=c?100:Math.floor(v/m*100),w={};f?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=pe(i),l=(new Date).getTime(),a=n(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ue(ue({},e),{},L({},n,s[n]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===oe}));c<0?r.push(ue(ue({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=ue(ue(ue({},r[c]),e),{},{updateDate:l});localStorage.setItem("".concat(i),JSON.stringify(r))}(w={completed:c,watchedTime:h,watchedPercentage:g},d,o.siteOwner):(w=ue(ue({videoId:oe,watchedTime:h,watchedPercentage:g,doneWatching:c,profileId:d},ve&&{seriesId:ve}),p&&{originalObjectId:p}),e(w).then((function(e){})).catch((function(e){}))),de=v+i}function pe(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function fe(e,n,t){var o=pe(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 he=function(e,n,t){var o=M(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,"'")})},ge=function(e){var n=M(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},we=!1,ye=function(e,n){var i,r,l=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(i=e[l])||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!we){var a=be(e,"videoAssets","secondaryVideoAssets"),s=t(a,n);return s&&o(n,s),we=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function be(e,n,t){if(Array.isArray(e))return e.map((function(e){return be(e,n,t)}));if(null!==e&&"object"===F(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]=be(e[i],n,t)})),o}return e}function ke(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 Oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ke(Object(t),!0).forEach((function(n){L(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ke(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var je=function(e,t,o,s){var u,c,d=s.res,v=s.sres,m=M(e),p=(null==d?void 0:d.contentType)||"video",f=(null==d||null===(u=d[p])||void 0===u||null===(c=u.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;i(d),m&&(m.on("loadstart",(function(){f?o.resolve({status:!0,msg:"Video Loaded",response:d}):o.resolve(Oe({status:!0,msg:"Player Initialised"},v?{seriesResponse:v,response:d}:{response:d}))})),m.on("loadeddata",(function(){var o,i;(null==m||!m.muted())&&he(e,sessionStorage.getItem("volume")||"100");var l=n();if(r(),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 a,s,u=Oe(Oe({},t),d);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ve=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ce=[],de=0,oe=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=M(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());ce.includes(de)||(e==de?(ce.push(e),me(a,n,l)):e>de&&(de=e+l))})),a.one("ended",(function(){me(a,n,l,!0)})))}(e,u,null==l||null===(a=l.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id)}})),m.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];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,p=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"===m){var f,h=p.getMediaSession(),g=h.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(f)}})),m.tech_.on("retryplaylist",(function(){f&&ye(d,e)})),m.on("error",(function(){var n,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&f)?ye(d,e):(l(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),o.reject({status:!1,msg:(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured",response:d}))})),m.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,r,l=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,s=a(),u=(null==s?void 0:s.get(l))||{t:0,p:0},c=u.t,d=u.p;c&&d<95&&setTimeout((function(){m.currentTime(c)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(f){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})))},Te=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-ab48f536.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-30914edb.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-f4f5c3dc.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-6311a73f.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-532012c0.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-ba4f75c0.js").then((function(t){t.initialiseSkin(e,n)}))};var Ie,Pe=function(){var e=B(_.mark((function e(){return _.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ie("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)}}(),Se=function(){var e=B(_.mark((function e(){return _.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){N.getPlugin("eme")||N.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),De=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(N)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(N)}))},loadAdsLibrary:Pe,loadEMELibrary:Se}),Ce=function(e,n){var t=new Map;s({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),u(t)})).catch((function(e){return console.log(e)}))};function xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Re(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xe(Object(t),!0).forEach((function(n){L(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ee=function(e,n,i,r){var a,s,u,c,d,v,m,p,f,h,g,w,b,k,O,j,T,I,P,S,R,E,A,V,H,U,z,F,J,G,X,K,Q,W=n.res,Y=void 0===W?null:W,Z=n.sres,ee=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 ne=null!=i&&i.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(v=Y)||void 0===v?void 0:v.contentType)||"video",oe=q(null===(m=Y)||void 0===m||null===(p=m[te])||void 0===p||null===(f=p.gist)||void 0===f?void 0:f.videoImageUrl)||q(null===(h=Y)||void 0===h||null===(g=h[te])||void 0===g||null===(w=g.gist)||void 0===w||null===(b=w.imageGist)||void 0===b?void 0:b.r16x9),ie=(null===(k=Y)||void 0===k||null===(O=k[te])||void 0===O||null===(j=O.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,re=(null===(T=Y)||void 0===T||null===(I=T[te])||void 0===I||null===(P=I.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,se=(null===(S=Y)||void 0===S||null===(R=S.ads)||void 0===R||null===(E=R.preRoll)||void 0===E||null===(A=E.adTags)||void 0===A||null===(V=A.web)||void 0===V?void 0:V.active)&&(null===(H=Y)||void 0===H||null===(U=H.ads)||void 0===U||null===(z=U.preRoll)||void 0===z||null===(F=z.adTags)||void 0===F||null===(J=F.web)||void 0===J?void 0:J.url);Y=Re(Re({},Y),{},{audioAssetSource:null==i?void 0:i.audioAssetSource});var ue=(Q={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:!0},muteToggle:"multiplayer"==i.skin,liveui:ie},L(Q,"autoplay",null==i?void 0:i.autoplay),L(Q,"normalizeAutoplay",(null==i?void 0:i.autoplay)&&!se),L(Q,"loop",(null==i?void 0:i.loop)||!1),L(Q,"audioPosterMode",null==i?void 0:i.audioPosterMode),L(Q,"html5",Re(Re({vhs:Re(Re({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==i?void 0:i.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==i||null===(G=i.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==i||null===(X=i.customData)||void 0===X?void 0:X.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==i||null===(K=i.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),L(Q,"poster",oe),L(Q,"techOrder",ne),L(Q,"chromecast",{requestCustomDataFn:function(n){var t=M(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,r,l,a,s,u,c,d,v,m=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){p.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;p.licenseUrl=f;var h=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=h}var g=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=g;var w=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;p.duration=w;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=y;var b=null==e||null===(u=e[m])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=b,p.subTitles=t,p.DVR=(null==e||null===(d=e[m])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Y,n,o)}}),Q);if(!N.getPlayers()[e])var ce=N(e,ue,function(){var n=B(_.mark((function n(){var a,s,u,c,d,v,m,p,f,h,g,w,b,k,O,j,T,I,P,S,R,E,A;return _.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ce),console.log(N.VERSION),console.log(N.getPlugins()),n.next=5,le(i);case 5:if(re&&r.resolve(Re({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Y}:{response:Y})),x(e),/Android/i.test(navigator.userAgent)&&(N.options.vhs.overrideNative=!0),k=null===(a=Y)||void 0===a||null===(s=a[te])||void 0===s?void 0:s.drmEnabled,O=null===(u=Y)||void 0===u||null===(c=u[te])||void 0===c||null===(d=c.liveDetails)||void 0===d?void 0:d.startOverTime,!k){n.next=13;break}return n.next=13,Se();case 13:ie&&ae(e,O),!se||null!=i&&null!==(v=i.customData)&&void 0!==v&&v.disableAds||D(e,se,Y),j=t(Y,e),console.log(j),null!=i&&i.nearestClusterUrl&&(j=C(j,i.nearestClusterUrl)),j?o(e,j):(r.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Y}),l(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Y)||void 0===m||null===(p=m[te])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(h=f.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(g=Y)||void 0===g||null===(w=g[te])||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0)&&(A=(null===(I=Y)||void 0===I||null===(P=I[te])||void 0===P||null===(S=P.contentDetails)||void 0===S?void 0:S.closedCaptions)||(null===(R=Y)||void 0===R||null===(E=R[te])||void 0===E?void 0:E.closedCaptions),T=A.filter((function(e){return"VTT"===e.format})),$(e,T)),null!=i&&i.disableControls?y(e):Te(e,Re(Re(Re({},i),ue),{},{liveVideo:re,isDvrEnabled:ie,res:Y,sres:ee})),je(e,Re(Re(Re({},i),ue),{},{liveVideo:re}),r,{res:Y,sres:ee});case 22:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ae(){return{loadVideoInstantly:c,onTimeUpdate:J,getVideoDuration:G,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=B(_.mark((function n(t,o){var r,l,a,s,u,c,d,v,m,p,h,g,w,y,b,D,C,x,B,L,N,M,q,F,J,G;return _.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!f(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(p=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,g=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,w=null==e?void 0:e.videoId,y=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,window.videoId=w,b=null==e?void 0:e.token,!I(e)){n.next=15;break}if(P().set(null==e?void 0:e.refreshToken),b&&!S(b)){n.next=14;break}return o({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}}),n.abrupt("return");case 14:Ie=JSON.parse(atob(b.split(".")[1]));case 15:return e.isAnonymousUser=!(null===(a=Ie)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=Ie)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=Ie)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=Ie)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b),D=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,C=null==e?void 0:e.airplay,x=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(B=null==e?void 0:e.errors)&&(window.customErrors=B),window.customData=null==e?void 0:e.customData,te(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),T.set(e.apiBaseUrl),null!=e&&e.skin&&!U(e.skin)||(e.skin="VL_ONE"),n.next=33,Pe();case 33:C&&"Safari"==z()&&Promise.resolve().then((function(){return De})).then((function(e){e.importAirplay()})),x&&ie("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then((function(){return R(x)})).catch((function(e){})),(L=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(D)))&&L.addEventListener("contextmenu",(function(e){return e.preventDefault()})),p?(M={directPlaybackUrl:p,id:N="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?k(N,b).then((function(n){Ee(D,{res:Re(Re({},n),M)},e,{resolve:t,reject:o})})).catch((function(e){j(e,D,o,N)})):Ee(D,{res:M},e,{resolve:t,reject:o})):y?(F=sessionStorage.getItem("season-idx")||0,V.set(parseInt(F)),J=null==e||null===(q=e.series)||void 0===q?void 0:q.id,E(J,b).then((function(n){var r,l,a,s=n.data,u=n.data.seasons;H(u);var c=w||(null==u||null===(r=u[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);Ce(J,b),k(c,b).then((function(n){var r,l,a;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,i(n.data),Ee(D,{res:null==n?void 0:n.data,sres:s},e,{resolve:t,reject:o})})).catch((function(e){j(e,D,o,w)}))})).catch((function(e){j(e,D,o)}))):g?(G=null==e?void 0:e.epg,A(G,b).then((function(n){var i=null==n?void 0:n.data;i.contentType="linearchannel",i.channelId=null==G?void 0:G.channelId,Ee(D,{res:i},e,{resolve:t,reject:o})})).catch((function(e){j(e,D,o,w)}))):k(w,b).then((function(n){var r,l,a,s;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.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,m,p=fe((null===(d=e.watchHistory)||void 0===d?void 0:d.profileId)||"",w,null==e?void 0:e.siteOwner);if(p&&p.length)e.watchHistoryResumeTime=(null===(v=p[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(m=p[0])||void 0===m?void 0:m.watchedPercentage)||null;c.contentType="video",Ee(D,{res:c},e,{resolve:t,reject:o})}else O(w,b).then((function(n){var i,r,l,a,s,u;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.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",Ee(D,{res:c},e,{resolve:t,reject:o})})).catch((function(n){var i,r,l,a;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),Ee(D,{res:c},e,{resolve:t,reject:o})}));else Ee(D,{res:c},e,{resolve:t,reject:o})})).catch((function(e){j(e,D,o,w)}));case 38:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ee,skip:d,getPlayer:M,play:v,pause:m,detectBrowser:z,rewind:p,loadVideo:o,seekToTimeStamp:K,isPlayerInitialised:f,load:h,authenticateLC:g,dispose:w,enableCaptions:W,disableCaptions:Y,getCaptions:Z,playSelectedResolution:ne,getSource:t,setVolume:he,getVolume:ge,disableControls:y,setPlaybackSpeed:Q,getEntitlementData:b}}export{Ae 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,p as v,k as m,r as p,m as f,n as h,o as g,q as w,t as y,u as b,v as k,w as O,x as j,y as T,z as I,A as P,B as S,C as D,D as C,E as x,F as R,G as E,H as A,I as V,J as H}from"./generic-ab80b8ea.js";import B from"@babel/runtime/helpers/asyncToGenerator";import L from"@babel/runtime/helpers/defineProperty";import _ from"@babel/runtime/regenerator";import N from"video.js";import{g as M,i as U,a as q}from"./skin-2882ecc4.js";import{d as z}from"./browser-d4613b36.js";import F from"@babel/runtime/helpers/typeof";import{o as J,g as G,a as X,s as K,b as Q}from"./util-6f289757.js";import{e as W,d as Y,g as Z,a as $}from"./captions-6cc39cdc.js";import{g as ee}from"./renditions-c0f96578.js";import{playSelectedResolution as ne}from"./resolution-00449d8d.js";import{s as te}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 oe,ie=function(e){return new Promise((function(n,t){if(le(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)}}))},le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},re=function(){var e=B(_.mark((function e(n){var t,o,i,l;return _.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=M(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,ie("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(N),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:"new"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"new"==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"==z()?null==o||o.airPlay({addButtonToControlBar:"new"==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)}}(),ae=function(e,n){var t=M(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=N.dom.getPointerPosition(a,n).x;N.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 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 ue(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){L(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 ce=[],de=0,ve=null;function me(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()),m=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var p=(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,h=Math.floor(t.currentTime()),g=c?100:Math.floor(v/m*100),w={};f?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),l=pe(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 ue(ue({},e),{},L({},n,s[n]))}),{}),c=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===oe}));c<0?l.push(ue(ue({content:u},e),{},{addedDate:r,updateDate:r})):l[c]=ue(ue(ue({},l[c]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(w={completed:c,watchedTime:h,watchedPercentage:g},d,o.siteOwner):(w=ue(ue({videoId:oe,watchedTime:h,watchedPercentage:g,doneWatching:c,profileId:d},ve&&{seriesId:ve}),p&&{originalObjectId:p}),e(w).then((function(e){})).catch((function(e){}))),de=v+i}function pe(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function fe(e,n,t){var o=pe(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 he=function(e,n,t){var o=M(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,"'")})},ge=function(e){var n=M(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},we=!1,ye=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)&&!we){var a=be(e,"videoAssets","secondaryVideoAssets"),s=t(a,n);return s&&o(n,s),we=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function be(e,n,t){if(Array.isArray(e))return e.map((function(e){return be(e,n,t)}));if(null!==e&&"object"===F(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]=be(e[i],n,t)})),o}return e}function ke(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 Oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ke(Object(t),!0).forEach((function(n){L(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ke(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var je=function(e,t,o,s){var u,c,d=s.res,v=s.sres,m=M(e),p=(null==d?void 0:d.contentType)||"video",f=(null==d||null===(u=d[p])||void 0===u||null===(c=u.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;i(d),m&&(m.on("loadstart",(function(){f?o.resolve({status:!0,msg:"Video Loaded",response:d}):o.resolve(Oe({status:!0,msg:"Player Initialised"},v?{seriesResponse:v,response:d}:{response:d}))})),m.on("loadeddata",(function(){var o,i;(null==m||!m.muted())&&he(e,sessionStorage.getItem("volume")||"100");var r=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 a,s,u=Oe(Oe({},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&&(ve=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ce=[],de=0,oe=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=M(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());ce.includes(de)||(e==de?(ce.push(e),me(a,n,r)):e>de&&(de=e+r))})),a.one("ended",(function(){me(a,n,r,!0)})))}(e,u,null==r||null===(a=r.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id)}})),m.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];m.trigger("subtitlechanged",n)})),m.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,m=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,p=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"===m){var f,h=p.getMediaSession(),g=h.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(f)}})),m.tech_.on("retryplaylist",(function(){f&&ye(d,e)})),m.on("error",(function(){var n,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&f)?ye(d,e):(r(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),o.reject({status:!1,msg:(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured",response:d}))})),m.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(){m.currentTime(c)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(f){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})))},Te=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-ab48f536.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-30914edb.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-ebbda87d.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-6311a73f.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-532012c0.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-0ef7630b.js").then((function(t){t.initialiseSkin(e,n)}))};var Ie,Pe=function(){var e=B(_.mark((function e(){return _.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ie("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)}}(),Se=function(){var e=B(_.mark((function e(){return _.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){N.getPlugin("eme")||N.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),De=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(N)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(N)}))},loadAdsLibrary:Pe,loadEMELibrary:Se}),Ce=function(e,n){var t=new Map;s({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),u(t)})).catch((function(e){return console.log(e)}))};function xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Re(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xe(Object(t),!0).forEach((function(n){L(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ee=function(e,n,i,l){var a,s,u,c,d,v,m,p,f,h,g,w,b,k,O,j,T,I,P,S,R,E,A,V,H,U,z,F,J,G,X,K,Q,W=n.res,Y=void 0===W?null:W,Z=n.sres,ee=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 ne=null!=i&&i.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(v=Y)||void 0===v?void 0:v.contentType)||"video",oe=q(null===(m=Y)||void 0===m||null===(p=m[te])||void 0===p||null===(f=p.gist)||void 0===f?void 0:f.videoImageUrl)||q(null===(h=Y)||void 0===h||null===(g=h[te])||void 0===g||null===(w=g.gist)||void 0===w||null===(b=w.imageGist)||void 0===b?void 0:b.r16x9),ie=(null===(k=Y)||void 0===k||null===(O=k[te])||void 0===O||null===(j=O.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,le=(null===(T=Y)||void 0===T||null===(I=T[te])||void 0===I||null===(P=I.streamingInfo)||void 0===P?void 0:P.isLiveStream)||!1,se=(null===(S=Y)||void 0===S||null===(R=S.ads)||void 0===R||null===(E=R.preRoll)||void 0===E||null===(A=E.adTags)||void 0===A||null===(V=A.web)||void 0===V?void 0:V.active)&&(null===(H=Y)||void 0===H||null===(U=H.ads)||void 0===U||null===(z=U.preRoll)||void 0===z||null===(F=z.adTags)||void 0===F||null===(J=F.web)||void 0===J?void 0:J.url);Y=Re(Re({},Y),{},{audioAssetSource:null==i?void 0:i.audioAssetSource});var ue=(Q={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:!0},muteToggle:"multiplayer"==i.skin,liveui:ie},L(Q,"autoplay",null==i?void 0:i.autoplay),L(Q,"normalizeAutoplay",(null==i?void 0:i.autoplay)&&!se),L(Q,"loop",(null==i?void 0:i.loop)||!1),L(Q,"audioPosterMode",null==i?void 0:i.audioPosterMode),L(Q,"html5",Re(Re({vhs:Re(Re({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==i?void 0:i.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==i||null===(G=i.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==i||null===(X=i.customData)||void 0===X?void 0:X.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==i||null===(K=i.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),L(Q,"poster",oe),L(Q,"techOrder",ne),L(Q,"chromecast",{requestCustomDataFn:function(n){var t=M(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,m=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){p.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;p.licenseUrl=f;var h=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=h}var g=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=g;var w=null==e||null===(l=e[m])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=w;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=y;var b=null==e||null===(u=e[m])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=b,p.subTitles=t,p.DVR=(null==e||null===(d=e[m])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Y,n,o)}}),Q);if(!N.getPlayers()[e])var ce=N(e,ue,function(){var n=B(_.mark((function n(){var a,s,u,c,d,v,m,p,f,h,g,w,b,k,O,j,T,I,P,S,R,E,A;return _.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ce),console.log(N.VERSION),console.log(N.getPlugins()),n.next=5,re(i);case 5:if(le&&l.resolve(Re({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Y}:{response:Y})),x(e),/Android/i.test(navigator.userAgent)&&(N.options.vhs.overrideNative=!0),k=null===(a=Y)||void 0===a||null===(s=a[te])||void 0===s?void 0:s.drmEnabled,O=null===(u=Y)||void 0===u||null===(c=u[te])||void 0===c||null===(d=c.liveDetails)||void 0===d?void 0:d.startOverTime,!k){n.next=13;break}return n.next=13,Se();case 13:ie&&ae(e,O),!se||null!=i&&null!==(v=i.customData)&&void 0!==v&&v.disableAds||D(e,se,Y),j=t(Y,e),console.log(j),null!=i&&i.nearestClusterUrl&&(j=C(j,i.nearestClusterUrl)),j?o(e,j):(l.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Y}),r(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Y)||void 0===m||null===(p=m[te])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(h=f.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(g=Y)||void 0===g||null===(w=g[te])||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0)&&(A=(null===(I=Y)||void 0===I||null===(P=I[te])||void 0===P||null===(S=P.contentDetails)||void 0===S?void 0:S.closedCaptions)||(null===(R=Y)||void 0===R||null===(E=R[te])||void 0===E?void 0:E.closedCaptions),T=A.filter((function(e){return"VTT"===e.format})),$(e,T)),null!=i&&i.disableControls?y(e):Te(e,Re(Re(Re({},i),ue),{},{liveVideo:le,isDvrEnabled:ie,res:Y,sres:ee})),je(e,Re(Re(Re({},i),ue),{},{liveVideo:le}),l,{res:Y,sres:ee});case 22:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ae(){return{loadVideoInstantly:c,onTimeUpdate:J,getVideoDuration:G,onVideoEnded:X,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=B(_.mark((function n(t,o){var l,r,a,s,u,c,d,v,m,p,h,g,w,y,b,D,C,x,B,L,N,M,q,F,J,G;return _.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!f(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(p=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,g=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,w=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=w,b=null==e?void 0:e.token,!I(e)){n.next=15;break}if(P().set(null==e?void 0:e.refreshToken),b&&!S(b)){n.next=14;break}return o({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}}),n.abrupt("return");case 14:Ie=JSON.parse(atob(b.split(".")[1]));case 15:return e.isAnonymousUser=!(null===(a=Ie)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=Ie)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=Ie)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=Ie)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b),D=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,C=null==e?void 0:e.airplay,x=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(B=null==e?void 0:e.errors)&&(window.customErrors=B),window.customData=null==e?void 0:e.customData,te(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),T.set(e.apiBaseUrl),null!=e&&e.skin&&!U(e.skin)||(e.skin="VL_ONE"),n.next=33,Pe();case 33:C&&"Safari"==z()&&Promise.resolve().then((function(){return De})).then((function(e){e.importAirplay()})),x&&ie("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then((function(){return R(x)})).catch((function(e){})),(L=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(D)))&&L.addEventListener("contextmenu",(function(e){return e.preventDefault()})),p?(M={directPlaybackUrl:p,id:N="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?k(N,b).then((function(n){Ee(D,{res:Re(Re({},n),M)},e,{resolve:t,reject:o})})).catch((function(e){j(e,D,o,N)})):Ee(D,{res:M},e,{resolve:t,reject:o})):y?(F=sessionStorage.getItem("season-idx")||0,V.set(parseInt(F)),J=null==e||null===(q=e.series)||void 0===q?void 0:q.id,E(J,b).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);Ce(J,b),k(c,b).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),Ee(D,{res:null==n?void 0:n.data,sres:s},e,{resolve:t,reject:o})})).catch((function(e){j(e,D,o,w)}))})).catch((function(e){j(e,D,o)}))):g?(G=null==e?void 0:e.epg,A(G,b).then((function(n){var i=null==n?void 0:n.data;i.contentType="linearchannel",i.channelId=null==G?void 0:G.channelId,Ee(D,{res:i},e,{resolve:t,reject:o})})).catch((function(e){j(e,D,o,w)}))):k(w,b).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,m,p=fe((null===(d=e.watchHistory)||void 0===d?void 0:d.profileId)||"",w,null==e?void 0:e.siteOwner);if(p&&p.length)e.watchHistoryResumeTime=(null===(v=p[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(m=p[0])||void 0===m?void 0:m.watchedPercentage)||null;c.contentType="video",Ee(D,{res:c},e,{resolve:t,reject:o})}else O(w,b).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",Ee(D,{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)),Ee(D,{res:c},e,{resolve:t,reject:o})}));else Ee(D,{res:c},e,{resolve:t,reject:o})})).catch((function(e){j(e,D,o,w)}));case 38:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ee,skip:d,getPlayer:M,play:v,pause:m,detectBrowser:z,rewind:p,loadVideo:o,seekToTimeStamp:K,isPlayerInitialised:f,load:h,authenticateLC:g,dispose:w,enableCaptions:W,disableCaptions:Y,getCaptions:Z,playSelectedResolution:ne,getSource:t,setVolume:he,getVolume:ge,disableControls:y,setPlaybackSpeed:Q,getEntitlementData:b}}export{Ae as default};
@@ -1 +1 @@
1
- import{h as o,o as l,p as i,q as e}from"./features-c633895c.js";import{g as r}from"./skin-2882ecc4.js";import{a as n,i as a,b as t}from"./index-0aaeaba2.js";import{i as s}from"./browser-d4613b36.js";import"videojs-contrib-quality-menu";import u from"video.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-ab80b8ea.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-b11763cb.js";import"./util-6f289757.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";function d(l,i){var e=r(l);e&&(e.on("loadeddata",(function(){var o,e,t,u,d;!function(o){var l=r(o);l&&l.qualityMenu({useResolutionLabels:!0})}(l),!(null!=i&&null!==(o=i.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!=i&&i.liveVideo||n(l,i),null!=i&&i.liveVideo||s()||a(l)})),e.one("play",(function(){var i,e,r,n;null!==(i=window)&&void 0!==i&&null!==(e=i.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(l,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)})))}function p(o,n){r(o).addClass("skin_vlone"),d(o,n),function(o,r){var n,a,s,u;(null==r||null===(n=r.relatedVideos)||void 0===n||null===(a=n.content)||void 0===a?void 0:a.length)>0&&l(o,null==r?void 0:r.relatedVideos);null!=r&&null!==(s=r.series)&&void 0!==s&&s.enable&&i(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)}(o,n),m()}var m=function(){var o,l,i,e,r,n,a,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===(l=o.app_data)||void 0===l||null===(i=l.appcmsMain)||void 0===i||null===(e=i.brand)||void 0===e||null===(r=e.cta)||void 0===r||null===(n=r.primary)||void 0===n?void 0:n.backgroundColor)),v&&(v.style.background="".concat(null===(a=window)||void 0===a||null===(t=a.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{p as initialiseSkin};
1
+ import{h as o,o as l,p as i,q as e}from"./features-c633895c.js";import{g as r}from"./skin-2882ecc4.js";import{a as n,i as a,b as t}from"./index-58e0b4a3.js";import{i as s}from"./browser-d4613b36.js";import"videojs-contrib-quality-menu";import u from"video.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-ab80b8ea.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-b11763cb.js";import"./util-6f289757.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";function d(l,i){var e=r(l);e&&(e.on("loadeddata",(function(){var o,e,t,u,d;!function(o){var l=r(o);l&&l.qualityMenu({useResolutionLabels:!0})}(l),!(null!=i&&null!==(o=i.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!=i&&i.liveVideo||n(l,i),null!=i&&i.liveVideo||s()||a(l)})),e.one("play",(function(){var i,e,r,n;null!==(i=window)&&void 0!==i&&null!==(e=i.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(l,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)})))}function p(o,n){r(o).addClass("skin_vlone"),d(o,n),function(o,r){var n,a,s,u;(null==r||null===(n=r.relatedVideos)||void 0===n||null===(a=n.content)||void 0===a?void 0:a.length)>0&&l(o,null==r?void 0:r.relatedVideos);null!=r&&null!==(s=r.series)&&void 0!==s&&s.enable&&i(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)}(o,n),m()}var m=function(){var o,l,i,e,r,n,a,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===(l=o.app_data)||void 0===l||null===(i=l.appcmsMain)||void 0===i||null===(e=i.brand)||void 0===e||null===(r=e.cta)||void 0===r||null===(n=r.primary)||void 0===n?void 0:n.backgroundColor)),v&&(v.style.background="".concat(null===(a=window)||void 0===a||null===(t=a.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{p as initialiseSkin};
@@ -1 +1 @@
1
- import{f as l,g as e,h as o,d as i,e as n,i as t,j as a,k as r,l as s,m as d}from"./features-c633895c.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 j,b as y}from"./index-0aaeaba2.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-ab80b8ea.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-b11763cb.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()||j(i)})),t.one("play",(function(){var l,e,n,t;null!==(l=window)&&void 0!==l&&null!==(e=l.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(i,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)})))}function x(l,e){c(l).addClass("skin_defaultv2"),function(){"Chrome"==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),y(l,e)}export{x as initialiseSkin};
1
+ import{f as l,g as e,h as o,d as i,e as n,i as t,j as a,k as r,l as s,m as d}from"./features-c633895c.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 j,b as y}from"./index-58e0b4a3.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-ab80b8ea.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-b11763cb.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()||j(i)})),t.one("play",(function(){var l,e,n,t;null!==(l=window)&&void 0!==l&&null!==(e=l.customData)&&void 0!==e&&e.iframeOverlayUrl&&o(i,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)})))}function x(l,e){c(l).addClass("skin_defaultv2"),function(){"Chrome"==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),y(l,e)}export{x as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.136-backup",
3
+ "version": "1.0.138-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"),a=require("./skin-aef573bd.js"),o=require("./generic-cdde2bcb.js"),l=require("./autoNextVideo-2220fa0e.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"),m=require("@babel/runtime/helpers/slicedToArray"),v=[],f=function(e,t){var n=a.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=o.getVideoIdx();l.switchToNext(i,e,v)}};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"),a=m(i,2),o=a[0],l=a[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 a=i.width/l,u=i.height/o,s=0;s<o;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=a,d.height=u,d.getContext("2d").drawImage(i,c*a,s*u,a,u,0,0,a,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)}})));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,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===u(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);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 a,o,l,u,s,c,d,p;o=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))}(),(a=document.createElement("div")).className="vjs-thumbnail-holder",l=document.createElement("img"),a.appendChild(l),l.src=o[0].src,l.className="vjs-thumbnail",t(l.style,o[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(a),d=function(e){var i,u,d,p,m,v,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,v=e.pageX,e.changedTouches&&(v=e.changedTouches[0].pageX),p=v||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),o)i>u&&(d=Math.max(d,u));(m=o[d]).src&&l.src!=m.src&&(l.src=m.src),m.style&&l.style!=m.style&&t(l.style,m.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,m.width||o[0].width)/2)>f?p-=p+h-f:p<h&&(p=h),a.style.left=p+"px"},s.on("mousemove",d),s.on("touchmove",d),p=function(e){a.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,a,o;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,a=i.split("\n"),o=[],a.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&a[n-1].includes("#EXT-X-TILES")&&(a[n-1]=a[n-1].split(","),r.uri=t+e,a[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=m(t,2),i=n[0],a=n[1];i=i.toLowerCase(),r[i]=a}))})),o.push(r))})),e.abrupt("return",o);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,a,l,u,s,c,p,m,v,f,h,g,x,y,b,w,E,C,N,k;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 a=e.sent,e.next=7,a.text();case 7:l=e.sent,u=new DOMParser,s=u.parseFromString(l,"application/xml"),c=null===(r=o.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=34;break}if("image"!==(v=p[m]).getAttribute("contentType")||"image/png"!==v.getAttribute("mimeType")){e.next=31;break}if(f=v.getElementsByTagName("SegmentTemplate")[0],h=v.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],x=g.getAttribute("value"),!f){e.next=31;break}for(f.getAttribute("media"),y=f.getAttribute("duration"),b=f.getAttribute("timescale"),w=y/b,E=Math.round(c/w),C=Math.ceil(E/9),N=f.getAttribute("media"),k=[],m=0;m<C;m++)k.push({duration:w,layout:x,uri:n+"/"+N.replace("$Number$",m)});return e.abrupt("return",k);case 31:m++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).apply(this,arguments)}function T(){return(T=c(d.mark((function e(t){var n,r,i,o,l,u,s,c,p,m,v;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.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==(o=e.sent)?void 0:o.length)>0)){e.next=16;break}return l=(null==o?void 0:o[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==(m=e.sent)?void 0:m.length)>0)){e.next=27;break}return e.next=25,w(m);case 25:v=e.sent,n.thumbnails(v);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;v=[];var l=o.getCurrentSeries();null==l||l.map((function(e){var t;return(t=v).push.apply(t,i(e.episodes))})),null==t||null===(r=t.series)||void 0===r||r.cb}else{var u,s;v=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=a.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&&o.getVideoIdx()<=(null===(t=v)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var d,p=v.filter((function(e,t){return t==o.getVideoIdx()}));if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var m,h,g,x,y,b,w,E,C,N,k,T;(null===(m=document.getElementsByClassName("next-ep-preview"))||void 0===m?void 0:m[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],A=null===(x=document.getElementsByClassName("next-ep-content"))||void 0===x?void 0:x[0],B=null===(y=p[0])||void 0===y?void 0:y.title;(null===(b=B)||void 0===b?void 0:b.length)>60&&(B=B.substr(0,60)+"..."),I.textContent="".concat(B),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 L,M,O,S,j,q,X,R,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(e).append(V);var F=document.createElement("div");F.className="next-ep-header",F.textContent="Next up";var D=null===(L=p[0])||void 0===L?void 0:L.title,U=document.createElement("img");U.className="next-ep-img",U.src=(null===(M=p[0])||void 0===M||null===(O=M.gist)||void 0===O||null===(S=O.imageGist)||void 0===S?void 0:S.r16x9)||(null==p||null===(j=p[0])||void 0===j?void 0:j.img)||(null===(q=window)||void 0===q||null===(X=q.customData)||void 0===X?void 0:X.fallbackImage);var G=document.createElement("div");G.className="next-ep-title",(null===(R=D)||void 0===R?void 0:R.length)>60&&(D=D.substr(0,60)+"..."),G.textContent="".concat(D);var W=document.createElement("div");W.className="next-ep-content",W.append(U),W.append(G),W.onclick=function(){return f(e)},V.append(F),V.append(W)}},exports.addTVProviderImage=function(e,t){var n=a.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(r),o.alt="Provider Image",i.append(o),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)};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./skin-2882ecc4.js";import{K as n,L as r,g as i}from"./generic-ab80b8ea.js";import{s as o}from"./autoNextVideo-b11763cb.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,f,v,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 f,v,g,y,b,w,E,C,N,k,T,A;(null===(f=document.getElementsByClassName("next-ep-preview"))||void 0===f?void 0:f[0]).style.visibility="hidden";var B=null===(v=document.getElementsByClassName("next-ep-title"))||void 0===v?void 0:v[0],I=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],L=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)+"..."),B.textContent="".concat(M),I.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),L.onclick=function(){return x(i)}}else{var P,O,j,S,X,R,F,D,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 V=null===(P=m[0])||void 0===P?void 0:P.title,W=document.createElement("img");W.className="next-ep-img",W.src=(null===(O=m[0])||void 0===O||null===(j=O.gist)||void 0===j||null===(S=j.imageGist)||void 0===S?void 0:S.r16x9)||(null==m||null===(X=m[0])||void 0===X?void 0:X.img)||(null===(R=window)||void 0===R||null===(F=R.customData)||void 0===F?void 0:F.fallbackImage);var $=document.createElement("div");$.className="next-ep-title",(null===(D=V)||void 0===D?void 0:D.length)>60&&(V=V.substr(0,60)+"..."),$.textContent="".concat(V);var H=document.createElement("div");H.className="next-ep-content",H.append(W),H.append($),H.onclick=function(){return x(i)},U.append(G),U.append(H)}},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)}})));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},f=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},v=function e(t){return"HTML"!==t.nodeName&&"static"===f(t)("position")?e(t.offsetParent):t},l.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,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=v(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-=v(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=f(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),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 B.apply(this,arguments)}function B(){return(B=u(s.mark((function e(t){var n,r,o,a,l,u,c,d,p,m,f,v,h,g,x,y,b,w,E,C,N,k;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"),d=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,p=c.getElementsByTagName("AdaptationSet"),m=0;case 13:if(!(m<p.length)){e.next=34;break}if("image"!==(f=p[m]).getAttribute("contentType")||"image/png"!==f.getAttribute("mimeType")){e.next=31;break}if(v=f.getElementsByTagName("SegmentTemplate")[0],h=f.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],x=g.getAttribute("value"),!v){e.next=31;break}for(v.getAttribute("media"),y=v.getAttribute("duration"),b=v.getAttribute("timescale"),w=y/b,E=Math.round(d/w),C=Math.ceil(E/9),N=v.getAttribute("media"),k=[],m=0;m<C;m++)k.push({duration:w,layout:x,uri:n+"/"+N.replace("$Number$",m)});return e.abrupt("return",k);case 31:m++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).apply(this,arguments)}function I(e){return L.apply(this,arguments)}function L(){return(L=u(s.mark((function e(n){var r,i,o,a,l,u,c,d,p,m,f;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:f=e.sent,r.thumbnails(f);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,I as i};