@viewlift/player-backup 1.0.40-backup → 1.0.42-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/autoNextVideo-8656a841.js +1 -0
- package/cjs/bundle.css +1 -1
- package/cjs/{caption-settings-dfaf4210.js → caption-settings-4e762ac2.js} +1 -1
- package/cjs/{features-68987000.js → features-9f66c5b2.js} +1 -1
- package/cjs/generic-d74a3b68.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/{keyboardShortcuts-c7820be4.js → keyboardShortcuts-a0cc657a.js} +1 -1
- package/cjs/{multicam-48941ff4.js → multicam-01812a04.js} +1 -1
- package/cjs/{multicamv2-ef0afe2c.js → multicamv2-83cea567.js} +1 -1
- package/cjs/{mwebPotraitTray-b9abb359.js → mwebPotraitTray-54298fe5.js} +1 -1
- package/cjs/{nextEpisodeButton-2151d197.js → nextEpisodeButton-56cc8d79.js} +1 -1
- package/cjs/{playlist-f4448fe7.js → playlist-49e7ede9.js} +1 -1
- package/cjs/{renditions-de9cffcc.js → renditions-ebfdd2b2.js} +1 -1
- package/cjs/{resolution-732a1ac3.js → resolution-d4cdbcb0.js} +1 -1
- package/cjs/{series-8ebbeaa4.js → series-b4dff6d6.js} +1 -1
- package/cjs/{series-v2-cc4a9de1.js → series-v2-3ef3f191.js} +1 -1
- package/cjs/{settings-icon-9cc35050.js → settings-icon-77196a60.js} +1 -1
- package/cjs/{skin-add94a22.js → skin-1a498ca1.js} +1 -1
- package/cjs/{skin-1e9dde97.js → skin-8140cdce.js} +1 -1
- package/cjs/{skin-0b926fe7.js → skin-9d7c6286.js} +1 -1
- package/cjs/skin-bea1efcd.js +1 -0
- package/cjs/{skin-306aea45.js → skin-e0cd26ad.js} +1 -1
- package/cjs/{util-bb176db0.js → util-dc2b13ea.js} +1 -1
- package/cjs/{videoSelector-20432ba0.js → videoSelector-7845eb0c.js} +1 -1
- package/esm/autoNextVideo-11c92db9.js +1 -0
- package/esm/bundle.css +1 -1
- package/esm/{caption-settings-f5ed1d5b.js → caption-settings-627d7d48.js} +1 -1
- package/esm/{features-e749a4ec.js → features-5fde26e5.js} +1 -1
- package/esm/generic-a58c376a.js +1 -0
- package/esm/index.js +1 -1
- package/esm/{keyboardShortcuts-64550cec.js → keyboardShortcuts-f16f554b.js} +1 -1
- package/esm/{multicam-b7f0db4f.js → multicam-3a5e8f19.js} +1 -1
- package/esm/{multicamv2-d068a43b.js → multicamv2-66462362.js} +1 -1
- package/esm/{mwebPotraitTray-585105a1.js → mwebPotraitTray-24765550.js} +1 -1
- package/esm/{nextEpisodeButton-17fc582d.js → nextEpisodeButton-32cb18de.js} +1 -1
- package/esm/{playlist-e3c81e07.js → playlist-878f853b.js} +1 -1
- package/esm/{renditions-96da564c.js → renditions-bbab5489.js} +1 -1
- package/esm/{resolution-1dde23be.js → resolution-1ed5361a.js} +1 -1
- package/esm/{series-af61b2f7.js → series-a279df1f.js} +1 -1
- package/esm/{series-v2-9a813fa4.js → series-v2-621b2aba.js} +1 -1
- package/esm/{settings-icon-658d3ec4.js → settings-icon-fd63bf43.js} +1 -1
- package/esm/{skin-6ed63cfd.js → skin-146f75b8.js} +1 -1
- package/esm/skin-2cb09517.js +1 -0
- package/esm/{skin-64448263.js → skin-6b70508b.js} +1 -1
- package/esm/{skin-aa26e685.js → skin-8637dcb6.js} +1 -1
- package/esm/{skin-4ca0f112.js → skin-c2a25d33.js} +1 -1
- package/esm/{util-b003fd8d.js → util-e4f12146.js} +1 -1
- package/esm/{videoSelector-08ab2e92.js → videoSelector-b3c80717.js} +1 -1
- package/package.json +1 -1
- package/cjs/autoNextVideo-c08e5141.js +0 -1
- package/cjs/generic-d6489c83.js +0 -1
- package/cjs/skin-d475739f.js +0 -1
- package/esm/autoNextVideo-214dc46e.js +0 -1
- package/esm/generic-713f097f.js +0 -1
- package/esm/skin-320ff245.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/assertThisInitialized"),s=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),c=require("video.js"),d=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/assertThisInitialized"),s=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),c=require("video.js"),d=require("./generic-d74a3b68.js"),u=require("./loader-393b838a.js"),p=require("./icons-0f7b3404.js");function v(e){var i=h();return function(){var t,n=a(e);if(i){var s=a(this).constructor;t=Reflect.construct(n,arguments,s)}else t=n.apply(this,arguments);return r(this,t)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var f,m=c.getComponent("Component"),g=function(){s(r,m);var e=v(r);function r(t){var s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(this,r),s=e.call(this,t,a),o(n(s),"seriesData",[]),s.seriesData=a.seriesData,f=a.playerId,b(s.el(),s.seriesData),s.loadCSS(),s}return t(r,[{key:"createEl",value:function(){var e=document.createElement("div");return e.classList.add("vjs-season-list"),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./series-9c237975.js")})).then((function(e){var i=document.createElement("style");i.id="series",i.append("".concat(e.default)),document.head.appendChild(i)}))}}]),r}();function y(){return(y=e(l.mark((function e(i,t,n,s){return l.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d.pause(f),u.showLoader(f),d.load(f,t).then((function(e){d.setCurrentVideo(e.response),d.play(f)}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,i){for(var t='<div class="hover-div"></div>\n '.concat(p.EpisodesSvg(),'\n <div class="player-season-list-container on-click-toggle">\n <div id="season-list" class="season-list">\n <div class="season-list-head">seasons</div>\n <div class="season-name-container">\n ').concat(function(e){return e.map((function(e,i){return'<div\n class="season-title-sdk"\n key='.concat("title-".concat(e.title),'\n > <div class="season-container">\n ',e.title,"\n </div>\n </div>\n ")})).join("")}(i),'\n </div>\n </div>\n <div id="episode-list" class="episode-list hide-container"><div id="episodes-back-btn" class="episodes-back-btn" >\n <svg class=\'icon icon-backward\' height="22px" width="22px" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0.383092 19.5818C-0.0882695 19.0669 -0.124672 18.2566 0.273985 17.6961L0.382714 17.5615L7.30134 9.99714L0.383092 2.43893C-0.0882694 1.92406 -0.124672 1.11374 0.273985 0.553232L0.382714 0.418625C0.853882 -0.0964584 1.59542 -0.136236 2.10835 0.299398L2.23153 0.418213L11 9.99608L2.23191 19.5814C1.72148 20.1394 0.893733 20.1396 0.383092 19.5818Z" fill="white"/>\n </svg>\n <span>Episodes<span></div> <div id="episode-container" class="episode-container"> </div></div>\n </div>');null!=e&&e.firstChild;)e.removeChild(e.firstChild);for(var n=d.parseHtmlString(t);null!=n&&n.firstChild;)e.appendChild(n.firstChild)}exports.customSeasonList=b,exports.handleSeasonChange=function(e,i,t,n){var s=document.getElementById("season-list"),r=document.getElementById("episode-list"),a=document.getElementById("episode-container");e.id;for(var o=e.episodes.map((function(e,i){return'\n <div id="episode-wrapper" class="episode-wrapper">\n <div class="episode-title" id="episode-title">\n <div class="details-wrapper">\n <div id="title-wrapper" class="title-wrapper">'.concat(i+1," ").concat(e.title,' </div>\n <div class="progress-bar-div">\n <div id="progress-div" class="progress-div"></div>\n </div>\n </div>\n <div class="meta-details">\n <div class="episode-image lazy" style="width:124px; height: 70px;">\n <img src=').concat(e.gist.videoImageUrl,' alt="').concat(e.title,'\'s cover"></img>\n </div>\n <div class="description-wrapper">').concat(e.gist.description,"</div>\n </div>\n </div>\n </div>")})).join("");null!=a&&a.firstChild;)a.removeChild(a.firstChild);for(var l=d.parseHtmlString(o);null!=l&&l.firstChild;)a.appendChild(l.firstChild);!function(e){d.getSeriesWatchHistory(e).then((function(e){var i=e.data,t=document.querySelectorAll("#progress-div");t&&i.map((function(e,i){e&&e.watchedPercentage&&t[i]&&(t[i].style.width=e.watchedPercentage+"px")}))})).catch((function(e){}))}(n),s.classList.toggle("hide-container"),r.classList.toggle("hide-container");var c=document.querySelectorAll(".details-wrapper"),u=document.querySelectorAll("#episode-title"),p=document.querySelectorAll(".meta-details"),v=document.querySelector("#episodes-back-btn"),h=e.id,f=e.episodes;v.addEventListener("click",(function(){return function(e,i){e.classList.remove("hide-container"),i.classList.add("hide-container")}(s,r)}));for(var m=function(i){c[i].addEventListener("click",(function(){return function(e,i,t){var n=i.querySelector(".meta-details");i.classList.toggle("episode-active"),n.classList.toggle("metadetails-active"),t.forEach((function(i,n){n!==e&&(t[n].classList.remove("episode-active"),t[n].querySelector(".meta-details").classList.remove("metadetails-active"))}))}(i,u[i],u)})),p[i].addEventListener("click",(function(){return function(e,i,t,n){return y.apply(this,arguments)}(i,f[i].id,t,u)})),e.episodes[i].id==h&&u[i].classList.add("highlight-active-eps")},g=0;g<c.length;g++)m(g)},exports.seriesModule=g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),r=require("@babel/runtime/helpers/getPrototypeOf"),l=require("video.js"),a=require("./icons-0f7b3404.js"),d=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),r=require("@babel/runtime/helpers/getPrototypeOf"),l=require("video.js"),a=require("./icons-0f7b3404.js"),d=require("./generic-d74a3b68.js");require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/regenerator"),require("axios");var c=require("./autoNextVideo-8656a841.js");function u(e){var t=v();return function(){var n,s=r(e);if(t){var i=r(this).constructor;n=Reflect.construct(s,arguments,i)}else n=s.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}require("js-cookie"),require("ua-parser-js"),require("./util-dc2b13ea.js");var p=l.getComponent("Component"),m=function(){i(r,p);var o=u(r);function r(n){var i,l,a,u,v,p,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,r),(p=o.call(this,n,m)).playerId=m.playerId,p.seriesData=m.sres,p.videos=null==m||null===(i=m.sres)||void 0===i?void 0:i.seasons,p.currentVideoData=m.res,p.initialiseStructure(),p.loadCSS(),p.selectedSeason=0,p.cb=null==m||null===(l=m.series)||void 0===l?void 0:l.cb,p.autoPlayNext=(null==m||null===(a=m.series)||void 0===a?void 0:a.autoPlayNext)||!1,sessionStorage.getItem("token"),p.watchMap=d.getSeriesWatchMap(),null!==(u=s(p))&&void 0!==u&&u.autoPlayNext&&null!=m&&null!==(v=m.series)&&void 0!==v&&v.enable){var h,g,f,C,y=null==m||null===(h=m.sres)||void 0===h?void 0:h.seasons,b=[];y.map((function(t){b.push.apply(b,e(t.episodes))})),d.createIdxMapping(b),d.setVideoIdxById(null===(g=p.options_)||void 0===g||null===(f=g.res)||void 0===f||null===(C=f.video)||void 0===C?void 0:C.id),c.autoPlayNext({playerId:p.playerId,content:b,cb:p.cb,series:null==m?void 0:m.sres})}return p}return n(r,[{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(a.EpisodesSvg())});return l.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./series-v2-70137d8c.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")?(d.closeOpenDrawers(),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"}),i=l.dom.createEl("div",{className:"series-selector-cross-icon",innerHTML:"".concat(a.crossIconSvg())});i.onclick=function(){if("series-selector-cross-icon"===i.className)e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px";else if("series-selector-back-icon"===i.className){var s=l.dom.$(".series-selector-content",t.el());for(l.dom.$(".series-selector-cross-icon",t.el()),i.className="series-selector-cross-icon";null!=s&&s.firstChild;)s.removeChild(s.firstChild);var o=t.createSeasonLister();for(l.dom.appendContent(s,o),l.dom.$(".series-selector-title",t.el()).textContent="Seasons";null!=i&&i.firstChild;)i.removeChild(i.firstChild);var r=d.parseSvgString(a.crossIconSvg());i.appendChild(r)}};var o=l.dom.createEl("div",{className:"series-selector-title",innerHTML:"Seasons"}),r=l.dom.createEl("div",{className:"series-selector-content"}),c=this.createSeasonLister();l.dom.appendContent(r,c),l.dom.appendContent(s,i),l.dom.appendContent(s,o),l.dom.appendContent(e,s),l.dom.appendContent(e,r),d.getPlayer(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;d.getPlayer(this.playerId);for(var t=d.getCurrentSeries(),n=l.dom.createEl("div",{className:"season-container"}),s=function(s){var i,o=document.createElement("label");o.className="season-holder",o.setAttribute("for","season-".concat(s));var r=document.createElement("div");r.className="season - ".concat(s),r.textContent=null===(i=t[s])||void 0===i?void 0:i.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,r),l.dom.appendContent(n,o)},i=0;i<t.length;i++)s(i);return n}},{key:"getSeasonDetailsContainer",value:function(t,n){var s=this;t=t.map((function(e){var t,n,i,o,r;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===(i=n.imageGist)||void 0===i?void 0:i.r16x9,watchedPercentage:(null==s||null===(o=s.watchMap)||void 0===o||null===(r=o.get(null==e?void 0:e.id))||void 0===r?void 0:r.p)||0}}));for(var i=function(i){var o,r,a,c,u,v,p,m=l.dom.createEl("div",{className:"series-container"}),h=l.dom.createEl("div",{className:"series-section",index:i}),g=l.dom.createEl("div",{className:"series-title",innerHTML:"".concat((null===(o=t[i])||void 0===o?void 0:o.title)||"")}),f=l.dom.createEl("div",{className:"series-progress-bar",innerHTML:"<div style='width:".concat(t[i].watchedPercentage,"%' class='series-progress-bar-value'></div>")});l.dom.appendContent(h,g),l.dom.appendContent(h,f),l.dom.appendContent(m,h),l.dom.appendContent(n,m);var C=l.dom.createEl("div",{className:"series-section-expanded hidden"}),y=(null===(r=t[i])||void 0===r?void 0:r.description)||"";(null===(a=y)||void 0===a?void 0:a.length)>170&&(y=y.substr(0,170)+"...");var b=l.dom.createEl("div",{className:"series-description",innerHTML:"".concat(y||"")}),S=l.dom.createEl("img",{className:"series-image"});S.src="".concat((null===(c=t[i])||void 0===c?void 0:c.img)||(null===(u=window)||void 0===u||null===(v=u.customData)||void 0===v?void 0:v.fallbackImage)),S.alt="".concat(null===(p=t[i])||void 0===p?void 0:p.title),l.dom.appendContent(C,S),l.dom.appendContent(C,b),l.dom.appendContent(m,C),l.dom.appendContent(n,m),C.onclick=function(e){var n;e.stopPropagation(),d.setVideoIdxById(null===(n=t[i])||void 0===n?void 0:n.id),d.load(s.playerId,t[i].id).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,i,o=document.getElementsByClassName("series-selector-content")[0].childNodes,r=(o=e(o))[t.target.index].getElementsByClassName("series-section-expanded")[0];null!=r&&null!==(n=r.classList)&&void 0!==n&&n.contains("hidden")?(m.style.backgroundColor="#0000007d",null==r||null===(s=r.classList)||void 0===s||s.remove("hidden")):(null==r||null===(i=r.classList)||void 0===i||i.add("hidden"),m.style.backgroundColor="unset")}},o=0;o<t.length;o++)i(o);return parent}},{key:"showSeasonDetails",value:function(e){this.selectedSeason=e;for(var t=l.dom.$(".series-selector-content",this.el());null!=t&&t.firstChild;)t.removeChild(t.firstChild);var n=d.getCurrentSeries()[e].episodes;this.getSeasonDetailsContainer(n,t);var s=l.dom.$(".series-selector-cross-icon",this.el());for(s.className="series-selector-back-icon";null!=s&&s.firstChild;)s.removeChild(s.firstChild);var i=d.parseSvgString(a.BackIcon());s.appendChild(i),l.dom.$(".series-selector-title",this.el()).textContent="Season ".concat(e+1)}}]),r}();exports.default=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),r=require("video.js"),l=require("./icons-0f7b3404.js"),s=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),r=require("video.js"),l=require("./icons-0f7b3404.js"),s=require("./generic-d74a3b68.js"),c=require("./renditions-ebfdd2b2.js"),d=require("./resolution-d4cdbcb0.js"),u=require("./localisation-56e0a999.js");function p(e){var t=m();return function(){var n,a=o(e);if(t){var r=o(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return i(this,n)}}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/assertThisInitialized");var h=r.getComponent("Component"),v=function(){a(o,h);var i=p(o);function o(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,o),(n=i.call(this,e,a)).playerId=a.playerId,n.seriesData=a.sres,n.currentVideoData=a.res,n.initialiseStructure(),n.loadCSS(),n}return n(o,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"settings-selection vjs-control vjs-button"});e.style.position="unset";var t=r.dom.createEl("div",{className:"settings-selector-icon",innerHTML:"".concat(l.SettingsSvgV2())});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./settings-icon-e6a8feee.js")})).then((function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=r.dom.createEl("div",{className:"selection-container hidden"});r.dom.$(".settings-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(s.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");t.style.height="".concat(n),r.dom.appendContent(e,t),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(t),s.detectOrientationChange(this.playerId,t)}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),a=r.dom.createEl("div",{className:"settings-selector-head"}),i=r.dom.createEl("div",{className:"settings-selector-cross-icon",innerHTML:"".concat(l.crossIconSvg())});i.onclick=function(){e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px"};var o=r.dom.createEl("div",{className:"settings-selector-title",innerHTML:u.getLocalisation("settingsTitle")||"Settings"}),c=r.dom.createEl("div",{className:"settings-selector-content"}),d=r.dom.createEl("div",{className:"settings-container"}),p=this.createVideoQualityContainer();r.dom.appendContent(d,p);var m=this.createAudioQualityContainer();r.dom.appendContent(d,m),r.dom.appendContent(a,i),r.dom.appendContent(a,o),r.dom.appendContent(e,a),r.dom.appendContent(e,c),r.dom.appendContent(c,d),s.getPlayer(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:"createAudioQualityContainer",value:function(){var e=s.getPlayer(this.playerId),t=null==e?void 0:e.audioTracks().tracks_;if(!((null==t?void 0:t.length)<=1)){var n=r.dom.createEl("div",{className:"audio-language-container"}),a=r.dom.createEl("div",{className:"audio-language-container-title",innerHTML:u.getLocalisation("audioLanguageText")||"Audio Language"});r.dom.appendContent(n,a);for(var i=function(e){var a,i=document.createElement("label");i.className="audio-language-holder",i.setAttribute("for","language-radio-".concat(e));var o=document.createElement("div");o.className="audio - ".concat(e),o.textContent=null==t||null===(a=t[e])||void 0===a?void 0:a.label;var l=r.dom.createEl("input",{className:"radio - ".concat(e),id:"language-radio-".concat(e),name:"audio-language-radio"});l.setAttribute("type","radio"),1==t[e].enabled&&(l.checked=!0),l.onchange=function(n){t.map((function(e){e.enabled=!1})),t[e].enabled=!0},r.dom.appendContent(i,l),r.dom.appendContent(i,o),r.dom.appendContent(n,i)},o=0;o<t.length;o++)i(o);return n}}},{key:"createVideoQualityContainer",value:function(){var t=this,n=r.dom.createEl("div",{className:"video-quality-container"}),a=r.dom.createEl("div",{className:"video-quality-container-title",innerHTML:u.getLocalisation("videoQualityText")||"Video Quality"});r.dom.appendContent(n,a);var i=[].concat(e(c.getRenditions(this.playerId)),[{height:"Auto"}]);d.playSelectedResolution(this.playerId,"raw",!0);for(var o=function(e){var a,o,l,c=document.createElement("label");c.className="video-quality-holder",c.setAttribute("for","quality".concat(e));var u=document.createElement("div");u.className="video-quality - ".concat(e);var p=(null==i||null===(a=i[e])||void 0===a?void 0:a.height)+"".concat("Auto"==(null==i||null===(o=i[e])||void 0===o?void 0:o.height)?"":"p"),m=document.createTextNode(p);if(u.appendChild(m),(null==i||null===(l=i[e])||void 0===l?void 0:l.height)>=720)for(var h=s.parseHtmlString("<span class='hd-rendition'> HD </span>");null!=h&&h.firstChild;)u.appendChild(h.firstChild);var v=r.dom.createEl("input",{className:"radio - ".concat(e),id:"quality".concat(e),name:"quality-radio",rendata:"".concat(i[e]),checked:"".concat(e==i.length-1)});v.setAttribute("type","radio"),v.onchange=function(n){var a=i[e];"true"=="".concat("Auto"==i[e].height)?d.playSelectedResolution(t.playerId,a,!0):d.playSelectedResolution(t.playerId,a)},r.dom.appendContent(c,v),r.dom.appendContent(c,u),r.dom.appendContent(n,c)},l=0;l<i.length;l++)o(l);return n}}]),o}();exports.default=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./generic-
|
|
1
|
+
"use strict";var e=require("./generic-d74a3b68.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var r=function(){document.getElementsByClassName("vjs-control-bar")[0].style.visibility="hidden"};exports.initaliseSkin=function(t){Promise.resolve().then((function(){return require("./skin-225252ff.js")})).then((function(e){var r=document.createElement("style");r.id="carousel_homepage",r.append("".concat(e.default)),document.head.appendChild(r)})),r(),function(r){var t=document.getElementById("".concat(r)),n=e.getPlayer(r);t&&t.addEventListener("touchstart",(function(){n.paused()?e.play(r):e.pause(r)}))}(t)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=require("./features-
|
|
1
|
+
"use strict";var e,t=require("./features-9f66c5b2.js"),n=require("./icons-0f7b3404.js"),r=require("./generic-d74a3b68.js"),s=require("@babel/runtime/helpers/defineProperty"),o=require("./keyboardShortcuts-a0cc657a.js");function i(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 l(e,o){var l=r.getPlayer(e);l.one("play",(function(){null!=o&&o.streams&&t.addMulticamView(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)),null!=o&&o.airplay&&"Safari"==r.detectBrowser()&&l.addChild("airPlayButton"),null!=o&&o.chromecastReceiverId&&l.addChild("chromecastButton"),l.addChild("FullscreenToggle"),l.getChild("FullscreenToggle").el().appendChild(r.createIconMarkup(n.MinimizeSvg(window.controlsColor))),l.getChild("FullscreenToggle").el().appendChild(r.createIconMarkup(n.MaximizeSvg(window.controlsColor))),a(e)})),l.on("loadedmetadata",(function(){window.endFirstFrame(l),"Safari"!==r.detectBrowser()&&t.addResolutionModule(e,"live",n.SettingsSvg())})),l.one("loadedmetadata",(function(){var n;null!=o&&o.streams&&(null==o||null===(n=o.streams)||void 0===n?void 0:n.length)>=2&&t.addMwebPotraitTrayModule(e,o)}))}function a(t){var n=r.getPlayer(t);c(),n.on("pause",(function(){clearTimeout(e),u()})),n.on("play",(function(){c()}));var s=document.getElementById("".concat(t));s.addEventListener("mouseenter",(function(){u(),n.paused()||c()})),s.addEventListener("touchstart",(function(){u(),c()})),s.addEventListener("mousemove",(function(){u(),n.paused()||c()}))}function u(){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 c(){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-ebfdd2b2.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.hideControls=a,exports.initialiseSkin=function(e,s){var i;o.initialiseKeyboardEvents(e,s),(null==(i=s)||!i.liveui)&&(null==i||!i.liveVideo)||null!=i&&i.liveui&&null!=i&&i.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){t.addSlowMotion(e)}(e),function(e,t){var s=r.getPlayer(e),o=s.controlBar.getChild("SubsCapsButton").el();document.getElementsByClassName("vjs-subs-caps-button")[1].appendChild(r.createIconMarkup(n.NewCaptionsSvg()));var i=document.createElement("div");i.classList.add("caption-header"),o.querySelector(".vjs-menu-content").insertBefore(i,o.querySelector(".vjs-menu-item"));var l=document.createElement("div");if(l.innerText="Captions",l.className="fs14",document.getElementsByClassName("vjs-subs-caps-button")[0].appendChild(l),"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,s),l(e,s)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./features-
|
|
1
|
+
"use strict";var e=require("./features-9f66c5b2.js"),r=require("./keyboardShortcuts-a0cc657a.js"),t=require("./icons-0f7b3404.js"),i=require("./generic-d74a3b68.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-ebfdd2b2.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.initialiseSkin=function(n,s){r.initialiseKeyboardEvents(n,s),Promise.resolve().then((function(){return require("./skin-983a2ea7.js")})).then((function(e){var r=document.createElement("style");r.id="def_skin",r.append("".concat(e.default)),document.head.appendChild(r)})),function(r,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())}(n,s),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-56cc8d79.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))}))}(n,s),function(e,r){var n=i.getPlayer(e),s=document.getElementsByClassName("vjs-current-time")[0],o=document.getElementsByClassName("vjs-duration")[0],l=document.getElementsByClassName("vjs-time-divider")[0];r.liveVideo&&(s&&(s.style.display="none"),o&&(o.style.display="none"),l&&(l.style.display="none"));n.controlBar.getChild("FullscreenToggle").el().appendChild(i.createIconMarkup(t.MinimizeSvg(window.controlsColor))),n.controlBar.getChild("FullscreenToggle").el().appendChild(i.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var a=n.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(i.createIconMarkup(t.NewCaptionsSvg()));var u=document.createElement("div");u.classList.add("caption-header"),a.querySelector(".vjs-menu-content").insertBefore(u,a.querySelector(".vjs-menu-item"))}(n,s)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./features-9f66c5b2.js"),t=require("./icons-0f7b3404.js"),l=require("./generic-d74a3b68.js"),i=require("./renditions-ebfdd2b2.js"),n=require("@babel/runtime/helpers/toConsumableArray"),o=require("./autoNextVideo-8656a841.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("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-dc2b13ea.js");var r=l.getCurrentSeries(),a=[];null==r||r.map((function(e){return a.push.apply(a,n(e.episodes))}));var d=function(e,t){var i;null==t||null===(i=t.series)||void 0===i||i.cb;var n=l.getPlayer(e);n.on("timeupdate",(function(){var e,t=Math.floor(n.currentTime()),i=n.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-t<=10&&l.getVideoIdx()<=(null==a?void 0:a.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=a.filter((function(e,t){return t==l.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var d,s,v,c,m,p,g,h,f,y,b;(null===(d=document.getElementsByClassName("next-ep-preview"))||void 0===d?void 0:d[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],q=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.textContent="".concat(j),x.src=(null===(g=r[0])||void 0===g||null===(h=g.gist)||void 0===h||null===(f=h.imageGist)||void 0===f?void 0:f.r16x9)||(null===(y=window)||void 0===y||null===(b=y.customData)||void 0===b?void 0:b.fallbackImage),q.onclick=function(){return u(e)}}else{var w,E,N,B,V,S,k,P=document.createElement("div");P.className="next-ep-preview",P.style.visibility="hidden",document.getElementById(e).append(P);var I=document.createElement("div");I.className="next-ep-header",I.textContent="Next up";var M=null===(w=r[0])||void 0===w?void 0:w.title,R=document.createElement("img");R.className="next-ep-img",R.src=(null===(E=r[0])||void 0===E||null===(N=E.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null===(V=window)||void 0===V||null===(S=V.customData)||void 0===S?void 0:S.fallbackImage);var T=document.createElement("div");T.className="next-ep-title",(null===(k=M)||void 0===k?void 0:k.length)>60&&(M=M.substr(0,60)+"..."),T.textContent="".concat(M);var O=document.createElement("div");O.className="next-ep-content",O.append(R),O.append(T),O.onclick=function(){return u(e)},P.append(I),P.append(O)}},u=function(e,t){var i=l.getPlayer(e),n=Math.floor(i.currentTime());if(Math.floor(i.duration())!=n){i.pause(e);var r=l.getVideoIdx();o.switchToNext(r,e,a)}};function s(t,n){var o=l.getPlayer(t);o.on("loadeddata",(function(){var r,a,u;(null===(r=i.getRenditions(t))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(t,n),(null===(a=l.getCaptions(t))||void 0===a?void 0:a.length)>0&&e.addCaptionButton(t,n),null!=n&&null!==(u=n.series)&&void 0!==u&&u.enable&&d(t,n),function(e,t){var l,i=Math.floor(e/60),n=null===(l=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===l?void 0:l[0];n&&(n.style.marginRight=i>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");t&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",n&&(n.style.marginRight="56px"))}(o.duration(),(null==n?void 0:n.liveVideo)||!1)})),o.one("play",(function(){var l,i,n,o;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}exports.initialiseSkin=function(i,n){!function(){"Chrome"==l.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));Promise.resolve().then((function(){return require("./skin-921d35a8.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),s(i,n),function(e,i){var n=l.getPlayer(e);n.controlBar.getChild("FullscreenToggle").el().appendChild(l.createIconMarkup(t.MinimizeSvg(window.controlsColor))),n.controlBar.getChild("FullscreenToggle").el().appendChild(l.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var o=document.getElementsByClassName("vjs-time-control");i.liveVideo&&(o[0].style.display="none")}(i,n),function(l,i){var n,o,r,a,d,u;0==(null==i?void 0:i.liveVideo)&&0==(null==i?void 0:i.liveui)&&e.addSkipButton(l,"defaultV2",t.SkipSvgV2());(0==(null==i?void 0:i.liveVideo)&&0==(null==i?void 0:i.liveui)||1==(null==i?void 0:i.liveui))&&e.addRewindButton(l,"defaultV2",t.RewindSvgV2());i.liveVideo||e.addSlowMotion(l);(null==i||null===(n=i.relatedVideos)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(l,null==i?void 0:i.relatedVideos);(null==i||null===(r=i.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(l,null==i?void 0:i.streams);(null==i||null===(a=i.playlist)||void 0===a||null===(d=a.content)||void 0===d?void 0:d.length)>0&&e.addPlaylistSelector(l,null==i?void 0:i.playlist);null!=i&&null!==(u=i.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(l,i)}(i,n),function(e,t){var i=l.getPlayer(e),n=null==t?void 0:t.tvProviderLogoUrl;if(!n)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(n),r.alt="Provider Image",o.append(r),i.el().appendChild(o),i.on("useractive",(function(){o.classList.remove("vjs-fade")})),i.on("userinactive",(function(){i.paused()||o.classList.add("vjs-fade")})),i.on("fullscreenchange",(function(){i.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(i,n)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./generic-
|
|
1
|
+
"use strict";var e=require("./generic-d74a3b68.js"),r=require("./features-9f66c5b2.js"),i=require("./renditions-ebfdd2b2.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./localisation-56e0a999.js"),exports.initialiseSkin=function(t,n){Promise.resolve().then((function(){return require("./skin-fc1e7e52.js")})).then((function(e){var r=document.createElement("style");r.id="multiplayer_css",r.append("".concat(e.default)),document.head.appendChild(r)})),function(t,n){e.getPlayer(t).on("loadeddata",(function(){var e;(null===(e=i.getRenditions(t))||void 0===e?void 0:e.length)>0&&r.addSettingsButtonV2(t,n)}))}(t,n),function(i){var t=e.getPlayer(i);t.controls(!1),r.addDBClickFullScreen(i)}(t)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("./generic-
|
|
1
|
+
"use strict";var t=require("./generic-d74a3b68.js");exports.getVideoDuration=function(e){var n=t.getPlayer(e);return n?n.duration():"Cannot find player with id: '".concat(e,"'")},exports.onTimeUpdate=function(e,n){var a=t.getPlayer(e);a?a.on("timeupdate",(function(){return n(a.currentTime())})):n("Cannot find player with id: '".concat(e,"'"))},exports.onVideoEnded=function(e,n){var a=t.getPlayer(e);a?a.on("ended",(function(){return n(!0)})):n("Cannot find player with id: '".concat(e,"'"))},exports.seekToTimeStamp=function(e,n,a){var r=t.getPlayer(e);r?n>=0&&n<=r.duration()?(a({status:!0,msg:"Successfully seeked to timestamp : ".concat(n)}),r.currentTime(n)):a({status:!1,msg:"Out of bounds, please provide a valid timestamp"}):a("Cannot find player with id: '".concat(e,"'"))},exports.setPlaybackSpeed=function(e,n){var a=t.getPlayer(e);if(!a)return"Cannot find player with id: '".concat(e,"'");try{return a.playbackRate(n),"Playback speed set to ".concat(n,"x")}catch(t){return"Error: ".concat(t)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),r=require("video.js"),a=require("./icons-0f7b3404.js"),l=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),r=require("video.js"),a=require("./icons-0f7b3404.js"),l=require("./generic-d74a3b68.js"),d=require("./autoNextVideo-8656a841.js"),c=require("./localisation-56e0a999.js");function s(e){var t=u();return function(){var n,r=i(e);if(t){var a=i(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return o(this,n)}}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("./util-dc2b13ea.js");var v=r.getComponent("Component"),m=function(){n(i,v);var o=s(i);function i(t){var n,r,a,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,i),(a=o.call(this,t,c)).playerId=c.playerId,a.seriesData=c.sres,a.videos=c.related.content,a.cb=(null==c||null===(n=c.related)||void 0===n?void 0:n.cb)||null,a.autoNext=(null==c||null===(r=c.related)||void 0===r?void 0:r.autoNext)||!1,a.currentVideoData=c.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&(l.setVideoIdx(0),d.autoPlayNext({playerId:a.playerId,content:a.videos,cb:a.cb})),a}return t(i,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"video-selection vjs-control vjs-button"});e.style.position="unset";var t=r.dom.createEl("div",{className:"video-selector-icon",innerHTML:"".concat(a.EpisodesSvg())});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./videoSelector-fcdf11eb.js")})).then((function(e){var t=document.createElement("style");t.id="video-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=r.dom.createEl("div",{className:"video-selection-container hidden"});r.dom.$(".video-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(l.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");t.style.height="".concat(n),r.dom.appendContent(e,t),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(t),l.detectOrientationChange(this.playerId,t)}},{key:"toggleOpenClose",value:function(){}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),o=r.dom.createEl("div",{className:"video-selector-head"}),i=r.dom.createEl("div",{className:"video-selector-cross-icon",innerHTML:"".concat(a.crossIconSvg())});i.onclick=function(){e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px"};for(var d=r.dom.createEl("div",{className:"video-selector-title",innerHTML:c.getLocalisation("relatedVideoTitle")||"Recommended"}),s=r.dom.createEl("div",{className:"video-selector-content"}),u=r.dom.createEl("div",{className:"video-container"}),v=function(e){var n,o,i,a,d,c=r.dom.createEl("div",{className:"video -".concat(e)}),v=r.dom.createEl("div",{className:"recommended -".concat(e)});v.setAttribute("video-idx",e),v.onclick=function(){l.setVideoIdx(e+1);for(var n=r.dom.$$(".recommended"),o=0;o<n.length;o++)n[o].style.border="none";l.highlightVideo(e),l.load(t.playerId,t.videos[e].id).then((function(e){t.cb&&t.cb(e)})).catch((function(e){t.cb&&t.cb(e)}))};var m=document.createElement("img");m.className="related-thumbnail-image",m.src="".concat((null==t||null===(n=t.videos)||void 0===n||null===(o=n[e])||void 0===o?void 0:o.img)||(null===(i=window)||void 0===i||null===(a=i.customData)||void 0===a?void 0:a.fallbackImage)),m.alt="No Thumbnail Available",v.append(m);var p=r.dom.createEl("div",{className:"info -".concat(e),innerHTML:"".concat((null==t||null===(d=t.videos[e])||void 0===d?void 0:d.title)||"")});r.dom.appendContent(c,v),r.dom.appendContent(c,p),r.dom.appendContent(u,c),r.dom.appendContent(s,u)},m=0;m<this.videos.length;m++)v(m);r.dom.appendContent(o,i),r.dom.appendContent(o,d),r.dom.appendContent(e,o),r.dom.appendContent(e,s),l.getPlayer(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")}))}}]),i}();exports.default=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,q as t,P as i,e as o,Q as e,O as a,R as c}from"./generic-a58c376a.js";import{a as u}from"./util-e4f12146.js";var s,r=0,f=0,l=function(l){clearTimeout(r);var d=null==l?void 0:l.content;s=null==l?void 0:l.cb;var h=l.playerId;u(h,(function(){var u=n(h);0!==(null==u?void 0:u.currentTime())&&((f=a())>d.length-1||t(h,d[f].id).then((function(n){i(f),o(n.response),f++,c(f),v(n)})).catch((function(n){v(n),i(f),f++,c(f),r=setTimeout((function(){e(h)&&m(f,h,d)}),5e3)})))}))},m=function n(o,e,a,u){f=o,o>a.length-1||t(e,a[o].id).then((function(n){i(f),f++,c(f),v(n)})).catch((function(t){v(t),setTimeout((function(){i(f),f++,c(f),n(f,e,a)}),5e3)}))},v=function(n){s&&s(n)};export{l as a,m as s};
|
package/esm/bundle.css
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
.widget-selection{
|
|
20
19
|
display: flex;
|
|
21
20
|
align-items: center;
|
|
@@ -136,6 +135,7 @@
|
|
|
136
135
|
.widget-selector-content #sr-widget{
|
|
137
136
|
padding: 0 18px;
|
|
138
137
|
}
|
|
138
|
+
|
|
139
139
|
.vjs-poster {
|
|
140
140
|
display: inline-block;
|
|
141
141
|
vertical-align: middle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as r,e as c}from"./icons-c2efba97.js";import{w as l,v as s,T as d,U as p,a as m,u}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as r,e as c}from"./icons-c2efba97.js";import{w as l,v as s,T as d,U as p,a as m,u}from"./generic-a58c376a.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function v(e){var t=h();return function(){var n,i=o(e);if(t){var r=o(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return a(this,n)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=i.getComponent("Component"),g=function(){n(o,f);var a=v(o);function o(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,o),(n=a.call(this,t,i)).playerId=i.playerId,n.seriesData=i.sres,n.currentVideoData=i.res,n.initialiseStructure(),n.loadCSS(),n}return t(o,[{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"caption-selection vjs-control vjs-button"});e.style.position="unset";var t=i.dom.createEl("div",{className:"caption-selector-icon",innerHTML:"".concat(r())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./caption-settings-2e47813b.js").then((function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=l(this.playerId);null==t||t.map((function(t){return s(e.playerId,t.id)}));var n=this.el(),a=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var e;null!==(e=a.classList)&&void 0!==e&&e.contains("hidden")?(d(),a.classList.remove("hidden"),n.classList.add("open"),a.style.right="0px"):(a.classList.add("hidden"),n.classList.remove("open"),a.style.right="-350px")};var o=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height");a.style.height="".concat(o),i.dom.appendContent(n,a),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(a),p(this.playerId,a)}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),a=i.dom.createEl("div",{className:"caption-selector-head"}),o=i.dom.createEl("div",{className:"caption-selector-cross-icon",innerHTML:"".concat(c())});o.onclick=function(){e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px"};var r=i.dom.createEl("div",{className:"caption-selector-title",innerHTML:"Captions"}),l=i.dom.createEl("div",{className:"caption-selector-content"}),s=i.dom.createEl("div",{className:"caption-container"}),d=this.createLanguageContanier();i.dom.appendContent(s,d);var p=this.createFontSizeContainer();i.dom.appendContent(s,p),i.dom.appendContent(a,o),i.dom.appendContent(a,r),i.dom.appendContent(e,a),i.dom.appendContent(e,l),i.dom.appendContent(l,s),m(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:"createLanguageContanier",value:function(){var e=this,t=i.dom.createEl("div",{className:"caption-language-container"}),n=i.dom.createEl("div",{className:"caption-language-container-title",innerHTML:"Language"});i.dom.appendContent(t,n);var a=document.createElement("label");a.setAttribute("for","radio-off"),a.className="caption-language-holder";var o=document.createElement("div");o.className="caption",o.innerHTML="Off";var r=i.dom.createEl("input",{className:"radio - off",id:"radio-off",name:"language-radio",checked:"true"});r.setAttribute("type","radio"),r.onchange=function(t){l(e.playerId).map((function(t){return s(e.playerId,t.id)}))},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var c=l(this.playerId),d=function(n){var a,o=document.createElement("label");o.className="caption-language-holder",o.setAttribute("for","language-radio-".concat(n));var r=document.createElement("div");r.className="caption - ".concat(n),r.textContent=null==c||null===(a=c[n])||void 0===a?void 0:a.label;var l=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});l.onchange=function(t){u(e.playerId,c[n].id)},l.setAttribute("type","radio"),i.dom.appendContent(o,l),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},p=0;p<c.length;p++)d(p);return t}},{key:"createFontSizeContainer",value:function(){var e=i.dom.createEl("div",{className:"caption-font-container"}),t=i.dom.createEl("div",{className:"caption-font-container-title",innerHTML:"Font Size"});i.dom.appendContent(e,t);for(var n=[{size:14},{size:18},{size:24}],a=0;a<n.length;a++){var o,r=document.createElement("label");r.className="caption-font-holder",r.setAttribute("for","font".concat(a));var c=document.createElement("div");c.className="fontsize - ".concat(a),c.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var l=i.dom.createEl("input",{className:"radio - ".concat(a),id:"font".concat(a),name:"font-size-radio",size:"".concat(n[a].size),checked:"".concat(a==n.length-1)});l.setAttribute("type","radio"),l.onchange=function(e){var t=e.target.size;if(document.getElementById("caption-size")){document.getElementById("caption-size").textContent=".vjs-text-track-cue{font-size:".concat(t,"px !important}")}else{var n=document.createElement("style");n.textContent=".vjs-text-track-cue{font-size:".concat(t,"px !important}"),n.id="caption-size",document.head.append(n)}},i.dom.appendContent(r,l),i.dom.appendContent(r,c),i.dom.appendContent(e,r)}return e}}]),o}();export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{a,L as s,r as c,k as d}from"./generic-
|
|
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{a,L as s,r as c,k as d}from"./generic-a58c376a.js";import{g as u}from"./renditions-bbab5489.js";import{g as m}from"./localisation-0bf399a1.js";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){var t=h();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var v=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=m("slowMoText")||"Slow Mo",r}return n(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},g=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var c=s(l);return o.append(c),r}return n(a,[{key:"handleClick",value:function(){c(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var c=s(l);return o.append(c),r}return n(a,[{key:"handleClick",value:function(){d(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},C=function(e,t){import("./multicam-3a5e8f19.js").then((function(n){var r=n.default,o=t.streams,l=a(e);i.registerComponent("multicamModule",r),l.getChild("controlBar").addChild("multicamModule",{playerId:e,streams:o,config:t},l.controlBar.children().length)}));var n=document.querySelector(".vjs-control-bar");n&&"live"==(null==t?void 0:t.skin)&&(n.style.background="transparent")},B=function(e,t,n){import("./resolution-1ed5361a.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a(e),s=u(e);(null==s?void 0:s.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:s},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-32cb18de.js").then((function(r){var o=r.default,l=a(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},j=function(e,t){import("./mwebPotraitTray-24765550.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("mwebPotraitTray",r),o.getChild("controlBar").addChild("mwebPotraitTray",{playerId:e,config:t},0)}))},k=function(e,t,n){import("./series-a279df1f.js").then((function(r){var o=r.seriesModule,l=a(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var s=document.querySelectorAll(".season-title-sdk"),c=function(e){s[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},d=0;d<s.length;d++)c(d)}))},E=function(e,t){import("./videoSelector-b3c80717.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},O=function(e,t){import("./caption-settings-627d7d48.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)}))},w=function(e,t){import("./settings-icon-fd63bf43.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)}))},S=function(e,t){import("./playlist-878f853b.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},I=function(t,n){import("./series-v2-621b2aba.js").then((function(r){var o=r.default,l=a(t);i.registerComponent("seriesV2",o),l.getChild("controlBar").addChild("seriesV2",function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({playerId:t},n),l.controlBar.children().length-3)}))},M=function(e,t){import("./multicamv2-66462362.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},P=function(e,t){var n=a(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},L=function(e){var t=a(e).el(),n=0,r=a(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o};export{C as a,B as b,j as c,v as d,k as e,b as f,y as g,g as h,w as i,O as j,P as k,E as l,M as m,S as n,I as o,L as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import"js-cookie";import r from"ua-parser-js";import a from"@babel/runtime/helpers/toConsumableArray";var l={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel"};function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function u(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?d(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var s={name:"@viewlift/player-backup",version:"1.0.42-backup",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.2.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3","js-cookie":"^3.0.5","video.js":"^7.20.3","videojs-contrib-ads":"^6.9.0","videojs-contrib-dash":"^5.1.1","videojs-contrib-eme":"^3.11.1","videojs-ima":"^2.1.0"}},c=function(e,n){var t,o,r,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):i({url:_(),params:u({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":s.version},withCredentials:!0})},v=function(e,n){var t,o;return i({url:b()+l.getLinearChannelDetails,params:u(u(u(u(u({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:n}})},m=function(e,n){var t,o,r=JSON.parse(atob(n.split(".")[1])),a=(null==r?void 0:r.site)||null;return r&&r.countryCode,null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})})):i({url:b()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},p=function(){var e=n(t.mark((function e(n,o){var r,a,l;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return a={siteOwner:null==n?void 0:n.siteOwner,userId:null==n?void 0:n.userId,videoId:null==n?void 0:n.videoId,watchedPercentage:null==n?void 0:n.watchedPercentage,watchedTime:null==n?void 0:n.watchedTime},e.abrupt("return",i({url:y(),method:"POST",headers:{Authorization:r,"x-api-key":n.xApiKey},params:{version:"v2"},data:JSON.stringify(a),withCredentials:!0}));case 8:if("v2"!=o){e.next=11;break}return l=u({doneWatching:null==n?void 0:n.doneWatching,videoId:null==n?void 0:n.videoId,watchedPercentage:null==n?void 0:n.watchedPercentage,watchedTime:null==n?void 0:n.watchedTime},(null==n?void 0:n.seriesId)&&{seriesId:n.seriesId}),e.abrupt("return",i({url:h(),method:"POST",headers:{Authorization:r},data:l,params:u({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 11:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),f=function(e,n){var t,o,r=(null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(n.split(".")[1])),u=(null==d?void 0:d.site)||null;return i({method:"GET",url:w(e),params:{site:u},headers:{Authorization:n,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey}})}if("v2"==r){var s,c;JSON.parse(atob(n.split(".")[1]));var v=window.contentType;return i({method:"GET",url:T(e,v),headers:{Authorization:n,"x-api-key":null===(s=window)||void 0===s||null===(c=s.watchHistory)||void 0===c?void 0:c.xApiKey}})}},I=function(e){var n,t;if("v1"==((null===(n=window)||void 0===n||null===(t=n.watchHistory)||void 0===t?void 0:t.apiVersion)||"v1"))return i({method:"GET",url:E(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token}});var o=e.videoId;return i({method:"GET",url:g(o),headers:{Authorization:e.token}})},g=function(e){return b()+"".concat(null==l?void 0:l.getSeriesWatchHistoryV2,"/").concat(e)},E=function(){return b()+"".concat(null==l?void 0:l.getSeriesWatchHistoryV1)},w=function(e){return b()+"".concat(null==l?void 0:l.getVideoInfoV1,"/").concat(e)},T=function(e,n){return b()+"".concat(null==l?void 0:l.getVideoInfoV2,"/").concat(n,"/").concat(e)},y=function(){return b()+"".concat(null==l?void 0:l.saveWatchHistoryV1)},h=function(){return b()+"".concat(null==l?void 0:l.saveWatchHistoryV2)},_=function(){return b()+"".concat(null==l?void 0:l.getVideoDetails)},b=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==l?void 0:l.apiBaseUrl)},O=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},D=null;function V(){return{set:function(e){e&&(D=e)},get:function(){return D}}}var L=function(){var e=n(t.mark((function e(){var n,o,r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=V().get(),o=b(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),S=null,C=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!O(n)){e.next=6;break}return S||(S=L().then((function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&V().set(r),i||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){S=null}))),e.abrupt("return",S);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),W=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e),i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}},A=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var F=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"};function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function R(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?k(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):k(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}window._deviceInfo=r(navigator.userAgent);var P,N,x,j,B,U=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},H=function(e){var n=M(e,"video.tags",[]),t=M(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},M=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},z=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},G=function(){var e,n,t,o,i,r,a,l,d,u,s,c,v=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",m=arguments.length>1?arguments[1]:void 0,p=arguments.length>2?arguments[2]:void 0,f=null==p||null===(e=p.video)||void 0===e?void 0:e.metadata,I=Ce(m);if(!v.includes("VIEWLIFT_"))return v;var g=window.getComputedStyle(document.getElementById(m),null),E=Math.trunc(g.getPropertyValue("height").slice(0,-2)),w=Math.trunc(g.getPropertyValue("width").slice(0,-2)),T=M(p,"video.gist.id",""),y=R(R({},q(f)),{},{VIEWLIFT_WIDTH:w,VIEWLIFT_HEIGHT:E,VIEWLIFT_SIZE:U(w,E),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(n=window)||void 0===n?void 0:n.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:navigator.userAgent,VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:M(p,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:M(p,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:M(p,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==I||null===(t=I.options_)||void 0===t?void 0:t.autoplay)||1,VIEWLIFT_MUTE:(null==I||null===(o=I.options_)||void 0===o?void 0:o.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:H(p),VIEWLIFT_MEDIA_ID:T,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(M(p,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:T,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+M(p,"video.gist.permalink","")),VIEWLIFT_COPPA:M(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(a=r.site)||void 0===a?void 0:a.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:M(null===(l=window)||void 0===l||null===(d=l.app_data)||void 0===d||null===(u=d.site)||void 0===u?void 0:u.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*M(p,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:M(p,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:T,VIEWLIFT_CONTENT_TITLE:M(p,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:M(p,"video.series[0].gist.title",M(p,"seriesInfo.title","VIEWLIFT_CONTENT_SERIES_TITLE")),VIEWLIFT_CONTENT_EPISODE:M(p,"video.currentEpisode","VIEWLIFT_CONTENT_EPISODE"),VIEWLIFT_CONTENT_SEASON:M(p,"video.currentSeason","VIEWLIFT_CONTENT_SEASON"),VIEWLIFT_CONTENT_GENRE:M(p,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER"},null===(s=window)||void 0===s||null===(c=s.customData)||void 0===c?void 0:c.macros);for(var h in y){var _=new RegExp("\\b("+h+")\\b","g");v=v.replace(_,y[h])}return v},q=function(e){var n,t,o,i,r,a,l={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){d.set(e.name,e.value)})));var u=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return u||s?(z()?u?l=R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(l=R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?l=R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(l=R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?l=R(R({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}):s&&(l=R(R({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||""})),l=z()?R(R({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):R(R({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=R(R({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}),l=z()?R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),l},Y=function(e,n){var t,o,i,r,a,l,d,u,s,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[f])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(o=e[f])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,E=null==e||null===(r=e[f])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,w=(null==e||null===(l=e[f])||void 0===l||null===(d=l.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[f])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var T=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return X(E);if(I){var y=K(g,n);return y.src=G(y.src,n,e),y}if("Safari"!==F()&&T)return J(g);if(w){var h=X(g);return h.src=G(h.src,n,e),h}if(null!=g&&g.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return _.src=G(_.src,n,e),_}return null},J=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},X=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},K=function(e,n){var t=e.fairPlay,i=e.widevine,r=e.playReady,a=F(),l=Ce(n);if("Safari"===a){var d=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,(function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))}))},getContentId:function(e,n){if(n)return new TextDecoder("utf-16").decode(n.slice(16))},getLicense:function(n,t,i,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,(function(e,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(t);try{l.eme()}catch(e){console.log("EME ERROR :",e)}return d}var u,s={src:i.url,type:"application/dash+xml"};return"caliente"==(null===(u=window)||void 0===u?void 0:u.siteName)?(l.eme(),s.keySystems={"com.widevine.alpha":{url:i.licenseUrl,licenseHeaders:{"X-AxDRM-Message":i.licenseToken}},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken}}}):(s.keySystemOptions=[],s.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:i.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),s.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),s};var Q=function(e){N=e},Z=function(){return N},$=function(e){P=e},ee=function(){return P},ne=function(){return x},te=function(e){x=e},oe=function(e){B=e},ie=function(){return B},re=function(e){j=new Map,e.map((function(e,n){j.set(e.id,n)}))},ae=function(e){if(j){var n=j.get(e);te(n+1)}},le=function(e,n){for(var t=Ce(e).textTracks(),o=0;o<t.length;o++){var i=t[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!=n||(i.mode="showing")}},de=function(e,n){for(var t=Ce(e).textTracks(),o=0;o<t.length;o++){var i=t[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!==n||(i.mode="hidden")}},ue=function(e){var n,t=Ce(e);return(null==t||null===(n=t.textTracks())||void 0===n?void 0:n.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},se=function(e){var n=Ce(e);n.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,n.removeRemoteTextTrack(e)}))},ce=function(e,n){var t=Ce(e);t.remoteTextTracks().tracks_.map((function(e){t.removeRemoteTextTrack(e)})),n.map((function(e){t.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},ve=!1,me=function(e,n,t){var o=G(n,e,t),i=Ce(e);n&&window.google&&(i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,r=Ce(e);if(null!==r.el_){ve=!0;var a={id:e,adTagUrl:"".concat(n,"&vid=").concat(window.videoId,"&url=").concat(window.location.href,"&correlator=").concat((new Date).getTime(),"&cust_params=sd%3D60000%26site%3D").concat(window.location.origin,"%26autostart%3D%26mute%3D%26user_agent%3D%26keyword%3D%26category%3D").concat(window.category,"%26vid%3D").concat(window.videoId),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),ve&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,n,!0),r.ima.requestAds()}),1e3));var l=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&l.hasAttribute("controls")&&l.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),r.one(d,(function(){u&&r.ima.initializeAdDisplayContainer()}));var s=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;r.one("ads-ad-started",(function(){s&&s({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){s&&s({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){s&&s({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o))},pe=function(e){return"live"!==e&&"carousel"!==e&&"V2"!==e&&"defaultV2"!==e&&"multiplayer"!==e},fe=function(e){var n=(new DOMParser).parseFromString(e,"text/html");return null==n?void 0:n.querySelector("body")},Ie=function(e){var n=(new DOMParser).parseFromString(e,"image/svg+xml");return null==n?void 0:n.querySelector("svg")},ge=function(e){return Ie(e)},Ee=function(e){a(document.querySelectorAll("[video-idx]")).map((function(n){var t=n.getAttribute("video-idx");n.style.border=t==e?"2px solid white":"none"}))},we=function(){var e=a(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var n,t;null==e||null===(n=e.childNodes)||void 0===n||null===(t=n[0])||void 0===t||t.click()}))},Te=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},ye="",he=function(e,n){var t,o=function(){return function(e,n){var t=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape";if(ye!==t){var o=window.getComputedStyle(document.getElementById(e),null).getPropertyValue("height");n&&(n.style.height="".concat(o)),ye=t}}(e,n)};window._orientationChangeHandler=o;window.addEventListener("resize",(function(){clearTimeout(t),t=setTimeout((function(){o()}),100)}))};function _e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var be=function(e){o(e).play()},Oe=function(e){o(e).pause()},De=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Ve=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Le=function(e){return!!o.getPlayer("".concat(e))},Se=function(e){return o(e).paused()},Ce=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},We=function(){var e=n(t.mark((function e(n,o,i){var r,a,l,d,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C();case 2:return d=e.sent,ae(o),u=0,s=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(a=window)&&void 0!==a&&null!==(l=a.watchHistory)&&void 0!==l&&l.enable&&f(o,d).then((function(e){var n,t,o,i,r,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,s=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})),e.abrupt("return",new Promise((function(e,t){c(o,d).then((function(o){var i,r,a,l,d,c,v,m,p,f,I=null==o?void 0:o.data,g=(null==I||null===(i=I.video)||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;Q(o.data);var E=(null==I||null===(a=I.ads)||void 0===a||null===(l=a.preRoll)||void 0===l||null===(d=l.adTags)||void 0===d||null===(c=d.web)||void 0===c?void 0:c.active)&&(null==I||null===(v=I.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(p=m.adTags)||void 0===p||null===(f=p.web)||void 0===f?void 0:f.url);E&&me(n,E,I);var w=Y(I,n);if(w){var T,y,h,_,b,O,D,V,L,S,C,F,k,R,P=(null==I||null===(T=I.video)||void 0===T||null===(y=T.gist)||void 0===y?void 0:y.videoImageUrl)||(null==I||null===(h=I.video)||void 0===h||null===(_=h.gist)||void 0===_||null===(b=_.imageGist)||void 0===b?void 0:b.r16x9),N=Ce(n);if(N.poster(P),Re(n,w),N.on("loadstart",(function(){g&&e({status:!0,msg:"Video Loaded",response:I})})),N.on("loadeddata",(function(){A(),e({status:!0,msg:"Video Loaded",response:I})})),N.one("play",(function(){u&&s<95&&setTimeout((function(){N.currentTime(u)}),0)})),N.one("error",(function(){var e;t({status:!1,msg:(null==N||null===(e=N.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==I||null===(O=I.video)||void 0===O||null===(D=O.contentDetails)||void 0===D||null===(V=D.closedCaptions)||void 0===V?void 0:V.length)>0||(null==I||null===(L=I.video)||void 0===L||null===(S=L.closedCaptions)||void 0===S?void 0:S.length)>0)C=((null==I||null===(F=I.video)||void 0===F||null===(k=F.contentDetails)||void 0===k?void 0:k.closedCaptions)||(null==I||null===(R=I.video)||void 0===R?void 0:R.closedCaptions)).filter((function(e){return"VTT"===e.format})),ce(n,C);else se(n)}else W(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){Pe(e,n,t,o)}))})));case 8:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),Ae=function(e,n,t){var o=Ce(e);return o.src(n),new Promise((function(e,n){var i=0;o.one("loadedmetadata",(function(){clearTimeout(i),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){i=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Fe=function(e){var n=Ce(e);if(ke(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},ke=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},Re=function(e,n){Ce(e).src(n)},Pe=function(n,t,o,i){var r,a,l,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);Le(t)&&W(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):_e(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Ne=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{O as A,pe as B,m as C,c as D,Pe as E,v as F,f as G,Te as H,me as I,ce as J,$ as K,Ie as L,ge as M,ee as N,ne as O,Ee as P,Se as Q,te as R,fe as S,we as T,he as U,re as V,ae as W,Ce as a,Z as b,A as c,F as d,Q as e,ie as f,C as g,W as h,I as i,oe as j,De as k,Ae as l,Oe as m,Re as n,Le as o,be as p,We as q,Ve as r,p as s,Fe as t,le as u,de as v,ue as w,Y as x,Ne as y,V as z};
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import i from"@babel/runtime/regenerator";import t from"axios";import{g as o,a as r,d as l,s as a,c as s,h as d,b as u,e as c,f as v,i as m,j as f,l as w,k as p,p as h,m as g,r as y,n as b,o as T,q as I,t as k,u as P,v as O,w as E,x as S,y as j,z as D,A,B as R,C as F,D as C,E as x,F as B,G as M,H as _,I as H,J as N,K as L}from"./generic-713f097f.js";import V from"video.js";import{o as U,g as W,a as q,s as z,b as G}from"./util-b003fd8d.js";import{g as J}from"./renditions-96da564c.js";import{playSelectedResolution as K}from"./resolution-1dde23be.js";import{s as Q}from"./localisation-0bf399a1.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 Y(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function X(e,n){Y("event",e,n)}function Z(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function $(n){for(var i=1;i<arguments.length;i++){var t=null!=arguments[i]?arguments[i]:{};i%2?Z(Object(t),!0).forEach((function(i){e(n,i,t[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ne(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function ie(){return te.apply(this,arguments)}function te(){return te=n(i.mark((function e(){var n,t;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(n=e.sent,null==(t=JSON.parse(atob(n.split(".")[1])))||!t.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==t?void 0:t.userId);case 9:case"end":return e.stop()}}),e)}))),te.apply(this,arguments)}window.initialise=function(e){window.sid=ee(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var i,t,o,r=Math.floor(e.currentTime());X(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:ne(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(t=i.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var n,i,t;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),X("PLAY",$({pfm:window.platform,uid:ne(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(t=i.beacon)||void 0===t?void 0:t.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,n){var i,t;if(n.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(i=n.el_)&&void 0!==i&&null!==(t=i.className)&&void 0!==t&&t.includes("vjs-waiting"))X("BUFFERING",$({pfm:window.platform,uid:ne(),vid:window.videoId,videoPosition:n.el_&&Math.floor(n.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:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n,i,t;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,X("FIRST_FRAME",$({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),vid:window.videoId},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(t=i.beacon)||void 0===t?void 0:t.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 n,i,t,o,r,l;X("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(t=i.beacon)||void 0===t?void 0:t.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),X("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),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 n=[];e.on("timeupdate",(function(){var i=Math.floor(e.currentTime());i>=30&&i%30==0&&!n.includes(i)&&(n.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 n=e.currentTime(),i=e.duration(),t=e.buffered(),o=0;o<t.length;o++){var r=t.start(o),l=t.end(o);if(oe(n,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var oe=function(e,n,i){return e>=n&&e<=i};window.fireEvent=function(){var e=n(i.mark((function e(n){var r,l,a,s,d,u,c,v,m,f,w;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=[$($($({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),{},{uid:ne(),vid:window.videoId,url:n.url||document.location.href,ref:n.ref||document.referrer,pa:n.eventName,vpos:n.videoPosition,environment:window.environment,dp1:n.dp1||null,dp2:n.dp2||null,dp3:n.dp3||null,dp4:n.dp4||null,dp5:n.dp5||null,apos:!0===n.isAdEvent?n.videoPosition:null,apod:!0===n.isAdEvent?(i=n.adPosition,i?String(i):""):null,profid:ie(),player:n.playerType||"native",media_type:n.mediaType||"VIDEO",stream_id:window.sid,embedurl:null,ttfirstframe:n.ttFirstFrame,bitrate:n.bitrate,connectionspeed:null,resolutionheight:n.resHeight,resolutionwidth:n.resWidth,bufferhealth:n.bufferHealth},(null==n?void 0:n.duration)&&{duration:n.duration}),null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params)],e.next=3,o();case 3:w=e.sent,t({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:w},contentType:"application/x-www-form-urlencoded",dataType:"text",data:f}).catch((function(e){console.error(e)}));case 5:case"end":return e.stop()}var i}),e)})));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re,le,ae=function(e){var n,i,t=r(null==e?void 0:e.playerId);null!=e&&null!==(n=e.series)&&void 0!==n&&n.enable||null==e||!e.chromecastReceiverId||null===(i=window)||void 0===i||!i.cast?console.log("Chromecast plugin is not available"):null==t||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"==l()?null==t||t.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},se=function(e,n){var i=r(e);i&&n&&i.controlBar&&i.controlBar.progressControl.seekBar.on("click",(function(n){var i,t,o,r,l,a=this.el(),s=V.dom.getPointerPosition(a,n).x;V.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(i=window)||void 0===i||null===(t=i.cast)||void 0===t||null===(o=t.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function de(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}var ue=[],ce=0,ve=null;function me(n,i,t){var o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];le=(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(n.currentTime()),c=Math.floor(n.duration()),v=null==i||null===(l=i.watchHistory)||void 0===l?void 0:l.xapiKey,m={};"v1"==le?m={videoId:re,watchedTime:Math.floor(n.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:i.siteOwner,userId:i.userId,xApiKey:v}:"v2"==le&&(m=function(n){for(var i=1;i<arguments.length;i++){var t=null!=arguments[i]?arguments[i]:{};i%2?de(Object(t),!0).forEach((function(i){e(n,i,t[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):de(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}({videoId:re,watchedTime:Math.floor(n.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},ve&&{seriesId:ve})),a(m,le).then((function(e){})).catch((function(e){})),ce=u+t}var fe=function(e,n,i){var t=r(e);if(t)if(n>=0&&n<=100){t.muted()&&t.muted(!1);var o=parseFloat(n)/100;t.volume(o),i&&i({status:!0,msg:"Volume set to ".concat(n,"%")})}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,"'")})},we=function(e){var n=r(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function pe(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}var he=function(n,i,t,o){var l,a,m=o.res,f=o.sres,w=r(n),p=(null==m||null===(l=m.video)||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;c(m),w.on("loadstart",(function(){p&&t.resolve({status:!0,msg:"Video Loaded",response:m})})),w.on("loadeddata",(function(){var o;(null==w||!w.muted())&&fe(n,sessionStorage.getItem("volume")||"100");var l,a,d=u();(s(),t.resolve(function(n){for(var i=1;i<arguments.length;i++){var t=null!=arguments[i]?arguments[i]:{};i%2?pe(Object(t),!0).forEach((function(i){e(n,i,t[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pe(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}({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,n,i){var t,o;null!=n&&n.series&&(ve=null==n||null===(t=n.series)||void 0===t?void 0:t.id),ue=[],ce=0,re=i;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=r(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());ue.includes(ce)||(e==ce?(ue.push(e),me(a,n,l)):e>ce&&(ce=e+l))})),a.on("ended",(function(){me(a,n,l,!0)})))}(n,i,null==d||null===(l=d.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.id)})),w.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];w.trigger("subtitlechanged",n)})),w.on("subtitlechanged",(function(e,n){var i,t,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===(t=i.cast)||void 0===t||null===(o=t.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=n?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(n,(null==w||null===(e=w.error())||void 0===e?void 0:e.message)||"Some error occured"),t.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 n,t,o,r=null===(n=u())||void 0===n||null===(t=n.video)||void 0===t||null===(o=t.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)}))},ge=function(e,n){var i=null==n?void 0:n.skin;"live"==i?import("./skin-6ed63cfd.js").then((function(i){i.initialiseSkin(e,n)})):"default"==i?import("./skin-aa26e685.js").then((function(i){i.initialiseSkin(e,n)})):"carousel"==i?import("./skin-64448263.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==i?import("./skin-320ff245.js").then((function(i){i.initialiseSkin(e,n)})):"multiplayer"==i&&import("./skin-4ca0f112.js").then((function(i){i.initialiseSkin(e,n)}))},ye=function(e){return new Promise((function(n,i){if(be(e))i("".concat(e," is alread initialised"));else{var t=document.createElement("script");t.async=!1,t.src=e,t.onload=function(){n()},t.onerror=function(n){i("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(t)}}))},be=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Te=function(e,n){n.controlBar.el_.style.color=e,n.controlBar.el_.querySelector(".vjs-play-progress")&&(n.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),n.controlBar.el_.querySelector(".vjs-volume-level")&&(n.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Ie,ke=function(){var e=n(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pe=function(){var e=n(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Oe=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ye("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(V)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(V)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),ye("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:ke,loadEMELibrary:Pe});function Ee(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function Se(n){for(var i=1;i<arguments.length;i++){var t=null!=arguments[i]?arguments[i]:{};i%2?Ee(Object(t),!0).forEach((function(i){e(n,i,t[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}var je=function(t,o,a,s){var u,c,v,m,f,w,p,h,g,y,T,I,k,P,O,E,D,A,R,F,C,x,B,M,L,U,W,q,z,G,J,K,Q=o.res,Y=void 0===Q?null:Q,X=o.sres,Z=void 0===X?null:X,$=(null===(u=window)||void 0===u||null===(c=u.cast)||void 0===c||null===(v=c.framework)||void 0===v||null===(m=v.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f?void 0:f.S)||void 0,ee=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==$&&"NOT_CONNECTED"!==$?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=_(null===(w=Y)||void 0===w||null===(p=w.video)||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||_(null===(g=Y)||void 0===g||null===(y=g.video)||void 0===y||null===(T=y.gist)||void 0===T||null===(I=T.imageGist)||void 0===I?void 0:I.r16x9),ie=(null===(k=Y)||void 0===k||null===(P=k.video)||void 0===P||null===(O=P.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,te=(null===(E=Y)||void 0===E||null===(D=E.video)||void 0===D||null===(A=D.streamingInfo)||void 0===A?void 0:A.isLiveStream)||!1,oe=(null==a?void 0:a.drmLibrary)||!1,re=(null===(R=Y)||void 0===R||null===(F=R.ads)||void 0===F||null===(C=F.preRoll)||void 0===C||null===(x=C.adTags)||void 0===x||null===(B=x.web)||void 0===B?void 0:B.active)&&(null===(M=Y)||void 0===M||null===(L=M.ads)||void 0===L||null===(U=L.preRoll)||void 0===U||null===(W=U.adTags)||void 0===W||null===(q=W.web)||void 0===q?void 0:q.url);Y=Se(Se({},Y),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var le=(K={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:ie},e(K,"autoplay",null==a?void 0:a.autoplay),e(K,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!re),e(K,"loop",(null==a?void 0:a.loop)||!1),e(K,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(K,"html5",Se(Se({dash:Se(Se({},!V.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:Se(Se({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(z=a.customData)||void 0===z?void 0:z.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(G=a.customData)||void 0===G?void 0:G.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(K,"poster",ne),e(K,"techOrder",ee),e(K,"chromecast",{requestCustomDataFn:function(e){var n=r(t);console.log(n.textTracksJson_);var i=n.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,n,i){var t,o,r,l,a,s,d,u,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var w=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var p=(null==e||null===(t=e.video)||void 0===t||null===(o=t.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}(Y,e,i)}}),K),de=V(t,le,function(){var e=n(i.mark((function e(){var n,o,r,u,c,v,m,f,w,p,h,g,y,T,I,k,P,O,E,D,A,R,F,C;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(a),te&&s.resolve(Se({status:!0,msg:"Player Initialised"},Z?{seriesResponse:Z,response:Y}:{response:Y})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&Te(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(V.options.vhs.overrideNative=!0),T=null===(n=Y)||void 0===n||null===(o=n.video)||void 0===o?void 0:o.drmEnabled,I=null===(r=Y)||void 0===r||null===(u=r.video)||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!T&&!oe){e.next=21;break}if("Safari"!==l()){e.next=14;break}return e.next=12,Pe();case 12:e.next=21;break;case 14:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=19;break}return e.next=17,Pe();case 17:e.next=21;break;case 19:return e.next=21,ke();case 21:ie&&se(t,I),!re||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||H(t,re,Y),(P=S(Y,t))?b(t,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Y}),d(t,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Y)||void 0===m||null===(f=m.video)||void 0===f||null===(w=f.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=Y)||void 0===h||null===(g=h.video)||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(C=(null===(E=Y)||void 0===E||null===(D=E.video)||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=Y)||void 0===R||null===(F=R.video)||void 0===F?void 0:F.closedCaptions),O=C.filter((function(e){return"VTT"===e.format})),N(t,O)),null!=a&&a.disableControls?j(t):ge(t,Se(Se(Se({},a),le),{},{liveVideo:te,isDvrEnabled:ie,res:Y,sres:Z})),he(t,Se(Se(Se({},a),le),{},{liveVideo:te}),s,{res:Y,sres:Z});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function De(){return{loadVideoInstantly:w,onTimeUpdate:U,getVideoDuration:W,onVideoEnded:q,init:function(e){return new Promise((function(n,i){var t,o,r,a,s,d,u,v,w,p,h;if(!T(null==e?void 0:e.playerId)){var g=(null==e||null===(t=e.epg)||void 0===t?void 0:t.enable)||!1,y=null==e?void 0:e.videoId,b=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=y;var I=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),I&&!A(I)){Ie=JSON.parse(atob(I.split(".")[1])),window.siteId=null===(r=Ie)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Ie)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Ie)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Ie)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Ie)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Ie)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var k=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,S=(null==e||null===(w=e.analytics)||void 0===w?void 0:w.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,Q(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!R(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Oe})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return Oe})).then((function(e){e.importChromecast()})),O&&"Safari"==l()&&Promise.resolve().then((function(){return Oe})).then((function(e){e.importAirplay()})),S&&ye("https://www.googletagmanager.com/gtag/js?id=".concat(S)).then((function(){return e=S,window.dataLayer=window.dataLayer||[],Y("js",new Date),void Y("config",e);var e})).catch((function(e){}));var _=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(k));if(_&&_.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b){var H,N=null==e||null===(H=e.series)||void 0===H?void 0:H.id;F(N,I).then((function(t){var o,r,l,a=t.data,s=t.data.seasons;L(s);var d=y||(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,n){var i=new Map;m({videoId:e,token:n}).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)}))}(N,I),C(d,I).then((function(t){var o,r,l;window.contentType=null==t||null===(o=t.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(t.data),je(k,{res:null==t?void 0:t.data,sres:a},e,{resolve:n,reject:i})})).catch((function(e){x(e,k,i,y)}))})).catch((function(e){x(e,k,i)}))}else if(g){var V=null==e?void 0:e.epg;B(V,I).then((function(t){var o=null==t?void 0:t.data;o.contentType="linearchannel",je(k,{res:o},e,{resolve:n,reject:i})})).catch((function(e){x(e,k,i,y)}))}else C(y,I).then((function(t){var o,r,l,a;window.contentType=null==t||null===(o=t.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==t?void 0:t.data);var s=null==t?void 0:t.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?M(y,I).then((function(t){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==t?void 0:t.data)),e.watchHistoryResumeTime=(null==t||null===(d=t.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==t||null===(u=t.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",je(k,{res:s},e,{resolve:n,reject:i})})).catch((function(t){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(t)),je(k,{res:s},e,{resolve:n,reject:i})})):je(k,{res:s},e,{resolve:n,reject:i})})).catch((function(e){x(e,k,i,y)}))}else i({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}})}}))},getRenditions:J,skip:p,getPlayer:r,play:h,pause:g,detectBrowser:l,rewind:y,loadVideo:b,seekToTimeStamp:z,isPlayerInitialised:T,load:I,dispose:k,enableCaptions:P,disableCaptions:O,getCaptions:E,playSelectedResolution:K,getSource:S,setVolume:fe,getVolume:we,disableControls:j,setPlaybackSpeed:G}}export{De as default};
|
|
1
|
+
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"axios";import{g as o,a as r,d as l,s as a,c as s,h as d,b as u,e as c,f as v,i as m,j as f,l as p,k as w,p as h,m as g,r as y,n as b,o as T,q as I,t as k,u as P,v as O,w as E,x as S,y as j,z as D,A,B as R,C as F,D as C,E as x,F as B,G as M,H as _,I as H,J as N,K as L}from"./generic-a58c376a.js";import V from"video.js";import{o as U,g as W,a as q,s as z,b as G}from"./util-e4f12146.js";import{g as J}from"./renditions-bbab5489.js";import{playSelectedResolution as K}from"./resolution-1ed5361a.js";import{s as Q}from"./localisation-0bf399a1.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 Y(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function X(e,n){Y("event",e,n)}function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function $(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ne(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function te(){return ie.apply(this,arguments)}function ie(){return ie=n(t.mark((function e(){var n,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(n=e.sent,null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),ie.apply(this,arguments)}window.initialise=function(e){window.sid=ee(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var t,i,o,r=Math.floor(e.currentTime());X(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:ne(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var n,t,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),X("PLAY",$({pfm:window.platform,uid:ne(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting"))X("BUFFERING",$({pfm:window.platform,uid:ne(),vid:window.videoId,videoPosition:n.el_&&Math.floor(n.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:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,X("FIRST_FRAME",$({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),vid:window.videoId},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var n,t,i,o,r,l;X("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),X("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ne(),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 n=[];e.on("timeupdate",(function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(n.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 n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(oe(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}}))()};var oe=function(e,n,t){return e>=n&&e<=t};window.fireEvent=function(){var e=n(t.mark((function e(n){var r,l,a,s,d,u,c,v,m,f,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=[$($($({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),{},{uid:ne(),vid:window.videoId,url:n.url||document.location.href,ref:n.ref||document.referrer,pa:n.eventName,vpos:n.videoPosition,environment:window.environment,dp1:n.dp1||null,dp2:n.dp2||null,dp3:n.dp3||null,dp4:n.dp4||null,dp5:n.dp5||null,apos:!0===n.isAdEvent?n.videoPosition:null,apod:!0===n.isAdEvent?(t=n.adPosition,t?String(t):""):null,profid:te(),player:n.playerType||"native",media_type:n.mediaType||"VIDEO",stream_id:window.sid,embedurl:null,ttfirstframe:n.ttFirstFrame,bitrate:n.bitrate,connectionspeed:null,resolutionheight:n.resHeight,resolutionwidth:n.resWidth,bufferhealth:n.bufferHealth},(null==n?void 0:n.duration)&&{duration:n.duration}),null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params)],e.next=3,o();case 3:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:f}).catch((function(e){console.error(e)}));case 5:case"end":return e.stop()}var t}),e)})));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re,le,ae=function(e){var n,t,i=r(null==e?void 0:e.playerId);null!=e&&null!==(n=e.series)&&void 0!==n&&n.enable||null==e||!e.chromecastReceiverId||null===(t=window)||void 0===t||!t.cast?console.log("Chromecast plugin is not available"):null==i||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"==l()?null==i||i.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},se=function(e,n){var t=r(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,i,o,r,l,a=this.el(),s=V.dom.getPointerPosition(a,n).x;V.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function de(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var ue=[],ce=0,ve=null;function me(n,t,i){var o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];le=(null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(n.currentTime()),c=Math.floor(n.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,m={};"v1"==le?m={videoId:re,watchedTime:Math.floor(n.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==le&&(m=function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?de(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):de(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}({videoId:re,watchedTime:Math.floor(n.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},ve&&{seriesId:ve})),a(m,le).then((function(e){})).catch((function(e){})),ce=u+i}var fe=function(e,n,t){var i=r(e);if(i)if(n>=0&&n<=100){i.muted()&&i.muted(!1);var o=parseFloat(n)/100;i.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},pe=function(e){var n=r(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function we(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var he=function(n,t,i,o){var l,a,m=o.res,f=o.sres,p=r(n),w=(null==m?void 0:m.contentType)||"video",h=(null==m||null===(l=m[w])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;c(m),p.on("loadstart",(function(){h&&i.resolve({status:!0,msg:"Video Loaded",response:m})})),p.on("loadeddata",(function(){var o;(null==p||!p.muted())&&fe(n,sessionStorage.getItem("volume")||"100");var l,a,d=u();(s(),i.resolve(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?we(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):we(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}({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,n,t){var i,o;null!=n&&n.series&&(ve=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ue=[],ce=0,re=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=r(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());ue.includes(ce)||(e==ce?(ue.push(e),me(a,n,l)):e>ce&&(ce=e+l))})),a.one("ended",(function(){me(a,n,l,!0)})))}(n,t,null==d||null===(l=d.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.id)})),p.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];p.trigger("subtitlechanged",n)})),p.on("subtitlechanged",(function(e,n){var t,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(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 p,w=f.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),p.on("loadedmetadata",(function(){window.endFirstFrame(p)})),p.one("error",(function(){var e,t;d(n,(null==p||null===(e=p.error())||void 0===e?void 0:e.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured"})})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,r=null===(n=u())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.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(){p.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),p.on("volumechange",(function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},ge=function(e,n){var t=null==n?void 0:n.skin;"live"==t?import("./skin-146f75b8.js").then((function(t){t.initialiseSkin(e,n)})):"default"==t?import("./skin-8637dcb6.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-6b70508b.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-2cb09517.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t&&import("./skin-c2a25d33.js").then((function(t){t.initialiseSkin(e,n)}))},ye=function(e){return new Promise((function(n,t){if(be(e))t("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!1,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}}))},be=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Te=function(e,n){n.controlBar.el_.style.color=e,n.controlBar.el_.querySelector(".vjs-play-progress")&&(n.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),n.controlBar.el_.querySelector(".vjs-volume-level")&&(n.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Ie,ke=function(){var e=n(t.mark((function e(){return t.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)}}(),Pe=function(){var e=n(t.mark((function e(){return t.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)}}(),Oe=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ye("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(V)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(V)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),ye("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:ke,loadEMELibrary:Pe});function Ee(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Se(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ee(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var je=function(i,o,a,s){var u,c,v,m,f,p,w,h,g,y,T,I,k,P,O,E,D,A,R,F,C,x,B,M,L,U,W,q,z,G,J,K,Q,Y=o.res,X=void 0===Y?null:Y,Z=o.sres,$=void 0===Z?null:Z,ee=(null===(u=window)||void 0===u||null===(c=u.cast)||void 0===c||null===(v=c.framework)||void 0===v||null===(m=v.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f?void 0:f.S)||void 0,ne=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],te=(null===(p=X)||void 0===p?void 0:p.contentType)||"video",ie=_(null===(w=X)||void 0===w||null===(h=w[te])||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.videoImageUrl)||_(null===(y=X)||void 0===y||null===(T=y[te])||void 0===T||null===(I=T.gist)||void 0===I||null===(k=I.imageGist)||void 0===k?void 0:k.r16x9),oe=(null===(P=X)||void 0===P||null===(O=P[te])||void 0===O||null===(E=O.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,re=(null===(D=X)||void 0===D||null===(A=D[te])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,le=(null==a?void 0:a.drmLibrary)||!1,de=(null===(F=X)||void 0===F||null===(C=F.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(B=x.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(L=X)||void 0===L||null===(U=L.ads)||void 0===U||null===(W=U.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(z=q.web)||void 0===z?void 0:z.url);X=Se(Se({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ue=(Q={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:oe},e(Q,"autoplay",null==a?void 0:a.autoplay),e(Q,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!de),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",Se(Se({dash:Se(Se({},!V.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:Se(Se({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ie),e(Q,"techOrder",ne),e(Q,"chromecast",{requestCustomDataFn:function(e){var n=r(i);console.log(n.textTracksJson_);var t=n.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,n,t){var i,o,r,l,a,s,d,u,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var p=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=p}var w=(null==e||null===(i=e.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=w;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=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}(X,e,t)}}),Q),ce=V(i,ue,function(){var e=n(t.mark((function e(){var n,o,r,u,c,v,m,f,p,w,h,g,y,T,I,k,P,O,E,D,A,R,F,C;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(a),re&&s.resolve(Se({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(ce),window.firstFrame(ce),"white"!==window.controlsColor&&Te(window.controlsColor,ce),/Android/i.test(navigator.userAgent)&&(V.options.vhs.overrideNative=!0),T=null===(n=X)||void 0===n||null===(o=n[te])||void 0===o?void 0:o.drmEnabled,I=null===(r=X)||void 0===r||null===(u=r[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!T&&!le){e.next=21;break}if("Safari"!==l()){e.next=14;break}return e.next=12,Pe();case 12:e.next=21;break;case 14:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=19;break}return e.next=17,Pe();case 17:e.next=21;break;case 19:return e.next=21,ke();case 21:oe&&se(i,I),!de||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||H(i,de,X),(P=S(X,i))?b(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),d(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[te])||void 0===f||null===(p=f.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(C=(null===(E=X)||void 0===E||null===(D=E[te])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[te])||void 0===F?void 0:F.closedCaptions),O=C.filter((function(e){return"VTT"===e.format})),N(i,O)),null!=a&&a.disableControls?j(i):ge(i,Se(Se(Se({},a),ue),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),he(i,Se(Se(Se({},a),ue),{},{liveVideo:re}),s,{res:X,sres:$});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function De(){return{loadVideoInstantly:p,onTimeUpdate:U,getVideoDuration:W,onVideoEnded:q,init:function(e){return new Promise((function(n,t){var i,o,r,a,s,d,u,v,p,w,h;if(!T(null==e?void 0:e.playerId)){var g=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,y=null==e?void 0:e.videoId,b=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=y;var I=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),I&&!A(I)){Ie=JSON.parse(atob(I.split(".")[1])),window.siteId=null===(r=Ie)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Ie)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Ie)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Ie)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Ie)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Ie)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var k=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,S=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,Q(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!R(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Oe})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return Oe})).then((function(e){e.importChromecast()})),O&&"Safari"==l()&&Promise.resolve().then((function(){return Oe})).then((function(e){e.importAirplay()})),S&&ye("https://www.googletagmanager.com/gtag/js?id=".concat(S)).then((function(){return e=S,window.dataLayer=window.dataLayer||[],Y("js",new Date),void Y("config",e);var e})).catch((function(e){}));var _=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(k));if(_&&_.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b){var H,N=null==e||null===(H=e.series)||void 0===H?void 0:H.id;F(N,I).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;L(s);var d=y||(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,n){var t=new Map;m({videoId:e,token:n}).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)}))}(N,I),C(d,I).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(i.data),je(k,{res:null==i?void 0:i.data,sres:a},e,{resolve:n,reject:t})})).catch((function(e){x(e,k,t,y)}))})).catch((function(e){x(e,k,t)}))}else if(g){var V=null==e?void 0:e.epg;B(V,I).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",je(k,{res:o},e,{resolve:n,reject:t})})).catch((function(e){x(e,k,t,y)}))}else C(y,I).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==i?void 0:i.data);var s=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?M(y,I).then((function(i){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==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",je(k,{res:s},e,{resolve:n,reject:t})})).catch((function(i){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(i)),je(k,{res:s},e,{resolve:n,reject:t})})):je(k,{res:s},e,{resolve:n,reject:t})})).catch((function(e){x(e,k,t,y)}))}else t({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}})}}))},getRenditions:J,skip:w,getPlayer:r,play:h,pause:g,detectBrowser:l,rewind:y,loadVideo:b,seekToTimeStamp:z,isPlayerInitialised:T,load:I,dispose:k,enableCaptions:P,disableCaptions:O,getCaptions:E,playSelectedResolution:K,getSource:S,setVolume:fe,getVolume:pe,disableControls:j,setPlaybackSpeed:G}}export{De as default};
|