@viewlift/player-backup 1.0.121-backup → 1.0.122-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.
Files changed (75) hide show
  1. package/cjs/{autoNextVideo-e1767094.js → autoNextVideo-ff42f1a0.js} +1 -1
  2. package/cjs/bundle.css +6 -6
  3. package/cjs/caption-settings-f7372584.js +1 -0
  4. package/cjs/{features-f75cd4d7.js → features-c93010e5.js} +1 -1
  5. package/cjs/generic-57501058.js +1 -0
  6. package/cjs/index.js +1 -1
  7. package/cjs/{keyboardShortcuts-32e2f8f8.js → keyboardShortcuts-4340bc6b.js} +1 -1
  8. package/cjs/multicam-864bd2bb.js +1 -0
  9. package/cjs/multicamv2-2ffa7f0c.js +1 -0
  10. package/cjs/mwebPotraitTray-56d6e4d2.js +1 -0
  11. package/cjs/nextEpisodeButton-8dfcec10.js +1 -0
  12. package/cjs/playlist-23f2b341.js +1 -0
  13. package/cjs/{renditions-679b535a.js → renditions-cc71ec8c.js} +1 -1
  14. package/cjs/resolution-812052c0.js +1 -0
  15. package/cjs/series-c6ebeb87.js +1 -0
  16. package/cjs/series-v2-07035af9.js +1 -0
  17. package/cjs/settings-icon-48c25dc4.js +1 -0
  18. package/cjs/{skin-4f2bca89.js → skin-2075dd29.js} +1 -1
  19. package/cjs/{skin-0f6301d7.js → skin-3d8b17fc.js} +1 -1
  20. package/cjs/{skin-d13755a0.js → skin-5ceb29b6.js} +1 -1
  21. package/cjs/{skin-47d8300b.js → skin-65cf70ff.js} +1 -1
  22. package/cjs/{skin-88550a4e.js → skin-65f18828.js} +1 -1
  23. package/cjs/{skin-edb064e8.js → skin-cffba054.js} +1 -1
  24. package/cjs/{util-b1efcc6f.js → util-26ad6aca.js} +1 -1
  25. package/cjs/videoSelector-3cdfe35b.js +1 -0
  26. package/esm/{autoNextVideo-db6283b1.js → autoNextVideo-739861ed.js} +1 -1
  27. package/esm/bundle.css +6 -6
  28. package/esm/caption-settings-835fcf0b.js +1 -0
  29. package/esm/{features-250dfa7a.js → features-0eeb3c65.js} +1 -1
  30. package/esm/generic-444bf169.js +1 -0
  31. package/esm/index.js +1 -1
  32. package/esm/{keyboardShortcuts-4b3b8afa.js → keyboardShortcuts-8624e77b.js} +1 -1
  33. package/esm/multicam-5e992904.js +1 -0
  34. package/esm/multicamv2-2640b4f1.js +1 -0
  35. package/esm/mwebPotraitTray-ff38b447.js +1 -0
  36. package/esm/nextEpisodeButton-5a62159a.js +1 -0
  37. package/esm/playlist-b612533a.js +1 -0
  38. package/esm/{renditions-090502aa.js → renditions-11d6f06f.js} +1 -1
  39. package/esm/resolution-4c376392.js +1 -0
  40. package/esm/series-4d4d1421.js +1 -0
  41. package/esm/series-v2-c7c9616a.js +1 -0
  42. package/esm/settings-icon-81bd8bec.js +1 -0
  43. package/esm/{skin-fd6c2622.js → skin-347cf391.js} +1 -1
  44. package/esm/{skin-5f9fe2f6.js → skin-48a28d17.js} +1 -1
  45. package/esm/{skin-26b3c430.js → skin-57962dea.js} +1 -1
  46. package/esm/{skin-6ab207d5.js → skin-79e9ebc9.js} +1 -1
  47. package/esm/{skin-87568757.js → skin-af53462a.js} +1 -1
  48. package/esm/{skin-d3ab50f7.js → skin-b1e2e3ce.js} +1 -1
  49. package/esm/{util-ad1895db.js → util-b468f9d5.js} +1 -1
  50. package/esm/videoSelector-0d8b0001.js +1 -0
  51. package/package.json +8 -8
  52. package/cjs/caption-settings-95ee84ba.js +0 -1
  53. package/cjs/generic-cc7d7e07.js +0 -1
  54. package/cjs/multicam-5c3b676c.js +0 -1
  55. package/cjs/multicamv2-b35484f8.js +0 -1
  56. package/cjs/mwebPotraitTray-36cdb29f.js +0 -1
  57. package/cjs/nextEpisodeButton-28fcd961.js +0 -1
  58. package/cjs/playlist-9da30b66.js +0 -1
  59. package/cjs/resolution-eceef15a.js +0 -1
  60. package/cjs/series-e724b1cc.js +0 -1
  61. package/cjs/series-v2-f1e98e62.js +0 -1
  62. package/cjs/settings-icon-6dad65b6.js +0 -1
  63. package/cjs/videoSelector-26c84724.js +0 -1
  64. package/esm/caption-settings-7336f73a.js +0 -1
  65. package/esm/generic-ff184c2f.js +0 -1
  66. package/esm/multicam-e5b32469.js +0 -1
  67. package/esm/multicamv2-5e33b343.js +0 -1
  68. package/esm/mwebPotraitTray-4a697d2a.js +0 -1
  69. package/esm/nextEpisodeButton-b2820628.js +0 -1
  70. package/esm/playlist-688d8355.js +0 -1
  71. package/esm/resolution-ba31e85b.js +0 -1
  72. package/esm/series-e68a0fbd.js +0 -1
  73. package/esm/series-v2-2243c975.js +0 -1
  74. package/esm/settings-icon-c4fd8e69.js +0 -1
  75. package/esm/videoSelector-d7110cde.js +0 -1
