@viewlift/player-backup 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/bundle.css CHANGED
@@ -13,6 +13,7 @@
13
13
 
14
14
 
15
15
 
16
+
16
17
  .widget-selection{
17
18
  display: flex;
18
19
  align-items: center;
@@ -134,7 +135,6 @@
134
135
  padding: 0 18px;
135
136
  }
136
137
 
137
-
138
138
  .vjs-poster {
139
139
  display: inline-block;
140
140
  vertical-align: middle;
@@ -1 +1 @@
1
- "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-ee90512f.js"),s=require("./renditions-54652b09.js");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){var t=d();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then((function(){return require("./caption-settings-aeebfd3c.js")})).then((function(r){var n,o,l,s,u=r.default,c=a.getPlayer(e);i.registerComponent("captionSelector",u),null===(n=document)||void 0===n||null===(o=n.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(),c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addMulticamSelector=function(e,t){Promise.resolve().then((function(){return require("./multicamv2-b0e1a78f.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},exports.addMulticamView=function(e,t){Promise.resolve().then((function(){return require("./multicam-502ec16a.js")})).then((function(r){var n=r.default,o=t.streams,l=a.getPlayer(e);i.registerComponent("multicamModule",n),l.getChild("controlBar").addChild("multicamModule",{playerId:e,streams:o,config:t},l.controlBar.children().length)}));var r=document.querySelector(".vjs-control-bar");r&&"live"==(null==t?void 0:t.skin)&&(r.style.background="transparent")},exports.addMwebPotraitTrayModule=function(e,t){Promise.resolve().then((function(){return require("./mwebPotraitTray-32820b71.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("mwebPotraitTray",n),o.getChild("controlBar").addChild("mwebPotraitTray",{playerId:e,config:t},0)}))},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then((function(){return require("./nextEpisodeButton-7142cc15.js")})).then((function(n){var o=n.default,l=a.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)}))},exports.addOutputtingOverlay=function(e,t){var r=a.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then((function(){return require("./playlist-4e139b6e.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},exports.addResolutionModule=function(e,t,r){Promise.resolve().then((function(){return require("./resolution-b15f073c.js")})).then((function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a.getPlayer(e),u=s.getRenditions(e);(null==u?void 0:u.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:u},l.controlBar.children().length-4))}))},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=c(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;return o.classList.add("vjs-rewind-button"),o.innerHTML=l,n}return r(s,[{key:"handleClick",value:function(){a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then((function(){return require("./series-e4e57071.js")})).then((function(n){var o=n.seriesModule,l=a.getPlayer(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"),u=function(e){s[e].addEventListener("click",(function(){t[e]&&n.handleSeasonChange(t[e],e,l,r)}))},c=0;c<s.length;c++)u(c)}))},exports.addSeriesSelectorV2=function(t,r){Promise.resolve().then((function(){return require("./series-v2-3b123eed.js")})).then((function(n){var o=n.default,l=a.getPlayer(t);i.registerComponent("seriesV2",o),l.getChild("controlBar").addChild("seriesV2",function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({playerId:t},r),l.controlBar.children().length-3)}))},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then((function(){return require("./settings-icon-54b79887.js")})).then((function(r){var n,o,l,s,u=r.default,c=a.getPlayer(e);i.registerComponent("settingsSelector",u),null===(n=document)||void 0===n||null===(o=n.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(),c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=c(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;return o.classList.add("vjs-skip-button"),o.innerHTML=l,n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=c(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.innerHTML="Slow Mo",n}return r(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)},exports.addVideoSelector=function(e,t){Promise.resolve().then((function(){return require("./videoSelector-cc3f932d.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))};
1
+ "use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-ee90512f.js"),s=require("./renditions-54652b09.js");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){var t=d();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then((function(){return require("./caption-settings-aeebfd3c.js")})).then((function(r){var n,o,l,s,u=r.default,c=a.getPlayer(e);i.registerComponent("captionSelector",u),null===(n=document)||void 0===n||null===(o=n.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(),c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addMulticamSelector=function(e,t){Promise.resolve().then((function(){return require("./multicamv2-b0e1a78f.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},exports.addMulticamView=function(e,t){Promise.resolve().then((function(){return require("./multicam-502ec16a.js")})).then((function(r){var n=r.default,o=t.streams,l=a.getPlayer(e);i.registerComponent("multicamModule",n),l.getChild("controlBar").addChild("multicamModule",{playerId:e,streams:o,config:t},l.controlBar.children().length)}));var r=document.querySelector(".vjs-control-bar");r&&"live"==(null==t?void 0:t.skin)&&(r.style.background="transparent")},exports.addMwebPotraitTrayModule=function(e,t){Promise.resolve().then((function(){return require("./mwebPotraitTray-32820b71.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("mwebPotraitTray",n),o.getChild("controlBar").addChild("mwebPotraitTray",{playerId:e,config:t},0)}))},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then((function(){return require("./nextEpisodeButton-7142cc15.js")})).then((function(n){var o=n.default,l=a.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)}))},exports.addOutputtingOverlay=function(e,t){var r=a.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then((function(){return require("./playlist-338168e6.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},exports.addResolutionModule=function(e,t,r){Promise.resolve().then((function(){return require("./resolution-b15f073c.js")})).then((function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a.getPlayer(e),u=s.getRenditions(e);(null==u?void 0:u.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:u},l.controlBar.children().length-4))}))},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=c(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;return o.classList.add("vjs-rewind-button"),o.innerHTML=l,n}return r(s,[{key:"handleClick",value:function(){a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then((function(){return require("./series-e4e57071.js")})).then((function(n){var o=n.seriesModule,l=a.getPlayer(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"),u=function(e){s[e].addEventListener("click",(function(){t[e]&&n.handleSeasonChange(t[e],e,l,r)}))},c=0;c<s.length;c++)u(c)}))},exports.addSeriesSelectorV2=function(t,r){Promise.resolve().then((function(){return require("./series-v2-3b123eed.js")})).then((function(n){var o=n.default,l=a.getPlayer(t);i.registerComponent("seriesV2",o),l.getChild("controlBar").addChild("seriesV2",function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({playerId:t},r),l.controlBar.children().length-3)}))},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then((function(){return require("./settings-icon-54b79887.js")})).then((function(r){var n,o,l,s,u=r.default,c=a.getPlayer(e);i.registerComponent("settingsSelector",u),null===(n=document)||void 0===n||null===(o=n.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(),c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=c(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;return o.classList.add("vjs-skip-button"),o.innerHTML=l,n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=c(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.innerHTML="Slow Mo",n}return r(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)},exports.addVideoSelector=function(e,t){Promise.resolve().then((function(){return require("./videoSelector-cc3f932d.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))};
@@ -0,0 +1 @@
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),i=require("axios");require("videojs-contrib-dash"),require("videojs-contrib-eme");var t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("./generic-ee90512f.js"),l=require("./util-0e80fbcd.js"),a=require("./renditions-54652b09.js"),d=require("./resolution-b15f073c.js"),s=require("./skin-84083352.js");function u(){var e,i;null===(e=window)||void 0===e||null===(i=e.dataLayer)||void 0===i||i.push(arguments)}function c(e,i){u("event",e,i)}function v(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function m(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}function f(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=f(),window.sessionStorage.setItem("uid",e),e)}function p(){var e=sessionStorage.getItem("token"),i=JSON.parse(atob(e.split(".")[1]));return null!=i&&i.anonymousId?"guest-user":null==i?void 0:i.userId}window.initialise=function(e){window.sid=f(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var i=Math.floor(e.currentTime());e.on("error",(function(){var t,n,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:i===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var i,t,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(t=i.customData)||void 0===t||null===(n=t.beacon)||void 0===n?void 0:n.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(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,i){var t,n;if(i.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=i&&null!==(t=i.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting"))c("BUFFERING",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:i.el_&&Math.floor(i.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:i.el_&&Math.floor(i.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var i,t,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(i=window)||void 0===i||null===(t=i.customData)||void 0===t||null===(n=t.beacon)||void 0===n?void 0:n.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 i,t,n,o,r,l;c("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(i=window)||void 0===i||null===(t=i.customData)||void 0===t||null===(n=t.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.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 i=[];e.on("timeupdate",(function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!i.includes(t)&&(i.push(t),fireEvent({eventName:"PING",videoPosition:t,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 i=e.currentTime(),t=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(g(i,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}}))()};var g=function(e,i,t){return e>=i&&e<=t};function h(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function y(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}window.fireEvent=function(e){var t,n,o,r,l,a,d,s,u,c,v=[m(m(m({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params),{},{uid:w(),vid:window.videoId,url:e.url||document.location.href,ref:e.ref||document.referrer,pa:e.eventName,vpos:e.videoPosition,environment:window.environment,dp1:e.dp1||null,dp2:e.dp2||null,dp3:e.dp3||null,dp4:e.dp4||null,dp5:e.dp5||null,apos:!0===e.isAdEvent?e.videoPosition:null,apod:!0===e.isAdEvent?(c=e.adPosition,c?String(c):""):null,profid:p(),player:e.playerType||"native",media_type:e.mediaType||"VIDEO",stream_id:window.sid,embedurl:null,ttfirstframe:e.ttFirstFrame,bitrate:e.bitrate,connectionspeed:null,resolutionheight:e.resHeight,resolutionwidth:e.resWidth,bufferhealth:e.bufferHealth},(null==e?void 0:e.duration)&&{duration:e.duration}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params)];i({url:(null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s||null===(u=s.beacon)||void 0===u?void 0:u.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:sessionStorage.getItem("token")},contentType:"application/x-www-form-urlencoded",dataType:"text",data:v}).catch((function(e){console.error(e)}))},window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var b,T,P=function(e,i){var t=r.getPlayer(e);t&&i&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(i){var t,n,r,l,a,d=this.el(),s=o.dom.getPointerPosition(d,i).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(n=t.cast)||void 0===n||null===(r=n.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*s,v.seek()}}))};function O(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}var I=[],E=0,S=null;function k(i,t,n){var o,l,a,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];T=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var s=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.profileId,u=Math.floor(i.currentTime()),c=Math.floor(i.duration()),v=null==t||null===(a=t.watchHistory)||void 0===a?void 0:a.xapiKey,m={};"v1"==T?m={videoId:b,watchedTime:Math.floor(i.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==T&&(m=function(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}({videoId:b,watchedTime:Math.floor(i.currentTime()),watchedPercentage:d?100:Math.floor(u/c*100),doneWatching:d,profileId:s},S&&{seriesId:S})),r.saveWatchHistory(m,t.token,T).then((function(e){})).catch((function(e){})),E=u+n}var j=function(e,i,t){var n=r.getPlayer(e);if(n)if(i>=0&&i<=100){n.muted()&&n.muted(!1);var o=parseFloat(i)/100;n.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(i,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},D=function(e){var i=r.getPlayer(e);return i?parseInt(100*i.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function R(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}var C,A=function(i,t,n,o){var l,a,d=o.res,s=o.sres,u=r.getPlayer(i),c=(null==d||null===(l=d.video)||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;r.setCurrentVideo(d),u.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:d})})),u.on("loadeddata",(function(){var o;(null==u||!u.muted())&&j(i,sessionStorage.getItem("volume")||"100");var l,a,c=r.getCurrentVideo();(r.clearError(),n.resolve(function(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:d}:{response:d})),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&!t.isAnonymousUser)&&function(e,i,t){var n,o;null!=i&&i.series&&(S=null==i||null===(n=i.series)||void 0===n?void 0:n.id),I=[],E=0,b=t;var l=(null==i||null===(o=i.watchHistory)||void 0===o?void 0:o.interval)||30,a=r.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());I.includes(E)||(e==E?(I.push(e),k(a,i,l)):e>E&&(E=e+l))})),a.on("ended",(function(){k(a,i,l,!0)})))}(i,t,null==c||null===(l=c.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.id)})),u.textTracks().on("change",(function(e){var i=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",i)})),u.on("subtitlechanged",(function(e,i){var t,n,o,r,l,a,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(n=t.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(d=a.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var w,p=f.getMediaSession(),g=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=i?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),u.on("loadedmetadata",(function(){window.endFirstFrame(u)})),u.one("error",(function(){var e,t;r.handleError(i,(null==u||null===(e=u.error())||void 0===e?void 0:e.message)||"Some error occured"),n.reject({status:!1,msg:(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"})})),u.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var i,n,o,l=null===(i=r.getCurrentVideo())||void 0===i||null===(n=i.video)||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.id,a=r.getSeriesWatchMap().get(l)||{t:0,p:0},d=a.t,s=a.p;d&&s<95&&setTimeout((function(){u.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},F=function(e,i){var t=null==i?void 0:i.skin;"live"==t?Promise.resolve().then((function(){return require("./skin-f6f07fbb.js")})).then((function(t){t.initialiseSkin(e,i)})):"default"==t?Promise.resolve().then((function(){return require("./skin-0436f5b0.js")})).then((function(t){t.initialiseSkin(e,i)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-b8808d9e.js")})).then((function(i){i.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-6283d44d.js")})).then((function(t){t.initialiseSkin(e,i)})):"multiplayer"==t&&Promise.resolve().then((function(){return require("./skin-fad0df82.js")})).then((function(t){t.initialiseSkin(e,i)}))},B=function(e){return new Promise((function(i,t){if(H(e))t("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){i()},n.onerror=function(i){t("Error while loading script ".concat(e," : ").concat(i))},document.head.appendChild(n)}}))},H=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},M=function(e,i){i.controlBar.el_.style.color=e,i.controlBar.el_.querySelector(".vjs-play-progress")&&(i.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),i.controlBar.el_.querySelector(".vjs-volume-level")&&(i.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};function V(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function N(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}var _=function(i,l,a,d){var s,u,c,v,m,f,w,p,g,h,b,T,O,I,E,S,k,j,D,R,C,B,H,V=l.res,_=void 0===V?null:V,x=l.sres,q=void 0===x?null:x,L=(null===(s=window)||void 0===s||null===(u=s.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m?void 0:m.S)||void 0,W=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==L&&"NOT_CONNECTED"!==L?["html5","chromecast"]:["chromecast","html5"]:["html5"],U=null==_||null===(f=_.video)||void 0===f||null===(w=f.gist)||void 0===w?void 0:w.videoImageUrl,z=(null==_||null===(p=_.video)||void 0===p||null===(g=p.liveDetails)||void 0===g?void 0:g.isDvrEnabled)||!1,G=function(e){var i,t={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(i=window)&&void 0!==i&&i.cast&&(t={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==r.detectBrowser()&&(t=y(y({},t),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),t}(a),J=(null==_||null===(h=_.video)||void 0===h||null===(b=h.streamingInfo)||void 0===b?void 0:b.isLiveStream)||!1;null==a||a.drmLibrary;var K=(null==_||null===(T=_.ads)||void 0===T||null===(O=T.preRoll)||void 0===O||null===(I=O.adTags)||void 0===I||null===(E=I.web)||void 0===E?void 0:E.active)&&(null==_||null===(S=_.ads)||void 0===S||null===(k=S.preRoll)||void 0===k||null===(j=k.adTags)||void 0===j||null===(D=j.web)||void 0===D?void 0:D.url),Q=(H={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:z},e(H,"autoplay",null==a?void 0:a.autoplay),e(H,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!K),e(H,"loop",(null==a?void 0:a.loop)||!1),e(H,"html5",N(N({dash:{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||3},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},vhs:N(N({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(R=a.customData)||void 0===R?void 0:R.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(C=a.customData)||void 0===C?void 0:C.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(B=a.customData)||void 0===B?void 0:B.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(H,"poster",U),e(H,"techOrder",W),e(H,"chromecast",{requestCustomDataFn:function(e){var t=r.getPlayer(i);console.log(t.textTracksJson_);var n=t.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,i,t){var n,o,r,l,a,d,s,u,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var f=i.keySystemOptions&&i.keySystemOptions[0]&&i.keySystemOptions[0].options&&i.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var w=i.keySystemOptions&&i.keySystemOptions[0]&&i.keySystemOptions[0].options&&i.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var p=(null==e||null===(n=e.video)||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=p;var g=null==e||null===(r=e.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var h=null==e||null===(a=e.video)||void 0===a||null===(d=a.gist)||void 0===d?void 0:d.title;m.mediaTitle=h;var y=null==e||null===(s=e.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=y,m.subTitles=t,m.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(_,e,n)}}),e(H,"plugins",G),H),Y=o(i,Q,function(){var e=t(n.mark((function e(){var t,l,s,u,c,v,m,f,w,p,g,h,y,b,T,O;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:J&&d.resolve(N({status:!0,msg:"Player Initialised"},q?{seriesResponse:q,response:_}:{response:_})),window.initialise(Y),window.firstFrame(Y),"white"!==window.controlsColor&&M(window.controlsColor,Y),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),null==_||null===(t=_.video)||void 0===t||t.drmEnabled,p=null==_||null===(l=_.video)||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,z&&P(i,p),!K||null!=a&&null!==(u=a.customData)&&void 0!==u&&u.disableAds||r.initialiseAdvertisement(i,K,_),(g=r.getSource(_,i))?r.loadVideo(i,g):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:_}),r.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==_||null===(c=_.video)||void 0===c||null===(v=c.contentDetails)||void 0===v||null===(m=v.closedCaptions)||void 0===m?void 0:m.length)>0||(null==_||null===(f=_.video)||void 0===f||null===(w=f.closedCaptions)||void 0===w?void 0:w.length)>0)&&(O=(null==_||null===(y=_.video)||void 0===y||null===(b=y.contentDetails)||void 0===b?void 0:b.closedCaptions)||(null==_||null===(T=_.video)||void 0===T?void 0:T.closedCaptions),h=O.filter((function(e){return"VTT"===e.format})),r.addCaptions(i,h)),null!=a&&a.disableControls?r.disableControls(i):F(i,N(N(N({},a),Q),{},{liveVideo:J,isDvrEnabled:z,res:_,sres:q})),A(i,N(N(N({},a),Q),{},{liveVideo:J}),d,{res:_,sres:q});case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};exports.VLPlayerCore=function(){return{loadVideoInstantly:r.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(i,t){var n,o,l,a,d,c,v,m,f;if(!r.isPlayerInitialised(null==e?void 0:e.playerId)){var w=null==e?void 0:e.videoId,p=(null==e||null===(n=e.series)||void 0===n?void 0:n.enable)||!1;window.videoId=w;var g=null==e?void 0:e.token;if(g&&!r.isTokenExpired(g)){C=JSON.parse(atob(g.split(".")[1])),window.siteId=null===(o=C)||void 0===o?void 0:o.siteId,window.siteName=null===(l=C)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=C)||void 0===a||!a.anonymousId),e.siteOwner=(null===(d=C)||void 0===d?void 0:d.site)||null,e.userId=(null===(c=C)||void 0===c?void 0:c.userId)||null,window.sessionStorage.setItem("uid",null===(v=C)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",g);var h=null==e?void 0:e.playerId,y=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,b=null==e?void 0:e.airplay,T=null==e?void 0:e.apiBaseUrl,P=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,O=null==e?void 0:e.errors;O&&(window.customErrors=O),window.customData=null==e?void 0:e.customData,T&&(window.playerEntitlementUrl=T),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!s.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return require("./library-b79c9160.js")})).then((function(e){e.importIMA()})),!y||null!=e&&e.series||Promise.resolve().then((function(){return require("./library-b79c9160.js")})).then((function(e){e.importChromecast()})),b&&"Safari"==r.detectBrowser()&&Promise.resolve().then((function(){return require("./library-b79c9160.js")})).then((function(e){e.importAirplay()})),P&&B("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return e=P,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var I=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(h));if(I&&I.addEventListener("contextmenu",(function(e){return e.preventDefault()})),p){var E,S=null==e||null===(E=e.series)||void 0===E?void 0:E.id;r.getSeriesDetails(S,g).then((function(n){var o,l,a,d=n.data,s=n.data.seasons;r.setCurrentSeries(s);var u=w||(null==s||null===(o=s[0])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,i){var t=new Map;r.getSeriesWatchHistory({videoId:e,token:i}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),r.setSeriesWatchMap(t)})).catch((function(e){return console.log(e)}))}(S,g),r.getVideoDetails(u,g).then((function(n){var o,l,a;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(l=o.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r.setCurrentVideo(n.data),_(h,{res:null==n?void 0:n.data,sres:d},e,{resolve:i,reject:t})})).catch((function(e){r.initiateErrorHandling(e,h,t,w)}))})).catch((function(e){r.initiateErrorHandling(e,h,t)}))}else r.getVideoDetails(w,g).then((function(n){var o,l,a,d;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(l=o.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r.setCurrentVideo(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(d=e.watchHistory)&&void 0!==d&&d.enable?r.getVideoInfo(w,g).then((function(n){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,_(h,{res:s},e,{resolve:i,reject:t})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),_(h,{res:s},e,{resolve:i,reject:t})})):_(h,{res:s},e,{resolve:i,reject:t})})).catch((function(e){r.initiateErrorHandling(e,h,t,w)}))}else t({status:!1,msg:"".concat(g?"Token is expired !":"Missing Authorization Token"),response:{token:g}})}}))},getRenditions:a.getRenditions,skip:r.skip,getPlayer:r.getPlayer,play:r.play,pause:r.pause,detectBrowser:r.detectBrowser,rewind:r.rewind,loadVideo:r.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:r.isPlayerInitialised,load:r.load,dispose:r.dispose,enableCaptions:r.enableCaptions,disableCaptions:r.disableCaptions,getCaptions:r.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:r.getSource,setVolume:j,getVolume:D,disableControls:r.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}},exports.loadScript=B;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("axios"),i=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),o=require("video.js"),r=require("./generic-ee90512f.js"),l=require("./util-0e80fbcd.js"),a=require("./renditions-54652b09.js"),d=require("./resolution-b15f073c.js"),s=require("./skin-84083352.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function m(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?v(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");function f(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=f(),window.sessionStorage.setItem("uid",e),e)}function p(){var e=sessionStorage.getItem("token"),t=JSON.parse(atob(e.split(".")[1]));return null!=t&&t.anonymousId?"guest-user":null==t?void 0:t.userId}window.initialise=function(e){window.sid=f(),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 i,n,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.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,i,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.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(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var i,n;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(i=t.el_)&&void 0!==i&&null!==(n=i.className)&&void 0!==n&&n.includes("vjs-waiting"))c("BUFFERING",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,i,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.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,i,n,o,r,l;c("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.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 i=Math.floor(e.currentTime());i>=30&&i%30==0&&!t.includes(i)&&(t.push(i),fireEvent({eventName:"PING",videoPosition:i,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(),i=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(h(t,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var h=function(e,t,i){return e>=t&&e<=i};function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function y(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?g(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}window.fireEvent=function(e){var i,n,o,r,l,a,d,s,u,c,v=[m(m(m({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params),{},{uid:w(),vid:window.videoId,url:e.url||document.location.href,ref:e.ref||document.referrer,pa:e.eventName,vpos:e.videoPosition,environment:window.environment,dp1:e.dp1||null,dp2:e.dp2||null,dp3:e.dp3||null,dp4:e.dp4||null,dp5:e.dp5||null,apos:!0===e.isAdEvent?e.videoPosition:null,apod:!0===e.isAdEvent?(c=e.adPosition,c?String(c):""):null,profid:p(),player:e.playerType||"native",media_type:e.mediaType||"VIDEO",stream_id:window.sid,embedurl:null,ttfirstframe:e.ttFirstFrame,bitrate:e.bitrate,connectionspeed:null,resolutionheight:e.resHeight,resolutionwidth:e.resWidth,bufferhealth:e.bufferHealth},(null==e?void 0:e.duration)&&{duration:e.duration}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params)];t({url:(null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s||null===(u=s.beacon)||void 0===u?void 0:u.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:sessionStorage.getItem("token")},contentType:"application/x-www-form-urlencoded",dataType:"text",data:v}).catch((function(e){console.error(e)}))},window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var b,T,P=function(e,t){var i=r.getPlayer(e);i&&t&&i.controlBar&&i.controlBar.progressControl.seekBar.on("click",(function(t){var i,n,r,l,a,d=this.el(),s=o.dom.getPointerPosition(d,t).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(r=n.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*s,v.seek()}}))};function O(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var I=[],k=0,S=null;function E(t,i,n){var o,l,a,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];T=(null==i||null===(o=i.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var s=null==i||null===(l=i.watchHistory)||void 0===l?void 0:l.profileId,u=Math.floor(t.currentTime()),c=Math.floor(t.duration()),v=null==i||null===(a=i.watchHistory)||void 0===a?void 0:a.xapiKey,m={};"v1"==T?m={videoId:b,watchedTime:Math.floor(t.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:i.siteOwner,userId:i.userId,xApiKey:v}:"v2"==T&&(m=function(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?O(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({videoId:b,watchedTime:Math.floor(t.currentTime()),watchedPercentage:d?100:Math.floor(u/c*100),doneWatching:d,profileId:s},S&&{seriesId:S})),r.saveWatchHistory(m,i.token,T).then((function(e){})).catch((function(e){})),k=u+n}var j=function(e,t,i){var n=r.getPlayer(e);if(n)if(t>=0&&t<=100){n.muted()&&n.muted(!1);var o=parseFloat(t)/100;n.volume(o),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},D=function(e){var t=r.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function C(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var A=function(t,i,n,o){var l,a,d=o.res,s=o.sres,u=r.getPlayer(t),c=(null==d||null===(l=d.video)||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;r.setCurrentVideo(d),u.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:d})})),u.on("loadeddata",(function(){var o;(null==u||!u.muted())&&j(t,sessionStorage.getItem("volume")||"100");var l,a,c=r.getCurrentVideo();(r.clearError(),n.resolve(function(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?C(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:d}:{response:d})),null!=i&&i.watchHistory&&null!=i&&null!==(o=i.watchHistory)&&void 0!==o&&o.enable&&!i.isAnonymousUser)&&function(e,t,i){var n,o;null!=t&&t.series&&(S=null==t||null===(n=t.series)||void 0===n?void 0:n.id),I=[],k=0,b=i;var l=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.interval)||30,a=r.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());I.includes(k)||(e==k?(I.push(e),E(a,t,l)):e>k&&(k=e+l))})),a.on("ended",(function(){E(a,t,l,!0)})))}(t,i,null==c||null===(l=c.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.id)})),u.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",t)})),u.on("subtitlechanged",(function(e,t){var i,n,o,r,l,a,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(d=a.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var w,p=f.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),u.on("loadedmetadata",(function(){window.endFirstFrame(u)})),u.one("error",(function(){var e,i;r.handleError(t,(null==u||null===(e=u.error())||void 0===e?void 0:e.message)||"Some error occured"),n.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured"})})),u.one("play",(function(){var e;if(null!=i&&null!==(e=i.series)&&void 0!==e&&e.enable){var t,n,o,l=null===(t=r.getCurrentVideo())||void 0===t||null===(n=t.video)||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.id,a=r.getSeriesWatchMap().get(l)||{t:0,p:0},d=a.t,s=a.p;d&&s<95&&setTimeout((function(){u.currentTime(d)}),0)}else null!=i&&i.watchHistoryResumeTime&&(null==i?void 0:i.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==i?void 0:i.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},R=function(e,t){var i=null==t?void 0:t.skin;"live"==i?Promise.resolve().then((function(){return require("./skin-fdc8ba2d.js")})).then((function(i){i.initialiseSkin(e,t)})):"default"==i?Promise.resolve().then((function(){return require("./skin-dc52b3ff.js")})).then((function(i){i.initialiseSkin(e,t)})):"carousel"==i?Promise.resolve().then((function(){return require("./skin-b8808d9e.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==i?Promise.resolve().then((function(){return require("./skin-ed994240.js")})).then((function(i){i.initialiseSkin(e,t)})):"multiplayer"==i&&Promise.resolve().then((function(){return require("./skin-ec245ce9.js")})).then((function(i){i.initialiseSkin(e,t)}))},F=function(e){return new Promise((function(t,i){if(B(e))i("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){t()},n.onerror=function(t){i("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(n)}}))},B=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},M=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 H,_=function(){var e=i(n.mark((function e(){return n.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)}}(),x=function(){var e=i(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){F("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(o)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),F("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:_,loadEMELibrary:x});function N(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function q(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?N(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var L=function(t,l,a,d){var s,u,c,v,m,f,w,p,h,g,b,T,O,I,k,S,E,j,D,C,F,B,H,V=l.res,N=void 0===V?null:V,L=l.sres,W=void 0===L?null:L,U=(null===(s=window)||void 0===s||null===(u=s.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m?void 0:m.S)||void 0,z=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==U&&"NOT_CONNECTED"!==U?["html5","chromecast"]:["chromecast","html5"]:["html5"],G=null==N||null===(f=N.video)||void 0===f||null===(w=f.gist)||void 0===w?void 0:w.videoImageUrl,J=(null==N||null===(p=N.video)||void 0===p||null===(h=p.liveDetails)||void 0===h?void 0:h.isDvrEnabled)||!1,K=function(e){var t,i={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(t=window)&&void 0!==t&&t.cast&&(i={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==r.detectBrowser()&&(i=y(y({},i),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),i}(a),Q=(null==N||null===(g=N.video)||void 0===g||null===(b=g.streamingInfo)||void 0===b?void 0:b.isLiveStream)||!1,X=(null==a?void 0:a.drmLibrary)||!1,Y=(null==N||null===(T=N.ads)||void 0===T||null===(O=T.preRoll)||void 0===O||null===(I=O.adTags)||void 0===I||null===(k=I.web)||void 0===k?void 0:k.active)&&(null==N||null===(S=N.ads)||void 0===S||null===(E=S.preRoll)||void 0===E||null===(j=E.adTags)||void 0===j||null===(D=j.web)||void 0===D?void 0:D.url),Z=(H={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:J},e(H,"autoplay",null==a?void 0:a.autoplay),e(H,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!Y),e(H,"loop",(null==a?void 0:a.loop)||!1),e(H,"html5",q(q({dash:{updateSettings:{streaming:{delay:{liveDelay:3},abr:{ABRStrategy:"abrL2A",maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},initialBitrate:{audio:-1,video:3e3},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:"abrFetchThroughputCalculationAAST"}}}},vhs:q(q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(C=a.customData)||void 0===C?void 0:C.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(F=a.customData)||void 0===F?void 0:F.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(B=a.customData)||void 0===B?void 0:B.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(H,"poster",G),e(H,"techOrder",z),e(H,"chromecast",{requestCustomDataFn:function(e){var i=r.getPlayer(t);console.log(i.textTracksJson_);var n=i.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,t,i){var n,o,r,l,a,d,s,u,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var f=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var p=(null==e||null===(n=e.video)||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=p;var h=null==e||null===(r=e.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=h;var g=null==e||null===(a=e.video)||void 0===a||null===(d=a.gist)||void 0===d?void 0:d.title;m.mediaTitle=g;var y=null==e||null===(s=e.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=y,m.subTitles=i,m.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(N,e,n)}}),e(H,"plugins",K),H),$=o(t,Z,function(){var e=i(n.mark((function e(){var i,l,s,u,c,v,m,f,w,p,h,g,y,b,T,O,I;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q&&d.resolve(q({status:!0,msg:"Player Initialised"},W?{seriesResponse:W,response:N}:{response:N})),window.initialise($),window.firstFrame($),"white"!==window.controlsColor&&M(window.controlsColor,$),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),p=null==N||null===(i=N.video)||void 0===i?void 0:i.drmEnabled,h=null==N||null===(l=N.video)||void 0===l||null===(s=l.liveDetails)||void 0===s?void 0:s.startOverTime,!p&&!X){e.next=15;break}if("Safari"!==r.detectBrowser()){e.next=13;break}return e.next=11,x();case 11:e.next=15;break;case 13:return e.next=15,Promise.all([x(),_()]);case 15:J&&P(t,h),!Y||null!=a&&null!==(u=a.customData)&&void 0!==u&&u.disableAds||r.initialiseAdvertisement(t,Y,N),(g=r.getSource(N,t))?r.loadVideo(t,g):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:N}),r.handleError(t,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==N||null===(c=N.video)||void 0===c||null===(v=c.contentDetails)||void 0===v||null===(m=v.closedCaptions)||void 0===m?void 0:m.length)>0||(null==N||null===(f=N.video)||void 0===f||null===(w=f.closedCaptions)||void 0===w?void 0:w.length)>0)&&(I=(null==N||null===(b=N.video)||void 0===b||null===(T=b.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null==N||null===(O=N.video)||void 0===O?void 0:O.closedCaptions),y=I.filter((function(e){return"VTT"===e.format})),r.addCaptions(t,y)),null!=a&&a.disableControls?r.disableControls(t):R(t,q(q(q({},a),Z),{},{liveVideo:Q,isDvrEnabled:J,res:N,sres:W})),A(t,q(q(q({},a),Z),{},{liveVideo:Q}),d,{res:N,sres:W});case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:r.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,i){var n,o,l,a,d,c,v,m,f;if(!r.isPlayerInitialised(null==e?void 0:e.playerId)){var w=null==e?void 0:e.videoId,p=(null==e||null===(n=e.series)||void 0===n?void 0:n.enable)||!1;window.videoId=w;var h=null==e?void 0:e.token;if(h&&!r.isTokenExpired(h)){H=JSON.parse(atob(h.split(".")[1])),window.siteId=null===(o=H)||void 0===o?void 0:o.siteId,window.siteName=null===(l=H)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=H)||void 0===a||!a.anonymousId),e.siteOwner=(null===(d=H)||void 0===d?void 0:d.site)||null,e.userId=(null===(c=H)||void 0===c?void 0:c.userId)||null,window.sessionStorage.setItem("uid",null===(v=H)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",h);var g=null==e?void 0:e.playerId,y=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,b=null==e?void 0:e.airplay,T=null==e?void 0:e.apiBaseUrl,P=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,O=null==e?void 0:e.errors;O&&(window.customErrors=O),window.customData=null==e?void 0:e.customData,T&&(window.playerEntitlementUrl=T),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!s.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return V})).then((function(e){e.importIMA()})),!y||null!=e&&e.series||Promise.resolve().then((function(){return V})).then((function(e){e.importChromecast()})),b&&"Safari"==r.detectBrowser()&&Promise.resolve().then((function(){return V})).then((function(e){e.importAirplay()})),P&&F("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return e=P,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var I=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(g));if(I&&I.addEventListener("contextmenu",(function(e){return e.preventDefault()})),p){var k,S=null==e||null===(k=e.series)||void 0===k?void 0:k.id;r.getSeriesDetails(S,h).then((function(n){var o,l,a,d=n.data,s=n.data.seasons;r.setCurrentSeries(s);var u=w||(null==s||null===(o=s[0])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var i=new Map;r.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),r.setSeriesWatchMap(i)})).catch((function(e){return console.log(e)}))}(S,h),r.getVideoDetails(u,h).then((function(n){var o,l,a;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(l=o.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r.setCurrentVideo(n.data),L(g,{res:null==n?void 0:n.data,sres:d},e,{resolve:t,reject:i})})).catch((function(e){r.initiateErrorHandling(e,g,i,w)}))})).catch((function(e){r.initiateErrorHandling(e,g,i)}))}else r.getVideoDetails(w,h).then((function(n){var o,l,a,d;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(l=o.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r.setCurrentVideo(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(d=e.watchHistory)&&void 0!==d&&d.enable?r.getVideoInfo(w,h).then((function(n){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,L(g,{res:s},e,{resolve:t,reject:i})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),L(g,{res:s},e,{resolve:t,reject:i})})):L(g,{res:s},e,{resolve:t,reject:i})})).catch((function(e){r.initiateErrorHandling(e,g,i,w)}))}else i({status:!1,msg:"".concat(h?"Token is expired !":"Missing Authorization Token"),response:{token:h}})}}))},getRenditions:a.getRenditions,skip:r.skip,getPlayer:r.getPlayer,play:r.play,pause:r.pause,detectBrowser:r.detectBrowser,rewind:r.rewind,loadVideo:r.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:r.isPlayerInitialised,load:r.load,dispose:r.dispose,enableCaptions:r.enableCaptions,disableCaptions:r.disableCaptions,getCaptions:r.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:r.getSource,setVolume:j,getVolume:D,disableControls:r.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("./index-e90e38a4.js");require("videojs-contrib-dash"),require("videojs-contrib-eme"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/regenerator"),require("video.js"),require("./generic-ee90512f.js"),require("./util-0e80fbcd.js"),require("./renditions-54652b09.js"),require("./resolution-b15f073c.js"),require("./skin-84083352.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),module.exports=e.VLPlayerCore;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),i=require("./index-e90e38a4.js"),t=require("video.js");require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("axios"),require("videojs-contrib-dash"),require("videojs-contrib-eme"),require("./generic-ee90512f.js"),require("js-cookie"),require("ua-parser-js"),require("./util-0e80fbcd.js"),require("./renditions-54652b09.js"),require("./resolution-b15f073c.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./skin-84083352.js");var n=function(){var i=e(r.mark((function e(){return r.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 i.apply(this,arguments)}}(),s=function(){var i=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return i.apply(this,arguments)}}();exports.importAirplay=function(){import("@silvermine/videojs-airplay").then((function(e){e.default(t)}))},exports.importChromecast=function(){import("@silvermine/videojs-chromecast").then((function(e){i.loadScript("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(t)})).catch((function(e){console.log(e)}))}))},exports.importIMA=function(){import("videojs-contrib-ads"),import("videojs-ima"),i.loadScript("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},exports.loadDashLibrary=n,exports.loadEMELibrary=s;
@@ -1 +1 @@
1
- "use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),a=require("video.js"),s=require("./icons-51594f89.js"),r=require("./generic-ee90512f.js"),d=require("./autoNextVideo-bf9f8d77.js"),c=require("./skin-84083352.js");function u(e){var t=p();return function(){var n,l=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(l,arguments,a)}else n=l.apply(this,arguments);return i(this,n)}}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-0e80fbcd.js");var m=a.getComponent("Component"),v=function(i){l(p,m);var o=u(p);function p(e){var n,l,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,p),(a=o.call(this,e,s)).playerId=s.playerId,a.seriesData=s.sres,a.videos=null==s||null===(n=s.playlist)||void 0===n?void 0:n.content,a.cb=(null==s||null===(l=s.playlist)||void 0===l?void 0:l.cb)||null,a.autoNext=(null==s||null===(i=s.playlist)||void 0===i?void 0:i.autoNext)||!1,a.currentVideoData=s.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&d.autoPlayNext({playerId:a.playerId,content:a.videos,cb:a.cb}),a}return n(p,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s.EpisodesSvg())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./playlist-df87ca90.js")})).then((function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=a.dom.createEl("div",{className:"selection-container hidden"});a.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(c.closeOpenDrawers(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var n=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),a.dom.appendContent(e,t),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(t)}},{key:"addFunctionality",value:function(t){var n=this,l=this.el(),i=a.dom.createEl("div",{className:"playlist-selector-head"}),o=a.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(s.crossIconSvg())});o.onclick=function(){t.classList.add("hidden"),l.classList.remove("open"),t.style.right="-350px"};for(var d=a.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),c=a.dom.createEl("div",{className:"playlist-selector-content"}),u=function(t){var l,i,o=a.dom.createEl("div",{className:"playlist-container"}),s=a.dom.createEl("div",{className:"playlist-section",index:t}),d=a.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.title)||"")}),u=a.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});a.dom.appendContent(s,d),a.dom.appendContent(s,u),a.dom.appendContent(o,s),a.dom.appendContent(c,o);var p=a.dom.createEl("div",{className:"playlist-section-expanded hidden"}),m=a.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(i=n.videos[t])||void 0===i?void 0:i.description)||"")}),v=a.dom.createEl("div",{className:"playlist-image"});v.style.backgroundImage="url(".concat(n.videos[t].img,")"),a.dom.appendContent(p,v),a.dom.appendContent(p,m),a.dom.appendContent(o,p),a.dom.appendContent(c,o),p.onclick=function(e){e.stopPropagation(),r.setVideoIdx(t+1),r.load(n.playerId,n.videos[t].id,sessionStorage.getItem("token")).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,i,a=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(a=e(a))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(n=s.classList)&&void 0!==n&&n.contains("hidden")?(o.style.backgroundColor="#0000007d",null==s||null===(l=s.classList)||void 0===l||l.remove("hidden")):(null==s||null===(i=s.classList)||void 0===i||i.add("hidden"),o.style.backgroundColor="unset")}},p=0;p<this.videos.length;p++)u(p);a.dom.appendContent(i,o),a.dom.appendContent(i,d),a.dom.appendContent(t,i),a.dom.appendContent(t,c),r.getPlayer(this.playerId).on("fullscreenchange",(function(){var e=window.getComputedStyle(document.getElementById(n.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(e,"px")}))}}]),p}();exports.default=v;
1
+ "use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),a=require("video.js"),s=require("./icons-51594f89.js"),r=require("./generic-ee90512f.js"),c=require("./autoNextVideo-bf9f8d77.js"),d=require("./skin-84083352.js");function u(e){var t=p();return function(){var n,l=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(l,arguments,a)}else n=l.apply(this,arguments);return i(this,n)}}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-0e80fbcd.js");var m=a.getComponent("Component"),v=function(i){l(p,m);var o=u(p);function p(e){var n,l,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,p),(a=o.call(this,e,s)).playerId=s.playerId,a.seriesData=s.sres,a.videos=null==s||null===(n=s.playlist)||void 0===n?void 0:n.content,a.cb=(null==s||null===(l=s.playlist)||void 0===l?void 0:l.cb)||null,a.autoNext=(null==s||null===(i=s.playlist)||void 0===i?void 0:i.autoNext)||!1,a.currentVideoData=s.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&c.autoPlayNext({playerId:a.playerId,content:a.videos,cb:a.cb}),a}return n(p,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s.EpisodesSvg())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./playlist-df87ca90.js")})).then((function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=a.dom.createEl("div",{className:"selection-container hidden"});a.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(d.closeOpenDrawers(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var n=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),a.dom.appendContent(e,t),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(t)}},{key:"addFunctionality",value:function(t){var n=this,l=this.el(),i=a.dom.createEl("div",{className:"playlist-selector-head"}),o=a.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(s.crossIconSvg())});o.onclick=function(){t.classList.add("hidden"),l.classList.remove("open"),t.style.right="-350px"};for(var c=a.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),d=a.dom.createEl("div",{className:"playlist-selector-content"}),u=function(t){var l,i,o=a.dom.createEl("div",{className:"playlist-container"}),s=a.dom.createEl("div",{className:"playlist-section",index:t}),c=a.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.title)||"")}),u=a.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});a.dom.appendContent(s,c),a.dom.appendContent(s,u),a.dom.appendContent(o,s),a.dom.appendContent(d,o);var p=a.dom.createEl("div",{className:"playlist-section-expanded hidden"}),m=a.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(i=n.videos[t])||void 0===i?void 0:i.description)||"")}),v=a.dom.createEl("div",{className:"playlist-image"});v.style.backgroundImage="url(".concat(n.videos[t].img,")"),a.dom.appendContent(p,v),a.dom.appendContent(p,m),a.dom.appendContent(o,p),a.dom.appendContent(d,o),p.onclick=function(e){e.stopPropagation(),r.setVideoIdx(t+1),r.load(n.playerId,n.videos[t].id,sessionStorage.getItem("token")).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,i,a=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(a=e(a))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(n=s.classList)&&void 0!==n&&n.contains("hidden")?(o.style.backgroundColor="#0000007d",null==s||null===(l=s.classList)||void 0===l||l.remove("hidden")):(null==s||null===(i=s.classList)||void 0===i||i.add("hidden"),o.style.backgroundColor="unset")}},p=0;p<this.videos.length;p++)u(p);a.dom.appendContent(i,o),a.dom.appendContent(i,c),a.dom.appendContent(t,i),a.dom.appendContent(t,d),r.getPlayer(this.playerId).on("fullscreenchange",(function(){var e=window.getComputedStyle(document.getElementById(n.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(e,"px")}))}}]),p}();exports.default=v;
@@ -1 +1 @@
1
- "use strict";var e=require("./features-47c37808.js"),r=require("./keyboardShortcuts-fbd99a1e.js"),t=require("./icons-51594f89.js"),i=require("./generic-ee90512f.js"),n=require("./skin-84083352.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-54652b09.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.initialiseSkin=function(s,o){r.initialiseKeyboardEvents(s,o),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,i){0==i.liveVideo&&0==i.liveui&&e.addSkipButton(r,"default",t.SkipSvg());(0==i.liveVideo&&0==i.liveui||1==i.liveui)&&e.addRewindButton(r,"default",t.RewindSvg())}(s,o),function(r,n){var s=i.getPlayer(r),o=(null==n?void 0:n.sres)||null;s.on("loadeddata",(function(){e.addResolutionModule(r,"default",t.SettingsSvg()),o&&Promise.resolve().then((function(){return require("./nextEpisodeButton-7142cc15.js")})).then((function(e){e.initaliseFunctionality(n.sres.seasons,i.getCurrentVideo())}))})),s.one("loadedmetadata",(function(){var t;o&&(e.addSeriesModule(r,null==n||null===(t=n.sres)||void 0===t?void 0:t.seasons,n),e.addNextEpisodeButton(n.sres,n.res,r))}))}(s,o),function(e,r){var s=i.getPlayer(e),o=document.getElementsByClassName("vjs-current-time")[0],l=document.getElementsByClassName("vjs-duration")[0],a=document.getElementsByClassName("vjs-time-divider")[0];r.liveVideo&&(o&&(o.style.display="none"),l&&(l.style.display="none"),a&&(a.style.display="none"));s.controlBar.getChild("FullscreenToggle").el().appendChild(n.createIconMarkup(t.MinimizeSvg(window.controlsColor))),s.controlBar.getChild("FullscreenToggle").el().appendChild(n.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var u=s.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(n.createIconMarkup(t.NewCaptionsSvg()));var d=document.createElement("div");d.classList.add("caption-header"),u.querySelector(".vjs-menu-content").insertBefore(d,u.querySelector(".vjs-menu-item"))}(s,o)};
1
+ "use strict";var e=require("./features-cb101ecc.js"),r=require("./keyboardShortcuts-fbd99a1e.js"),t=require("./icons-51594f89.js"),i=require("./generic-ee90512f.js"),n=require("./skin-84083352.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-54652b09.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.initialiseSkin=function(s,o){r.initialiseKeyboardEvents(s,o),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,i){0==i.liveVideo&&0==i.liveui&&e.addSkipButton(r,"default",t.SkipSvg());(0==i.liveVideo&&0==i.liveui||1==i.liveui)&&e.addRewindButton(r,"default",t.RewindSvg())}(s,o),function(r,n){var s=i.getPlayer(r),o=(null==n?void 0:n.sres)||null;s.on("loadeddata",(function(){e.addResolutionModule(r,"default",t.SettingsSvg()),o&&Promise.resolve().then((function(){return require("./nextEpisodeButton-7142cc15.js")})).then((function(e){e.initaliseFunctionality(n.sres.seasons,i.getCurrentVideo())}))})),s.one("loadedmetadata",(function(){var t;o&&(e.addSeriesModule(r,null==n||null===(t=n.sres)||void 0===t?void 0:t.seasons,n),e.addNextEpisodeButton(n.sres,n.res,r))}))}(s,o),function(e,r){var s=i.getPlayer(e),o=document.getElementsByClassName("vjs-current-time")[0],l=document.getElementsByClassName("vjs-duration")[0],a=document.getElementsByClassName("vjs-time-divider")[0];r.liveVideo&&(o&&(o.style.display="none"),l&&(l.style.display="none"),a&&(a.style.display="none"));s.controlBar.getChild("FullscreenToggle").el().appendChild(n.createIconMarkup(t.MinimizeSvg(window.controlsColor))),s.controlBar.getChild("FullscreenToggle").el().appendChild(n.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var u=s.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(n.createIconMarkup(t.NewCaptionsSvg()));var d=document.createElement("div");d.classList.add("caption-header"),u.querySelector(".vjs-menu-content").insertBefore(d,u.querySelector(".vjs-menu-item"))}(s,o)};
@@ -1 +1 @@
1
- "use strict";var e=require("./features-47c37808.js"),l=require("./icons-51594f89.js"),i=require("./generic-ee90512f.js"),n=require("./skin-84083352.js"),t=require("./renditions-54652b09.js"),o=require("@babel/runtime/helpers/toConsumableArray"),r=require("./autoNextVideo-bf9f8d77.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("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-0e80fbcd.js");var a=i.getCurrentSeries(),d=[];null==a||a.map((function(e){return d.push.apply(d,o(e.episodes))}));var s=function(e,l){var n;null==l||null===(n=l.series)||void 0===n||n.cb;var t=i.getPlayer(e);t.on("timeupdate",(function(){var e,l=Math.floor(t.currentTime()),n=t.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-l<=10&&i.getVideoIdx()<=(null==d?void 0:d.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=d.filter((function(e,l){return l==i.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var a,s,v,c,m,p,g,f,y,h,b;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var C=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],x=null===(v=document.getElementsByClassName("next-ep-img"))||void 0===v?void 0:v[0],j=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],w=null===(m=r[0])||void 0===m?void 0:m.title;(null===(p=w)||void 0===p?void 0:p.length)>60&&(w=w.substr(0,60)+"..."),C.innerHTML="".concat(w),x.src=(null===(g=r[0])||void 0===g||null===(f=g.gist)||void 0===f||null===(y=f.imageGist)||void 0===y?void 0:y.r16x9)||(null===(h=window)||void 0===h||null===(b=h.customData)||void 0===b?void 0:b.fallbackImage),j.onclick=function(){return u(e)}}else{var q,E,N,V,B,S,k,M=document.createElement("div");M.className="next-ep-preview",M.style.visibility="hidden",document.getElementById(e).append(M);var P=document.createElement("div");P.className="next-ep-header",P.innerHTML="Next up";var I=null===(q=r[0])||void 0===q?void 0:q.title,T=document.createElement("img");T.className="next-ep-img",T.src=(null===(E=r[0])||void 0===E||null===(N=E.gist)||void 0===N||null===(V=N.imageGist)||void 0===V?void 0:V.r16x9)||(null===(B=window)||void 0===B||null===(S=B.customData)||void 0===S?void 0:S.fallbackImage);var L=document.createElement("div");L.className="next-ep-title",(null===(k=I)||void 0===k?void 0:k.length)>60&&(I=I.substr(0,60)+"..."),L.innerHTML="".concat(I);var R=document.createElement("div");R.className="next-ep-content",R.append(T),R.append(L),R.onclick=function(){return u(e)},M.append(P),M.append(R)}},u=function(e,l){var n=i.getPlayer(e),t=Math.floor(n.currentTime());if(Math.floor(n.duration())!=t){n.pause(e);var o=i.getVideoIdx();r.switchToNext(o,e,d,sessionStorage.getItem("token"))}};function v(l,n){var o=i.getPlayer(l);o.on("loadeddata",(function(){var r,a,d;(null===(r=t.getRenditions(l))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(l,n),(null===(a=i.getCaptions(l))||void 0===a?void 0:a.length)>0&&e.addCaptionButton(l,n),null!=n&&null!==(d=n.series)&&void 0!==d&&d.enable&&s(l,n),function(e,l){var i,n=Math.floor(e/60),t=null===(i=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===i?void 0:i[0];t&&(t.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",t&&(t.style.marginRight="56px"))}(o.duration(),(null==n?void 0:n.liveVideo)||!1)})),o.one("play",(function(){var i,n,t,o;null!==(i=window)&&void 0!==i&&null!==(n=i.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(l,null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}exports.initialiseSkin=function(t,o){Promise.resolve().then((function(){return require("./skin-921d35a8.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)})),v(t,o),function(e,t){var o=i.getPlayer(e);o.controlBar.getChild("FullscreenToggle").el().appendChild(n.createIconMarkup(l.MinimizeSvg(window.controlsColor))),o.controlBar.getChild("FullscreenToggle").el().appendChild(n.createIconMarkup(l.MaximizeSvg(window.controlsColor)));var r=document.getElementsByClassName("vjs-time-control");t.liveVideo&&(r[0].style.display="none")}(t,o),function(i,n){var t,o,r,a,d,s;0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(i,"defaultV2",l.SkipSvgV2());(0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(i,"defaultV2",l.RewindSvgV2());n.liveVideo||e.addSlowMotion(i);(null==n||null===(t=n.relatedVideos)||void 0===t||null===(o=t.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(i,null==n?void 0:n.relatedVideos);(null==n||null===(r=n.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(i,null==n?void 0:n.streams);(null==n||null===(a=n.playlist)||void 0===a||null===(d=a.content)||void 0===d?void 0:d.length)>0&&e.addPlaylistSelector(i,null==n?void 0:n.playlist);null!=n&&null!==(s=n.series)&&void 0!==s&&s.enable&&e.addSeriesSelectorV2(i,n)}(t,o),function(e,l){var n=i.getPlayer(e),t=null==l?void 0:l.tvProviderLogoUrl;if(!t)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(t),r.alt="Provider Image",o.append(r),n.el().appendChild(o),n.on("useractive",(function(){o.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||o.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(t,o)};
1
+ "use strict";var e=require("./features-cb101ecc.js"),l=require("./icons-51594f89.js"),i=require("./generic-ee90512f.js"),n=require("./skin-84083352.js"),t=require("./renditions-54652b09.js"),o=require("@babel/runtime/helpers/toConsumableArray"),r=require("./autoNextVideo-bf9f8d77.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("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-0e80fbcd.js");var a=i.getCurrentSeries(),d=[];null==a||a.map((function(e){return d.push.apply(d,o(e.episodes))}));var s=function(e,l){var n;null==l||null===(n=l.series)||void 0===n||n.cb;var t=i.getPlayer(e);t.on("timeupdate",(function(){var e,l=Math.floor(t.currentTime()),n=t.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-l<=10&&i.getVideoIdx()<=(null==d?void 0:d.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=d.filter((function(e,l){return l==i.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var a,s,v,c,m,p,g,h,y,f,b;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var C=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],x=null===(v=document.getElementsByClassName("next-ep-img"))||void 0===v?void 0:v[0],w=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],j=null===(m=r[0])||void 0===m?void 0:m.title;(null===(p=j)||void 0===p?void 0:p.length)>60&&(j=j.substr(0,60)+"..."),C.innerHTML="".concat(j),x.src=(null===(g=r[0])||void 0===g||null===(h=g.gist)||void 0===h||null===(y=h.imageGist)||void 0===y?void 0:y.r16x9)||(null===(f=window)||void 0===f||null===(b=f.customData)||void 0===b?void 0:b.fallbackImage),w.onclick=function(){return u(e)}}else{var q,E,N,V,B,S,k,M=document.createElement("div");M.className="next-ep-preview",M.style.visibility="hidden",document.getElementById(e).append(M);var P=document.createElement("div");P.className="next-ep-header",P.innerHTML="Next up";var I=null===(q=r[0])||void 0===q?void 0:q.title,T=document.createElement("img");T.className="next-ep-img",T.src=(null===(E=r[0])||void 0===E||null===(N=E.gist)||void 0===N||null===(V=N.imageGist)||void 0===V?void 0:V.r16x9)||(null===(B=window)||void 0===B||null===(S=B.customData)||void 0===S?void 0:S.fallbackImage);var L=document.createElement("div");L.className="next-ep-title",(null===(k=I)||void 0===k?void 0:k.length)>60&&(I=I.substr(0,60)+"..."),L.innerHTML="".concat(I);var R=document.createElement("div");R.className="next-ep-content",R.append(T),R.append(L),R.onclick=function(){return u(e)},M.append(P),M.append(R)}},u=function(e,l){var n=i.getPlayer(e),t=Math.floor(n.currentTime());if(Math.floor(n.duration())!=t){n.pause(e);var o=i.getVideoIdx();r.switchToNext(o,e,d,sessionStorage.getItem("token"))}};function v(l,n){var o=i.getPlayer(l);o.on("loadeddata",(function(){var r,a,d;(null===(r=t.getRenditions(l))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(l,n),(null===(a=i.getCaptions(l))||void 0===a?void 0:a.length)>0&&e.addCaptionButton(l,n),null!=n&&null!==(d=n.series)&&void 0!==d&&d.enable&&s(l,n),function(e,l){var i,n=Math.floor(e/60),t=null===(i=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===i?void 0:i[0];t&&(t.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",t&&(t.style.marginRight="56px"))}(o.duration(),(null==n?void 0:n.liveVideo)||!1)})),o.one("play",(function(){var i,n,t,o;null!==(i=window)&&void 0!==i&&null!==(n=i.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(l,null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}exports.initialiseSkin=function(t,o){Promise.resolve().then((function(){return require("./skin-921d35a8.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)})),v(t,o),function(e,t){var o=i.getPlayer(e);o.controlBar.getChild("FullscreenToggle").el().appendChild(n.createIconMarkup(l.MinimizeSvg(window.controlsColor))),o.controlBar.getChild("FullscreenToggle").el().appendChild(n.createIconMarkup(l.MaximizeSvg(window.controlsColor)));var r=document.getElementsByClassName("vjs-time-control");t.liveVideo&&(r[0].style.display="none")}(t,o),function(i,n){var t,o,r,a,d,s;0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(i,"defaultV2",l.SkipSvgV2());(0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(i,"defaultV2",l.RewindSvgV2());n.liveVideo||e.addSlowMotion(i);(null==n||null===(t=n.relatedVideos)||void 0===t||null===(o=t.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(i,null==n?void 0:n.relatedVideos);(null==n||null===(r=n.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(i,null==n?void 0:n.streams);(null==n||null===(a=n.playlist)||void 0===a||null===(d=a.content)||void 0===d?void 0:d.length)>0&&e.addPlaylistSelector(i,null==n?void 0:n.playlist);null!=n&&null!==(s=n.series)&&void 0!==s&&s.enable&&e.addSeriesSelectorV2(i,n)}(t,o),function(e,l){var n=i.getPlayer(e),t=null==l?void 0:l.tvProviderLogoUrl;if(!t)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(t),r.alt="Provider Image",o.append(r),n.el().appendChild(o),n.on("useractive",(function(){o.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||o.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(t,o)};
@@ -1 +1 @@
1
- "use strict";var e,t=require("./features-47c37808.js"),n=require("./icons-51594f89.js"),r=require("./generic-ee90512f.js"),s=require("./skin-84083352.js"),o=require("@babel/runtime/helpers/defineProperty"),i=require("./keyboardShortcuts-fbd99a1e.js");function l(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 a(e,i){var a=r.getPlayer(e);a.one("play",(function(){null!=i&&i.streams&&t.addMulticamView(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},i)),null!=i&&i.airplay&&"Safari"==r.detectBrowser()&&a.addChild("airPlayButton"),null!=i&&i.chromecastReceiverId&&a.addChild("chromecastButton"),a.addChild("FullscreenToggle"),a.getChild("FullscreenToggle").el().appendChild(s.createIconMarkup(n.MinimizeSvg(window.controlsColor))),a.getChild("FullscreenToggle").el().appendChild(s.createIconMarkup(n.MaximizeSvg(window.controlsColor))),u(e)})),a.on("loadedmetadata",(function(){window.endFirstFrame(a),"Safari"!==r.detectBrowser()&&t.addResolutionModule(e,"live",n.SettingsSvg())})),a.one("loadedmetadata",(function(){var n;null!=i&&i.streams&&(null==i||null===(n=i.streams)||void 0===n?void 0:n.length)>=2&&t.addMwebPotraitTrayModule(e,i)}))}function u(t){var n=r.getPlayer(t);d(),n.on("pause",(function(){clearTimeout(e),c()})),n.on("play",(function(){d()}));var s=document.getElementById("".concat(t));s.addEventListener("mouseenter",(function(){c(),n.paused()||d()})),s.addEventListener("touchstart",(function(){c(),d()})),s.addEventListener("mousemove",(function(){c(),n.paused()||d()}))}function c(){var e=document.getElementsByClassName("vjs-chromecast-button")[0],t=document.getElementsByClassName("vjs-airplay-button")[0],n=document.getElementsByClassName("vjs-fullscreen-control")[0];null!=e&&e.classList.contains("hideoutsidecontrols")&&(null==e||e.classList.remove("hideoutsidecontrols")),n.classList.contains("hideoutsidecontrols")&&n.classList.remove("hideoutsidecontrols"),null!=t&&t.classList.contains("hideoutsidecontrols")&&t.classList.remove("hideoutsidecontrols")}function d(){var t=document.getElementsByClassName("vjs-chromecast-button")[0],n=document.getElementsByClassName("vjs-fullscreen-control")[0],r=document.getElementsByClassName("vjs-airplay-button")[0];clearTimeout(e),e=setTimeout((function(){null==t||t.classList.add("hideoutsidecontrols"),null==n||n.classList.add("hideoutsidecontrols"),null==r||r.classList.add("hideoutsidecontrols")}),2200)}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-54652b09.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.hideControls=u,exports.initialiseSkin=function(e,o){var l;i.initialiseKeyboardEvents(e,o),(null==(l=o)||!l.liveui)&&(null==l||!l.liveVideo)||null!=l&&l.liveui&&null!=l&&l.liveVideo?Promise.resolve().then((function(){return require("./dvr_skin-f7f770ae.js")})).then((function(e){var t=document.createElement("style");t.id="dvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})):Promise.resolve().then((function(){return require("./nondvr_skin-ef2cb3b2.js")})).then((function(e){var t=document.createElement("style");t.id="nondvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,n){t.addSlowMotion(e)}(e),function(e,t){var o=r.getPlayer(e),i=o.controlBar.getChild("SubsCapsButton").el();document.getElementsByClassName("vjs-subs-caps-button")[1].appendChild(s.createIconMarkup(n.NewCaptionsSvg()));var l=document.createElement("div");l.classList.add("caption-header"),i.querySelector(".vjs-menu-content").insertBefore(l,i.querySelector(".vjs-menu-item"));var a=document.createElement("div");if(a.innerText="Captions",a.className="fs14",document.getElementsByClassName("vjs-subs-caps-button")[0].appendChild(a),"Safari"==r.detectBrowser()){document.getElementsByClassName("vjs-subs-caps-button")[0].style.left="9.5rem"}null!=t&&t.liveui||null==t||!t.liveVideo||(document.getElementsByClassName("vjs-progress-control")[0].style.display="none")}(e,o),a(e,o)};
1
+ "use strict";var e,t=require("./features-cb101ecc.js"),n=require("./icons-51594f89.js"),r=require("./generic-ee90512f.js"),s=require("./skin-84083352.js"),o=require("@babel/runtime/helpers/defineProperty"),i=require("./keyboardShortcuts-fbd99a1e.js");function l(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 a(e,i){var a=r.getPlayer(e);a.one("play",(function(){null!=i&&i.streams&&t.addMulticamView(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},i)),null!=i&&i.airplay&&"Safari"==r.detectBrowser()&&a.addChild("airPlayButton"),null!=i&&i.chromecastReceiverId&&a.addChild("chromecastButton"),a.addChild("FullscreenToggle"),a.getChild("FullscreenToggle").el().appendChild(s.createIconMarkup(n.MinimizeSvg(window.controlsColor))),a.getChild("FullscreenToggle").el().appendChild(s.createIconMarkup(n.MaximizeSvg(window.controlsColor))),u(e)})),a.on("loadedmetadata",(function(){window.endFirstFrame(a),"Safari"!==r.detectBrowser()&&t.addResolutionModule(e,"live",n.SettingsSvg())})),a.one("loadedmetadata",(function(){var n;null!=i&&i.streams&&(null==i||null===(n=i.streams)||void 0===n?void 0:n.length)>=2&&t.addMwebPotraitTrayModule(e,i)}))}function u(t){var n=r.getPlayer(t);d(),n.on("pause",(function(){clearTimeout(e),c()})),n.on("play",(function(){d()}));var s=document.getElementById("".concat(t));s.addEventListener("mouseenter",(function(){c(),n.paused()||d()})),s.addEventListener("touchstart",(function(){c(),d()})),s.addEventListener("mousemove",(function(){c(),n.paused()||d()}))}function c(){var e=document.getElementsByClassName("vjs-chromecast-button")[0],t=document.getElementsByClassName("vjs-airplay-button")[0],n=document.getElementsByClassName("vjs-fullscreen-control")[0];null!=e&&e.classList.contains("hideoutsidecontrols")&&(null==e||e.classList.remove("hideoutsidecontrols")),n.classList.contains("hideoutsidecontrols")&&n.classList.remove("hideoutsidecontrols"),null!=t&&t.classList.contains("hideoutsidecontrols")&&t.classList.remove("hideoutsidecontrols")}function d(){var t=document.getElementsByClassName("vjs-chromecast-button")[0],n=document.getElementsByClassName("vjs-fullscreen-control")[0],r=document.getElementsByClassName("vjs-airplay-button")[0];clearTimeout(e),e=setTimeout((function(){null==t||t.classList.add("hideoutsidecontrols"),null==n||n.classList.add("hideoutsidecontrols"),null==r||r.classList.add("hideoutsidecontrols")}),2200)}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-54652b09.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.hideControls=u,exports.initialiseSkin=function(e,o){var l;i.initialiseKeyboardEvents(e,o),(null==(l=o)||!l.liveui)&&(null==l||!l.liveVideo)||null!=l&&l.liveui&&null!=l&&l.liveVideo?Promise.resolve().then((function(){return require("./dvr_skin-f7f770ae.js")})).then((function(e){var t=document.createElement("style");t.id="dvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})):Promise.resolve().then((function(){return require("./nondvr_skin-ef2cb3b2.js")})).then((function(e){var t=document.createElement("style");t.id="nondvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,n){t.addSlowMotion(e)}(e),function(e,t){var o=r.getPlayer(e),i=o.controlBar.getChild("SubsCapsButton").el();document.getElementsByClassName("vjs-subs-caps-button")[1].appendChild(s.createIconMarkup(n.NewCaptionsSvg()));var l=document.createElement("div");l.classList.add("caption-header"),i.querySelector(".vjs-menu-content").insertBefore(l,i.querySelector(".vjs-menu-item"));var a=document.createElement("div");if(a.innerText="Captions",a.className="fs14",document.getElementsByClassName("vjs-subs-caps-button")[0].appendChild(a),"Safari"==r.detectBrowser()){document.getElementsByClassName("vjs-subs-caps-button")[0].style.left="9.5rem"}null!=t&&t.liveui||null==t||!t.liveVideo||(document.getElementsByClassName("vjs-progress-control")[0].style.display="none")}(e,o),a(e,o)};
@@ -1 +1 @@
1
- "use strict";var e=require("./generic-ee90512f.js"),r=require("./renditions-54652b09.js"),i=require("./features-47c37808.js");require("@babel/runtime/helpers/defineProperty"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),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"),exports.initialiseSkin=function(t,n){Promise.resolve().then((function(){return require("./skin-f225a42e.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 e;(null===(e=r.getRenditions(t))||void 0===e?void 0:e.length)>0&&i.addSettingsButtonV2(t,n)}))}(t,n)};
1
+ "use strict";var e=require("./generic-ee90512f.js"),r=require("./renditions-54652b09.js"),i=require("./features-cb101ecc.js");require("@babel/runtime/helpers/defineProperty"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),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"),exports.initialiseSkin=function(t,n){Promise.resolve().then((function(){return require("./skin-f225a42e.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 e;(null===(e=r.getRenditions(t))||void 0===e?void 0:e.length)>0&&i.addSettingsButtonV2(t,n)}))}(t,n)};
@@ -0,0 +1 @@
1
+ import{g as n,o as t,b as o,I as e,H as i,J as s}from"./generic-2bf074c4.js";import{a}from"./util-25747132.js";import{h as c}from"./skin-665ec17e.js";var r,u=0,f=0,l=function(l){clearTimeout(u);var v=null==l?void 0:l.content;r=null==l?void 0:l.cb;var d=l.playerId,g=sessionStorage.getItem("token");a(d,(function(){var a=n(d);0!==(null==a?void 0:a.currentTime())&&((f=i())>v.length-1||t(d,v[f].id,g).then((function(n){c(f),o(n.response),f++,s(f),h(n)})).catch((function(n){h(n),c(f),f++,s(f),u=setTimeout((function(){e(d)&&m(f,d,v,g)}),5e3)})))}))},m=function n(o,e,i,a,r){f=o,o>i.length-1||t(e,i[o].id,a).then((function(n){c(f),f++,s(f),h(n)})).catch((function(t){h(t),setTimeout((function(){c(f),f++,s(f),n(f,e,i,a)}),5e3)}))},h=function(n){r&&r(n)};export{l as a,m as s};
package/esm/bundle.css CHANGED
@@ -13,6 +13,7 @@
13
13
 
14
14
 
15
15
 
16
+
16
17
  .widget-selection{
17
18
  display: flex;
18
19
  align-items: center;
@@ -134,7 +135,6 @@
134
135
  padding: 0 18px;
135
136
  }
136
137
 
137
-
138
138
  .vjs-poster {
139
139
  display: inline-block;
140
140
  vertical-align: middle;
@@ -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,r as s,j as c}from"./generic-2bf074c4.js";import{g as d}from"./renditions-4bf28942.js";function u(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 m(e){var t=p();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 p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var h=function(e){var o=function(e){r(i,e);var o=m(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.innerHTML="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)},f=function(e,o,l){var a=function(o){r(a,o);var i=m(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;return o.classList.add("vjs-rewind-button"),o.innerHTML=l,r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},g=function(e,o,l){var a=function(o){r(a,o);var i=m(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;return o.classList.add("vjs-skip-button"),o.innerHTML=l,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)},v=function(e,t){import("./multicam-c072652e.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")},y=function(e,t,n){import("./resolution-e1444da9.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=d(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))}))},C=function(e,t,n){import("./nextEpisodeButton-5694fd81.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)}))},B=function(e,t){import("./mwebPotraitTray-d32baf21.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)}))},b=function(e,t,n){import("./series-2088662e.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)}))},j=function(e,t){import("./videoSelector-52aafbc7.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)}))},k=function(e,t){import("./caption-settings-2dfa52b0.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.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},O=function(e,t){import("./settings-icon-97cb1623.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.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},M=function(e,t){import("./playlist-cf33d7c6.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)}))},S=function(t,n){import("./series-v2-d20528f3.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?u(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({playerId:t},n),l.controlBar.children().length-3)}))},E=function(e,t){import("./multicamv2-cc9ecad5.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)}))},I=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)};export{v as a,y as b,B as c,h as d,b as e,C as f,g,f as h,O as i,k as j,I as k,j as l,E as m,M as n,S as o};
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,r as s,j as c}from"./generic-2bf074c4.js";import{g as d}from"./renditions-4bf28942.js";function u(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 m(e){var t=p();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 p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var h=function(e){var o=function(e){r(i,e);var o=m(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.innerHTML="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)},f=function(e,o,l){var a=function(o){r(a,o);var i=m(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;return o.classList.add("vjs-rewind-button"),o.innerHTML=l,r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},g=function(e,o,l){var a=function(o){r(a,o);var i=m(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;return o.classList.add("vjs-skip-button"),o.innerHTML=l,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)},v=function(e,t){import("./multicam-c072652e.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")},y=function(e,t,n){import("./resolution-e1444da9.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=d(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))}))},C=function(e,t,n){import("./nextEpisodeButton-5694fd81.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)}))},B=function(e,t){import("./mwebPotraitTray-d32baf21.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)}))},b=function(e,t,n){import("./series-2088662e.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)}))},j=function(e,t){import("./videoSelector-4f4a7ae9.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)}))},k=function(e,t){import("./caption-settings-2dfa52b0.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.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},O=function(e,t){import("./settings-icon-97cb1623.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.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},M=function(e,t){import("./playlist-be2fa9fd.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)}))},S=function(t,n){import("./series-v2-aa62968c.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?u(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({playerId:t},n),l.controlBar.children().length-3)}))},E=function(e,t){import("./multicamv2-cc9ecad5.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)}))},I=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)};export{v as a,y as b,B as c,h as d,b as e,C as f,g,f as h,O as i,k as j,I as k,j as l,E as m,M as n,S as o};
@@ -0,0 +1 @@
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import i from"axios";import"videojs-contrib-dash";import"videojs-contrib-eme";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import o from"video.js";import{d as r,g as l,s as a,c as d,h as s,a as u,b as c,e as v,f as m,i as f,l as w,j as p,p as h,k as g,r as y,m as b,n as T,o as O,q as P,t as I,u as k,v as E,w as j,x as S,y as D,z as R,A,B as F,C,D as B,E as M,F as H}from"./generic-2bf074c4.js";import{o as N,g as _,a as x,s as L,b as V}from"./util-25747132.js";import{g as U}from"./renditions-4bf28942.js";import{playSelectedResolution as W}from"./resolution-e1444da9.js";import{i as q}from"./skin-665ec17e.js";function z(){var e,i;null===(e=window)||void 0===e||null===(i=e.dataLayer)||void 0===i||i.push(arguments)}function G(e,i){z("event",e,i)}function J(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function K(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}function Q(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function Y(){var e=window.sessionStorage.getItem("uid");return e||(e=Q(),window.sessionStorage.setItem("uid",e),e)}function X(){var e=sessionStorage.getItem("token"),i=JSON.parse(atob(e.split(".")[1]));return null!=i&&i.anonymousId?"guest-user":null==i?void 0:i.userId}window.initialise=function(e){window.sid=Q(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var i=Math.floor(e.currentTime());e.on("error",(function(){var t,n,o,r=Math.floor(e.currentTime());G(r?"FAILED_TO_START":"DROPPED_STREAM",K({pfm:window.platform,uid:Y(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:i===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var i,t,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),G("PLAY",K({pfm:window.platform,uid:Y(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(t=i.customData)||void 0===t||null===(n=t.beacon)||void 0===n?void 0:n.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(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,i){var t,n;if(i.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=i&&null!==(t=i.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting"))G("BUFFERING",K({pfm:window.platform,uid:Y(),vid:window.videoId,videoPosition:i.el_&&Math.floor(i.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:i.el_&&Math.floor(i.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var i,t,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,G("FIRST_FRAME",K({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Y(),vid:window.videoId},null===(i=window)||void 0===i||null===(t=i.customData)||void 0===t||null===(n=t.beacon)||void 0===n?void 0:n.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 i,t,n,o,r,l;G("AD_REQUEST",K({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Y(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(i=window)||void 0===i||null===(t=i.customData)||void 0===t||null===(n=t.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),G("AD_IMPRESSION",K({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Y(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.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 i=[];e.on("timeupdate",(function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!i.includes(t)&&(i.push(t),fireEvent({eventName:"PING",videoPosition:t,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 i=e.currentTime(),t=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(Z(i,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}}))()};var Z=function(e,i,t){return e>=i&&e<=t};function $(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function ee(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}window.fireEvent=function(e){var t,n,o,r,l,a,d,s,u,c,v=[K(K(K({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params),{},{uid:Y(),vid:window.videoId,url:e.url||document.location.href,ref:e.ref||document.referrer,pa:e.eventName,vpos:e.videoPosition,environment:window.environment,dp1:e.dp1||null,dp2:e.dp2||null,dp3:e.dp3||null,dp4:e.dp4||null,dp5:e.dp5||null,apos:!0===e.isAdEvent?e.videoPosition:null,apod:!0===e.isAdEvent?(c=e.adPosition,c?String(c):""):null,profid:X(),player:e.playerType||"native",media_type:e.mediaType||"VIDEO",stream_id:window.sid,embedurl:null,ttfirstframe:e.ttFirstFrame,bitrate:e.bitrate,connectionspeed:null,resolutionheight:e.resHeight,resolutionwidth:e.resWidth,bufferhealth:e.bufferHealth},(null==e?void 0:e.duration)&&{duration:e.duration}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params)];i({url:(null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s||null===(u=s.beacon)||void 0===u?void 0:u.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:sessionStorage.getItem("token")},contentType:"application/x-www-form-urlencoded",dataType:"text",data:v}).catch((function(e){console.error(e)}))},window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var ie,te,ne=function(e,i){var t=l(e);t&&i&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(i){var t,n,r,l,a,d=this.el(),s=o.dom.getPointerPosition(d,i).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(n=t.cast)||void 0===n||null===(r=n.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*s,v.seek()}}))};function oe(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}var re=[],le=0,ae=null;function de(i,t,n){var o,r,l,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];te=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var s=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(i.currentTime()),c=Math.floor(i.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,m={};"v1"==te?m={videoId:ie,watchedTime:Math.floor(i.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==te&&(m=function(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}({videoId:ie,watchedTime:Math.floor(i.currentTime()),watchedPercentage:d?100:Math.floor(u/c*100),doneWatching:d,profileId:s},ae&&{seriesId:ae})),a(m,t.token,te).then((function(e){})).catch((function(e){})),le=u+n}var se=function(e,i,t){var n=l(e);if(n)if(i>=0&&i<=100){n.muted()&&n.muted(!1);var o=parseFloat(i)/100;n.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(i,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},ue=function(e){var i=l(e);return i?parseInt(100*i.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ce(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}var ve,me=function(i,t,n,o){var r,a,m=o.res,f=o.sres,w=l(i),p=(null==m||null===(r=m.video)||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;c(m),w.on("loadstart",(function(){p&&n.resolve({status:!0,msg:"Video Loaded",response:m})})),w.on("loadeddata",(function(){var o;(null==w||!w.muted())&&se(i,sessionStorage.getItem("volume")||"100");var r,a,s=u();(d(),n.resolve(function(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:m}:{response:m})),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&!t.isAnonymousUser)&&function(e,i,t){var n,o;null!=i&&i.series&&(ae=null==i||null===(n=i.series)||void 0===n?void 0:n.id),re=[],le=0,ie=t;var r=(null==i||null===(o=i.watchHistory)||void 0===o?void 0:o.interval)||30,a=l(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());re.includes(le)||(e==le?(re.push(e),de(a,i,r)):e>le&&(le=e+r))})),a.on("ended",(function(){de(a,i,r,!0)})))}(i,t,null==s||null===(r=s.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.id)})),w.textTracks().on("change",(function(e){var i=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];w.trigger("subtitlechanged",i)})),w.on("subtitlechanged",(function(e,i){var t,n,o,r,l,a,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(n=t.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(d=a.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var w,p=f.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=i?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),w.on("loadedmetadata",(function(){window.endFirstFrame(w)})),w.one("error",(function(){var e,t;s(i,(null==w||null===(e=w.error())||void 0===e?void 0:e.message)||"Some error occured"),n.reject({status:!1,msg:(null==w||null===(t=w.error())||void 0===t?void 0:t.message)||"Some error occured"})})),w.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var i,n,o,r=null===(i=u())||void 0===i||null===(n=i.video)||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.id,l=v().get(r)||{t:0,p:0},a=l.t,d=l.p;a&&d<95&&setTimeout((function(){w.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){w.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),w.on("volumechange",(function(){var e=100*w.volume().toFixed(2);w.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},fe=function(e,i){var t=null==i?void 0:i.skin;"live"==t?import("./skin-3445651c.js").then((function(t){t.initialiseSkin(e,i)})):"default"==t?import("./skin-c7391ef0.js").then((function(t){t.initialiseSkin(e,i)})):"carousel"==t?import("./skin-809a9390.js").then((function(i){i.initaliseSkin(e)})):"defaultV2"==t?import("./skin-3b60a34b.js").then((function(t){t.initialiseSkin(e,i)})):"multiplayer"==t&&import("./skin-2351798d.js").then((function(t){t.initialiseSkin(e,i)}))},we=function(e){return new Promise((function(i,t){if(pe(e))t("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){i()},n.onerror=function(i){t("Error while loading script ".concat(e," : ").concat(i))},document.head.appendChild(n)}}))},pe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},he=function(e,i){i.controlBar.el_.style.color=e,i.controlBar.el_.querySelector(".vjs-play-progress")&&(i.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),i.controlBar.el_.querySelector(".vjs-volume-level")&&(i.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};function ge(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),t.push.apply(t,n)}return t}function ye(i){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(n),!0).forEach((function(t){e(i,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}))}return i}var be=function(i,a,d,u){var c,v,m,f,w,p,h,g,y,T,O,P,I,k,E,D,R,A,F,C,H,N,_,x=a.res,L=void 0===x?null:x,V=a.sres,U=void 0===V?null:V,W=(null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(f=m.CastContext)||void 0===f||null===(w=f.getInstance())||void 0===w?void 0:w.S)||void 0,q=null!=d&&d.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==W&&"NOT_CONNECTED"!==W?["html5","chromecast"]:["chromecast","html5"]:["html5"],z=null==L||null===(p=L.video)||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl,G=(null==L||null===(g=L.video)||void 0===g||null===(y=g.liveDetails)||void 0===y?void 0:y.isDvrEnabled)||!1,J=function(e){var i,t={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(i=window)&&void 0!==i&&i.cast&&(t={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==r()&&(t=ee(ee({},t),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),t}(d),K=(null==L||null===(T=L.video)||void 0===T||null===(O=T.streamingInfo)||void 0===O?void 0:O.isLiveStream)||!1;null==d||d.drmLibrary;var Q=(null==L||null===(P=L.ads)||void 0===P||null===(I=P.preRoll)||void 0===I||null===(k=I.adTags)||void 0===k||null===(E=k.web)||void 0===E?void 0:E.active)&&(null==L||null===(D=L.ads)||void 0===D||null===(R=D.preRoll)||void 0===R||null===(A=R.adTags)||void 0===A||null===(F=A.web)||void 0===F?void 0:F.url),Y=(_={controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:("default"==d.skin||"defaultV2"==d.skin||"live"==(null==d?void 0:d.skin))&&{inline:!1},fullscreenToggle:"default"==d.skin||"defaultV2"==d.skin,audioTrackButton:!1,pictureInPictureToggle:(d.skin,!1)},muteToggle:"multiplayer"==d.skin,liveui:G},e(_,"autoplay",null==d?void 0:d.autoplay),e(_,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!Q),e(_,"loop",(null==d?void 0:d.loop)||!1),e(_,"html5",ye(ye({dash:{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||3},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},vhs:ye(ye({experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==d||null===(C=d.customData)||void 0===C?void 0:C.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==d?void 0:d.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==d?void 0:d.experimentalBufferBasedABR)||!1})},0==(null==d||null===(H=d.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(N=d.customData)||void 0===N?void 0:N.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(_,"poster",z),e(_,"techOrder",q),e(_,"chromecast",{requestCustomDataFn:function(e){var t=l(i);console.log(t.textTracksJson_);var n=t.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,i,t){var n,o,r,l,a,d,s,u,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var f=i.keySystemOptions&&i.keySystemOptions[0]&&i.keySystemOptions[0].options&&i.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var w=i.keySystemOptions&&i.keySystemOptions[0]&&i.keySystemOptions[0].options&&i.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var p=(null==e||null===(n=e.video)||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=p;var h=null==e||null===(r=e.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=h;var g=null==e||null===(a=e.video)||void 0===a||null===(d=a.gist)||void 0===d?void 0:d.title;m.mediaTitle=g;var y=null==e||null===(s=e.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=y,m.subTitles=t,m.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(L,e,n)}}),e(_,"plugins",J),_),X=o(i,Y,function(){var e=t(n.mark((function e(){var t,r,l,a,c,v,m,f,w,p,h,g,y,T,O,P;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:K&&u.resolve(ye({status:!0,msg:"Player Initialised"},U?{seriesResponse:U,response:L}:{response:L})),window.initialise(X),window.firstFrame(X),"white"!==window.controlsColor&&he(window.controlsColor,X),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),null==L||null===(t=L.video)||void 0===t||t.drmEnabled,p=null==L||null===(r=L.video)||void 0===r||null===(l=r.liveDetails)||void 0===l?void 0:l.startOverTime,G&&ne(i,p),!Q||null!=d&&null!==(a=d.customData)&&void 0!==a&&a.disableAds||B(i,Q,L),(h=j(L,i))?b(i,h):(u.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:L}),s(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==L||null===(c=L.video)||void 0===c||null===(v=c.contentDetails)||void 0===v||null===(m=v.closedCaptions)||void 0===m?void 0:m.length)>0||(null==L||null===(f=L.video)||void 0===f||null===(w=f.closedCaptions)||void 0===w?void 0:w.length)>0)&&(P=(null==L||null===(y=L.video)||void 0===y||null===(T=y.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null==L||null===(O=L.video)||void 0===O?void 0:O.closedCaptions),g=P.filter((function(e){return"VTT"===e.format})),M(i,g)),null!=d&&d.disableControls?S(i):fe(i,ye(ye(ye({},d),Y),{},{liveVideo:K,isDvrEnabled:G,res:L,sres:U})),me(i,ye(ye(ye({},d),Y),{},{liveVideo:K}),u,{res:L,sres:U});case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Te(){return{loadVideoInstantly:w,onTimeUpdate:N,getVideoDuration:_,onVideoEnded:x,init:function(e){return new Promise((function(i,t){var n,o,l,a,d,s,u,v,w;if(!T(null==e?void 0:e.playerId)){var p=null==e?void 0:e.videoId,h=(null==e||null===(n=e.series)||void 0===n?void 0:n.enable)||!1;window.videoId=p;var g=null==e?void 0:e.token;if(g&&!D(g)){ve=JSON.parse(atob(g.split(".")[1])),window.siteId=null===(o=ve)||void 0===o?void 0:o.siteId,window.siteName=null===(l=ve)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=ve)||void 0===a||!a.anonymousId),e.siteOwner=(null===(d=ve)||void 0===d?void 0:d.site)||null,e.userId=(null===(s=ve)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=ve)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",g);var y=null==e?void 0:e.playerId,b=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,P=null==e?void 0:e.apiBaseUrl,I=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,k=null==e?void 0:e.errors;k&&(window.customErrors=k),window.customData=null==e?void 0:e.customData,P&&(window.playerEntitlementUrl=P),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!q(e.skin)||(e.skin="defaultV2"),import("./library-6870523c.js").then((function(e){e.importIMA()})),!b||null!=e&&e.series||import("./library-6870523c.js").then((function(e){e.importChromecast()})),O&&"Safari"==r()&&import("./library-6870523c.js").then((function(e){e.importAirplay()})),I&&we("https://www.googletagmanager.com/gtag/js?id=".concat(I)).then((function(){return e=I,window.dataLayer=window.dataLayer||[],z("js",new Date),void z("config",e);var e})).catch((function(e){}));var E=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(y));if(E&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h){var j,S=null==e||null===(j=e.series)||void 0===j?void 0:j.id;R(S,g).then((function(n){var o,r,l,a=n.data,d=n.data.seasons;H(d);var s=p||(null==d||null===(o=d[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,i){var t=new Map;m({videoId:e,token:i}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),f(t)})).catch((function(e){return console.log(e)}))}(S,g),A(s,g).then((function(n){var o,r,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(n.data),be(y,{res:null==n?void 0:n.data,sres:a},e,{resolve:i,reject:t})})).catch((function(e){F(e,y,t,p)}))})).catch((function(e){F(e,y,t)}))}else A(p,g).then((function(n){var o,r,l,a;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==n?void 0:n.data);var d=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?C(p,g).then((function(n){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(s=n.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,be(y,{res:d},e,{resolve:i,reject:t})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),be(y,{res:d},e,{resolve:i,reject:t})})):be(y,{res:d},e,{resolve:i,reject:t})})).catch((function(e){F(e,y,t,p)}))}else t({status:!1,msg:"".concat(g?"Token is expired !":"Missing Authorization Token"),response:{token:g}})}}))},getRenditions:U,skip:p,getPlayer:l,play:h,pause:g,detectBrowser:r,rewind:y,loadVideo:b,seekToTimeStamp:L,isPlayerInitialised:T,load:O,dispose:P,enableCaptions:I,disableCaptions:k,getCaptions:E,playSelectedResolution:W,getSource:j,setVolume:se,getVolume:ue,disableControls:S,setPlaybackSpeed:V}}export{Te as V,we as l};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"axios";import i from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import o from"video.js";import{d as r,g as l,s as a,c as s,h as d,a as u,b as c,e as v,f as m,i as f,l as w,j as p,p as h,k as g,r as y,m as b,n as T,o as O,q as P,t as I,u as k,v as j,w as E,x as S,y as D,z as A,A as F,B as R,C,D as B,E as M,F as _}from"./generic-2bf074c4.js";import{o as x,g as H,a as N,s as L,b as V}from"./util-25747132.js";import{g as U}from"./renditions-4bf28942.js";import{playSelectedResolution as W}from"./resolution-e1444da9.js";import{i as q}from"./skin-665ec17e.js";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";function z(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function G(e,t){z("event",e,t)}function J(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function K(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?J(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Q(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function X(){var e=window.sessionStorage.getItem("uid");return e||(e=Q(),window.sessionStorage.setItem("uid",e),e)}function Y(){var e=sessionStorage.getItem("token"),t=JSON.parse(atob(e.split(".")[1]));return null!=t&&t.anonymousId?"guest-user":null==t?void 0:t.userId}window.initialise=function(e){window.sid=Q(),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 i,n,o,r=Math.floor(e.currentTime());G(r?"FAILED_TO_START":"DROPPED_STREAM",K({pfm:window.platform,uid:X(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.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,i,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),G("PLAY",K({pfm:window.platform,uid:X(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.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(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var i,n;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(i=t.el_)&&void 0!==i&&null!==(n=i.className)&&void 0!==n&&n.includes("vjs-waiting"))G("BUFFERING",K({pfm:window.platform,uid:X(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,i,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,G("FIRST_FRAME",K({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:X(),vid:window.videoId},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.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,i,n,o,r,l;G("AD_REQUEST",K({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:X(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),G("AD_IMPRESSION",K({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:X(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.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 i=Math.floor(e.currentTime());i>=30&&i%30==0&&!t.includes(i)&&(t.push(i),fireEvent({eventName:"PING",videoPosition:i,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(),i=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(Z(t,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var Z=function(e,t,i){return e>=t&&e<=i};function $(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ee(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?$(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}window.fireEvent=function(e){var i,n,o,r,l,a,s,d,u,c,v=[K(K(K({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params),{},{uid:X(),vid:window.videoId,url:e.url||document.location.href,ref:e.ref||document.referrer,pa:e.eventName,vpos:e.videoPosition,environment:window.environment,dp1:e.dp1||null,dp2:e.dp2||null,dp3:e.dp3||null,dp4:e.dp4||null,dp5:e.dp5||null,apos:!0===e.isAdEvent?e.videoPosition:null,apod:!0===e.isAdEvent?(c=e.adPosition,c?String(c):""):null,profid:Y(),player:e.playerType||"native",media_type:e.mediaType||"VIDEO",stream_id:window.sid,embedurl:null,ttfirstframe:e.ttFirstFrame,bitrate:e.bitrate,connectionspeed:null,resolutionheight:e.resHeight,resolutionwidth:e.resWidth,bufferhealth:e.bufferHealth},(null==e?void 0:e.duration)&&{duration:e.duration}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params)];t({url:(null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:sessionStorage.getItem("token")},contentType:"application/x-www-form-urlencoded",dataType:"text",data:v}).catch((function(e){console.error(e)}))},window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var te,ie,ne=function(e,t){var i=l(e);i&&t&&i.controlBar&&i.controlBar.progressControl.seekBar.on("click",(function(t){var i,n,r,l,a,s=this.el(),d=o.dom.getPointerPosition(s,t).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(r=n.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*d,v.seek()}}))};function oe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var re=[],le=0,ae=null;function se(t,i,n){var o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ie=(null==i||null===(o=i.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var d=null==i||null===(r=i.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(t.currentTime()),c=Math.floor(t.duration()),v=null==i||null===(l=i.watchHistory)||void 0===l?void 0:l.xapiKey,m={};"v1"==ie?m={videoId:te,watchedTime:Math.floor(t.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:i.siteOwner,userId:i.userId,xApiKey:v}:"v2"==ie&&(m=function(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?oe(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({videoId:te,watchedTime:Math.floor(t.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},ae&&{seriesId:ae})),a(m,i.token,ie).then((function(e){})).catch((function(e){})),le=u+n}var de=function(e,t,i){var n=l(e);if(n)if(t>=0&&t<=100){n.muted()&&n.muted(!1);var o=parseFloat(t)/100;n.volume(o),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},ue=function(e){var t=l(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ce(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var ve=function(t,i,n,o){var r,a,m=o.res,f=o.sres,w=l(t),p=(null==m||null===(r=m.video)||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;c(m),w.on("loadstart",(function(){p&&n.resolve({status:!0,msg:"Video Loaded",response:m})})),w.on("loadeddata",(function(){var o;(null==w||!w.muted())&&de(t,sessionStorage.getItem("volume")||"100");var r,a,d=u();(s(),n.resolve(function(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?ce(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:m}:{response:m})),null!=i&&i.watchHistory&&null!=i&&null!==(o=i.watchHistory)&&void 0!==o&&o.enable&&!i.isAnonymousUser)&&function(e,t,i){var n,o;null!=t&&t.series&&(ae=null==t||null===(n=t.series)||void 0===n?void 0:n.id),re=[],le=0,te=i;var r=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.interval)||30,a=l(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());re.includes(le)||(e==le?(re.push(e),se(a,t,r)):e>le&&(le=e+r))})),a.on("ended",(function(){se(a,t,r,!0)})))}(t,i,null==d||null===(r=d.video)||void 0===r||null===(a=r.gist)||void 0===a?void 0:a.id)})),w.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];w.trigger("subtitlechanged",t)})),w.on("subtitlechanged",(function(e,t){var i,n,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var w,p=f.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),w.on("loadedmetadata",(function(){window.endFirstFrame(w)})),w.one("error",(function(){var e,i;d(t,(null==w||null===(e=w.error())||void 0===e?void 0:e.message)||"Some error occured"),n.reject({status:!1,msg:(null==w||null===(i=w.error())||void 0===i?void 0:i.message)||"Some error occured"})})),w.one("play",(function(){var e;if(null!=i&&null!==(e=i.series)&&void 0!==e&&e.enable){var t,n,o,r=null===(t=u())||void 0===t||null===(n=t.video)||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.id,l=v().get(r)||{t:0,p:0},a=l.t,s=l.p;a&&s<95&&setTimeout((function(){w.currentTime(a)}),0)}else null!=i&&i.watchHistoryResumeTime&&(null==i?void 0:i.watchedPercentage)<95&&setTimeout((function(){w.currentTime(null==i?void 0:i.watchHistoryResumeTime)}),0)})),w.on("volumechange",(function(){var e=100*w.volume().toFixed(2);w.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},me=function(e,t){var i=null==t?void 0:t.skin;"live"==i?import("./skin-4226cde2.js").then((function(i){i.initialiseSkin(e,t)})):"default"==i?import("./skin-2c6bd00d.js").then((function(i){i.initialiseSkin(e,t)})):"carousel"==i?import("./skin-809a9390.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==i?import("./skin-f010003b.js").then((function(i){i.initialiseSkin(e,t)})):"multiplayer"==i&&import("./skin-6d5ce680.js").then((function(i){i.initialiseSkin(e,t)}))},fe=function(e){return new Promise((function(t,i){if(we(e))i("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){t()},n.onerror=function(t){i("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(n)}}))},we=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},pe=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 he,ge=function(){var e=i(n.mark((function e(){return n.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)}}(),ye=function(){var e=i(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),be=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(o)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),fe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:ge,loadEMELibrary:ye});function Te(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Oe(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?Te(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Pe=function(t,a,s,u){var c,v,m,f,w,p,h,g,y,T,O,P,I,k,j,D,A,F,R,C,_,x,H,N=a.res,L=void 0===N?null:N,V=a.sres,U=void 0===V?null:V,W=(null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(f=m.CastContext)||void 0===f||null===(w=f.getInstance())||void 0===w?void 0:w.S)||void 0,q=null!=s&&s.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==W&&"NOT_CONNECTED"!==W?["html5","chromecast"]:["chromecast","html5"]:["html5"],z=null==L||null===(p=L.video)||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl,G=(null==L||null===(g=L.video)||void 0===g||null===(y=g.liveDetails)||void 0===y?void 0:y.isDvrEnabled)||!1,J=function(e){var t,i={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(t=window)&&void 0!==t&&t.cast&&(i={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==r()&&(i=ee(ee({},i),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),i}(s),K=(null==L||null===(T=L.video)||void 0===T||null===(O=T.streamingInfo)||void 0===O?void 0:O.isLiveStream)||!1,Q=(null==s?void 0:s.drmLibrary)||!1,X=(null==L||null===(P=L.ads)||void 0===P||null===(I=P.preRoll)||void 0===I||null===(k=I.adTags)||void 0===k||null===(j=k.web)||void 0===j?void 0:j.active)&&(null==L||null===(D=L.ads)||void 0===D||null===(A=D.preRoll)||void 0===A||null===(F=A.adTags)||void 0===F||null===(R=F.web)||void 0===R?void 0:R.url),Y=(H={controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:("default"==s.skin||"defaultV2"==s.skin||"live"==(null==s?void 0:s.skin))&&{inline:!1},fullscreenToggle:"default"==s.skin||"defaultV2"==s.skin,audioTrackButton:!1,pictureInPictureToggle:(s.skin,!1)},muteToggle:"multiplayer"==s.skin,liveui:G},e(H,"autoplay",null==s?void 0:s.autoplay),e(H,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!X),e(H,"loop",(null==s?void 0:s.loop)||!1),e(H,"html5",Oe(Oe({dash:{updateSettings:{streaming:{delay:{liveDelay:3},abr:{ABRStrategy:"abrL2A",maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},initialBitrate:{audio:-1,video:3e3},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:"abrFetchThroughputCalculationAAST"}}}},vhs:Oe(Oe({experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==s||null===(C=s.customData)||void 0===C?void 0:C.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==s?void 0:s.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==s?void 0:s.experimentalBufferBasedABR)||!1})},0==(null==s||null===(_=s.customData)||void 0===_?void 0:_.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(x=s.customData)||void 0===x?void 0:x.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(H,"poster",z),e(H,"techOrder",q),e(H,"chromecast",{requestCustomDataFn:function(e){var i=l(t);console.log(i.textTracksJson_);var n=i.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,t,i){var n,o,r,l,a,s,d,u,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var f=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var p=(null==e||null===(n=e.video)||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=p;var h=null==e||null===(r=e.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=h;var g=null==e||null===(a=e.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=g;var y=null==e||null===(d=e.video)||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=y,m.subTitles=i,m.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(L,e,n)}}),e(H,"plugins",J),H),Z=o(t,Y,function(){var e=i(n.mark((function e(){var i,l,a,c,v,m,f,w,p,h,g,y,T,O,P,I,k;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(K&&u.resolve(Oe({status:!0,msg:"Player Initialised"},U?{seriesResponse:U,response:L}:{response:L})),window.initialise(Z),window.firstFrame(Z),"white"!==window.controlsColor&&pe(window.controlsColor,Z),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),h=null==L||null===(i=L.video)||void 0===i?void 0:i.drmEnabled,g=null==L||null===(l=L.video)||void 0===l||null===(a=l.liveDetails)||void 0===a?void 0:a.startOverTime,!h&&!Q){e.next=15;break}if("Safari"!==r()){e.next=13;break}return e.next=11,ye();case 11:e.next=15;break;case 13:return e.next=15,Promise.all([ye(),ge()]);case 15:G&&ne(t,g),!X||null!=s&&null!==(c=s.customData)&&void 0!==c&&c.disableAds||B(t,X,L),(y=E(L,t))?b(t,y):(u.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:L}),d(t,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==L||null===(v=L.video)||void 0===v||null===(m=v.contentDetails)||void 0===m||null===(f=m.closedCaptions)||void 0===f?void 0:f.length)>0||(null==L||null===(w=L.video)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0)&&(k=(null==L||null===(O=L.video)||void 0===O||null===(P=O.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null==L||null===(I=L.video)||void 0===I?void 0:I.closedCaptions),T=k.filter((function(e){return"VTT"===e.format})),M(t,T)),null!=s&&s.disableControls?S(t):me(t,Oe(Oe(Oe({},s),Y),{},{liveVideo:K,isDvrEnabled:G,res:L,sres:U})),ve(t,Oe(Oe(Oe({},s),Y),{},{liveVideo:K}),u,{res:L,sres:U});case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Ie(){return{loadVideoInstantly:w,onTimeUpdate:x,getVideoDuration:H,onVideoEnded:N,init:function(e){return new Promise((function(t,i){var n,o,l,a,s,d,u,v,w;if(!T(null==e?void 0:e.playerId)){var p=null==e?void 0:e.videoId,h=(null==e||null===(n=e.series)||void 0===n?void 0:n.enable)||!1;window.videoId=p;var g=null==e?void 0:e.token;if(g&&!D(g)){he=JSON.parse(atob(g.split(".")[1])),window.siteId=null===(o=he)||void 0===o?void 0:o.siteId,window.siteName=null===(l=he)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=he)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=he)||void 0===s?void 0:s.site)||null,e.userId=(null===(d=he)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(u=he)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",g);var y=null==e?void 0:e.playerId,b=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,P=null==e?void 0:e.apiBaseUrl,I=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,k=null==e?void 0:e.errors;k&&(window.customErrors=k),window.customData=null==e?void 0:e.customData,P&&(window.playerEntitlementUrl=P),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!q(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return be})).then((function(e){e.importIMA()})),!b||null!=e&&e.series||Promise.resolve().then((function(){return be})).then((function(e){e.importChromecast()})),O&&"Safari"==r()&&Promise.resolve().then((function(){return be})).then((function(e){e.importAirplay()})),I&&fe("https://www.googletagmanager.com/gtag/js?id=".concat(I)).then((function(){return e=I,window.dataLayer=window.dataLayer||[],z("js",new Date),void z("config",e);var e})).catch((function(e){}));var j=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(y));if(j&&j.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h){var E,S=null==e||null===(E=e.series)||void 0===E?void 0:E.id;A(S,g).then((function(n){var o,r,l,a=n.data,s=n.data.seasons;_(s);var d=p||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var i=new Map;m({videoId:e,token:t}).then((function(e){e.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),f(i)})).catch((function(e){return console.log(e)}))}(S,g),F(d,g).then((function(n){var o,r,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(n.data),Pe(y,{res:null==n?void 0:n.data,sres:a},e,{resolve:t,reject:i})})).catch((function(e){R(e,y,i,p)}))})).catch((function(e){R(e,y,i)}))}else F(p,g).then((function(n){var o,r,l,a;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?C(p,g).then((function(n){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,Pe(y,{res:s},e,{resolve:t,reject:i})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),Pe(y,{res:s},e,{resolve:t,reject:i})})):Pe(y,{res:s},e,{resolve:t,reject:i})})).catch((function(e){R(e,y,i,p)}))}else i({status:!1,msg:"".concat(g?"Token is expired !":"Missing Authorization Token"),response:{token:g}})}}))},getRenditions:U,skip:p,getPlayer:l,play:h,pause:g,detectBrowser:r,rewind:y,loadVideo:b,seekToTimeStamp:L,isPlayerInitialised:T,load:O,dispose:P,enableCaptions:I,disableCaptions:k,getCaptions:j,playSelectedResolution:W,getSource:E,setVolume:de,getVolume:ue,disableControls:S,setPlaybackSpeed:V}}export{Ie as default};
1
+ import"video.js/dist/video-js.min.css";export{V as default}from"./index-75b29630.js";import"videojs-contrib-dash";import"videojs-contrib-eme";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/regenerator";import"video.js";import"./generic-2bf074c4.js";import"./util-25747132.js";import"./renditions-4bf28942.js";import"./resolution-e1444da9.js";import"./skin-665ec17e.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";
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/regenerator";import{l as t}from"./index-75b29630.js";import i from"video.js";import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"axios";import"videojs-contrib-dash";import"videojs-contrib-eme";import"./generic-2bf074c4.js";import"js-cookie";import"ua-parser-js";import"./util-25747132.js";import"./renditions-4bf28942.js";import"./resolution-e1444da9.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";import"./skin-665ec17e.js";function o(){import("@silvermine/videojs-chromecast").then((function(e){t("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))}function n(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))}function s(){import("videojs-contrib-ads"),import("videojs-ima"),t("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))}var a=function(){var t=e(r.mark((function e(){return r.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 t.apply(this,arguments)}}(),m=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}();export{n as importAirplay,o as importChromecast,s as importIMA,a as loadDashLibrary,m as loadEMELibrary};
@@ -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 i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as s,e as r}from"./icons-f5378bf3.js";import{g as d,o as c,J as p}from"./generic-2bf074c4.js";import{a as m}from"./autoNextVideo-98e1dc3a.js";import{a as u}from"./skin-665ec17e.js";import"@babel/runtime/helpers/defineProperty";import"axios";import"js-cookie";import"ua-parser-js";import"./util-25747132.js";function v(e){var t=y();return function(){var n,l=i(e);if(t){var a=i(this).constructor;n=Reflect.construct(l,arguments,a)}else n=l.apply(this,arguments);return o(this,n)}}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}var h=a.getComponent("Component"),f=function(o){l(y,h);var i=v(y);function y(e){var n,l,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,y),(a=i.call(this,e,s)).playerId=s.playerId,a.seriesData=s.sres,a.videos=null==s||null===(n=s.playlist)||void 0===n?void 0:n.content,a.cb=(null==s||null===(l=s.playlist)||void 0===l?void 0:l.cb)||null,a.autoNext=(null==s||null===(o=s.playlist)||void 0===o?void 0:o.autoNext)||!1,a.currentVideoData=s.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&m({playerId:a.playerId,content:a.videos,cb:a.cb}),a}return n(y,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s())});return a.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=a.dom.createEl("div",{className:"selection-container hidden"});a.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(u(),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=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),a.dom.appendContent(e,t),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(t)}},{key:"addFunctionality",value:function(t){var n=this,l=this.el(),o=a.dom.createEl("div",{className:"playlist-selector-head"}),i=a.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(r())});i.onclick=function(){t.classList.add("hidden"),l.classList.remove("open"),t.style.right="-350px"};for(var s=a.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),m=a.dom.createEl("div",{className:"playlist-selector-content"}),u=function(t){var l,o,i=a.dom.createEl("div",{className:"playlist-container"}),s=a.dom.createEl("div",{className:"playlist-section",index:t}),r=a.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.title)||"")}),d=a.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});a.dom.appendContent(s,r),a.dom.appendContent(s,d),a.dom.appendContent(i,s),a.dom.appendContent(m,i);var u=a.dom.createEl("div",{className:"playlist-section-expanded hidden"}),v=a.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(o=n.videos[t])||void 0===o?void 0:o.description)||"")}),y=a.dom.createEl("div",{className:"playlist-image"});y.style.backgroundImage="url(".concat(n.videos[t].img,")"),a.dom.appendContent(u,y),a.dom.appendContent(u,v),a.dom.appendContent(i,u),a.dom.appendContent(m,i),u.onclick=function(e){e.stopPropagation(),p(t+1),c(n.playerId,n.videos[t].id,sessionStorage.getItem("token")).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,a=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(a=e(a))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(n=s.classList)&&void 0!==n&&n.contains("hidden")?(i.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"),i.style.backgroundColor="unset")}},v=0;v<this.videos.length;v++)u(v);a.dom.appendContent(o,i),a.dom.appendContent(o,s),a.dom.appendContent(t,o),a.dom.appendContent(t,m),d(this.playerId).on("fullscreenchange",(function(){var e=window.getComputedStyle(document.getElementById(n.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(e,"px")}))}}]),y}();export{f as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import s from"@babel/runtime/helpers/assertThisInitialized";import o from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import l from"video.js";import{E as r,e as c,B as d}from"./icons-f5378bf3.js";import{e as u,K as m,L as p,g as v,G as h,o as f}from"./generic-2bf074c4.js";import{a as g}from"./skin-665ec17e.js";import"@babel/runtime/helpers/defineProperty";import"axios";import{a as y}from"./autoNextVideo-08fc8e67.js";import"js-cookie";import"ua-parser-js";import"./util-25747132.js";function b(e){var t=C();return function(){var n,s=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(s,arguments,o)}else n=s.apply(this,arguments);return i(this,n)}}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(C=function(){return!!e})()}var N=l.getComponent("Component"),L=function(i){o(C,N);var a=b(C);function C(n){var o,i,l,r,c,d,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,C),(d=a.call(this,n,v)).playerId=v.playerId,d.seriesData=v.sres,d.videos=null==v||null===(o=v.sres)||void 0===o?void 0:o.seasons,d.currentVideoData=v.res,d.initialiseStructure(),d.loadCSS(),d.selectedSeason=0,d.cb=null==v||null===(i=v.series)||void 0===i?void 0:i.cb,d.autoPlayNext=(null==v||null===(l=v.series)||void 0===l?void 0:l.autoPlayNext)||!1,sessionStorage.getItem("token"),d.watchMap=u(),null!==(r=s(d))&&void 0!==r&&r.autoPlayNext&&null!=v&&null!==(c=v.series)&&void 0!==c&&c.enable){var h,f,g,b,N=null==v||null===(h=v.sres)||void 0===h?void 0:h.seasons,L=[];N.map((function(t){L.push.apply(L,e(t.episodes))})),m(L),p(null===(f=d.options_)||void 0===f||null===(g=f.res)||void 0===g||null===(b=g.video)||void 0===b?void 0:b.id),y({playerId:d.playerId,content:L,cb:d.cb,series:null==v?void 0:v.sres})}return d}return n(C,[{key:"createEl",value:function(){var e=l.dom.createEl("div",{className:"series-selection vjs-control vjs-button"});e.style.position="unset";var t=l.dom.createEl("div",{className:"series-selector-icon",innerHTML:"".concat(r())});return l.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./series-v2-0727ee8c.js").then((function(e){var t=document.createElement("style");t.id="series-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"toggleOpenClose",value:function(e){var t,n=this.el();null!=e&&null!==(t=e.classList)&&void 0!==t&&t.contains("hidden")?(g(),e.classList.remove("hidden"),n.classList.add("open"),e.style.right="0px"):(e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px")}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),n=l.dom.createEl("div",{className:"series-selection-container hidden"});l.dom.$(".series-selector-icon",this.el()).onclick=function(){return e.toggleOpenClose(n)};var s=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);n.style.height="".concat(s,"px"),l.dom.appendContent(t,n),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(n)}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),s=l.dom.createEl("div",{className:"series-selector-head"}),o=l.dom.createEl("div",{className:"series-selector-cross-icon",innerHTML:"".concat(c())});o.onclick=function(){if("series-selector-cross-icon"===o.className)e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px";else if("series-selector-back-icon"===o.className){var s=l.dom.$(".series-selector-content",t.el());l.dom.$(".series-selector-cross-icon",t.el()),o.className="series-selector-cross-icon",s.innerHTML="";var i=t.createSeasonLister();l.dom.appendContent(s,i),l.dom.$(".series-selector-title",t.el()).innerHTML="Seasons",o.innerHTML="".concat(c())}};var i=l.dom.createEl("div",{className:"series-selector-title",innerHTML:"Seasons"}),a=l.dom.createEl("div",{className:"series-selector-content"}),r=this.createSeasonLister();l.dom.appendContent(a,r),l.dom.appendContent(s,o),l.dom.appendContent(s,i),l.dom.appendContent(e,s),l.dom.appendContent(e,a),v(this.playerId).on("fullscreenchange",(function(){var n=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(n,"px")}))}},{key:"createSeasonLister",value:function(){var e=this;v(this.playerId);for(var t=h(),n=l.dom.createEl("div",{className:"season-container"}),s=function(s){var o=document.createElement("label");o.className="season-holder",o.setAttribute("for","season-".concat(s));var i=document.createElement("div");i.className="season - ".concat(s),i.innerHTML=t[s].title;var a=l.dom.createEl("input",{className:"radio - ".concat(s),id:"season-".concat(s),name:"season-radio"});a.setAttribute("type","radio"),e.selectedSeason==s&&(a.checked=!0),a.onclick=function(t){e.showSeasonDetails(s)},l.dom.appendContent(o,a),l.dom.appendContent(o,i),l.dom.appendContent(n,o)},o=0;o<t.length;o++)s(o);return n}},{key:"getSeasonDetailsContainer",value:function(t,n){var s=this;t=t.map((function(e){var t,n,o,i;return{id:null==e?void 0:e.id,title:null==e?void 0:e.title,description:null==e||null===(t=e.gist)||void 0===t?void 0:t.description,img:null==e||null===(n=e.gist)||void 0===n||null===(o=n.imageGist)||void 0===o?void 0:o.r16x9,watchedPercentage:(null==s||null===(i=s.watchMap.get(null==e?void 0:e.id))||void 0===i?void 0:i.p)||0}}));for(var o=function(o){var i,a,r,c,d,u,m,v=l.dom.createEl("div",{className:"series-container"}),h=l.dom.createEl("div",{className:"series-section",index:o}),g=l.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(i=t[o])||void 0===i?void 0:i.title)||"")}),y=l.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[o].watchedPercentage,"%' class='series-progress-bar-value'></div>")});l.dom.appendContent(h,g),l.dom.appendContent(h,y),l.dom.appendContent(v,h),l.dom.appendContent(n,v);var b=l.dom.createEl("div",{className:"series-section-expanded hidden"}),C=(null===(a=t[o])||void 0===a?void 0:a.description)||"";(null===(r=C)||void 0===r?void 0:r.length)>170&&(C=C.substr(0,170)+"...");var N=l.dom.createEl("div",{className:"series-description",innerHTML:"".concat(C||"")}),L=l.dom.createEl("img",{className:"series-image"});L.src="".concat((null===(c=t[o])||void 0===c?void 0:c.img)||(null===(d=window)||void 0===d||null===(u=d.customData)||void 0===u?void 0:u.fallbackImage)),L.alt="".concat(null===(m=t[o])||void 0===m?void 0:m.title),l.dom.appendContent(b,L),l.dom.appendContent(b,N),l.dom.appendContent(v,b),l.dom.appendContent(n,v),b.onclick=function(e){var n;e.stopPropagation(),p(null===(n=t[o])||void 0===n?void 0:n.id),f(s.playerId,t[o].id,sessionStorage.getItem("token")).then((function(e){null!=s&&s.cb&&s.cb(e)})).catch((function(e){null!=s&&s.cb&&s.cb(e)}))},h.onclick=function(t){var n,s,o,i=document.getElementsByClassName("series-selector-content")[0].childNodes,a=(i=e(i))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=a&&null!==(n=a.classList)&&void 0!==n&&n.contains("hidden")?(v.style.backgroundColor="#0000007d",null==a||null===(s=a.classList)||void 0===s||s.remove("hidden")):(null==a||null===(o=a.classList)||void 0===o||o.add("hidden"),v.style.backgroundColor="unset")}},i=0;i<t.length;i++)o(i);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;var t=l.dom.$(".series-selector-content",this.el());t.innerHTML="";var n=h()[e].episodes;this.getSeasonDetailsContainer(n,t);var s=l.dom.$(".series-selector-cross-icon",this.el());s.className="series-selector-back-icon",s.innerHTML="".concat(d()),l.dom.$(".series-selector-title",this.el()).innerHTML="Season ".concat(e+1)}}]),C}();export{L as default};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import s from"@babel/runtime/helpers/assertThisInitialized";import o from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import l from"video.js";import{E as r,e as c,B as d}from"./icons-f5378bf3.js";import{e as u,K as m,L as p,g as v,G as h,o as f}from"./generic-2bf074c4.js";import{a as g}from"./skin-665ec17e.js";import"@babel/runtime/helpers/defineProperty";import"axios";import{a as y}from"./autoNextVideo-98e1dc3a.js";import"js-cookie";import"ua-parser-js";import"./util-25747132.js";function b(e){var t=C();return function(){var n,s=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(s,arguments,o)}else n=s.apply(this,arguments);return i(this,n)}}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(C=function(){return!!e})()}var N=l.getComponent("Component"),L=function(i){o(C,N);var a=b(C);function C(n){var o,i,l,r,c,d,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,C),(d=a.call(this,n,v)).playerId=v.playerId,d.seriesData=v.sres,d.videos=null==v||null===(o=v.sres)||void 0===o?void 0:o.seasons,d.currentVideoData=v.res,d.initialiseStructure(),d.loadCSS(),d.selectedSeason=0,d.cb=null==v||null===(i=v.series)||void 0===i?void 0:i.cb,d.autoPlayNext=(null==v||null===(l=v.series)||void 0===l?void 0:l.autoPlayNext)||!1,sessionStorage.getItem("token"),d.watchMap=u(),null!==(r=s(d))&&void 0!==r&&r.autoPlayNext&&null!=v&&null!==(c=v.series)&&void 0!==c&&c.enable){var h,f,g,b,N=null==v||null===(h=v.sres)||void 0===h?void 0:h.seasons,L=[];N.map((function(t){L.push.apply(L,e(t.episodes))})),m(L),p(null===(f=d.options_)||void 0===f||null===(g=f.res)||void 0===g||null===(b=g.video)||void 0===b?void 0:b.id),y({playerId:d.playerId,content:L,cb:d.cb,series:null==v?void 0:v.sres})}return d}return n(C,[{key:"createEl",value:function(){var e=l.dom.createEl("div",{className:"series-selection vjs-control vjs-button"});e.style.position="unset";var t=l.dom.createEl("div",{className:"series-selector-icon",innerHTML:"".concat(r())});return l.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./series-v2-0727ee8c.js").then((function(e){var t=document.createElement("style");t.id="series-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"toggleOpenClose",value:function(e){var t,n=this.el();null!=e&&null!==(t=e.classList)&&void 0!==t&&t.contains("hidden")?(g(),e.classList.remove("hidden"),n.classList.add("open"),e.style.right="0px"):(e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px")}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),n=l.dom.createEl("div",{className:"series-selection-container hidden"});l.dom.$(".series-selector-icon",this.el()).onclick=function(){return e.toggleOpenClose(n)};var s=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);n.style.height="".concat(s,"px"),l.dom.appendContent(t,n),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(n)}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),s=l.dom.createEl("div",{className:"series-selector-head"}),o=l.dom.createEl("div",{className:"series-selector-cross-icon",innerHTML:"".concat(c())});o.onclick=function(){if("series-selector-cross-icon"===o.className)e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px";else if("series-selector-back-icon"===o.className){var s=l.dom.$(".series-selector-content",t.el());l.dom.$(".series-selector-cross-icon",t.el()),o.className="series-selector-cross-icon",s.innerHTML="";var i=t.createSeasonLister();l.dom.appendContent(s,i),l.dom.$(".series-selector-title",t.el()).innerHTML="Seasons",o.innerHTML="".concat(c())}};var i=l.dom.createEl("div",{className:"series-selector-title",innerHTML:"Seasons"}),a=l.dom.createEl("div",{className:"series-selector-content"}),r=this.createSeasonLister();l.dom.appendContent(a,r),l.dom.appendContent(s,o),l.dom.appendContent(s,i),l.dom.appendContent(e,s),l.dom.appendContent(e,a),v(this.playerId).on("fullscreenchange",(function(){var n=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(n,"px")}))}},{key:"createSeasonLister",value:function(){var e=this;v(this.playerId);for(var t=h(),n=l.dom.createEl("div",{className:"season-container"}),s=function(s){var o=document.createElement("label");o.className="season-holder",o.setAttribute("for","season-".concat(s));var i=document.createElement("div");i.className="season - ".concat(s),i.innerHTML=t[s].title;var a=l.dom.createEl("input",{className:"radio - ".concat(s),id:"season-".concat(s),name:"season-radio"});a.setAttribute("type","radio"),e.selectedSeason==s&&(a.checked=!0),a.onclick=function(t){e.showSeasonDetails(s)},l.dom.appendContent(o,a),l.dom.appendContent(o,i),l.dom.appendContent(n,o)},o=0;o<t.length;o++)s(o);return n}},{key:"getSeasonDetailsContainer",value:function(t,n){var s=this;t=t.map((function(e){var t,n,o,i;return{id:null==e?void 0:e.id,title:null==e?void 0:e.title,description:null==e||null===(t=e.gist)||void 0===t?void 0:t.description,img:null==e||null===(n=e.gist)||void 0===n||null===(o=n.imageGist)||void 0===o?void 0:o.r16x9,watchedPercentage:(null==s||null===(i=s.watchMap.get(null==e?void 0:e.id))||void 0===i?void 0:i.p)||0}}));for(var o=function(o){var i,a,r,c,d,u,m,v=l.dom.createEl("div",{className:"series-container"}),h=l.dom.createEl("div",{className:"series-section",index:o}),g=l.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(i=t[o])||void 0===i?void 0:i.title)||"")}),y=l.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[o].watchedPercentage,"%' class='series-progress-bar-value'></div>")});l.dom.appendContent(h,g),l.dom.appendContent(h,y),l.dom.appendContent(v,h),l.dom.appendContent(n,v);var b=l.dom.createEl("div",{className:"series-section-expanded hidden"}),C=(null===(a=t[o])||void 0===a?void 0:a.description)||"";(null===(r=C)||void 0===r?void 0:r.length)>170&&(C=C.substr(0,170)+"...");var N=l.dom.createEl("div",{className:"series-description",innerHTML:"".concat(C||"")}),L=l.dom.createEl("img",{className:"series-image"});L.src="".concat((null===(c=t[o])||void 0===c?void 0:c.img)||(null===(d=window)||void 0===d||null===(u=d.customData)||void 0===u?void 0:u.fallbackImage)),L.alt="".concat(null===(m=t[o])||void 0===m?void 0:m.title),l.dom.appendContent(b,L),l.dom.appendContent(b,N),l.dom.appendContent(v,b),l.dom.appendContent(n,v),b.onclick=function(e){var n;e.stopPropagation(),p(null===(n=t[o])||void 0===n?void 0:n.id),f(s.playerId,t[o].id,sessionStorage.getItem("token")).then((function(e){null!=s&&s.cb&&s.cb(e)})).catch((function(e){null!=s&&s.cb&&s.cb(e)}))},h.onclick=function(t){var n,s,o,i=document.getElementsByClassName("series-selector-content")[0].childNodes,a=(i=e(i))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=a&&null!==(n=a.classList)&&void 0!==n&&n.contains("hidden")?(v.style.backgroundColor="#0000007d",null==a||null===(s=a.classList)||void 0===s||s.remove("hidden")):(null==a||null===(o=a.classList)||void 0===o||o.add("hidden"),v.style.backgroundColor="unset")}},i=0;i<t.length;i++)o(i);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;var t=l.dom.$(".series-selector-content",this.el());t.innerHTML="";var n=h()[e].episodes;this.getSeasonDetailsContainer(n,t);var s=l.dom.$(".series-selector-cross-icon",this.el());s.className="series-selector-back-icon",s.innerHTML="".concat(d()),l.dom.$(".series-selector-title",this.el()).innerHTML="Season ".concat(e+1)}}]),C}();export{L as default};
@@ -1 +1 @@
1
- import{g as e}from"./generic-2bf074c4.js";import{g as r}from"./renditions-4bf28942.js";import{i as t}from"./features-b1f43dd4.js";import"@babel/runtime/helpers/defineProperty";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";function i(i,o){import("./skin-d5510f70.js").then((function(e){var r=document.createElement("style");r.id="multiplayer_css",r.append("".concat(e.default)),document.head.appendChild(r)})),function(i,o){e(i).on("loadeddata",(function(){var e;(null===(e=r(i))||void 0===e?void 0:e.length)>0&&t(i,o)}))}(i,o)}export{i as initialiseSkin};
1
+ import{g as e}from"./generic-2bf074c4.js";import{g as r}from"./renditions-4bf28942.js";import{i as t}from"./features-6af2b457.js";import"@babel/runtime/helpers/defineProperty";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";function i(i,o){import("./skin-d5510f70.js").then((function(e){var r=document.createElement("style");r.id="multiplayer_css",r.append("".concat(e.default)),document.head.appendChild(r)})),function(i,o){e(i).on("loadeddata",(function(){var e;(null===(e=r(i))||void 0===e?void 0:e.length)>0&&t(i,o)}))}(i,o)}export{i as initialiseSkin};
@@ -1 +1 @@
1
- import{a as e,b as t,c as n,d as s}from"./features-b1f43dd4.js";import{M as o,a as r,S as l,N as a}from"./icons-f5378bf3.js";import{g as i,d as c}from"./generic-2bf074c4.js";import{c as u}from"./skin-665ec17e.js";import d from"@babel/runtime/helpers/defineProperty";import{i as m}from"./keyboardShortcuts-80f64268.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-4bf28942.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function v(s,a){var m=i(s);m.one("play",(function(){null!=a&&a.streams&&e(s,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},a)),null!=a&&a.airplay&&"Safari"==c()&&m.addChild("airPlayButton"),null!=a&&a.chromecastReceiverId&&m.addChild("chromecastButton"),m.addChild("FullscreenToggle"),m.getChild("FullscreenToggle").el().appendChild(u(o(window.controlsColor))),m.getChild("FullscreenToggle").el().appendChild(u(r(window.controlsColor))),b(s)})),m.on("loadedmetadata",(function(){window.endFirstFrame(m),"Safari"!==c()&&t(s,"live",l())})),m.one("loadedmetadata",(function(){var e;null!=a&&a.streams&&(null==a||null===(e=a.streams)||void 0===e?void 0:e.length)>=2&&n(s,a)}))}function f(e,t){var n;m(e,t),(null==(n=t)||!n.liveui)&&(null==n||!n.liveVideo)||null!=n&&n.liveui&&null!=n&&n.liveVideo?import("./dvr_skin-9cc1b144.js").then((function(e){var t=document.createElement("style");t.id="dvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})):import("./nondvr_skin-64be70e5.js").then((function(e){var t=document.createElement("style");t.id="nondvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,t){s(e)}(e),function(e,t){var n=i(e),s=n.controlBar.getChild("SubsCapsButton").el();document.getElementsByClassName("vjs-subs-caps-button")[1].appendChild(u(a()));var o=document.createElement("div");o.classList.add("caption-header"),s.querySelector(".vjs-menu-content").insertBefore(o,s.querySelector(".vjs-menu-item"));var r=document.createElement("div");if(r.innerText="Captions",r.className="fs14",document.getElementsByClassName("vjs-subs-caps-button")[0].appendChild(r),"Safari"==c()){document.getElementsByClassName("vjs-subs-caps-button")[0].style.left="9.5rem"}null!=t&&t.liveui||null==t||!t.liveVideo||(document.getElementsByClassName("vjs-progress-control")[0].style.display="none")}(e,t),v(e,t)}var h;function b(e){var t=i(e);j(),t.on("pause",(function(){clearTimeout(h),y()})),t.on("play",(function(){j()}));var n=document.getElementById("".concat(e));n.addEventListener("mouseenter",(function(){y(),t.paused()||j()})),n.addEventListener("touchstart",(function(){y(),j()})),n.addEventListener("mousemove",(function(){y(),t.paused()||j()}))}function y(){var e=document.getElementsByClassName("vjs-chromecast-button")[0],t=document.getElementsByClassName("vjs-airplay-button")[0],n=document.getElementsByClassName("vjs-fullscreen-control")[0];null!=e&&e.classList.contains("hideoutsidecontrols")&&(null==e||e.classList.remove("hideoutsidecontrols")),n.classList.contains("hideoutsidecontrols")&&n.classList.remove("hideoutsidecontrols"),null!=t&&t.classList.contains("hideoutsidecontrols")&&t.classList.remove("hideoutsidecontrols")}function j(){var e=document.getElementsByClassName("vjs-chromecast-button")[0],t=document.getElementsByClassName("vjs-fullscreen-control")[0],n=document.getElementsByClassName("vjs-airplay-button")[0];clearTimeout(h),h=setTimeout((function(){null==e||e.classList.add("hideoutsidecontrols"),null==t||t.classList.add("hideoutsidecontrols"),null==n||n.classList.add("hideoutsidecontrols")}),2200)}export{b as hideControls,f as initialiseSkin};
1
+ import{a as e,b as t,c as n,d as s}from"./features-6af2b457.js";import{M as o,a as r,S as l,N as a}from"./icons-f5378bf3.js";import{g as i,d as c}from"./generic-2bf074c4.js";import{c as u}from"./skin-665ec17e.js";import d from"@babel/runtime/helpers/defineProperty";import{i as m}from"./keyboardShortcuts-80f64268.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-4bf28942.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function v(s,a){var m=i(s);m.one("play",(function(){null!=a&&a.streams&&e(s,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},a)),null!=a&&a.airplay&&"Safari"==c()&&m.addChild("airPlayButton"),null!=a&&a.chromecastReceiverId&&m.addChild("chromecastButton"),m.addChild("FullscreenToggle"),m.getChild("FullscreenToggle").el().appendChild(u(o(window.controlsColor))),m.getChild("FullscreenToggle").el().appendChild(u(r(window.controlsColor))),b(s)})),m.on("loadedmetadata",(function(){window.endFirstFrame(m),"Safari"!==c()&&t(s,"live",l())})),m.one("loadedmetadata",(function(){var e;null!=a&&a.streams&&(null==a||null===(e=a.streams)||void 0===e?void 0:e.length)>=2&&n(s,a)}))}function f(e,t){var n;m(e,t),(null==(n=t)||!n.liveui)&&(null==n||!n.liveVideo)||null!=n&&n.liveui&&null!=n&&n.liveVideo?import("./dvr_skin-9cc1b144.js").then((function(e){var t=document.createElement("style");t.id="dvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})):import("./nondvr_skin-64be70e5.js").then((function(e){var t=document.createElement("style");t.id="nondvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,t){s(e)}(e),function(e,t){var n=i(e),s=n.controlBar.getChild("SubsCapsButton").el();document.getElementsByClassName("vjs-subs-caps-button")[1].appendChild(u(a()));var o=document.createElement("div");o.classList.add("caption-header"),s.querySelector(".vjs-menu-content").insertBefore(o,s.querySelector(".vjs-menu-item"));var r=document.createElement("div");if(r.innerText="Captions",r.className="fs14",document.getElementsByClassName("vjs-subs-caps-button")[0].appendChild(r),"Safari"==c()){document.getElementsByClassName("vjs-subs-caps-button")[0].style.left="9.5rem"}null!=t&&t.liveui||null==t||!t.liveVideo||(document.getElementsByClassName("vjs-progress-control")[0].style.display="none")}(e,t),v(e,t)}var h;function b(e){var t=i(e);j(),t.on("pause",(function(){clearTimeout(h),y()})),t.on("play",(function(){j()}));var n=document.getElementById("".concat(e));n.addEventListener("mouseenter",(function(){y(),t.paused()||j()})),n.addEventListener("touchstart",(function(){y(),j()})),n.addEventListener("mousemove",(function(){y(),t.paused()||j()}))}function y(){var e=document.getElementsByClassName("vjs-chromecast-button")[0],t=document.getElementsByClassName("vjs-airplay-button")[0],n=document.getElementsByClassName("vjs-fullscreen-control")[0];null!=e&&e.classList.contains("hideoutsidecontrols")&&(null==e||e.classList.remove("hideoutsidecontrols")),n.classList.contains("hideoutsidecontrols")&&n.classList.remove("hideoutsidecontrols"),null!=t&&t.classList.contains("hideoutsidecontrols")&&t.classList.remove("hideoutsidecontrols")}function j(){var e=document.getElementsByClassName("vjs-chromecast-button")[0],t=document.getElementsByClassName("vjs-fullscreen-control")[0],n=document.getElementsByClassName("vjs-airplay-button")[0];clearTimeout(h),h=setTimeout((function(){null==e||e.classList.add("hideoutsidecontrols"),null==t||t.classList.add("hideoutsidecontrols"),null==n||n.classList.add("hideoutsidecontrols")}),2200)}export{b as hideControls,f as initialiseSkin};
@@ -1 +1 @@
1
- import{i as e,j as l,k as i,g as n,h as t,d as o,l as a,m as s,n as r,o as d}from"./features-b1f43dd4.js";import{M as u,a as v,c as m,d as c}from"./icons-f5378bf3.js";import{G as p,g,H as f,v as h}from"./generic-2bf074c4.js";import{c as y}from"./skin-665ec17e.js";import{g as b}from"./renditions-4bf28942.js";import C from"@babel/runtime/helpers/toConsumableArray";import{s as j}from"./autoNextVideo-08fc8e67.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"./util-25747132.js";var x=p(),E=[];null==x||x.map((function(e){return E.push.apply(E,C(e.episodes))}));var N=function(e,l){var i;null==l||null===(i=l.series)||void 0===i||i.cb;var n=g(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),i=n.duration(),t=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-l<=10&&f()<=(null==E?void 0:E.length)-1?t&&(t.style.visibility="visible"):t&&(t.style.visibility="hidden")}));var t,o=E.filter((function(e,l){return l==f()}));if((null==o?void 0:o.length)>0)if(null!==(t=document.getElementsByClassName("next-ep-preview"))&&void 0!==t&&t[0]){var a,s,r,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],C=null===(r=document.getElementsByClassName("next-ep-img"))||void 0===r?void 0:r[0],j=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],x=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=x)||void 0===v?void 0:v.length)>60&&(x=x.substr(0,60)+"..."),b.innerHTML="".concat(x),C.src=(null===(m=o[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),j.onclick=function(){return w(e)}}else{var N,B,k,V,M,L,T,I=document.createElement("div");I.className="next-ep-preview",I.style.visibility="hidden",document.getElementById(e).append(I);var P=document.createElement("div");P.className="next-ep-header",P.innerHTML="Next up";var D=null===(N=o[0])||void 0===N?void 0:N.title,H=document.createElement("img");H.className="next-ep-img",H.src=(null===(B=o[0])||void 0===B||null===(k=B.gist)||void 0===k||null===(V=k.imageGist)||void 0===V?void 0:V.r16x9)||(null===(M=window)||void 0===M||null===(L=M.customData)||void 0===L?void 0:L.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(T=D)||void 0===T?void 0:T.length)>60&&(D=D.substr(0,60)+"..."),F.innerHTML="".concat(D);var G=document.createElement("div");G.className="next-ep-content",G.append(H),G.append(F),G.onclick=function(){return w(e)},I.append(P),I.append(G)}},w=function(e,l){var i=g(e),n=Math.floor(i.currentTime());if(Math.floor(i.duration())!=n){i.pause(e);var t=f();j(t,e,E,sessionStorage.getItem("token"))}};function B(n,t){var o=g(n);o.on("loadeddata",(function(){var i,a,s;(null===(i=b(n))||void 0===i?void 0:i.length)>0&&e(n,t),(null===(a=h(n))||void 0===a?void 0:a.length)>0&&l(n,t),null!=t&&null!==(s=t.series)&&void 0!==s&&s.enable&&N(n,t),function(e,l){var i,n=Math.floor(e/60),t=null===(i=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===i?void 0:i[0];t&&(t.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",t&&(t.style.marginRight="56px"))}(o.duration(),(null==t?void 0:t.liveVideo)||!1)})),o.one("play",(function(){var e,l,t,o;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&i(n,null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}function k(e,l){import("./skin-3470b8fa.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)})),B(e,l),function(e,l){var i=g(e);i.controlBar.getChild("FullscreenToggle").el().appendChild(y(u(window.controlsColor))),i.controlBar.getChild("FullscreenToggle").el().appendChild(y(v(window.controlsColor)));var n=document.getElementsByClassName("vjs-time-control");l.liveVideo&&(n[0].style.display="none")}(e,l),function(e,l){var i,u,v,p,g,f;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&t(e,"defaultV2",c());l.liveVideo||o(e);(null==l||null===(i=l.relatedVideos)||void 0===i||null===(u=i.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&s(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(g=p.content)||void 0===g?void 0:g.length)>0&&r(e,null==l?void 0:l.playlist);null!=l&&null!==(f=l.series)&&void 0!==f&&f.enable&&d(e,l)}(e,l),function(e,l){var i=g(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var t=document.createElement("div");t.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(n),o.alt="Provider Image",t.append(o),i.el().appendChild(t),i.on("useractive",(function(){t.classList.remove("vjs-fade")})),i.on("userinactive",(function(){i.paused()||t.classList.add("vjs-fade")})),i.on("fullscreenchange",(function(){i.isFullscreen_?t.style.top="3.2rem":t.style.top="1rem"}))}(e,l)}export{k as initialiseSkin};
1
+ import{i as e,j as l,k as i,g as n,h as t,d as o,l as a,m as s,n as r,o as d}from"./features-6af2b457.js";import{M as u,a as v,c as m,d as c}from"./icons-f5378bf3.js";import{G as p,g,H as f,v as h}from"./generic-2bf074c4.js";import{c as y}from"./skin-665ec17e.js";import{g as b}from"./renditions-4bf28942.js";import C from"@babel/runtime/helpers/toConsumableArray";import{s as j}from"./autoNextVideo-98e1dc3a.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"./util-25747132.js";var x=p(),E=[];null==x||x.map((function(e){return E.push.apply(E,C(e.episodes))}));var N=function(e,l){var i;null==l||null===(i=l.series)||void 0===i||i.cb;var n=g(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),i=n.duration(),t=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-l<=10&&f()<=(null==E?void 0:E.length)-1?t&&(t.style.visibility="visible"):t&&(t.style.visibility="hidden")}));var t,o=E.filter((function(e,l){return l==f()}));if((null==o?void 0:o.length)>0)if(null!==(t=document.getElementsByClassName("next-ep-preview"))&&void 0!==t&&t[0]){var a,s,r,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],C=null===(r=document.getElementsByClassName("next-ep-img"))||void 0===r?void 0:r[0],j=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],x=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=x)||void 0===v?void 0:v.length)>60&&(x=x.substr(0,60)+"..."),b.innerHTML="".concat(x),C.src=(null===(m=o[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),j.onclick=function(){return w(e)}}else{var N,B,k,V,M,L,T,I=document.createElement("div");I.className="next-ep-preview",I.style.visibility="hidden",document.getElementById(e).append(I);var P=document.createElement("div");P.className="next-ep-header",P.innerHTML="Next up";var D=null===(N=o[0])||void 0===N?void 0:N.title,H=document.createElement("img");H.className="next-ep-img",H.src=(null===(B=o[0])||void 0===B||null===(k=B.gist)||void 0===k||null===(V=k.imageGist)||void 0===V?void 0:V.r16x9)||(null===(M=window)||void 0===M||null===(L=M.customData)||void 0===L?void 0:L.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(T=D)||void 0===T?void 0:T.length)>60&&(D=D.substr(0,60)+"..."),F.innerHTML="".concat(D);var G=document.createElement("div");G.className="next-ep-content",G.append(H),G.append(F),G.onclick=function(){return w(e)},I.append(P),I.append(G)}},w=function(e,l){var i=g(e),n=Math.floor(i.currentTime());if(Math.floor(i.duration())!=n){i.pause(e);var t=f();j(t,e,E,sessionStorage.getItem("token"))}};function B(n,t){var o=g(n);o.on("loadeddata",(function(){var i,a,s;(null===(i=b(n))||void 0===i?void 0:i.length)>0&&e(n,t),(null===(a=h(n))||void 0===a?void 0:a.length)>0&&l(n,t),null!=t&&null!==(s=t.series)&&void 0!==s&&s.enable&&N(n,t),function(e,l){var i,n=Math.floor(e/60),t=null===(i=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===i?void 0:i[0];t&&(t.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",t&&(t.style.marginRight="56px"))}(o.duration(),(null==t?void 0:t.liveVideo)||!1)})),o.one("play",(function(){var e,l,t,o;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&i(n,null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}function k(e,l){import("./skin-3470b8fa.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)})),B(e,l),function(e,l){var i=g(e);i.controlBar.getChild("FullscreenToggle").el().appendChild(y(u(window.controlsColor))),i.controlBar.getChild("FullscreenToggle").el().appendChild(y(v(window.controlsColor)));var n=document.getElementsByClassName("vjs-time-control");l.liveVideo&&(n[0].style.display="none")}(e,l),function(e,l){var i,u,v,p,g,f;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&t(e,"defaultV2",c());l.liveVideo||o(e);(null==l||null===(i=l.relatedVideos)||void 0===i||null===(u=i.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&s(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(g=p.content)||void 0===g?void 0:g.length)>0&&r(e,null==l?void 0:l.playlist);null!=l&&null!==(f=l.series)&&void 0!==f&&f.enable&&d(e,l)}(e,l),function(e,l){var i=g(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var t=document.createElement("div");t.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(n),o.alt="Provider Image",t.append(o),i.el().appendChild(t),i.on("useractive",(function(){t.classList.remove("vjs-fade")})),i.on("userinactive",(function(){i.paused()||t.classList.add("vjs-fade")})),i.on("fullscreenchange",(function(){i.isFullscreen_?t.style.top="3.2rem":t.style.top="1rem"}))}(e,l)}export{k as initialiseSkin};
@@ -1 +1 @@
1
- import{b as e,e as t,f as s,g as o,h as n}from"./features-b1f43dd4.js";import{i}from"./keyboardShortcuts-80f64268.js";import{S as r,M as a,a as l,N as d,b as m,R as u}from"./icons-f5378bf3.js";import{g as p,a as c}from"./generic-2bf074c4.js";import{c as f}from"./skin-665ec17e.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-4bf28942.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function v(v,b){i(v,b),import("./skin-cd537931.js").then((function(e){var t=document.createElement("style");t.id="def_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,t){0==t.liveVideo&&0==t.liveui&&o(e,"default",m());(0==t.liveVideo&&0==t.liveui||1==t.liveui)&&n(e,"default",u())}(v,b),function(o,n){var i=p(o),a=(null==n?void 0:n.sres)||null;i.on("loadeddata",(function(){e(o,"default",r()),a&&import("./nextEpisodeButton-5694fd81.js").then((function(e){e.initaliseFunctionality(n.sres.seasons,c())}))})),i.one("loadedmetadata",(function(){var e;a&&(t(o,null==n||null===(e=n.sres)||void 0===e?void 0:e.seasons,n),s(n.sres,n.res,o))}))}(v,b),function(e,t){var s=p(e),o=document.getElementsByClassName("vjs-current-time")[0],n=document.getElementsByClassName("vjs-duration")[0],i=document.getElementsByClassName("vjs-time-divider")[0];t.liveVideo&&(o&&(o.style.display="none"),n&&(n.style.display="none"),i&&(i.style.display="none"));s.controlBar.getChild("FullscreenToggle").el().appendChild(f(a(window.controlsColor))),s.controlBar.getChild("FullscreenToggle").el().appendChild(f(l(window.controlsColor)));var r=s.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(f(d()));var m=document.createElement("div");m.classList.add("caption-header"),r.querySelector(".vjs-menu-content").insertBefore(m,r.querySelector(".vjs-menu-item"))}(v,b)}export{v as initialiseSkin};
1
+ import{b as e,e as t,f as s,g as o,h as n}from"./features-6af2b457.js";import{i}from"./keyboardShortcuts-80f64268.js";import{S as r,M as a,a as l,N as d,b as m,R as u}from"./icons-f5378bf3.js";import{g as p,a as c}from"./generic-2bf074c4.js";import{c as v}from"./skin-665ec17e.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-4bf28942.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function f(f,h){i(f,h),import("./skin-cd537931.js").then((function(e){var t=document.createElement("style");t.id="def_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,t){0==t.liveVideo&&0==t.liveui&&o(e,"default",m());(0==t.liveVideo&&0==t.liveui||1==t.liveui)&&n(e,"default",u())}(f,h),function(o,n){var i=p(o),a=(null==n?void 0:n.sres)||null;i.on("loadeddata",(function(){e(o,"default",r()),a&&import("./nextEpisodeButton-5694fd81.js").then((function(e){e.initaliseFunctionality(n.sres.seasons,c())}))})),i.one("loadedmetadata",(function(){var e;a&&(t(o,null==n||null===(e=n.sres)||void 0===e?void 0:e.seasons,n),s(n.sres,n.res,o))}))}(f,h),function(e,t){var s=p(e),o=document.getElementsByClassName("vjs-current-time")[0],n=document.getElementsByClassName("vjs-duration")[0],i=document.getElementsByClassName("vjs-time-divider")[0];t.liveVideo&&(o&&(o.style.display="none"),n&&(n.style.display="none"),i&&(i.style.display="none"));s.controlBar.getChild("FullscreenToggle").el().appendChild(v(a(window.controlsColor))),s.controlBar.getChild("FullscreenToggle").el().appendChild(v(l(window.controlsColor)));var r=s.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(v(d()));var m=document.createElement("div");m.classList.add("caption-header"),r.querySelector(".vjs-menu-content").insertBefore(m,r.querySelector(".vjs-menu-item"))}(f,h)}export{f as initialiseSkin};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/inherits";import n from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as r,e as l}from"./icons-f5378bf3.js";import{g as c,o as s,J as d}from"./generic-2bf074c4.js";import{a as m,h as u}from"./skin-665ec17e.js";import{a as p}from"./autoNextVideo-08fc8e67.js";import"@babel/runtime/helpers/defineProperty";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"./util-25747132.js";function v(e){var t=h();return function(){var o,a=i(e);if(t){var r=i(this).constructor;o=Reflect.construct(a,arguments,r)}else o=a.apply(this,arguments);return n(this,o)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=a.getComponent("Component"),y=function(n){o(h,f);var i=v(h);function h(t){var o,n,a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(a=i.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.videos=r.related.content,a.cb=(null==r||null===(o=r.related)||void 0===o?void 0:o.cb)||null,a.autoNext=(null==r||null===(n=r.related)||void 0===n?void 0:n.autoNext)||!1,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&p({playerId:a.playerId,content:a.videos,cb:a.cb}),a}return t(h,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(r())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-8e258d45.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.el(),t=a.dom.createEl("div",{className:"video-selection-container hidden"});a.dom.$(".video-selector-icon",this.el()).onclick=function(){var o;null!==(o=t.classList)&&void 0!==o&&o.contains("hidden")?(m(),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 o=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px"),a.dom.appendContent(e,t),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(t)}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=a.dom.createEl("div",{className:"video-selector-head"}),i=a.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(l())});i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px"};for(var r=a.dom.createEl("div",{className:"video-selector-title",innerHTML:"Recommended"}),m=a.dom.createEl("div",{className:"video-selector-content"}),p=a.dom.createEl("div",{className:"video-container"}),v=function(e){var o,n=a.dom.createEl("div",{className:"video -".concat(e)}),i=a.dom.createEl("div",{className:"recommended -".concat(e)});i.setAttribute("video-idx",e),i.onclick=function(){d(e+1);for(var o=a.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";u(e),s(t.playerId,t.videos[e].id,sessionStorage.getItem("token")).then((function(e){t.cb&&t.cb(e)})).catch((function(e){t.cb&&t.cb(e)}))};var r=document.createElement("img");r.className="related-thumbnail-image",r.src="".concat(t.videos[e].img),r.alt="No Thumbnail Available",i.append(r);var l=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(o=t.videos[e])||void 0===o?void 0:o.title)||"")});a.dom.appendContent(n,i),a.dom.appendContent(n,l),a.dom.appendContent(p,n),a.dom.appendContent(m,p)},h=0;h<this.videos.length;h++)v(h);a.dom.appendContent(n,i),a.dom.appendContent(n,r),a.dom.appendContent(e,n),a.dom.appendContent(e,m),c(this.playerId).on("fullscreenchange",(function(){var o=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(o,"px")}))}}]),h}();export{y as default};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/inherits";import n from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import a from"video.js";import{E as r,e as l}from"./icons-f5378bf3.js";import{g as c,o as s,J as d}from"./generic-2bf074c4.js";import{a as m,h as u}from"./skin-665ec17e.js";import{a as p}from"./autoNextVideo-98e1dc3a.js";import"@babel/runtime/helpers/defineProperty";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"./util-25747132.js";function v(e){var t=h();return function(){var o,a=i(e);if(t){var r=i(this).constructor;o=Reflect.construct(a,arguments,r)}else o=a.apply(this,arguments);return n(this,o)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=a.getComponent("Component"),y=function(n){o(h,f);var i=v(h);function h(t){var o,n,a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(a=i.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.videos=r.related.content,a.cb=(null==r||null===(o=r.related)||void 0===o?void 0:o.cb)||null,a.autoNext=(null==r||null===(n=r.related)||void 0===n?void 0:n.autoNext)||!1,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&p({playerId:a.playerId,content:a.videos,cb:a.cb}),a}return t(h,[{key:"createEl",value:function(){var e=a.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=a.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(r())});return a.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./videoSelector-8e258d45.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.el(),t=a.dom.createEl("div",{className:"video-selection-container hidden"});a.dom.$(".video-selector-icon",this.el()).onclick=function(){var o;null!==(o=t.classList)&&void 0!==o&&o.contains("hidden")?(m(),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 o=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px"),a.dom.appendContent(e,t),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(t)}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,o=this.el(),n=a.dom.createEl("div",{className:"video-selector-head"}),i=a.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(l())});i.onclick=function(){e.classList.add("hidden"),o.classList.remove("open"),e.style.right="-350px"};for(var r=a.dom.createEl("div",{className:"video-selector-title",innerHTML:"Recommended"}),m=a.dom.createEl("div",{className:"video-selector-content"}),p=a.dom.createEl("div",{className:"video-container"}),v=function(e){var o,n=a.dom.createEl("div",{className:"video -".concat(e)}),i=a.dom.createEl("div",{className:"recommended -".concat(e)});i.setAttribute("video-idx",e),i.onclick=function(){d(e+1);for(var o=a.dom.$$(".recommended"),n=0;n<o.length;n++)o[n].style.border="none";u(e),s(t.playerId,t.videos[e].id,sessionStorage.getItem("token")).then((function(e){t.cb&&t.cb(e)})).catch((function(e){t.cb&&t.cb(e)}))};var r=document.createElement("img");r.className="related-thumbnail-image",r.src="".concat(t.videos[e].img),r.alt="No Thumbnail Available",i.append(r);var l=a.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(o=t.videos[e])||void 0===o?void 0:o.title)||"")});a.dom.appendContent(n,i),a.dom.appendContent(n,l),a.dom.appendContent(p,n),a.dom.appendContent(m,p)},h=0;h<this.videos.length;h++)v(h);a.dom.appendContent(n,i),a.dom.appendContent(n,r),a.dom.appendContent(e,n),a.dom.appendContent(e,m),c(this.playerId).on("fullscreenchange",(function(){var o=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(o,"px")}))}}]),h}();export{y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- import{g as n,o as t,b as o,I as e,H as i,J as a}from"./generic-2bf074c4.js";import{a as s}from"./util-25747132.js";import{h as c}from"./skin-665ec17e.js";var r,u=0,f=0,l=function(l){clearTimeout(u);var v=null==l?void 0:l.content;r=null==l?void 0:l.cb;var d=l.playerId,g=sessionStorage.getItem("token");s(d,(function(){var s=n(d);0!==(null==s?void 0:s.currentTime())&&((f=i())>v.length-1||t(d,v[f].id,g).then((function(n){c(f),o(n.response),f++,a(f),h(n)})).catch((function(n){h(n),c(f),f++,a(f),u=setTimeout((function(){e(d)&&m(f,d,v,g)}),5e3)})))}))},m=function n(o,e,i,s,r){f=o,o>i.length-1||t(e,i[o].id,s).then((function(n){c(f),f++,a(f),h(n)})).catch((function(t){h(t),setTimeout((function(){c(f),f++,a(f),n(f,e,i,s)}),5e3)}))},h=function(n){r&&r(n)};export{l as a,m as s};
@@ -1 +0,0 @@
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-f5378bf3.js";import{g as d,o as c,J as p}from"./generic-2bf074c4.js";import{a as m}from"./autoNextVideo-08fc8e67.js";import{a as u}from"./skin-665ec17e.js";import"@babel/runtime/helpers/defineProperty";import"axios";import"js-cookie";import"ua-parser-js";import"./util-25747132.js";function v(e){var t=y();return function(){var n,l=a(e);if(t){var i=a(this).constructor;n=Reflect.construct(l,arguments,i)}else n=l.apply(this,arguments);return o(this,n)}}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}var h=i.getComponent("Component"),f=function(o){l(y,h);var a=v(y);function y(e){var n,l,o,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,y),(i=a.call(this,e,s)).playerId=s.playerId,i.seriesData=s.sres,i.videos=null==s||null===(n=s.playlist)||void 0===n?void 0:n.content,i.cb=(null==s||null===(l=s.playlist)||void 0===l?void 0:l.cb)||null,i.autoNext=(null==s||null===(o=s.playlist)||void 0===o?void 0:o.autoNext)||!1,i.currentVideoData=s.res,i.initialiseStructure(),i.loadCSS(),i.autoNext&&m({playerId:i.playerId,content:i.videos,cb:i.cb}),i}return n(y,[{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")?(u(),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=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),i.dom.appendContent(e,t),document.getElementById(this.playerId).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"}),m=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(m,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(m,a),u.onclick=function(e){e.stopPropagation(),p(t+1),c(n.playerId,n.videos[t].id,sessionStorage.getItem("token")).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,m),d(this.playerId).on("fullscreenchange",(function(){var e=window.getComputedStyle(document.getElementById(n.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(e,"px")}))}}]),y}();export{f as default};