@@ -1 +1 @@
1
- "use strict";var e=require("./features-f75cd4d7.js"),r=require("./keyboardShortcuts-32e2f8f8.js"),i=require("./icons-515b2da0.js"),n=require("./generic-cc7d7e07.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("video.js"),require("./renditions-679b535a.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.initialiseSkin=function(t,s){r.initialiseKeyboardEvents(t,s),Promise.resolve().then((function(){return require("./skin-983a2ea7.js")})).then((function(e){var r=document.createElement("style");r.id="def_skin",r.append("".concat(e.default)),document.head.appendChild(r)})),function(r,n){0==n.liveVideo&&0==n.liveui&&e.addSkipButton(r,"default",i.SkipSvg());(0==n.liveVideo&&0==n.liveui||1==n.liveui)&&e.addRewindButton(r,"default",i.RewindSvg())}(t,s),function(r,t){var s=n.getPlayer(r),l=(null==t?void 0:t.sres)||null;s.on("loadeddata",(function(){e.addResolutionModule(r,"default",i.SettingsSvg()),l&&Promise.resolve().then((function(){return require("./nextEpisodeButton-28fcd961.js")})).then((function(e){e.initaliseFunctionality(t.sres.seasons,n.getCurrentVideo())}))})),s.one("loadedmetadata",(function(){var i;l&&(e.addSeriesModule(r,null==t||null===(i=t.sres)||void 0===i?void 0:i.seasons,t),e.addNextEpisodeButton(t.sres,t.res,r))}))}(t,s),function(e,r){var t,s,l,o,a=n.getPlayer(e),u=document.getElementsByClassName("vjs-current-time")[0],d=document.getElementsByClassName("vjs-duration")[0],c=document.getElementsByClassName("vjs-time-divider")[0];r.liveVideo&&(u&&(u.style.display="none"),d&&(d.style.display="none"),c&&(c.style.display="none"));null===(t=a.controlBar.getChild("FullscreenToggle"))||void 0===t||null===(s=t.el())||void 0===s||s.appendChild(n.createIconMarkup(i.MinimizeSvg(window.controlsColor))),null===(l=a.controlBar.getChild("FullscreenToggle"))||void 0===l||null===(o=l.el())||void 0===o||o.appendChild(n.createIconMarkup(i.MaximizeSvg(window.controlsColor)));var m=a.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(n.createIconMarkup(i.NewCaptionsSvg()));var v=document.createElement("div");v.classList.add("caption-header"),m.querySelector(".vjs-menu-content").insertBefore(v,m.querySelector(".vjs-menu-item"))}(t,s)};
1
+ "use strict";var e=require("./features-c93010e5.js"),r=require("./keyboardShortcuts-4340bc6b.js"),i=require("./icons-515b2da0.js"),n=require("./generic-57501058.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("video.js"),require("./renditions-cc71ec8c.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.initialiseSkin=function(t,s){r.initialiseKeyboardEvents(t,s),Promise.resolve().then((function(){return require("./skin-983a2ea7.js")})).then((function(e){var r=document.createElement("style");r.id="def_skin",r.append("".concat(e.default)),document.head.appendChild(r)})),function(r,n){0==n.liveVideo&&0==n.liveui&&e.addSkipButton(r,"default",i.SkipSvg());(0==n.liveVideo&&0==n.liveui||1==n.liveui)&&e.addRewindButton(r,"default",i.RewindSvg())}(t,s),function(r,t){var s=n.getPlayer(r),l=(null==t?void 0:t.sres)||null;s.on("loadeddata",(function(){e.addResolutionModule(r,"default",i.SettingsSvg()),l&&Promise.resolve().then((function(){return require("./nextEpisodeButton-8dfcec10.js")})).then((function(e){e.initaliseFunctionality(t.sres.seasons,n.getCurrentVideo())}))})),s.one("loadedmetadata",(function(){var i;l&&(e.addSeriesModule(r,null==t||null===(i=t.sres)||void 0===i?void 0:i.seasons,t),e.addNextEpisodeButton(t.sres,t.res,r))}))}(t,s),function(e,r){var t,s,l,o,a=n.getPlayer(e),u=document.getElementsByClassName("vjs-current-time")[0],d=document.getElementsByClassName("vjs-duration")[0],c=document.getElementsByClassName("vjs-time-divider")[0];r.liveVideo&&(u&&(u.style.display="none"),d&&(d.style.display="none"),c&&(c.style.display="none"));null===(t=a.controlBar.getChild("FullscreenToggle"))||void 0===t||null===(s=t.el())||void 0===s||s.appendChild(n.createIconMarkup(i.MinimizeSvg(window.controlsColor))),null===(l=a.controlBar.getChild("FullscreenToggle"))||void 0===l||null===(o=l.el())||void 0===o||o.appendChild(n.createIconMarkup(i.MaximizeSvg(window.controlsColor)));var m=a.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(n.createIconMarkup(i.NewCaptionsSvg()));var v=document.createElement("div");v.classList.add("caption-header"),m.querySelector(".vjs-menu-content").insertBefore(v,m.querySelector(".vjs-menu-item"))}(t,s)};
@@ -1 +1 @@
1
- "use strict";var e=require("./generic-cc7d7e07.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var r=function(){var e=document.getElementsByClassName("vjs-control-bar")[0];e&&(e.style.visibility="hidden")};exports.initaliseSkin=function(t){Promise.resolve().then((function(){return require("./skin-225252ff.js")})).then((function(e){var r=document.createElement("style");r.id="carousel_homepage",r.append("".concat(e.default)),document.head.appendChild(r)})),r(),function(r){var t=document.getElementById("".concat(r)),n=e.getPlayer(r);t&&t.addEventListener("touchstart",(function(){n.paused()?e.play(r):e.pause(r)}))}(t)};
1
+ "use strict";var e=require("./generic-57501058.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var r=function(){var e=document.getElementsByClassName("vjs-control-bar")[0];e&&(e.style.visibility="hidden")};exports.initaliseSkin=function(t){Promise.resolve().then((function(){return require("./skin-225252ff.js")})).then((function(e){var r=document.createElement("style");r.id="carousel_homepage",r.append("".concat(e.default)),document.head.appendChild(r)})),r(),function(r){var t=document.getElementById("".concat(r)),n=e.getPlayer(r);t&&t.addEventListener("touchstart",(function(){n.paused()?e.play(r):e.pause(r)}))}(t)};
@@ -1 +1 @@
1
- "use strict";var e=require("./features-f75cd4d7.js"),t=require("./icons-515b2da0.js"),n=require("./generic-cc7d7e07.js"),r=require("./renditions-679b535a.js"),i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./autoNextVideo-e1767094.js"),o=require("@babel/runtime/helpers/typeof"),a=require("video.js"),u=require("@babel/runtime/helpers/asyncToGenerator"),s=require("@babel/runtime/regenerator"),d=require("@babel/runtime/helpers/slicedToArray");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("./localisation-56e0a999.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-b1efcc6f.js");var c,v,p,m,f=[],h=function(e,t){var r=n.getPlayer(e),i=Math.floor(r.currentTime());if(Math.floor(r.duration())!=i){r.pause(e);var o=n.getVideoIdx();l.switchToNext(o,e,f)}};function g(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function y(e){return x.apply(this,arguments)}function x(){return(x=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"),l=d(i,2),o=l[0],a=l[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 l=i.width/a,u=i.height/o,s=0;s<o;s++)for(var d=0;d<a;d++){var c=document.createElement("canvas");c.width=l,c.height=u,c.getContext("2d").drawImage(i,d*l,s*u,l,u,0,0,l,u);var v=c.toDataURL("image/png");r.push({uri:v,duration:t.duration})}e(r)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e){return w.apply(this,arguments)}function w(){return(w=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",g(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function C(e){return E.apply(this,arguments)}function E(){return(E=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 y(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n=e.duration;r[n*t]={src:e.uri,style:{left:"-60px",height:"85px",width:"130px"}}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}c={0:{src:"example-thumbnail.png"}},v=function e(){var t,n,r,i,l;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[r])i.hasOwnProperty(l)&&("object"===o(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},p=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},m=function e(t){return"HTML"!==t.nodeName&&"static"===p(t)("position")?e(t.offsetParent):t},a.registerPlugin("thumbnails",(function(e){var t,n,r,i,l,o,a,u;n=v({},c,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",v(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",(function(e){o=i.duration()})),i.on("loadedmetadata",(function(e){o=i.duration()})),(l=i.controlBar.progressControl).el().appendChild(t),a=function(e){var i,a,u,s,d,c,f,h,g,y;for(a in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=m(l.el()).getBoundingClientRect()).width||y.right)+g,c=e.pageX,e.changedTouches&&(c=e.changedTouches[0].pageX),s=c||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=m(l.el()).getBoundingClientRect().left+g,i=Math.floor((s-l.el().offsetLeft)/l.width()*o),n)i>a&&(u=Math.max(u,a));(d=n[u]).src&&r.src!=d.src&&(r.src=d.src),d.style&&r.style!=d.style&&v(r.style,d.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=p(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,d.width||n[0].width)/2)>f?s-=s+h-f:s<h&&(s=h),t.style.left=s+"px"},l.on("mousemove",a),l.on("touchmove",a),u=function(e){t.style.left="-1000px"},l.on("mouseout",u),l.on("touchcancel",u),l.on("touchend",u),i.on("userinactive",u)}));var k=function(){var e=u(s.mark((function e(t,n){var r,i,l,o;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,l=i.split("\n"),o=[],l.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&l[n-1].includes("#EXT-X-TILES")&&(l[n-1]=l[n-1].split(","),r.uri=t+e,l[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],l=n[1];i=i.toLowerCase(),r[i]=l}))})),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 B.apply(this,arguments)}function B(){return(B=u(s.mark((function e(t){var r,i,l,o,a,u,d,c,v,p,m,f,h,g,y,x,b,w,C,E,k,N;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=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:a=e.sent,u=new DOMParser,d=u.parseFromString(a,"application/xml"),c=null===(i=n.getCurrentVideo())||void 0===i||null===(l=i.video)||void 0===l?void 0:l.runtime,v=d.getElementsByTagName("AdaptationSet"),p=0;case 13:if(!(p<v.length)){e.next=34;break}if("image"!==(m=v[p]).getAttribute("contentType")||"image/png"!==m.getAttribute("mimeType")){e.next=31;break}if(f=m.getElementsByTagName("SegmentTemplate")[0],h=m.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],y=g.getAttribute("value"),!f){e.next=31;break}for(f.getAttribute("media"),x=f.getAttribute("duration"),b=f.getAttribute("timescale"),w=x/b,C=Math.round(c/w),E=Math.ceil(C/9),k=f.getAttribute("media"),N=[],p=0;p<E;p++)N.push({duration:w,layout:y,uri:r+"/"+k.replace("$Number$",p)});return e.abrupt("return",N);case 31:p++,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 j(){return(j=u(s.mark((function e(t){var r,i,l,o,a,u,d,c,v,p,m,f,h,g,y,x,w,E,B,j,S;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getPlayer(t),i=r.currentSource(),null==(l=i.src)||!l.includes("m3u8")){e.next=18;break}return e.next=5,b(l);case 5:if(!((null==(o=e.sent)?void 0:o.length)>0)){e.next=16;break}return y=(null==o?void 0:o[0])||null,x=y.uri,w=(null==r||null===(a=r.tech())||void 0===a||null===(u=a.vhs)||void 0===u||null===(d=u.playlists)||void 0===d||null===(c=d.master)||void 0===c||null===(v=c.uri)||void 0===v?void 0:v.substring(0,null==r||null===(p=r.tech())||void 0===p||null===(m=p.vhs)||void 0===m||null===(f=m.playlists)||void 0===f||null===(h=f.master)||void 0===h||null===(g=h.uri)||void 0===g?void 0:g.lastIndexOf("/")))+"/",e.next=11,k(w,x);case 11:return E=e.sent,e.next=14,C(E);case 14:B=e.sent,r.thumbnails(B);case 16:e.next=27;break;case 18:if(null==l||!l.includes("mpd")){e.next=27;break}return e.next=21,N(l);case 21:if(!((null==(j=e.sent)?void 0:j.length)>0)){e.next=27;break}return e.next=25,C(j);case 25:S=e.sent,r.thumbnails(S);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(t,l){var o=n.getPlayer(t);o&&(o.on("loadeddata",(function(){var a,u,s,d,c,v,p;(null===(a=r.getRenditions(t))||void 0===a?void 0:a.length)>0&&e.addSettingsButtonV2(t,l),(null===(u=n.getCaptions(t))||void 0===u?void 0:u.length)>0&&e.addCaptionButton(t,l),!(null!=l&&null!==(s=l.series)&&void 0!==s&&s.enable||null!==(d=window)&&void 0!==d&&null!==(c=d.app_data)&&void 0!==c&&null!==(v=c.appcmsMain)&&void 0!==v&&null!==(p=v.features)&&void 0!==p&&p.auto_play)||null!=l&&l.liveVideo||function(e,t){var r;if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable){var l;f=[];var o=n.getCurrentSeries();null==o||o.map((function(e){var t;return(t=f).push.apply(t,i(e.episodes))})),null==t||null===(l=t.series)||void 0===l||l.cb}else{var a,u;f=null==t||null===(a=t.relatedVideos)||void 0===a?void 0:a.content,null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var s=n.getPlayer(e);s.on("timeupdate",(function(){var e,t,r=Math.floor(s.currentTime()),i=s.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n.getVideoIdx()<=(null===(t=f)||void 0===t?void 0:t.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}));var d,c=f.filter((function(e,t){return t==n.getVideoIdx()}));if((null==c?void 0:c.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var v,p,m,g,y,x,b,w,C,E,k,N;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var B=null===(p=document.getElementsByClassName("next-ep-title"))||void 0===p?void 0:p[0],j=null===(m=document.getElementsByClassName("next-ep-img"))||void 0===m?void 0:m[0],S=null===(g=document.getElementsByClassName("next-ep-content"))||void 0===g?void 0:g[0],q=null===(y=c[0])||void 0===y?void 0:y.title;(null===(x=q)||void 0===x?void 0:x.length)>60&&(q=q.substr(0,60)+"..."),B.textContent="".concat(q),j.src=(null===(b=c[0])||void 0===b||null===(w=b.gist)||void 0===w||null===(C=w.imageGist)||void 0===C?void 0:C.r16x9)||(null==c||null===(E=c[0])||void 0===E?void 0:E.img)||(null===(k=window)||void 0===k||null===(N=k.customData)||void 0===N?void 0:N.fallbackImage),S.onclick=function(){return h(e)}}else{var T,V,M,P,I,O,A,L,R=document.createElement("div");R.className="next-ep-preview",R.style.visibility="hidden",document.getElementById(e).append(R);var X=document.createElement("div");X.className="next-ep-header",X.textContent="Next up";var F=null===(T=c[0])||void 0===T?void 0:T.title,D=document.createElement("img");D.className="next-ep-img",D.src=(null===(V=c[0])||void 0===V||null===(M=V.gist)||void 0===M||null===(P=M.imageGist)||void 0===P?void 0:P.r16x9)||(null==c||null===(I=c[0])||void 0===I?void 0:I.img)||(null===(O=window)||void 0===O||null===(A=O.customData)||void 0===A?void 0:A.fallbackImage);var U=document.createElement("div");U.className="next-ep-title",(null===(L=F)||void 0===L?void 0:L.length)>60&&(F=F.substr(0,60)+"..."),U.textContent="".concat(F);var G=document.createElement("div");G.className="next-ep-content",G.append(D),G.append(U),G.onclick=function(){return h(e)},R.append(X),R.append(G)}}(t,l),function(e,t){var n,r=Math.floor(e/60),i=null===(n=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===n?void 0:n[0];i&&(i.style.marginRight=r>60?"56px":"41px");var l=document.getElementsByClassName("vjs-live-control")[0],o=document.getElementsByClassName("vjs-time-control");t&&l.classList.value.includes("vjs-hidden")&&(o[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==l?void 0:l.liveVideo)||!1),null!=l&&l.liveVideo||n.isMobile()||function(e){j.apply(this,arguments)}(t)})),o.one("play",(function(){var n,r,i,l;null!==(n=window)&&void 0!==n&&null!==(r=n.customData)&&void 0!==r&&r.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.iframeOverlayUrl)})))}exports.initialiseSkin=function(r,i){!function(){"Chrome"==n.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));Promise.resolve().then((function(){return require("./skin-c66e9b42.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),S(r,i),function(e,r){var i,l,o,a,u,s,d=n.getPlayer(e);null==d||null===(i=d.controlBar)||void 0===i||null===(l=i.getChild("FullscreenToggle"))||void 0===l||null===(o=l.el())||void 0===o||o.appendChild(n.createIconMarkup(t.MinimizeSvg(window.controlsColor))),null==d||null===(a=d.controlBar)||void 0===a||null===(u=a.getChild("FullscreenToggle"))||void 0===u||null===(s=u.el())||void 0===s||s.appendChild(n.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var c=document.getElementsByClassName("vjs-time-control");r.liveVideo&&c[0]&&(c[0].style.display="none")}(r,i),function(n,r){var i,l,o,a,u,s;0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)&&e.addSkipButton(n,"defaultV2",t.SkipSvgV2());(0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)||1==(null==r?void 0:r.liveui))&&e.addRewindButton(n,"defaultV2",t.RewindSvgV2());r.liveVideo||e.addSlowMotion(n);(null==r||null===(i=r.relatedVideos)||void 0===i||null===(l=i.content)||void 0===l?void 0:l.length)>0&&e.addVideoSelector(n,null==r?void 0:r.relatedVideos);(null==r||null===(o=r.streams)||void 0===o?void 0:o.length)>1&&e.addMulticamSelector(n,null==r?void 0:r.streams);(null==r||null===(a=r.playlist)||void 0===a||null===(u=a.content)||void 0===u?void 0:u.length)>0&&e.addPlaylistSelector(n,null==r?void 0:r.playlist);null!=r&&null!==(s=r.series)&&void 0!==s&&s.enable&&e.addSeriesSelectorV2(n,r)}(r,i),function(e,t){var r=n.getPlayer(e),i=null==t?void 0:t.tvProviderLogoUrl;if(!i)return;var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",l.append(o),r.el().appendChild(l),r.on("useractive",(function(){l.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||l.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"}))}(r,i)};
1
+ "use strict";var e=require("./features-c93010e5.js"),t=require("./icons-515b2da0.js"),n=require("./generic-57501058.js"),r=require("./renditions-cc71ec8c.js"),i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./autoNextVideo-ff42f1a0.js"),o=require("@babel/runtime/helpers/typeof"),a=require("video.js"),u=require("@babel/runtime/helpers/asyncToGenerator"),s=require("@babel/runtime/regenerator"),d=require("@babel/runtime/helpers/slicedToArray");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("./localisation-56e0a999.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-26ad6aca.js");var c,v,p,m,f=[],h=function(e,t){var r=n.getPlayer(e),i=Math.floor(r.currentTime());if(Math.floor(r.duration())!=i){r.pause(e);var o=n.getVideoIdx();l.switchToNext(o,e,f)}};function g(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function y(e){return x.apply(this,arguments)}function x(){return(x=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"),l=d(i,2),o=l[0],a=l[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 l=i.width/a,u=i.height/o,s=0;s<o;s++)for(var d=0;d<a;d++){var c=document.createElement("canvas");c.width=l,c.height=u,c.getContext("2d").drawImage(i,d*l,s*u,l,u,0,0,l,u);var v=c.toDataURL("image/png");r.push({uri:v,duration:t.duration})}e(r)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e){return w.apply(this,arguments)}function w(){return(w=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",g(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function C(e){return E.apply(this,arguments)}function E(){return(E=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 y(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n=e.duration;r[n*t]={src:e.uri,style:{left:"-60px",height:"85px",width:"130px"}}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}c={0:{src:"example-thumbnail.png"}},v=function e(){var t,n,r,i,l;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[r])i.hasOwnProperty(l)&&("object"===o(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},p=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},m=function e(t){return"HTML"!==t.nodeName&&"static"===p(t)("position")?e(t.offsetParent):t},a.registerPlugin("thumbnails",(function(e){var t,n,r,i,l,o,a,u;n=v({},c,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",v(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",(function(e){o=i.duration()})),i.on("loadedmetadata",(function(e){o=i.duration()})),(l=i.controlBar.progressControl).el().appendChild(t),a=function(e){var i,a,u,s,d,c,f,h,g,y;for(a in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=m(l.el()).getBoundingClientRect()).width||y.right)+g,c=e.pageX,e.changedTouches&&(c=e.changedTouches[0].pageX),s=c||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=m(l.el()).getBoundingClientRect().left+g,i=Math.floor((s-l.el().offsetLeft)/l.width()*o),n)i>a&&(u=Math.max(u,a));(d=n[u]).src&&r.src!=d.src&&(r.src=d.src),d.style&&r.style!=d.style&&v(r.style,d.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=p(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,d.width||n[0].width)/2)>f?s-=s+h-f:s<h&&(s=h),t.style.left=s+"px"},l.on("mousemove",a),l.on("touchmove",a),u=function(e){t.style.left="-1000px"},l.on("mouseout",u),l.on("touchcancel",u),l.on("touchend",u),i.on("userinactive",u)}));var k=function(){var e=u(s.mark((function e(t,n){var r,i,l,o;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,l=i.split("\n"),o=[],l.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&l[n-1].includes("#EXT-X-TILES")&&(l[n-1]=l[n-1].split(","),r.uri=t+e,l[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],l=n[1];i=i.toLowerCase(),r[i]=l}))})),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 B.apply(this,arguments)}function B(){return(B=u(s.mark((function e(t){var r,i,l,o,a,u,d,c,v,p,m,f,h,g,y,x,b,w,C,E,k,N;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=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:a=e.sent,u=new DOMParser,d=u.parseFromString(a,"application/xml"),c=null===(i=n.getCurrentVideo())||void 0===i||null===(l=i.video)||void 0===l?void 0:l.runtime,v=d.getElementsByTagName("AdaptationSet"),p=0;case 13:if(!(p<v.length)){e.next=34;break}if("image"!==(m=v[p]).getAttribute("contentType")||"image/png"!==m.getAttribute("mimeType")){e.next=31;break}if(f=m.getElementsByTagName("SegmentTemplate")[0],h=m.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],y=g.getAttribute("value"),!f){e.next=31;break}for(f.getAttribute("media"),x=f.getAttribute("duration"),b=f.getAttribute("timescale"),w=x/b,C=Math.round(c/w),E=Math.ceil(C/9),k=f.getAttribute("media"),N=[],p=0;p<E;p++)N.push({duration:w,layout:y,uri:r+"/"+k.replace("$Number$",p)});return e.abrupt("return",N);case 31:p++,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 j(){return(j=u(s.mark((function e(t){var r,i,l,o,a,u,d,c,v,p,m,f,h,g,y,x,w,E,B,j,S;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getPlayer(t),i=r.currentSource(),null==(l=i.src)||!l.includes("m3u8")){e.next=18;break}return e.next=5,b(l);case 5:if(!((null==(o=e.sent)?void 0:o.length)>0)){e.next=16;break}return y=(null==o?void 0:o[0])||null,x=y.uri,w=(null==r||null===(a=r.tech())||void 0===a||null===(u=a.vhs)||void 0===u||null===(d=u.playlists)||void 0===d||null===(c=d.master)||void 0===c||null===(v=c.uri)||void 0===v?void 0:v.substring(0,null==r||null===(p=r.tech())||void 0===p||null===(m=p.vhs)||void 0===m||null===(f=m.playlists)||void 0===f||null===(h=f.master)||void 0===h||null===(g=h.uri)||void 0===g?void 0:g.lastIndexOf("/")))+"/",e.next=11,k(w,x);case 11:return E=e.sent,e.next=14,C(E);case 14:B=e.sent,r.thumbnails(B);case 16:e.next=27;break;case 18:if(null==l||!l.includes("mpd")){e.next=27;break}return e.next=21,N(l);case 21:if(!((null==(j=e.sent)?void 0:j.length)>0)){e.next=27;break}return e.next=25,C(j);case 25:S=e.sent,r.thumbnails(S);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(t,l){var o=n.getPlayer(t);o&&(o.on("loadeddata",(function(){var a,u,s,d,c,v,p;(null===(a=r.getRenditions(t))||void 0===a?void 0:a.length)>0&&e.addSettingsButtonV2(t,l),(null===(u=n.getCaptions(t))||void 0===u?void 0:u.length)>0&&e.addCaptionButton(t,l),!(null!=l&&null!==(s=l.series)&&void 0!==s&&s.enable||null!==(d=window)&&void 0!==d&&null!==(c=d.app_data)&&void 0!==c&&null!==(v=c.appcmsMain)&&void 0!==v&&null!==(p=v.features)&&void 0!==p&&p.auto_play)||null!=l&&l.liveVideo||function(e,t){var r;if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable){var l;f=[];var o=n.getCurrentSeries();null==o||o.map((function(e){var t;return(t=f).push.apply(t,i(e.episodes))})),null==t||null===(l=t.series)||void 0===l||l.cb}else{var a,u;f=null==t||null===(a=t.relatedVideos)||void 0===a?void 0:a.content,null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var s=n.getPlayer(e);s.on("timeupdate",(function(){var e,t,r=Math.floor(s.currentTime()),i=s.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n.getVideoIdx()<=(null===(t=f)||void 0===t?void 0:t.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}));var d,c=f.filter((function(e,t){return t==n.getVideoIdx()}));if((null==c?void 0:c.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var v,p,m,g,y,x,b,w,C,E,k,N;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var B=null===(p=document.getElementsByClassName("next-ep-title"))||void 0===p?void 0:p[0],j=null===(m=document.getElementsByClassName("next-ep-img"))||void 0===m?void 0:m[0],S=null===(g=document.getElementsByClassName("next-ep-content"))||void 0===g?void 0:g[0],q=null===(y=c[0])||void 0===y?void 0:y.title;(null===(x=q)||void 0===x?void 0:x.length)>60&&(q=q.substr(0,60)+"..."),B.textContent="".concat(q),j.src=(null===(b=c[0])||void 0===b||null===(w=b.gist)||void 0===w||null===(C=w.imageGist)||void 0===C?void 0:C.r16x9)||(null==c||null===(E=c[0])||void 0===E?void 0:E.img)||(null===(k=window)||void 0===k||null===(N=k.customData)||void 0===N?void 0:N.fallbackImage),S.onclick=function(){return h(e)}}else{var T,V,M,P,I,O,A,L,R=document.createElement("div");R.className="next-ep-preview",R.style.visibility="hidden",document.getElementById(e).append(R);var X=document.createElement("div");X.className="next-ep-header",X.textContent="Next up";var F=null===(T=c[0])||void 0===T?void 0:T.title,D=document.createElement("img");D.className="next-ep-img",D.src=(null===(V=c[0])||void 0===V||null===(M=V.gist)||void 0===M||null===(P=M.imageGist)||void 0===P?void 0:P.r16x9)||(null==c||null===(I=c[0])||void 0===I?void 0:I.img)||(null===(O=window)||void 0===O||null===(A=O.customData)||void 0===A?void 0:A.fallbackImage);var U=document.createElement("div");U.className="next-ep-title",(null===(L=F)||void 0===L?void 0:L.length)>60&&(F=F.substr(0,60)+"..."),U.textContent="".concat(F);var G=document.createElement("div");G.className="next-ep-content",G.append(D),G.append(U),G.onclick=function(){return h(e)},R.append(X),R.append(G)}}(t,l),function(e,t){var n,r=Math.floor(e/60),i=null===(n=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===n?void 0:n[0];i&&(i.style.marginRight=r>60?"56px":"41px");var l=document.getElementsByClassName("vjs-live-control")[0],o=document.getElementsByClassName("vjs-time-control");t&&l.classList.value.includes("vjs-hidden")&&(o[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==l?void 0:l.liveVideo)||!1),null!=l&&l.liveVideo||n.isMobile()||function(e){j.apply(this,arguments)}(t)})),o.one("play",(function(){var n,r,i,l;null!==(n=window)&&void 0!==n&&null!==(r=n.customData)&&void 0!==r&&r.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.iframeOverlayUrl)})))}exports.initialiseSkin=function(r,i){!function(){"Chrome"==n.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));Promise.resolve().then((function(){return require("./skin-c66e9b42.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),S(r,i),function(e,r){var i,l,o,a,u,s,d=n.getPlayer(e);null==d||null===(i=d.controlBar)||void 0===i||null===(l=i.getChild("FullscreenToggle"))||void 0===l||null===(o=l.el())||void 0===o||o.appendChild(n.createIconMarkup(t.MinimizeSvg(window.controlsColor))),null==d||null===(a=d.controlBar)||void 0===a||null===(u=a.getChild("FullscreenToggle"))||void 0===u||null===(s=u.el())||void 0===s||s.appendChild(n.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var c=document.getElementsByClassName("vjs-time-control");r.liveVideo&&c[0]&&(c[0].style.display="none")}(r,i),function(n,r){var i,l,o,a,u,s;0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)&&e.addSkipButton(n,"defaultV2",t.SkipSvgV2());(0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)||1==(null==r?void 0:r.liveui))&&e.addRewindButton(n,"defaultV2",t.RewindSvgV2());r.liveVideo||e.addSlowMotion(n);(null==r||null===(i=r.relatedVideos)||void 0===i||null===(l=i.content)||void 0===l?void 0:l.length)>0&&e.addVideoSelector(n,null==r?void 0:r.relatedVideos);(null==r||null===(o=r.streams)||void 0===o?void 0:o.length)>1&&e.addMulticamSelector(n,null==r?void 0:r.streams);(null==r||null===(a=r.playlist)||void 0===a||null===(u=a.content)||void 0===u?void 0:u.length)>0&&e.addPlaylistSelector(n,null==r?void 0:r.playlist);null!=r&&null!==(s=r.series)&&void 0!==s&&s.enable&&e.addSeriesSelectorV2(n,r)}(r,i),function(e,t){var r=n.getPlayer(e),i=null==t?void 0:t.tvProviderLogoUrl;if(!i)return;var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",l.append(o),r.el().appendChild(l),r.on("useractive",(function(){l.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||l.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"}))}(r,i)};
@@ -1 +1 @@
1
- "use strict";var e=require("./generic-cc7d7e07.js"),r=require("./features-f75cd4d7.js"),i=require("./renditions-679b535a.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.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/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./localisation-56e0a999.js"),exports.initialiseSkin=function(t,n){Promise.resolve().then((function(){return require("./skin-fc1e7e52.js")})).then((function(e){var r=document.createElement("style");r.id="multiplayer_css",r.append("".concat(e.default)),document.head.appendChild(r)})),function(t,n){e.getPlayer(t).on("loadeddata",(function(){var u;(null===(u=i.getRenditions(t))||void 0===u?void 0:u.length)>0&&r.addSettingsButtonV2(t,n),null!=n&&n.disableCaptions&&e.removeCaptions(t)}))}(t,n),function(i,t){var n=e.getPlayer(i);n.controls(!1),r.addDBClickFullScreen(i)}(t)};
1
+ "use strict";var e=require("./generic-57501058.js"),r=require("./features-c93010e5.js"),i=require("./renditions-cc71ec8c.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.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/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./localisation-56e0a999.js"),exports.initialiseSkin=function(t,n){Promise.resolve().then((function(){return require("./skin-fc1e7e52.js")})).then((function(e){var r=document.createElement("style");r.id="multiplayer_css",r.append("".concat(e.default)),document.head.appendChild(r)})),function(t,n){e.getPlayer(t).on("loadeddata",(function(){var u;(null===(u=i.getRenditions(t))||void 0===u?void 0:u.length)>0&&r.addSettingsButtonV2(t,n),null!=n&&n.disableCaptions&&e.removeCaptions(t)}))}(t,n),function(i){var t=e.getPlayer(i);t.controls(!1),r.addDBClickFullScreen(i)}(t)};
@@ -1 +1 @@
1
- "use strict";var t=require("./generic-cc7d7e07.js");exports.getVideoDuration=function(e){var n=t.getPlayer(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")},exports.onTimeUpdate=function(e,n){var a=t.getPlayer(e);a?a.on("timeupdate",(function(){return n(a.currentTime())})):n("Cannot find player with id: '".concat(e,"'"))},exports.onVideoEnded=function(e,n){var a=t.getPlayer(e);a?a.on("ended",(function(){return n(!0)})):n("Cannot find player with id: '".concat(e,"'"))},exports.seekToTimeStamp=function(e,n,a){var r=t.getPlayer(e);r?n>=0&&n<=r.duration()?(a({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),r.currentTime(n)):a({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):a("Cannot find player with id: '".concat(e,"'"))},exports.setPlaybackSpeed=function(e,n){var a=t.getPlayer(e);if(!a)return"Cannot find player with id: '".concat(e,"'");try{return a.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(t){return"Error: ".concat(t)}};
1
+ "use strict";var t=require("./generic-57501058.js");exports.getVideoDuration=function(e){var n=t.getPlayer(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")},exports.onTimeUpdate=function(e,n){var a=t.getPlayer(e);a?a.on("timeupdate",(function(){return n(a.currentTime())})):n("Cannot find player with id: '".concat(e,"'"))},exports.onVideoEnded=function(e,n){var a=t.getPlayer(e);a?a.on("ended",(function(){return n(!0)})):n("Cannot find player with id: '".concat(e,"'"))},exports.seekToTimeStamp=function(e,n,a){var r=t.getPlayer(e);r?n>=0&&n<=r.duration()?(a({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),r.currentTime(n)):a({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):a("Cannot find player with id: '".concat(e,"'"))},exports.setPlaybackSpeed=function(e,n){var a=t.getPlayer(e);if(!a)return"Cannot find player with id: '".concat(e,"'");try{return a.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(t){return"Error: ".concat(t)}};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),r=require("video.js"),a=require("./icons-515b2da0.js"),l=require("./generic-57501058.js"),d=require("./autoNextVideo-ff42f1a0.js"),s=require("./localisation-56e0a999.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("./util-26ad6aca.js");var u=r.getComponent("Component"),v=function(){n(h,u);var v,m,p=(v=h,m=c(),function(){var e,t=i(v);if(m){var n=i(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o(this,e)});function h(t){var n,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(i=p.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.videos=r.related.content,i.cb=(null==r||null===(n=r.related)||void 0===n?void 0:n.cb)||null,i.autoNext=(null==r||null===(o=r.related)||void 0===o?void 0:o.autoNext)||!1,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&(l.setVideoIdx(0),d.autoPlayNext({playerId:i.playerId,content:i.videos,cb:i.cb})),i}return t(h,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=r.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(a.EpisodesSvg())});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./videoSelector-fcdf11eb.js")})).then((function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),n=r.dom.createEl("div",{className:"video-selection-container hidden"});r.dom.$(".video-selector-icon",this.el()).onclick=function(){var o;null!==(o=n.classList)&&void 0!==o&&o.contains("hidden")?(l.closeOpenDrawers(),n.classList.remove("hidden"),t.classList.add("open"),n.style.right="0px",l.setUpdatedElHeight(e.playerId,n)):(n.classList.add("hidden"),t.classList.remove("open"),n.style.right="-350px")};var o=document.getElementById(this.playerId);if(o){var i=window.getComputedStyle(o,null).getPropertyValue("height");n.style.height="".concat(i),r.dom.appendContent(t,n),o.style.overflow="hidden",this.addFunctionality(n),l.detectOrientationChange(this.playerId,n)}}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),o=r.dom.createEl("div",{className:"video-selector-head"}),i=r.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(a.crossIconSvg())});i.onclick=function(){e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px"};for(var d=r.dom.createEl("div",{className:"video-selector-title",innerHTML:s.getLocalisation("relatedVideoTitle")||"Recommended"}),c=r.dom.createEl("div",{className:"video-selector-content"}),u=r.dom.createEl("div",{className:"video-container"}),v=function(e){var n,o,i,a,d,s=r.dom.createEl("div",{className:"video -".concat(e)}),v=r.dom.createEl("div",{className:"recommended -".concat(e)});v.setAttribute("video-idx",e),v.onclick=function(){l.setVideoIdx(e+1);for(var n=r.dom.$$(".recommended"),o=0;o<n.length;o++)n[o].style.border="none";l.highlightVideo(e),l.load(t.playerId,t.videos[e].id).then((function(e){t.cb&&t.cb(e)})).catch((function(e){t.cb&&t.cb(e)}))};var m=document.createElement("img");m.className="related-thumbnail-image",m.src="".concat((null==t||null===(n=t.videos)||void 0===n||null===(o=n[e])||void 0===o?void 0:o.img)||(null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.fallbackImage)),m.alt="No Thumbnail Available",v.append(m);var p=r.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(d=t.videos[e])||void 0===d?void 0:d.title)||"")});r.dom.appendContent(s,v),r.dom.appendContent(s,p),r.dom.appendContent(u,s),r.dom.appendContent(c,u)},m=0;m<this.videos.length;m++)v(m);r.dom.appendContent(o,i),r.dom.appendContent(o,d),r.dom.appendContent(e,o),r.dom.appendContent(e,c),l.handleDrawerResizing(this.playerId,e)}}]),h}();exports.default=v;
@@ -1 +1 @@
1
- import{g as n,q as t,V as i,c as o,W as e,S as a,X as c}from"./generic-ff184c2f.js";import{a as u}from"./util-ad1895db.js";var s,r=0,f=0,l=function(l){clearTimeout(r);var d=null==l?void 0:l.content;s=null==l?void 0:l.cb;var h=l.playerId;u(h,(function(){var u=n(h);0!==(null==u?void 0:u.currentTime())&&((f=a())>d.length-1||(c(f+1),t(h,d[f].id).then((function(n){i(f),o(n.response),f++,v(n)})).catch((function(n){v(n),i(f),f++,r=setTimeout((function(){e(h)&&m(f,h,d)}),5e3)}))))}))},m=function n(o,e,a,u){f=o,o>a.length-1||(c(f+1),t(e,a[o].id).then((function(n){i(f),f++,v(n)})).catch((function(t){v(t),setTimeout((function(){i(f),f++,n(f,e,a)}),5e3)})))},v=function(n){s&&s(n)};export{l as a,m as s};
1
+ import{g as n,q as t,U as i,c as o,V as e,R as a,W as c}from"./generic-444bf169.js";import{a as u}from"./util-b468f9d5.js";var s,r=0,f=0,l=function(l){clearTimeout(r);var d=null==l?void 0:l.content;s=null==l?void 0:l.cb;var h=l.playerId;u(h,(function(){var u=n(h);0!==(null==u?void 0:u.currentTime())&&((f=a())>d.length-1||(c(f+1),t(h,d[f].id).then((function(n){i(f),o(n.response),f++,v(n)})).catch((function(n){v(n),i(f),f++,r=setTimeout((function(){e(h)&&m(f,h,d)}),5e3)}))))}))},m=function n(o,e,a,u){f=o,o>a.length-1||(c(f+1),t(e,a[o].id).then((function(n){i(f),f++,v(n)})).catch((function(t){v(t),setTimeout((function(){i(f),f++,n(f,e,a)}),5e3)})))},v=function(n){s&&s(n)};export{l as a,m as s};
package/esm/bundle.css CHANGED
@@ -10,12 +10,6 @@
10
10
 
11
11
 
12
12
 
13
-
14
-
15
-
16
-
17
-
18
-
19
13
  .widget-selection{
20
14
  display: flex;
21
15
  align-items: center;
@@ -136,6 +130,12 @@
136
130
  .widget-selector-content #sr-widget{
137
131
  padding: 0 18px;
138
132
  }
133
+
134
+
135
+
136
+
137
+
138
+
139
139
  /* nextep */
140
140
  .next-ep-preview{
141
141
  position: absolute;
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as r,e as c}from"./icons-3e9a1686.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import{x as l,w as s,Z as d,_ as p,$ as m,a0 as u,v}from"./generic-444bf169.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var h=i.getComponent("Component"),y=function(){n(b,h);var y,g,C=(y=b,g=f(),function(){var e,t=o(y);if(g){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function b(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),(i=C.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important"),i}return t(b,[{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"caption-selection vjs-control vjs-button"});e.style.position="unset";var t=i.dom.createEl("div",{className:"caption-selector-icon",innerHTML:"".concat(r())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./caption-settings-cb47408f.js").then((function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=l(this.playerId);null==t||t.map((function(t){return s(e.playerId,t.id)}));var n=this.el(),a=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var t;null!==(t=a.classList)&&void 0!==t&&t.contains("hidden")?(d(),a.classList.remove("hidden"),n.classList.add("open"),a.style.right="0px",p(e.playerId,a)):(a.classList.add("hidden"),n.classList.remove("open"),a.style.right="-350px")};var o=document.getElementById(this.playerId);if(o){var r=window.getComputedStyle(o,null).getPropertyValue("height");a.style.height="".concat(r),i.dom.appendContent(n,a),o.style.overflow="hidden",this.addFunctionality(a),m(this.playerId,a)}}},{key:"addFunctionality",value:function(e){var t=this.el(),n=i.dom.createEl("div",{className:"caption-selector-head"}),a=i.dom.createEl("div",{className:"caption-selector-cross-icon",innerHTML:"".concat(c())});a.onclick=function(){e.classList.add("hidden"),t.classList.remove("open"),e.style.right="-350px"};var o=i.dom.createEl("div",{className:"caption-selector-title",innerHTML:"Captions"}),r=i.dom.createEl("div",{className:"caption-selector-content"}),l=i.dom.createEl("div",{className:"caption-container"}),s=this.createLanguageContanier();i.dom.appendContent(l,s),i.dom.appendContent(n,a),i.dom.appendContent(n,o),i.dom.appendContent(e,n),i.dom.appendContent(e,r),i.dom.appendContent(r,l),u(this.playerId,e)}},{key:"createLanguageContanier",value:function(){var e=this,t=i.dom.createEl("div",{className:"caption-language-container"}),n=i.dom.createEl("div",{className:"caption-language-container-title",innerHTML:"Language"});i.dom.appendContent(t,n);var a=document.createElement("label");a.setAttribute("for","radio-off"),a.className="caption-language-holder";var o=document.createElement("div");o.className="caption",o.innerHTML="Off";var r=i.dom.createEl("input",{className:"radio - off",id:"radio-off",name:"language-radio",checked:"true"});r.setAttribute("type","radio"),r.onchange=function(t){var n,a,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important")),l(e.playerId).map((function(t){return s(e.playerId,t.id)}))},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var c=l(this.playerId),d=function(n){var a,o=document.createElement("label");o.className="caption-language-holder",o.setAttribute("for","language-radio-".concat(n));var r=document.createElement("div");r.className="caption - ".concat(n),r.textContent=null==c||null===(a=c[n])||void 0===a?void 0:a.label;var l=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});l.onchange=function(t){v(e.playerId,c[n].id)},l.setAttribute("type","radio"),i.dom.appendContent(o,l),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},p=0;p<c.length;p++)d(p);return t}},{key:"createFontSizeContainer",value:function(){var e=i.dom.createEl("div",{className:"caption-font-container"}),t=i.dom.createEl("div",{className:"caption-font-container-title",innerHTML:"Font Size"});i.dom.appendContent(e,t);for(var n=[{size:14},{size:18},{size:24}],a=0;a<n.length;a++){var o,r=document.createElement("label");r.className="caption-font-holder",r.setAttribute("for","font".concat(a));var c=document.createElement("div");c.className="fontsize - ".concat(a),c.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var l=i.dom.createEl("input",{className:"radio - ".concat(a),id:"font".concat(a),name:"font-size-radio",size:"".concat(n[a].size),checked:"".concat(a==n.length-1)});l.setAttribute("type","radio"),l.onchange=function(e){var t=e.target.size;if(document.getElementById("caption-size")){document.getElementById("caption-size").textContent=".vjs-text-track-cue{font-size:".concat(t,"px !important}")}else{var n=document.createElement("style");n.textContent=".vjs-text-track-cue{font-size:".concat(t,"px !important}"),n.id="caption-size",document.head.append(n)}},i.dom.appendContent(r,l),i.dom.appendContent(r,c),i.dom.appendContent(e,r)}return e}}]),b}();export{y as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{g as a,Q as s,r as c,m as d}from"./generic-ff184c2f.js";import{g as u}from"./renditions-090502aa.js";import{g as m}from"./localisation-0bf399a1.js";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){var t=h();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var v=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=m("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},g=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var c=s(l);return o.append(c),r}return n(a,[{key:"handleClick",value:function(){c(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var c=s(l);return o.append(c),r}return n(a,[{key:"handleClick",value:function(){d(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},C=function(e,t){import("./multicam-e5b32469.js").then((function(n){var r=n.default,o=t.streams,l=a(e);i.registerComponent("multicamModule",r),l.getChild("controlBar").addChild("multicamModule",{playerId:e,streams:o,config:t},l.controlBar.children().length)}));var n=document.querySelector(".vjs-control-bar");n&&"live"==(null==t?void 0:t.skin)&&(n.style.background="transparent")},B=function(e,t,n){import("./resolution-ba31e85b.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a(e),s=u(e);(null==s?void 0:s.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:s},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-b2820628.js").then((function(r){var o=r.default,l=a(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},j=function(e,t){import("./mwebPotraitTray-4a697d2a.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("mwebPotraitTray",r),o.getChild("controlBar").addChild("mwebPotraitTray",{playerId:e,config:t},0)}))},k=function(e,t,n){import("./series-e68a0fbd.js").then((function(r){var o=r.seriesModule,l=a(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var s=document.querySelectorAll(".season-title-sdk"),c=function(e){s[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},d=0;d<s.length;d++)c(d)}))},E=function(e,t){import("./videoSelector-d7110cde.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},O=function(e,t){import("./caption-settings-7336f73a.js").then((function(n){var r,o,l,s,c=n.default,d=a(e);i.registerComponent("captionSelector",c),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),d&&d.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},w=function(e,t){import("./settings-icon-c4fd8e69.js").then((function(n){var r,o,l,s,c=n.default,d=a(e);i.registerComponent("settingsSelector",c),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),d&&d.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},S=function(e,t){import("./playlist-688d8355.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},I=function(t,n){import("./series-v2-2243c975.js").then((function(r){var o=r.default,l=a(t);i.registerComponent("seriesV2",o),l.getChild("controlBar").addChild("seriesV2",function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({playerId:t},n),l.controlBar.children().length-3)}))},M=function(e,t){import("./multicamv2-5e33b343.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},P=function(e,t){var n=a(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},T=function(e){var t=a(e).el(),n=0,r=a(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o};export{C as a,B as b,j as c,v as d,k as e,b as f,y as g,g as h,w as i,O as j,P as k,E as l,M as m,S as n,I as o,T as p};
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{g as a,P as s,r as c,m as d}from"./generic-444bf169.js";import{g as u}from"./renditions-11d6f06f.js";import{g as m}from"./localisation-0bf399a1.js";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){var t=h();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var v=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=m("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},g=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var c=s(l);return o.append(c),r}return n(a,[{key:"handleClick",value:function(){c(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var c=s(l);return o.append(c),r}return n(a,[{key:"handleClick",value:function(){d(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},C=function(e,t){import("./multicam-5e992904.js").then((function(n){var r=n.default,o=t.streams,l=a(e);i.registerComponent("multicamModule",r),l.getChild("controlBar").addChild("multicamModule",{playerId:e,streams:o,config:t},l.controlBar.children().length)}));var n=document.querySelector(".vjs-control-bar");n&&"live"==(null==t?void 0:t.skin)&&(n.style.background="transparent")},B=function(e,t,n){import("./resolution-4c376392.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a(e),s=u(e);(null==s?void 0:s.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:s},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-5a62159a.js").then((function(r){var o=r.default,l=a(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},j=function(e,t){import("./mwebPotraitTray-ff38b447.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("mwebPotraitTray",r),o.getChild("controlBar").addChild("mwebPotraitTray",{playerId:e,config:t},0)}))},k=function(e,t,n){import("./series-4d4d1421.js").then((function(r){var o=r.seriesModule,l=a(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var s=document.querySelectorAll(".season-title-sdk"),c=function(e){s[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},d=0;d<s.length;d++)c(d)}))},E=function(e,t){import("./videoSelector-0d8b0001.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},O=function(e,t){import("./caption-settings-835fcf0b.js").then((function(n){var r,o,l,s,c=n.default,d=a(e);i.registerComponent("captionSelector",c),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),d&&d.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},w=function(e,t){import("./settings-icon-81bd8bec.js").then((function(n){var r,o,l,s,c=n.default,d=a(e);i.registerComponent("settingsSelector",c),null===(r=document)||void 0===r||null===(o=r.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),d&&d.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},S=function(e,t){import("./playlist-b612533a.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},I=function(t,n){import("./series-v2-c7c9616a.js").then((function(r){var o=r.default,l=a(t);i.registerComponent("seriesV2",o),l.getChild("controlBar").addChild("seriesV2",function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({playerId:t},n),l.controlBar.children().length-3)}))},M=function(e,t){import("./multicamv2-2640b4f1.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},P=function(e,t){var n=a(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},T=function(e){var t=a(e).el(),n=0,r=a(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o};export{C as a,B as b,j as c,v as d,k as e,b as f,y as g,g as h,w as i,O as j,P as k,E as l,M as m,S as n,I as o,T as p};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import r from"js-cookie";import a from"ua-parser-js";import l from"@babel/runtime/helpers/toConsumableArray";var d={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel"};function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function s(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)}function c(e,t){u("event",e,t)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?v(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var f={name:"@viewlift/player8",version:"1.0.110",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.5.0",axios:"^1.2.3","js-cookie":"^3.0.5","video.js":"^8.21.1","videojs-contrib-ads":"^7.5.2","videojs-contrib-eme":"^5.5.1","videojs-contrib-quality-menu":"^1.0.3",ima:"npm:videojs-ima@2.2.0"}};window.vl_player_version=f.version;var p=function(e,t){var n,i,r,a;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:F(),params:m({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":f.version},withCredentials:!0})},w=function(e,t){var n,i,r,a;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:S()+d.getLinearChannelDetails,params:m(m(m(m(m({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t}})},g=function(e,t){var n,i,r=JSON.parse(atob(t.split(".")[1])),a=(null==r?void 0:r.site)||null;return r&&r.countryCode,null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise((function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})})):o({url:S()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:t}})},I=function(){var e=t(n.mark((function e(t,i){var r,a;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:if(r=e.sent,"v1"!=i){e.next=8;break}return a={siteOwner:null==t?void 0:t.siteOwner,userId:null==t?void 0:t.userId,videoId:null==t?void 0:t.videoId,watchedPercentage:null==t?void 0:t.watchedPercentage,watchedTime:null==t?void 0:t.watchedTime},e.abrupt("return",o({url:O(),method:"POST",headers:{Authorization:r,"x-api-key":t.xApiKey},params:{version:"v2"},data:JSON.stringify(a),withCredentials:!0}));case 8:if("v2"!=i){e.next=10;break}return e.abrupt("return",o({url:D(),method:"POST",headers:{Authorization:r},data:m({},t),params:m({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),E=function(e,t){var n,i,r=(null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(t.split(".")[1])),u=(null==d?void 0:d.site)||null;return o({method:"GET",url:b(e),params:{site:u},headers:{Authorization:t,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey},timeout:15e3})}if("v2"==r){var s,c;JSON.parse(atob(t.split(".")[1]));var v=window.contentType;return o({method:"GET",url:_(e,v),headers:{Authorization:t,"x-api-key":null===(s=window)||void 0===s||null===(c=s.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},h=function(e){var t,n;if("v1"==((null===(t=window)||void 0===t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1"))return o({method:"GET",url:y(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token},timeout:15e3});var i=e.videoId;return o({method:"GET",url:T(i),headers:{Authorization:e.token},timeout:15e3})},T=function(e){return S()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV2,"/").concat(e)},y=function(){return S()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV1)},b=function(e){return S()+"".concat(null==d?void 0:d.getVideoInfoV1,"/").concat(e)},_=function(e,t){return S()+"".concat(null==d?void 0:d.getVideoInfoV2,"/").concat(t,"/").concat(e)},O=function(){return S()+"".concat(null==d?void 0:d.saveWatchHistoryV1)},D=function(){return S()+"".concat(null==d?void 0:d.saveWatchHistoryV2)},F=function(){var e,t,n,i,o=S()+"".concat(null==d?void 0:d.getVideoDetails);return null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.overrideEntitlementBaseUrl?(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":o},S=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==d?void 0:d.apiBaseUrl)},P=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},A=null;function L(){return{set:function(e){e&&(A=e)},get:function(){return A}}}var R,V,C,W,N,k,B=function(){var e=t(n.mark((function e(){var t,i,r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=L().get(),i=S(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),x=null,j=function(){var e=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!P(t)){e.next=6;break}return x||(x=B().then((function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&L().set(r),o||t})).catch((function(e){return console.error("Error fetching refresh token",e),t})).finally((function(){x=null}))),e.abrupt("return",x);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t},U=function(e,t,n){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:t},withCredentials:!0})},H=function(e){V=e},z=function(){return V},G=function(e){R=e},Y=function(){return R},q=function(){return C},J=function(e){C=e},K=function(e){N=e},X=function(){return N},Q=function(e){W=new Map,e.map((function(e,t){W.set(e.id,t)}))},Z=function(e){if(W){var t=W.get(e);J(t+1)}},$=(k=0,{set:function(e){e>=0&&(k=e)},get:function(){return k}});function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function te(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ee(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ee(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ne=function(){var e,t,n,i,o,r,a,l=z();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==l||null===(o=l.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)};function ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function oe(){var e=window.sessionStorage.getItem("uid");return e||(e=ie(),window.sessionStorage.setItem("uid",e),e)}function re(){return ae.apply(this,arguments)}function ae(){return(ae=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.initialise=function(e){window.sid=ie(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",te({pfm:window.platform,uid:oe(),vid:ne(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",te({pfm:window.platform,uid:oe(),vid:ne(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))c("BUFFERING",te({pfm:window.platform,uid:oe(),vid:ne(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",te({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:ne()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,a;c("AD_REQUEST",te({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:ne(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",te({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:ne()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(le(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var le=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var i,r,a,l,d,u,s,c,v,m,f;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=te,e.t1=te,e.t2=te({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=oe(),e.t5=ne(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,re();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(l=window)||void 0===l||null===(d=l.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),m=[e.t31],e.next=37,j();case 37:f=e.sent,o({url:(null===(s=window)||void 0===s||null===(c=s.customData)||void 0===c||null===(v=c.beacon)||void 0===v?void 0:v.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:f},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var de=function(e,t){if(import("./error-2395864b.js").then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},ue=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var se=function(){var e,t;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(t=e.userAgentData)||void 0===t?void 0:t.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},ce=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)};function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function me(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ve(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ve(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window._deviceInfo=a(navigator.userAgent);var fe=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},pe=function(e){var t=we(e,"video.tags",[]),n=we(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},we=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},ge=function(){var e,t,n,i,o,a,l,d,u,s,c,v,m,f,p,w,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",I=arguments.length>1?arguments[1]:void 0,E=arguments.length>2?arguments[2]:void 0,h=(null==E?void 0:E.contentType)||"video",T=null==E||null===(e=E[h])||void 0===e?void 0:e.metadata,y=Qe(I);if(!g.includes("VIEWLIFT_"))return g;var b=window.getComputedStyle(document.getElementById(I),null),_=Math.trunc(b.getPropertyValue("height").slice(0,-2)),O=Math.trunc(b.getPropertyValue("width").slice(0,-2)),D="linearchannel"===h?null==E||null===(t=E.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(i=n.find((function(e){return(null==e?void 0:e.id)===(null==E?void 0:E.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:we(E,"video.gist.id",""),F=me(me({},he(T)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE:fe(O,_),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(a=window)||void 0===a?void 0:a.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:we(E,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:we(E,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:we(E,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==y||null===(l=y.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==y||null===(d=y.options_)||void 0===d?void 0:d.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:pe(E),VIEWLIFT_MEDIA_ID:D,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(we(E,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:D,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+we(E,"video.gist.permalink","")),VIEWLIFT_CONSENT:r.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:we(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(c=s.site)||void 0===c?void 0:c.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:we(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(f=m.site)||void 0===f?void 0:f.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*we(E,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:we(E,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:D,VIEWLIFT_CONTENT_TITLE:we(E,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:we(E,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:we(E,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:Ee(),VIEWLIFT_SEASON_NUMBER:Ie(),VIEWLIFT_CONTENT_TAGS:pe(E)},null===(p=window)||void 0===p||null===(w=p.customData)||void 0===w?void 0:w.macros);for(var S in F){var P=new RegExp(S,"g");g=g.replace(P,F[S])}return g},Ie=function(){var e=$.get();return e>=0?e+1:1},Ee=function(){var e,t,n,i=Y(),o=z(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=$.get(),l=null==i||null===(t=i[a])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1},he=function(e){var t,n,i,o,r,a,l={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){d.set(e.name,e.value)})));var u=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return u||s?(ce()?u?l=me(me({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(l=me(me({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?l=me(me({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(l=me(me({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?l=me(me({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}):s&&(l=me(me({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||""})),l=ce()?me(me({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):me(me({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=me(me({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}),l=ce()?me(me({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):me(me({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),l},Te=function(e,t){var n,i,o,r,a,l,d,u,s,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",w=null==e||null===(n=e[p])||void 0===n?void 0:n.drmEnabled,g=null==e||null===(i=e[p])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,I=null==e||null===(r=e[p])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,E=(null==e||null===(l=e[p])||void 0===l||null===(d=l.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var h=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=I&&I.hls)return be(I);if(w){var T=_e(g,t);return T.src=ge(T.src,t,e),T}if("Safari"!==se()&&h)return ye(g);if(E){var y=be(g);return y.src=ge(y.src,t,e),y}if(null!=g&&g.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(g);return b.src=ge(b.src,t,e),b}return null},ye=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},be=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},_e=function(e,t){var n=e.fairPlay,o=e.widevine,r=e.playReady,a=se();if(Qe(t),"Safari"===a){var l=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};console.log("🔐 Requesting FairPlay Certificate...",o),i.xhr(o,(function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))}))},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,o,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,(function(e,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return Oe(t),l}var d={src:o.url,type:"application/dash+xml"};return Oe(t),d.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},d};var Oe=function(e){var t=Qe(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==se()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},De=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},Fe=function(e,t){var n,i,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.style)||void 0===o||o.setProperty("display","flex"));for(var r=Qe(e).textTracks(),a=0;a<r.length;a++){var l=r[a];"subtitles"!==l.kind&&"captions"!==l.kind||l.id!=t||(l.mode="showing")}},Se=function(e,t){for(var n=Qe(e).textTracks(),i=0;i<n.length;i++){var o=n[i];"subtitles"!==o.kind&&"captions"!==o.kind||o.id!==t||(o.mode="hidden")}},Pe=function(e){var t,n=Qe(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},Ae=function(e){var t=Qe(e);t.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,t.removeRemoteTextTrack(e)}))},Le=function(e,t){var n=Qe(e);n.remoteTextTracks().tracks_.map((function(e){n.removeRemoteTextTrack(e)})),t.map((function(e){n.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},Re=!1,Ve=function(e,t,n){var i=ge(t,e,n),o=Qe(e);t&&window.google&&(o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,r=Qe(e);if(null!==r.el_){Re=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),Re&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var l=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&l.hasAttribute("controls")&&l.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),r.one(d,(function(){u&&r.ima.initializeAdDisplayContainer()}));var s=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;r.one("ads-ad-started",(function(){s&&s({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){s&&s({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){s&&s({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i))},Ce=function(e){var t=(new DOMParser).parseFromString(e,"text/html");return null==t?void 0:t.querySelector("body")},We=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");return null==t?void 0:t.querySelector("svg")},Ne=function(e){return We(e)},ke=function(e){l(document.querySelectorAll("[video-idx]")).map((function(t){var n=t.getAttribute("video-idx");t.style.border=n==e?"2px solid white":"none"}))},Be=function(){var e=l(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var t,n;null==e||null===(t=e.childNodes)||void 0===t||null===(n=t[0])||void 0===n||n.click()}))},xe=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},je="",Me=function(e,t){var n,i=function(){return function(e,t){var n=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",i=document.getElementById(e);if(i&&je!==n){var o=window.getComputedStyle(i,null).getPropertyValue("height");t&&(t.style.height="".concat(o)),je=n}}(e,t)};window._orientationChangeHandler=i;window.addEventListener("resize",(function(){clearTimeout(n),n=setTimeout((function(){i()}),100)}))},Ue=function(e,t){var n,i=Qe(e),o=Qe(e).el(),r=new ResizeObserver((function(){var i;null!==(i=t.classList)&&void 0!==i&&i.contains("hidden")||(n&&clearTimeout(n),n=setTimeout((function(){He(e,t)}),200))}));r.observe(o),i.on("dispose",(function(){r.disconnect()})),i.on("fullscreenchange",(function(){setTimeout((function(){He(e,t)}),50)}))},He=function(e,t){var n;if(t){var i=document.getElementById(e),o=null===(n=window.getComputedStyle(i,null))||void 0===n?void 0:n.height;t.style.height!==o&&(t.style.height="".concat(o))}};function ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Ge=function(e){i(e).play()},Ye=function(e){i(e).pause()},qe=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},Je=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},Ke=function(e){return!!i.getPlayer("".concat(e))},Xe=function(e){return i(e).paused()},Qe=function(e){return!!i.getPlayer("".concat(e))&&i.getPlayer("".concat(e))},Ze=function(){var e=t(n.mark((function e(t,i){var o,r,a,l=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=l.length>2&&void 0!==l[2]&&l[2],e.next=3,j();case 3:return r=e.sent,a=Qe(t),e.abrupt("return",new Promise((function(e,n){w(i,r).then((function(n){var r=null==n?void 0:n.data;window.sid=ie(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=Te(r,t);H(r),l&&o?(it(t,l),a.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).catch((function(e){n({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),$e=function(){var e=t(n.mark((function e(t,i,o){var r,a,l,d,u,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return d=e.sent,(Y()||null)&&Z(i),u=0,s=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(a=window)&&void 0!==a&&null!==(l=a.watchHistory)&&void 0!==l&&l.enable&&E(i,d).then((function(e){var t,n,i,o,r,a;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,s=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null})).catch((function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,n){p(i,d).then((function(i){var o,r,a,l,d,c,v,m,f,p,w=null==i?void 0:i.data,g=(null==w||null===(o=w.video)||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;H(i.data);var I=(null==w||null===(a=w.ads)||void 0===a||null===(l=a.preRoll)||void 0===l||null===(d=l.adTags)||void 0===d||null===(c=d.web)||void 0===c?void 0:c.active)&&(null==w||null===(v=w.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(f=m.adTags)||void 0===f||null===(p=f.web)||void 0===p?void 0:p.url);I&&Ve(t,I,w);var E=Te(w,t);if(E){var h,T,y,b,_,O,D,F,S,P,A,L,R,V,C=(null==w||null===(h=w.video)||void 0===h||null===(T=h.gist)||void 0===T?void 0:T.videoImageUrl)||(null==w||null===(y=w.video)||void 0===y||null===(b=y.gist)||void 0===b||null===(_=b.imageGist)||void 0===_?void 0:_.r16x9),W=Qe(t);if(W.poster(C),it(t,E),W.on("loadstart",(function(){g&&e({status:!0,msg:"Video Loaded",response:w})})),W.on("loadeddata",(function(){ue(),e({status:!0,msg:"Video Loaded",response:w})})),W.one("play",(function(){u&&s<95&&setTimeout((function(){W.currentTime(u)}),0)})),W.one("error",(function(){var e;n({status:!1,msg:(null==W||null===(e=W.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==w||null===(O=w.video)||void 0===O||null===(D=O.contentDetails)||void 0===D||null===(F=D.closedCaptions)||void 0===F?void 0:F.length)>0||(null==w||null===(S=w.video)||void 0===S||null===(P=S.closedCaptions)||void 0===P?void 0:P.length)>0)A=((null==w||null===(L=w.video)||void 0===L||null===(R=L.contentDetails)||void 0===R?void 0:R.closedCaptions)||(null==w||null===(V=w.video)||void 0===V?void 0:V.closedCaptions)).filter((function(e){return"VTT"===e.format})),Le(t,A);else Ae(t)}else de(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){ot(e,t,n,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}(),et=function(e,t,n){var i=Qe(e);return i.src(t),new Promise((function(e,t){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){t("FAILED: Took too long to load")}),n)}))}))},tt=function(e){var t=Qe(e);if(nt(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},nt=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},it=function(e,t){var n=Qe(e);n&&n.src(t)},ot=function(t,n,i,o){var r,a,l,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ke(n)&&de(n,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ze(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ze(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))},rt=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{Me as $,s as A,p as B,E as C,ot as D,M as E,L as F,P as G,xe as H,Ve as I,De as J,Le as K,g as L,w as M,$ as N,G as O,We as P,Ne as Q,q as R,Y as S,ce as T,ke as U,Xe as V,J as W,Ae as X,Ce as Y,Be as Z,He as _,z as a,Ue as a0,Q as a1,Z as a2,Te as b,H as c,se as d,ue as e,X as f,Qe as g,de as h,h as i,K as j,et as k,it as l,qe as m,Ye as n,Ke as o,Ge as p,$e as q,Je as r,I as s,Ze as t,tt as u,Fe as v,Se as w,Pe as x,rt as y,U as z};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import{d as e,g as n,s as t,a as o,b as i,l,c as r,e as a,h as s,f as u,i as d,j as c,k as v,m,p,n as f,r as w,o as h,q as y,t as g,u as b,v as k,w as j,x as I,y as O,z as T,A as P,B as S,C,D as x,E as D,F as R,G as A,H as E,I as B,J as V,K as H,L,M as _,N as M,O as N,P as U}from"./generic-ff184c2f.js";import F from"@babel/runtime/helpers/asyncToGenerator";import q from"@babel/runtime/helpers/defineProperty";import z from"@babel/runtime/regenerator";import J from"video.js";import G from"@babel/runtime/helpers/typeof";import{o as K,g as X,a as W,s as Y,b as Q}from"./util-ad1895db.js";import{g as Z}from"./renditions-090502aa.js";import{playSelectedResolution as $}from"./resolution-ba31e85b.js";import{s as ee}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 ne,te,oe=function(e){return new Promise((function(n,t){if(ie(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)}}))},ie=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},le=function(){var t=F(z.mark((function t(o){var i,l,r,a;return z.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=n(null==o?void 0:o.playerId),null!=o&&null!==(i=o.series)&&void 0!==i&&i.enable||null==o||!o.chromecastReceiverId){t.next=20;break}return t.next=4,import("@silvermine/videojs-chromecast");case 4:return a=t.sent,t.prev=5,t.next=8,oe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:t.next=13;break;case 10:t.prev=10,t.t0=t.catch(5),console.log("Error",t.t0);case 13:return t.prev=13,a.default(J),t.finish(13);case 16:null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"default"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"default"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},t.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=o&&o.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"default"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return t.stop()}}),t,null,[[5,10,13,16]])})));return function(e){return t.apply(this,arguments)}}(),re=function(e,t){var o=n(e);o&&t&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=J.dom.getPointerPosition(a,n).x;J.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=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"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function ae(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 se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ae(Object(t),!0).forEach((function(n){q(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ae(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ue=[],de=0,ce=null;function ve(e,n,o){var i,l,r,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];te=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration()),m=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.xapiKey,p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,w=Math.floor(e.currentTime()),h=u?100:Math.floor(c/v*100),y={};f?pe(y={completed:u,watchedTime:w,watchedPercentage:h},d,n.siteOwner):("v1"==te?y={videoId:ne,watchedTime:w,watchedPercentage:h,siteOwner:n.siteOwner,userId:n.userId,xApiKey:m}:"v2"==te&&(y=se(se({videoId:ne,watchedTime:w,watchedPercentage:h,doneWatching:u,profileId:d},ce&&{seriesId:ce}),p&&{originalObjectId:p})),t(y,te).then((function(e){})).catch((function(e){}))),de=c+o}function me(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function pe(e,n,t){var i=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),l=me(i),r=(new Date).getTime(),a=o(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return se(se({},e),{},q({},n,s[n]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ne}));d<0?l.push(se(se({content:u},e),{},{addedDate:r,updateDate:r})):l[d]=se(se(se({},l[d]),e),{},{updateDate:r}),localStorage.setItem("".concat(i),JSON.stringify(l))}var fe=function(e,t,o){var i=n(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var l=parseFloat(t)/100;i.volume(l),o&&o({status:!0,msg:"Volume set to ".concat(t,"%")})}else o&&o({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else o({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},we=function(e){var t=n(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},he=!1,ye=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!he){var a=ge(e,"videoAssets","secondaryVideoAssets"),s=i(a,n);return s&&l(n,s),he=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function ge(e,n,t){if(Array.isArray(e))return e.map((function(e){return ge(e,n,t)}));if(null!==e&&"object"===G(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]=ge(e[i],n,t)})),o}return e}function be(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 ke(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?be(Object(t),!0).forEach((function(n){q(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):be(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var je=function(e,t,i,l){var d,c,v=l.res,m=l.sres,p=n(e),f=(null==v?void 0:v.contentType)||"video",w=(null==v||null===(d=v[f])||void 0===d||null===(c=d.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;r(v),p&&(p.on("loadstart",(function(){w&&i.resolve({status:!0,msg:"Video Loaded",response:v})})),p.on("loadeddata",(function(){var l,r;(null==p||!p.muted())&&fe(e,sessionStorage.getItem("volume")||"100");var s=o();if(a(),i.resolve(ke({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:v}:{response:v})),null!=t&&t.watchHistory&&null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.enable&&(!t.isAnonymousUser||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var u,d,c=ke(ke({},t),v);!function(e,t,o){var i,l,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(ce=null==t||null===(l=t.series)||void 0===l?void 0:l.id),ue=[],de=0,ne=o;var a=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=n(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ue.includes(de)||(e==de?(ue.push(e),ve(s,t,a)):e>de&&(de=e+a))})),s.one("ended",(function(){ve(s,t,a,!0)})))}(e,c,null==s||null===(u=s.video)||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.id)}})),p.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];p.trigger("subtitlechanged",n)})),p.on("subtitlechanged",(function(e,n){var t,o,i,l,r,a,s,u,d,c,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===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,w=p.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(f)}})),p.on("loadedmetadata",(function(){window.endFirstFrame(p)})),p.tech_.on("retryplaylist",(function(){w&&ye(v,e)})),p.on("error",(function(){var n,t;4===p.error().code&&w?ye(v,e):(s(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:v}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,l,r=null===(n=o())||void 0===n||null===(i=n.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,a=u().get(r)||{t:0,p:0},s=a.t,d=a.p;s&&d<95&&setTimeout((function(){p.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),p.on("volumechange",(function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),p.on("chromecastDisconnected",(function(){if(w){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))},Ie=function(e,n){var t=null==n?void 0:n.skin;"live"==t?import("./skin-26b3c430.js").then((function(t){t.initialiseSkin(e,n)})):"default"==t?import("./skin-6ab207d5.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-fd6c2622.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-d3ab50f7.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-5f9fe2f6.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t&&import("./skin-87568757.js").then((function(t){t.initaliseSkin(e,n)}))},Oe=function(e,n){n.controlBar.el_.style.color=e,n.controlBar.el_.querySelector(".vjs-play-progress")&&(n.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),n.controlBar.el_.querySelector(".vjs-volume-level")&&(n.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Te,Pe=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){J.getPlugin("eme")||J.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ce=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){oe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(J)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(J)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),oe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Pe,loadEMELibrary:Se});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 De(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){q(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 Re=function(t,o,r,a){var u,d,c,v,m,p,f,w,h,y,g,b,k,j,I,T,P,S,C,x,D,R,A,E,B,V,N,U,G,K,X,W,Y,Q=o.res,Z=void 0===Q?null:Q,$=o.sres,ee=void 0===$?null:$;null===(u=window)||void 0===u||null===(d=u.cast)||void 0===d||null===(c=d.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m||m.S;var ne=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(p=Z)||void 0===p?void 0:p.contentType)||"video",oe=H(null===(f=Z)||void 0===f||null===(w=f[te])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||H(null===(y=Z)||void 0===y||null===(g=y[te])||void 0===g||null===(b=g.gist)||void 0===b||null===(k=b.imageGist)||void 0===k?void 0:k.r16x9),ie=(null===(j=Z)||void 0===j||null===(I=j[te])||void 0===I||null===(T=I.liveDetails)||void 0===T?void 0:T.isDvrEnabled)||!1,ae=(null===(P=Z)||void 0===P||null===(S=P[te])||void 0===S||null===(C=S.streamingInfo)||void 0===C?void 0:C.isLiveStream)||!1,se=(null==r?void 0:r.drmLibrary)||!1,ue=(null===(x=Z)||void 0===x||null===(D=x.ads)||void 0===D||null===(R=D.preRoll)||void 0===R||null===(A=R.adTags)||void 0===A||null===(E=A.web)||void 0===E?void 0:E.active)&&(null===(B=Z)||void 0===B||null===(V=B.ads)||void 0===V||null===(N=V.preRoll)||void 0===N||null===(U=N.adTags)||void 0===U||null===(G=U.web)||void 0===G?void 0:G.url);Z=De(De({},Z),{},{audioAssetSource:null==r?void 0:r.audioAssetSource});var de=(Y={controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:("default"==r.skin||"defaultV2"==r.skin||"live"==(null==r?void 0:r.skin))&&{inline:!1},fullscreenToggle:"default"==r.skin||"defaultV2"==r.skin,audioTrackButton:!1,pictureInPictureToggle:(r.skin,!1)},muteToggle:"multiplayer"==r.skin,liveui:ie},q(Y,"autoplay",null==r?void 0:r.autoplay),q(Y,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!ue),q(Y,"loop",(null==r?void 0:r.loop)||!1),q(Y,"audioPosterMode",null==r?void 0:r.audioPosterMode),q(Y,"html5",De(De({dash:De(De({},!J.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},null==r?void 0:r.dash),vhs:De(De({experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==r||null===(K=r.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==r?void 0:r.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==r?void 0:r.experimentalBufferBasedABR)||!1})},0==(null==r||null===(X=r.customData)||void 0===X?void 0:X.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(W=r.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),q(Y,"poster",oe),q(Y,"techOrder",ne),q(Y,"chromecast",{requestCustomDataFn:function(e){var o=n(t),i=((null==o?void 0:o.textTracksJson_)||o.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,d,c,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 w=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=w}var h=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=h;var y=null==e||null===(l=e[m])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=y;var g=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=g;var b=null==e||null===(u=e[m])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=b,p.subTitles=t,p.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Z,e,i)}}),Y);if(!J.getPlayers()[t])var ce=J(t,de,function(){var n=F(z.mark((function n(){var o,u,d,c,v,m,p,f,w,h,y,g,b,k,j,I,T,P,S,C,x,D,R,A;return z.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,le(r);case 2:if(ae&&a.resolve(De({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),window.initialise(ce),window.firstFrame(ce),"white"!==window.controlsColor&&Oe(window.controlsColor,ce),/Android/i.test(navigator.userAgent)&&(J.options.vhs.overrideNative=!0),k=null===(o=Z)||void 0===o||null===(u=o[te])||void 0===u?void 0:u.drmEnabled,j=null===(d=Z)||void 0===d||null===(c=d[te])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!k&&!se){n.next=22;break}if("Safari"!==e()){n.next=15;break}return n.next=13,Se();case 13:n.next=22;break;case 15:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){n.next=20;break}return n.next=18,Se();case 18:n.next=22;break;case 20:return n.next=22,Pe();case 22:if(null==r||!r.videoSourceUrl){n.next=25;break}return n.next=25,Pe();case 25:ie&&re(t,j),!ue||null!=r&&null!==(m=r.customData)&&void 0!==m&&m.disableAds||L(t,ue,Z),T=i(Z,t),null!=r&&r.nearestClusterUrl&&(T=_(T,r.nearestClusterUrl)),T?l(t,T):(a.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),s(t,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=Z)||void 0===p||null===(f=p[te])||void 0===f||null===(w=f.contentDetails)||void 0===w||null===(h=w.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(y=Z)||void 0===y||null===(g=y[te])||void 0===g||null===(b=g.closedCaptions)||void 0===b?void 0:b.length)>0)&&(A=(null===(S=Z)||void 0===S||null===(C=S[te])||void 0===C||null===(x=C.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(D=Z)||void 0===D||null===(R=D[te])||void 0===R?void 0:R.closedCaptions),P=A.filter((function(e){return"VTT"===e.format})),M(t,P)),null!=r&&r.disableControls?O(t):Ie(t,De(De(De({},r),de),{},{liveVideo:ae,isDvrEnabled:ie,res:Z,sres:ee})),je(t,De(De(De({},r),de),{},{liveVideo:ae}),a,{res:Z,sres:ee});case 33:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ae(){return{loadVideoInstantly:v,onTimeUpdate:K,getVideoDuration:X,onVideoEnded:W,init:function(n){return new Promise((function(t,o){var i,l,a,s,u,v,m,p,f,w,y;if(!h(null==n?void 0:n.playerId)){var g=(null==n?void 0:n.videoSourceUrl)||!1,b=null==n?void 0:n.asat,k=(null==n||null===(i=n.epg)||void 0===i?void 0:i.enable)||!1,j=null==n?void 0:n.videoId,I=(null==n||null===(l=n.series)||void 0===l?void 0:l.enable)||!1;window.videoId=j;var O=null==n?void 0:n.token;if(P(n)){if(S().set(null==n?void 0:n.refreshToken),!O||C(O))return void o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}});Te=JSON.parse(atob(O.split(".")[1]))}window.siteId=null===(a=Te)||void 0===a?void 0:a.siteId,window.siteName=null===(s=Te)||void 0===s?void 0:s.site,n.isAnonymousUser=!(null===(u=Te)||void 0===u||!u.anonymousId),n.siteOwner=(null===(v=Te)||void 0===v?void 0:v.site)||null,n.userId=(null===(m=Te)||void 0===m?void 0:m.userId)||null,window.sessionStorage.setItem("uid",null===(p=Te)||void 0===p?void 0:p.userId),window.watchHistory=n.watchHistory||null,sessionStorage.setItem("vlp_token",O);var T=null==n?void 0:n.playerId;n.chromecastReceiverId=null!=n&&n.series?null:null==n?void 0:n.chromecastReceiverId;var H=null==n?void 0:n.airplay,L=null==n?void 0:n.apiBaseUrl,_=(null==n||null===(f=n.analytics)||void 0===f?void 0:f.gaId)||null,M=null==n?void 0:n.errors;M&&(window.customErrors=M),window.customData=null==n?void 0:n.customData,ee(null==n||null===(w=n.customData)||void 0===w?void 0:w.localisation),L&&(window.playerEntitlementUrl=L),window.controlsColor=(null==n?void 0:n.controlsColor)||"white",null!=n&&n.skin&&!x(n.skin)||(n.skin="defaultV2"),Promise.resolve().then((function(){return Ce})).then((function(e){e.importIMA()})),H&&"Safari"==e()&&Promise.resolve().then((function(){return Ce})).then((function(e){e.importAirplay()})),_&&oe("https://www.googletagmanager.com/gtag/js?id=".concat(_)).then((function(){return D(_)})).catch((function(e){}));var F=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(T));if(F&&F.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g){var q="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",z={directPlaybackUrl:g,id:q};b?R(q,O).then((function(e){Re(T,{res:De(De({},e),z)},n,{resolve:t,reject:o})})).catch((function(e){A(e,T,o,q)})):Re(T,{res:z},n,{resolve:t,reject:o})}else if(I){var J,G=sessionStorage.getItem("season-idx")||0;N.set(parseInt(G));var K=null==n||null===(J=n.series)||void 0===J?void 0:J.id;E(K,O).then((function(e){var i,l,a,s=e.data,u=e.data.seasons;U(u);var v=j||(null==u||null===(i=u[0])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,n){var t=new Map;d({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),c(t)})).catch((function(e){return console.log(e)}))}(K,O),R(v,O).then((function(e){var i,l,a;window.contentType=null==e||null===(i=e.data)||void 0===i||null===(l=i.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(e.data),Re(T,{res:null==e?void 0:e.data,sres:s},n,{resolve:t,reject:o})})).catch((function(e){A(e,T,o,j)}))})).catch((function(e){A(e,T,o)}))}else if(k){var X=null==n?void 0:n.epg;B(X,O).then((function(e){var i=null==e?void 0:e.data;i.contentType="linearchannel",i.channelId=null==X?void 0:X.channelId,Re(T,{res:i},n,{resolve:t,reject:o})})).catch((function(e){A(e,T,o,j)}))}else R(j,O).then((function(e){var i,l,a,s;window.contentType=null==e||null===(i=e.data)||void 0===i||null===(l=i.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(null==e?void 0:e.data);var u,d=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(s=n.watchHistory)&&void 0!==s&&s.enable)if((null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,m,p=function(e,n,t){var o=me(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}((null===(c=n.watchHistory)||void 0===c?void 0:c.profileId)||"",j,null==n?void 0:n.siteOwner);if(p&&p.length)n.watchHistoryResumeTime=(null===(v=p[0])||void 0===v?void 0:v.watchedTime)||null,n.watchedPercentage=(null===(m=p[0])||void 0===m?void 0:m.watchedPercentage)||null;d.contentType="video",Re(T,{res:d},n,{resolve:t,reject:o})}else V(j,O).then((function(e){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==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,n.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",Re(T,{res:d},n,{resolve:t,reject:o})})).catch((function(e){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(e)),Re(T,{res:d},n,{resolve:t,reject:o})}));else Re(T,{res:d},n,{resolve:t,reject:o})})).catch((function(e){A(e,T,o,j)}))}}))},getRenditions:Z,skip:m,getPlayer:n,play:p,pause:f,detectBrowser:e,rewind:w,loadVideo:l,seekToTimeStamp:Y,isPlayerInitialised:h,load:y,authenticateLC:g,dispose:b,enableCaptions:k,disableCaptions:j,getCaptions:I,playSelectedResolution:$,getSource:i,setVolume:fe,getVolume:we,disableControls:O,setPlaybackSpeed:Q,getEntitlementData:T}}export{Ae as default};
1
+ import"video.js/dist/video-js.min.css";import"videojs-contrib-quality-menu";import{d as e,g as t,s as n,a as o,b as i,l,c as r,e as a,h as s,f as u,i as d,j as c,k as v,m,p,n as f,r as w,o as h,q as y,t as g,u as b,v as k,w as O,x as j,y as I,z as T,A as P,B as S,C,D,E as x,F as R,G as E,H as A,I as B,J as _,K as V,L as H,M as L,N as M,O as q}from"./generic-444bf169.js";import N from"@babel/runtime/helpers/asyncToGenerator";import U from"@babel/runtime/helpers/defineProperty";import F from"@babel/runtime/regenerator";import z from"video.js";import J from"@babel/runtime/helpers/typeof";import{o as G,g as K,a as X,s as Q,b as W}from"./util-b468f9d5.js";import{g as Y}from"./renditions-11d6f06f.js";import{playSelectedResolution as Z}from"./resolution-4c376392.js";import{s as $}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 ee,te,ne=function(e){return new Promise((function(t,n){if(oe(e))n("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){t()},o.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(o)}}))},oe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ie=function(){var n=N(F.mark((function n(o){var i,l,r,a;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=t(null==o?void 0:o.playerId),null!=o&&null!==(i=o.series)&&void 0!==i&&i.enable||null==o||!o.chromecastReceiverId){n.next=20;break}return n.next=4,import("@silvermine/videojs-chromecast");case 4:return a=n.sent,n.prev=5,n.next=8,ne("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:n.next=13;break;case 10:n.prev=10,n.t0=n.catch(5),console.log("Error",n.t0);case 13:return n.prev=13,a.default(z),n.finish(13);case 16:null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"default"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"default"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=o&&o.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"default"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return n.stop()}}),n,null,[[5,10,13,16]])})));return function(e){return n.apply(this,arguments)}}(),le=function(e,n){var o=t(e);o&&n&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(t){var n,o,i,l,r,a=this.el(),s=z.dom.getPointerPosition(a,t).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(n=window)||void 0===n||null===(o=n.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"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var se=[],ue=0,de=null;function ce(e,t,i){var l,r,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];te=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.apiVersion)||"v1";var c=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(e.currentTime()),m=Math.floor(e.duration()),p=null==t||null===(a=t.watchHistory)||void 0===a?void 0:a.xapiKey,f=(null==t||null===(s=t.video)||void 0===s?void 0:s.originalObjectId)||null,w=(null==t||null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,h=Math.floor(e.currentTime()),y=d?100:Math.floor(v/m*100),g={};w?function(e,t,n){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(n),l=ve(i),r=(new Date).getTime(),a=o(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return ae(ae({},e),{},U({},t,s[t]))}),{}),d=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===ee}));d<0?l.push(ae(ae({content:u},e),{},{addedDate:r,updateDate:r})):l[d]=ae(ae(ae({},l[d]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(g={completed:d,watchedTime:h,watchedPercentage:y},c,t.siteOwner):("v1"==te?g={videoId:ee,watchedTime:h,watchedPercentage:y,siteOwner:t.siteOwner,userId:t.userId,xApiKey:p}:"v2"==te&&(g=ae(ae({videoId:ee,watchedTime:h,watchedPercentage:y,doneWatching:d,profileId:c},de&&{seriesId:de}),f&&{originalObjectId:f})),n(g,te).then((function(e){})).catch((function(e){}))),ue=v+i}function ve(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}function me(e,t,n){var o=ve(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),i}var pe=function(e,n,o){var i=t(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var l=parseFloat(n)/100;i.volume(l),o&&o({status:!0,msg:"Volume set to ".concat(n,"%")})}else o&&o({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else o({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},fe=function(e){var n=t(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},we=!1,he=function(e,t){var n,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[r])||void 0===n||null===(o=n.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!we){var a=ye(e,"videoAssets","secondaryVideoAssets"),s=i(a,t);return s&&l(t,s),we=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function ye(e,t,n){if(Array.isArray(e))return e.map((function(e){return ye(e,t,n)}));if(null!==e&&"object"===J(e)){var o={};return Object.keys(e).forEach((function(i){i===t&&void 0!==e[n]?o[i]=e[n]:i===n&&void 0!==e[t]?o[i]=e[t]:o[i]=ye(e[i],t,n)})),o}return e}function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(n),!0).forEach((function(t){U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ke=function(e,n,i,l){var d,c,v=l.res,m=l.sres,p=t(e),f=(null==v?void 0:v.contentType)||"video",w=(null==v||null===(d=v[f])||void 0===d||null===(c=d.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;r(v),p&&(p.on("loadstart",(function(){w?i.resolve({status:!0,msg:"Video Loaded",response:v}):i.resolve(be({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:v}:{response:v}))})),p.on("loadeddata",(function(){var i,l;(null==p||!p.muted())&&pe(e,sessionStorage.getItem("volume")||"100");var r=o();if(a(),null!=n&&n.watchHistory&&null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.enable&&(!n.isAnonymousUser||null!=n&&null!==(l=n.watchHistory)&&void 0!==l&&l.saveOffline)){var s,u,d=be(be({},n),v);!function(e,n,o){var i,l,r;null!=n&&n.series&&null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable&&(de=null==n||null===(l=n.series)||void 0===l?void 0:l.id),se=[],ue=0,ee=o;var a=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,s=t(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());se.includes(ue)||(e==ue?(se.push(e),ce(s,n,a)):e>ue&&(ue=e+a))})),s.one("ended",(function(){ce(s,n,a,!0)})))}(e,d,null==r||null===(s=r.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id)}})),p.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];p.trigger("subtitlechanged",t)})),p.on("subtitlechanged",(function(e,t){var n,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(o=n.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===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,w=p.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));f=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(f)}})),p.on("loadedmetadata",(function(){window.endFirstFrame(p)})),p.tech_.on("retryplaylist",(function(){w&&he(v,e)})),p.on("error",(function(){var t,n;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&w)?he(v,e):(s(e,(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured",response:v}))})),p.one("play",(function(){var e;if(null!=n&&null!==(e=n.series)&&void 0!==e&&e.enable){var t,i,l,r=null===(t=o())||void 0===t||null===(i=t.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,a=u().get(r)||{t:0,p:0},s=a.t,d=a.p;s&&d<95&&setTimeout((function(){p.currentTime(s)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0)})),p.on("volumechange",(function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),p.on("chromecastDisconnected",(function(){if(w){p.currentSource();for(var e=p.textTracks(),t=e.length-1;t>=0;t--)p.removeRemoteTextTrack(e[t])}})))},Oe=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-57962dea.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-79e9ebc9.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-347cf391.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-b1e2e3ce.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?import("./skin-48a28d17.js").then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&import("./skin-af53462a.js").then((function(n){n.initaliseSkin(e,t)}))},je=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Ie,Te=function(){var e=N(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pe=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ne("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},importIMA:function(){import("videojs-contrib-ads"),import("ima"),ne("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadEMELibrary:Te}),Se=function(e,t){var n=new Map;d({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),c(n)})).catch((function(e){return console.log(e)}))};function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function De(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var xe=function(e,n,o,r){var a,u,d,c,v,m,p,f,w,h,y,g,b,k,O,j,T,P,S,C,D,x,R,E,H,L,M,q,J,G,K,X,Q,W=n.res,Y=void 0===W?null:W,Z=n.sres,$=void 0===Z?null:Z;null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(d=u.framework)||void 0===d||null===(c=d.CastContext)||void 0===c||null===(v=c.getInstance())||void 0===v||v.S;var ee=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=Y)||void 0===m?void 0:m.contentType)||"video",ne=A(null===(p=Y)||void 0===p||null===(f=p[te])||void 0===f||null===(w=f.gist)||void 0===w?void 0:w.videoImageUrl)||A(null===(h=Y)||void 0===h||null===(y=h[te])||void 0===y||null===(g=y.gist)||void 0===g||null===(b=g.imageGist)||void 0===b?void 0:b.r16x9),oe=(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===(P=T[te])||void 0===P||null===(S=P.streamingInfo)||void 0===S?void 0:S.isLiveStream)||!0;null==o||o.drmLibrary;var ae=(null===(C=Y)||void 0===C||null===(D=C.ads)||void 0===D||null===(x=D.preRoll)||void 0===x||null===(R=x.adTags)||void 0===R||null===(E=R.web)||void 0===E?void 0:E.active)&&(null===(H=Y)||void 0===H||null===(L=H.ads)||void 0===L||null===(M=L.preRoll)||void 0===M||null===(q=M.adTags)||void 0===q||null===(J=q.web)||void 0===J||J.url);ae="https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",Y=De(De({},Y),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var se=(Q={controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==o.skin,liveui:oe},U(Q,"autoplay",null==o?void 0:o.autoplay),U(Q,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!1),U(Q,"loop",(null==o?void 0:o.loop)||!1),U(Q,"audioPosterMode",null==o?void 0:o.audioPosterMode),U(Q,"html5",De(De({vhs:De(De({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,withCredentials:!1,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useNetworkInformationApi:!1},(null==o||null===(G=o.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==o||null===(K=o.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(X=o.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),U(Q,"poster",ne),U(Q,"techOrder",ee),U(Q,"chromecast",{requestCustomDataFn:function(n){var o=t(e),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var o,i,l,r,a,s,u,d,c,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=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;p.licenseUrl=f;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=w}var h=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=h;var y=null==e||null===(l=e[m])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=y;var g=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=g;var b=null==e||null===(u=e[m])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=b,p.subTitles=n,p.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Y,n,i)}}),Q);if(!z.getPlayers()[e])var ue=z(e,se,function(){var t=N(F.mark((function t(){var n,a,u,d,c,v,m,p,f,w,h,y,g,b,k,O,j,T,P,S,C,D;return F.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log(ue),this.setTimeout((function(){ue.qualityMenu({useResolutionLabels:!0})}),3e3),t.next=4,ie(o);case 4:return re&&r.resolve(De({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:Y}:{response:Y})),window.initialise(ue),window.firstFrame(ue),"white"!==window.controlsColor&&je(window.controlsColor,ue),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),null===(n=Y)||void 0===n||null===(a=n[te])||void 0===a||a.drmEnabled,b=null===(u=Y)||void 0===u||null===(d=u[te])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,t.next=13,Te();case 13:oe&&le(e,b),null!=o&&null!==(v=o.customData)&&void 0!==v&&v.disableAds||B(e,ae,Y),k=i(Y,e),console.log(k),null!=o&&o.nearestClusterUrl&&(k=_(k,o.nearestClusterUrl)),k?l(e,k):(r.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Y}),s(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===(w=f.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=Y)||void 0===h||null===(y=h[te])||void 0===y||null===(g=y.closedCaptions)||void 0===g?void 0:g.length)>0)&&(D=(null===(j=Y)||void 0===j||null===(T=j[te])||void 0===T||null===(P=T.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(S=Y)||void 0===S||null===(C=S[te])||void 0===C?void 0:C.closedCaptions),O=D.filter((function(e){return"VTT"===e.format})),V(e,O)),null!=o&&o.disableControls?I(e):Oe(e,De(De(De({},o),se),{},{liveVideo:re,isDvrEnabled:oe,res:Y,sres:$})),ke(e,De(De(De({},o),se),{},{liveVideo:re}),r,{res:Y,sres:$});case 22:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}())};function Re(){return{loadVideoInstantly:v,onTimeUpdate:G,getVideoDuration:K,onVideoEnded:X,init:function(t){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=N(F.mark((function n(o,i){var l,a,s,u,d,c,v,m,p,f,w,y,g,b,k,O,j,I,T,A,B,_,V,N,U,z,J,G,K;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!h(null==t?void 0:t.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(y=(null==t?void 0:t.videoSourceUrl)||!1,g=null==t?void 0:t.asat,b=(null==t||null===(l=t.epg)||void 0===l?void 0:l.enable)||!1,k=null==t?void 0:t.videoId,O=(null==t||null===(a=t.series)||void 0===a?void 0:a.enable)||!1,window.videoId=k,j=null==t?void 0:t.token,!x(t)){n.next=15;break}if(R().set(null==t?void 0:t.refreshToken),j&&!E(j)){n.next=14;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 14:Ie=JSON.parse(atob(j.split(".")[1]));case 15:window.siteId=null===(s=Ie)||void 0===s?void 0:s.siteId,window.siteName=null===(u=Ie)||void 0===u?void 0:u.site,t.isAnonymousUser=!(null===(d=Ie)||void 0===d||!d.anonymousId),t.siteOwner=(null===(c=Ie)||void 0===c?void 0:c.site)||null,t.userId=(null===(v=Ie)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=Ie)||void 0===m?void 0:m.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,T=null==t?void 0:t.airplay,A=null==t?void 0:t.apiBaseUrl,B=(null==t||null===(p=t.analytics)||void 0===p?void 0:p.gaId)||null,(_=null==t?void 0:t.errors)&&(window.customErrors=_),window.customData=null==t?void 0:t.customData,$(null==t||null===(f=t.customData)||void 0===f?void 0:f.localisation),A&&(window.playerEntitlementUrl=A),window.controlsColor=(null==t?void 0:t.controlsColor)||"white",Promise.resolve().then((function(){return Pe})).then((function(e){e.importIMA()})),T&&"Safari"==e()&&Promise.resolve().then((function(){return Pe})).then((function(e){e.importAirplay()})),B&&ne("https://www.googletagmanager.com/gtag/js?id=".concat(B)).then((function(){return P(B)})).catch((function(e){})),(V=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I)))&&V.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y?(U={directPlaybackUrl:y,id:N="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},g?S(N,j).then((function(e){xe(I,{res:De(De({},e),U)},t,{resolve:o,reject:i})})).catch((function(e){D(e,I,i,N)})):xe(I,{res:U},t,{resolve:o,reject:i})):O?(J=sessionStorage.getItem("season-idx")||0,M.set(parseInt(J)),G=null==t||null===(z=t.series)||void 0===z?void 0:z.id,H(G,j).then((function(e){var n,l,a,s=e.data,u=e.data.seasons;q(u);var d=k||(null==u||null===(n=u[0])||void 0===n||null===(l=n.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);Se(G,j),S(d,j).then((function(e){var n,l,a;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(l=n.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(e.data),xe(I,{res:null==e?void 0:e.data,sres:s},t,{resolve:o,reject:i})})).catch((function(e){D(e,I,i,k)}))})).catch((function(e){D(e,I,i)}))):b?(K=null==t?void 0:t.epg,L(K,j).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==K?void 0:K.channelId,xe(I,{res:n},t,{resolve:o,reject:i})})).catch((function(e){D(e,I,i,k)}))):S(k,j).then((function(e){var n,l,a,s;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(l=n.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(null==e?void 0:e.data);var u,d=null==e?void 0:e.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,m,p=me((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",k,null==t?void 0:t.siteOwner);if(p&&p.length)t.watchHistoryResumeTime=(null===(v=p[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(m=p[0])||void 0===m?void 0:m.watchedPercentage)||null;d.contentType="video",xe(I,{res:d},t,{resolve:o,reject:i})}else C(k,j).then((function(e){var n,l,r,a,s,u;null!==(n=window)&&void 0!==n&&null!==(l=n.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.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",xe(I,{res:d},t,{resolve:o,reject:i})})).catch((function(e){var n,l,r,a;null!==(n=window)&&void 0!==n&&null!==(l=n.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(e)),xe(I,{res:d},t,{resolve:o,reject:i})}));else xe(I,{res:d},t,{resolve:o,reject:i})})).catch((function(e){D(e,I,i,k)}));case 40:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:Y,skip:m,getPlayer:t,play:p,pause:f,detectBrowser:e,rewind:w,loadVideo:l,seekToTimeStamp:Q,isPlayerInitialised:h,load:y,authenticateLC:g,dispose:b,enableCaptions:k,disableCaptions:O,getCaptions:j,playSelectedResolution:Z,getSource:i,setVolume:pe,getVolume:fe,disableControls:I,setPlaybackSpeed:W,getEntitlementData:T}}export{Re as default};
@@ -1 +1 @@
1
- import{g as e,m as r,r as t}from"./generic-ff184c2f.js";function o(o,u){var l,i,n=e(o),c=null==n||null===(l=n.controlBar)||void 0===l||null===(i=l.playToggle)||void 0===i?void 0:i.el_,a=document.getElementsByTagName("video")[0];a&&a.addEventListener("keydown",(function(e){switch(e.key){case" ":return e.preventDefault(),a&&a.focus(),void(c&&c.click());case"m":case"M":return e.preventDefault(),a&&a.focus(),void(n.muted()?n.muted(!1):n.muted(!0));case"f":e.preventDefault(),a&&a.focus();var l=document.querySelector(".vjs-fullscreen-control");return void(l&&l.click());case"F":e.preventDefault();var i=document.querySelector(".vjs-fullscreen-control");return void(i&&i.click());case"ArrowLeft":if((1==u.liveVideo||1==u.liveui)&&0==u.liveui)break;return e.preventDefault(),a&&a.focus(),void t(o,10);case"ArrowRight":if(1==u.liveVideo||1==u.liveui)break;return e.preventDefault(),a&&a.focus(),void r(o,10);default:return}}))}export{o as i};
1
+ import{g as e,m as r,r as t}from"./generic-444bf169.js";function o(o,u){var l,i,n=e(o),c=null==n||null===(l=n.controlBar)||void 0===l||null===(i=l.playToggle)||void 0===i?void 0:i.el_,a=document.getElementsByTagName("video")[0];a&&a.addEventListener("keydown",(function(e){switch(e.key){case" ":return e.preventDefault(),a&&a.focus(),void(c&&c.click());case"m":case"M":return e.preventDefault(),a&&a.focus(),void(n.muted()?n.muted(!1):n.muted(!0));case"f":e.preventDefault(),a&&a.focus();var l=document.querySelector(".vjs-fullscreen-control");return void(l&&l.click());case"F":e.preventDefault();var i=document.querySelector(".vjs-fullscreen-control");return void(i&&i.click());case"ArrowLeft":if((1==u.liveVideo||1==u.liveui)&&0==u.liveui)break;return e.preventDefault(),a&&a.focus(),void t(o,10);case"ArrowRight":if(1==u.liveVideo||1==u.liveui)break;return e.preventDefault(),a&&a.focus(),void r(o,10);default:return}}))}export{o as i};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import i from"@babel/runtime/helpers/assertThisInitialized";import l from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import r from"@babel/runtime/helpers/defineProperty";import a from"video.js";import{s}from"./loader-580278fe.js";import{q as c,p as u}from"./generic-444bf169.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}var d=a.getComponent("Component"),p=function(){l(h,d);var p,v,f=(p=h,v=m(),function(){var e,t=n(p);if(v){var i=n(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return o(this,e)});function h(t){var l,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),l=f.call(this,t,o),r(i(l),"multicamCssPositioning",(function(e,t){var o=document.getElementById(t);if(o){var n,r,a,s,c,u,m,d,p=window.getComputedStyle(o,null),v=p.getPropertyValue("height"),f=p.getPropertyValue("width"),h=v.slice(0,-2);if(f.slice(0,-2)-135<=135)e.style.bottom="290px",e.style.height="352px";else"live"==l.config.skin&&(null===(n=i(l))||void 0===n||null===(r=n.config)||void 0===r||!r.liveui)&&(null===(a=i(l))||void 0===a||null===(s=a.config)||void 0===s||!s.liveVideo)||null!==(c=i(l))&&void 0!==c&&null!==(u=c.config)&&void 0!==u&&u.liveui&&null!==(m=i(l))&&void 0!==m&&null!==(d=m.config)&&void 0!==d&&d.liveVideo?(e.style.bottom="".concat(h-135,"px"),e.style.height="".concat(h-85,"px")):(e.style.bottom="3rem",e.style.height="".concat(h-105,"px"))}})),l.playerId=o.playerId,l.streams=null==o?void 0:o.streams,l.config=null==o?void 0:o.config,l.createUI(null==o?void 0:o.streams),l}return t(h,[{key:"createEl",value:function(){return a.dom.createEl("div",{className:"multicamera-parent"})}},{key:"createUI",value:function(e){var t,i,l,o,n,r,a=this,s=this.el();null!=this&&null!==(t=this.config)&&void 0!==t&&t.liveui&&null!=this&&null!==(i=this.config)&&void 0!==i&&i.liveVideo||0==(null==this||null===(l=this.config)||void 0===l?void 0:l.liveui)&&0==(null==this||null===(o=this.config)||void 0===o?void 0:o.liveVideo)?null==s||null===(n=s.classList)||void 0===n||n.add("".concat(this.config.skin)):null==s||null===(r=s.classList)||void 0===r||r.add("default"),this.loadCSS();for(var c=0;c<e.length;c++)this.createTile(e[c],c);this.multicamCssPositioning(s,this.playerId),window.onresize=function(){a.multicamCssPositioning(s,a.playerId)}}},{key:"getOffset",value:function(e){var t=e.getBoundingClientRect();return{left:t.left+window.scrollX,top:t.top+window.scrollY}}},{key:"createTile",value:function(e,t){var i=this,l=this.el(),o=a.dom.createEl("div",{className:"tile ".concat(t)});return 0==t&&(o.style.border="2px solid red"),o.style.backgroundImage="url(".concat(e.img,")"),a.dom.appendContent(l,o),o.addEventListener("click",(function(t){s(i.playerId),i.removeSelectedTile();var l=document.getElementsByClassName("".concat(t.srcElement.className))[0];l&&(l.style.border="2px solid red"),c(i.playerId,e.id).then((function(e){u(i.playerId)}))})),l}},{key:"removeSelectedTile",value:function(){for(var e=document.getElementsByClassName("tile"),t=0;t<e.length;t++)e[t].style.border=0}},{key:"loadCSS",value:function(){import("./multicam-de741974.js").then((function(e){var t=document.createElement("style");t.id="multicam",t.append("".concat(e.default)),document.head.appendChild(t)}))}}]),h}();export{p as default};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import o from"video.js";import{g as s,e as l,h as i}from"./icons-3e9a1686.js";import{Z as c,g as m,q as d,p}from"./generic-444bf169.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var h=o.getComponent("Component"),v=function(){a(g,h);var v,f,y=(v=g,f=u(),function(){var e,t=n(v);if(f){var a=n(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return r(this,e)});function g(t){var a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,g),(a=y.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.streams=r.streams,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a}return t(g,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=o.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return o.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-d006cffa.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=o.dom.createEl("div",{className:"stream-container hidden"});o.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=t.classList)&&void 0!==a&&a.contains("hidden")?(c(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var a=document.getElementById(this.playerId);if(a){var r=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(r,"px"),a.style.overflow="hidden",o.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),r=o.dom.createEl("div",{className:"stream-selector-head"}),n=o.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(l())});n.onclick=function(){e.classList.add("hidden"),a.classList.remove("open"),e.style.right="-350px"};for(var s=o.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),c=o.dom.createEl("div",{className:"stream-selector-content"}),u=o.dom.createEl("div",{className:"stream-tray"}),h=function(e){var a,r=o.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i())});0==e&&(r.classList.add("selected"),r.style.border="4px solid #D2393B"),r.onclick=function(){for(var a=o.dom.$$(".stream"),n=0;n<a.length;n++)a[n].style.border="none",a[n].classList.remove("selected");r.classList.add("selected"),r.style.border="4px solid #D2393B",d(t.playerId,t.streams[e].id).then((function(e){p(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},r.style.backgroundImage="url(".concat(t.streams[e].img,")");var n=document.createElement("img");n.className="stream-thumbnail-image",n.src="".concat(null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img),n.alt="No Thumbnail Available",r.append(n),o.dom.appendContent(u,r),o.dom.appendContent(c,u)},v=0;v<this.streams.length;v++)h(v);o.dom.appendContent(r,n),o.dom.appendContent(r,s),o.dom.appendContent(e,r),o.dom.appendContent(e,c),m(this.playerId).on("fullscreenchange",(function(){var a=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(a,"px")}))}}]),g}();export{v as default};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import l from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import r from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{s}from"./loader-580278fe.js";import{q as i,p as a}from"./generic-444bf169.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}var d=n.getComponent("Component"),u=function(){l(p,d);var u,m,v=(u=p,m=c(),function(){var e,t=r(u);if(m){var l=r(this).constructor;e=Reflect.construct(t,arguments,l)}else e=t.apply(this,arguments);return o(this,e)});function p(t){var l,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,p),(l=v.call(this,t,o)).playerId=o.playerId,l.config=o.config,l.createUI(null==o?void 0:o.config.streams),l}return t(p,[{key:"createEl",value:function(){return n.dom.createEl("div",{className:"mweb-potrait-parent"})}},{key:"createUI",value:function(e){var t,l,o,r,s,i,a,c,d=this.el(),u=1==(null==this||null===(t=this.config)||void 0===t?void 0:t.liveui)&&1==(null==this||null===(l=this.config)||void 0===l?void 0:l.liveVideo)||!(null!=this&&null!==(o=this.config)&&void 0!==o&&o.liveui)&&!(null!=this&&null!==(r=this.config)&&void 0!==r&&r.liveVideo)||!1;u?null==d||null===(s=d.classList)||void 0===s||s.add("dvr"):null==d||null===(i=d.classList)||void 0===i||i.add("nondvr");var m=n.dom.createEl("div",{className:"broadcast"});m.innerHTML="Broadcasts";var v=n.dom.createEl("div",{className:"potraittray hideMWebTray"});u?null==v||null===(a=v.classList)||void 0===a||a.add("dvr"):null==v||null===(c=v.classList)||void 0===c||c.add("nondvr"),v.style.width="".concat(window.innerWidth-50,"px");var p=n.dom.createEl("div",{className:"tilecontainer-potrait"});n.dom.appendContent(d,m),n.dom.appendContent(d,v),n.dom.appendContent(v,p),m.addEventListener("click",(function(){null!=v&&v.classList.contains("hideMWebTray")?(v.classList.remove("hideMWebTray"),d.style.background="darkgray"):(null==v||v.classList.add("hideMWebTray"),d.style.background="gray")})),this.loadCSS();for(var h=0;h<e.length;h++)this.createTile(e[h],h)}},{key:"createTile",value:function(e,t){var l=this,o=this.el(),r=n.dom.createEl("div",{className:"tile-potrait-mweb ".concat(t)});0==t&&(r.style.border="2px solid red"),r.style.backgroundImage="url(".concat(e.img,")");var c=n.dom.$(".tilecontainer-potrait",this.contentEl());return n.dom.appendContent(c,r),r.addEventListener("click",(function(t){s(l.playerId),l.removeSelectedTile();var o=document.getElementsByClassName("".concat(t.srcElement.className))[0];o&&(o.style.border="2px solid red"),i(l.playerId,e.id).then((function(e){a(l.playerId)}))})),o}},{key:"removeSelectedTile",value:function(){for(var e=document.getElementsByClassName("tile-potrait-mweb"),t=0;t<e.length;t++)e[t].style.border=0}},{key:"loadCSS",value:function(){import("./mwebPotrait-3c1805d8.js").then((function(e){var t=document.createElement("style");t.className="mweb",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"toggleProgressControls",value:function(e){var t=document.querySelector(".vjs-progress-control.vjs-control"),l=document.querySelector(".vjs-play-control.vjs-control.vjs-button"),o=document.querySelector(".vjs-remaining-time.vjs-time-control.vjs-control"),r=document.querySelector(".vjs-seek-to-live-control.vjs-control");e?(null==t||t.classList.add("hide-controls"),null==l||l.classList.add("hide-controls"),null==o||o.classList.add("hide-controls"),null==r||r.classList.add("hide-controls")):(null!=t&&t.classList.contains("hide-controls")&&(null==t||t.classList.remove("hide-controls")),null!=l&&l.classList.contains("hide-controls")&&(null==l||l.classList.remove("hide-controls")),null!=o&&o.classList.contains("hide-controls")&&(null==o||o.classList.remove("hide-controls")),null!=r&&r.classList.contains("hide-controls")&&(null==r||r.classList.remove("hide-controls")))}}]),p}();export{u as default};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import r from"video.js";import{P as l}from"./icons-3e9a1686.js";import{q as a,c as s,Y as d}from"./generic-444bf169.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var u=r.getComponent("Component"),c=function(){n(c,u);var a,s,d=(a=c,s=p(),function(){var e,t=i(a);if(s){var n=i(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o(this,e)});function c(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,c),(n=d.call(this,t,o)).playerId=o.playerId,n.seriesData=o.sres,n.currentVideoData=o.res,n.initialiseStructure(),n.loadCSS(),n}return t(c,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"play-next"}),t=r.dom.createEl("div",{className:"play-next-icon",innerHTML:"".concat(l(window.controlsColor?window.controlsColor:"white"))});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./nextEpisodeButton-a1556cdf.js").then((function(e){var t=document.createElement("style");t.id="multicam",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=r.dom.createEl("div",{className:"next-eps nextepisode-hidden"}),n=r.dom.createEl("div",{className:"next",innerHTML:"Next Episode"}),o=r.dom.createEl("div",{className:"nextep-meta-details next-margin"}),i=r.dom.createEl("div",{className:"next-eps-image"}),l=r.dom.createEl("div",{className:"next-eps-description"});r.dom.appendContent(o,i),r.dom.appendContent(o,l),r.dom.appendContent(t,n),r.dom.appendContent(t,o),this.toggleContentOnHover(e,t),r.dom.appendContent(e,t)}},{key:"toggleContentOnHover",value:function(e,t){e.addEventListener("mouseover",(function(){r.dom.removeClass(t,"nextepisode-hidden")})),t.addEventListener("mouseover",(function(){r.dom.removeClass(t,"nextepisode-hidden")})),e.addEventListener("mouseout",(function(){r.dom.addClass(t,"nextepisode-hidden")})),t.addEventListener("mouseout",(function(){r.dom.addClass(t,"nextepisode-hidden")}))}}]),c}(),m=function(e,t){var n=v(e,t.video.gist.id),o=h(e[n],t.video.gist.id),i=f(e[n],o);x(i.nextEp)},v=function(e,t){for(var n=-1,o=0;o<e.length;o++)for(var i=0;i<e[o].episodes.length;i++)if(e[o].episodes[i].id===t){n=o;break}return n},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;if(!(e&&t>=0))return{prevEp:null,nextEp:null};var n=e.episodes.length,o=t-1>=0?t-1:n-1,i=(t+1)%n,r=n>1?e.episodes[o]:null,l=n>1?e.episodes[i]:null;return o===i&&(0===o?l=null:r=null),{prevEp:r,nextEp:l,prevEpIdx:o,nextEpIdx:i}},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=null;return e?(e.episodes.forEach((function(e,o){e.gist.id===t&&(n=o)})),n):null},x=function(e){var t,n;r.dom.$(".next-eps"),r.dom.$(".play-next").onclick=function(){var t;a("my-player",null==e||null===(t=e.gist)||void 0===t?void 0:t.id).then((function(e){s(e.response)}))};var o=r.dom.$(".next-eps-image"),i=d("<img src=".concat(null==e||null===(t=e.gist)||void 0===t?void 0:t.videoImageUrl," />")),l=null==i?void 0:i.firstChild;null==o||o.append(l);for(var p=r.dom.$(".next-eps-description"),u=d("<div class='next-eps-title'>".concat(null==e?void 0:e.title,"</div>\n <div class='next-eps-description-details'>").concat(null==e||null===(n=e.gist)||void 0===n?void 0:n.description,"</div>"));null!=u&&u.firstChild;)null==p||p.appendChild(u.firstChild)};export{c as default,m as initaliseFunctionality};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import l from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{E as s,e as r}from"./icons-3e9a1686.js";import{Z as c,g as d,q as p,W as m}from"./generic-444bf169.js";import{a as u}from"./autoNextVideo-739861ed.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./util-b468f9d5.js";function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var y=i.getComponent("Component"),h=function(){l(b,y);var h,f,g=(h=b,f=v(),function(){var e,t=a(h);if(f){var n=a(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o(this,e)});function b(e){var n,l,o,a,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,b),(a=g.call(this,e,i)).playerId=i.playerId,a.seriesData=i.sres,a.videos=null==i||null===(n=i.playlist)||void 0===n?void 0:n.content,a.cb=(null==i||null===(l=i.playlist)||void 0===l?void 0:l.cb)||null,a.autoNext=(null==i||null===(o=i.playlist)||void 0===o?void 0:o.autoNext)||!1,a.currentVideoData=i.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&u({playerId:a.playerId,content:a.videos,cb:a.cb}),a}return n(b,[{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=i.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./playlist-7ecf432a.js").then((function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=i.dom.createEl("div",{className:"selection-container hidden"});i.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(c(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var n=document.getElementById(this.playerId);if(n){var l=window.getComputedStyle(n,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(l,"px"),i.dom.appendContent(e,t),n.style.overflow="hidden",this.addFunctionality(t)}}},{key:"addFunctionality",value:function(t){var n=this,l=this.el(),o=i.dom.createEl("div",{className:"playlist-selector-head"}),a=i.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(r())});a.onclick=function(){t.classList.add("hidden"),l.classList.remove("open"),t.style.right="-350px"};for(var s=i.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),c=i.dom.createEl("div",{className:"playlist-selector-content"}),u=function(t){var l,o,a=i.dom.createEl("div",{className:"playlist-container"}),s=i.dom.createEl("div",{className:"playlist-section",index:t}),r=i.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.title)||"")}),d=i.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});i.dom.appendContent(s,r),i.dom.appendContent(s,d),i.dom.appendContent(a,s),i.dom.appendContent(c,a);var u=i.dom.createEl("div",{className:"playlist-section-expanded hidden"}),v=i.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(o=n.videos[t])||void 0===o?void 0:o.description)||"")}),y=i.dom.createEl("div",{className:"playlist-image"});y.style.backgroundImage="url(".concat(n.videos[t].img,")"),i.dom.appendContent(u,y),i.dom.appendContent(u,v),i.dom.appendContent(a,u),i.dom.appendContent(c,a),u.onclick=function(e){e.stopPropagation(),m(t+1),p(n.playerId,n.videos[t].id).then((function(e){null!=n&&n.cb&&n.cb(e)})).catch((function(e){null!=n&&n.cb&&n.cb(e)}))},s.onclick=function(t){var n,l,o,i=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(i=e(i))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(n=s.classList)&&void 0!==n&&n.contains("hidden")?(a.style.backgroundColor="#0000007d",null==s||null===(l=s.classList)||void 0===l||l.remove("hidden")):(null==s||null===(o=s.classList)||void 0===o||o.add("hidden"),a.style.backgroundColor="unset")}},v=0;v<this.videos.length;v++)u(v);i.dom.appendContent(o,a),i.dom.appendContent(o,s),i.dom.appendContent(t,o),i.dom.appendContent(t,c),d(this.playerId).on("fullscreenchange",(function(){var e=document.getElementById(n.playerId);if(e){var l=window.getComputedStyle(e,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(l,"px")}}))}}]),b}();export{h as default};
@@ -1 +1 @@
1
- import{g as l}from"./generic-ff184c2f.js";var i=function(i){var n,o=l(i),t=[];if((null==o||null===(n=o.tech_)||void 0===n?void 0:n.vhs)||!1){var e,d,v=null==o||null===(e=o.tech_)||void 0===e||null===(d=e.vhs)||void 0===d?void 0:d.representations();(null==v?void 0:v.length)>0&&(t=null==v?void 0:v.sort((function(l,i){return(null==l?void 0:l.height)==(null==i?void 0:i.height)?(null==i?void 0:i.bandwidth)-(null==l?void 0:l.bandwidth):(null==i?void 0:i.height)-(null==l?void 0:l.height)})))}else{var u,h,r=null==o||null===(u=o.dash)||void 0===u||null===(h=u.mediaPlayer)||void 0===h?void 0:h.getBitrateInfoListFor("video");(null==r?void 0:r.length)>0&&(t=null==r?void 0:r.sort((function(l,i){return i.height-l.height})))}return t};export{i as g};
1
+ import{g as l}from"./generic-444bf169.js";var i=function(i){var n,o=l(i),t=[];if((null==o||null===(n=o.tech_)||void 0===n?void 0:n.vhs)||!1){var e,d,v=null==o||null===(e=o.tech_)||void 0===e||null===(d=e.vhs)||void 0===d?void 0:d.representations();(null==v?void 0:v.length)>0&&(t=null==v?void 0:v.sort((function(l,i){return(null==l?void 0:l.height)==(null==i?void 0:i.height)?(null==i?void 0:i.bandwidth)-(null==l?void 0:l.bandwidth):(null==i?void 0:i.height)-(null==l?void 0:l.height)})))}else{var u,h,r=null==o||null===(u=o.dash)||void 0===u||null===(h=u.mediaPlayer)||void 0===h?void 0:h.getBitrateInfoListFor("video");(null==r?void 0:r.length)>0&&(t=null==r?void 0:r.sort((function(l,i){return i.height-l.height})))}return t};export{i as g};