@viewlift/player-backup 1.0.52-backup → 1.0.53-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/bundle.css +2 -2
- package/cjs/caption-settings-38d8182a.js +1 -0
- package/cjs/{features-ae230900.js → features-8c5c9ab4.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{skin-129c8dfc.js → skin-aee6fe54.js} +1 -1
- package/cjs/{skin-b41805f9.js → skin-c5155d46.js} +1 -1
- package/cjs/{skin-66b11b23.js → skin-d1d027c6.js} +1 -1
- package/cjs/{skin-151a2f9d.js → skin-eec5279f.js} +1 -1
- package/esm/bundle.css +2 -2
- package/esm/caption-settings-5b759674.js +1 -0
- package/esm/{features-cf0571e1.js → features-a1f78f04.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{skin-d4591693.js → skin-030cc782.js} +1 -1
- package/esm/{skin-c08afe97.js → skin-19e32835.js} +1 -1
- package/esm/{skin-de3a3d56.js → skin-c75c4981.js} +1 -1
- package/esm/{skin-6ce61902.js → skin-df37a954.js} +1 -1
- package/package.json +1 -1
- package/cjs/caption-settings-b6545c31.js +0 -1
- package/esm/caption-settings-8a91ed9b.js +0 -1
package/cjs/bundle.css
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
|
|
18
|
+
|
|
17
19
|
.widget-selection{
|
|
18
20
|
display: flex;
|
|
19
21
|
align-items: center;
|
|
@@ -134,8 +136,6 @@
|
|
|
134
136
|
.widget-selector-content #sr-widget{
|
|
135
137
|
padding: 0 18px;
|
|
136
138
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
139
|
.vjs-poster {
|
|
140
140
|
display: inline-block;
|
|
141
141
|
vertical-align: middle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),r=require("./icons-0f7b3404.js"),l=require("./generic-e42efcd8.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var s=i.getComponent("Component"),d=function(){n(m,s);var d,u,p=(d=m,u=c(),function(){var e,t=o(d);if(u){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function m(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,m),(i=p.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important"),i}return t(m,[{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.CaptionsSvgV2())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./caption-settings-34ca0188.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,t,n,a,o=this;if(console.log("intialisefn",null===(e=document)||void 0===e||null===(t=e.getElementsByClassName("caption-selector-content"))||void 0===t?void 0:t[0]),null===(n=document)||void 0===n||null===(a=n.getElementsByClassName("caption-selector-content"))||void 0===a||!a[0]){var r=l.getCaptions(this.playerId);console.log("im triggered again from loadeddata",r),null==r||r.map((function(e){return l.disableCaptions(o.playerId,e.id)}));var c=this.el(),s=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var e;null!==(e=s.classList)&&void 0!==e&&e.contains("hidden")?(l.closeOpenDrawers(),s.classList.remove("hidden"),c.classList.add("open"),s.style.right="0px"):(s.classList.add("hidden"),c.classList.remove("open"),s.style.right="-350px")};var d=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height");s.style.height="".concat(d),i.dom.appendContent(c,s),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(s),l.detectOrientationChange(this.playerId,s)}}},{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(r.crossIconSvg())});o.onclick=function(){e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px"};var c=i.dom.createEl("div",{className:"caption-selector-title",innerHTML:"Captions"}),s=i.dom.createEl("div",{className:"caption-selector-content"}),d=i.dom.createEl("div",{className:"caption-container"}),u=this.createLanguageContanier();i.dom.appendContent(d,u),i.dom.appendContent(a,o),i.dom.appendContent(a,c),i.dom.appendContent(e,a),i.dom.appendContent(e,s),i.dom.appendContent(s,d),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")}))}},{key:"createLanguageContanier",value:function(){var e=this,t=i.dom.createEl("div",{className:"caption-language-container"}),n=i.dom.createEl("div",{className:"caption-language-container-title",innerHTML:"Language"});i.dom.appendContent(t,n);var a=document.createElement("label");a.setAttribute("for","radio-off"),a.className="caption-language-holder";var o=document.createElement("div");o.className="caption",o.innerHTML="Off";var r=i.dom.createEl("input",{className:"radio - off",id:"radio-off",name:"language-radio",checked:"true"});r.setAttribute("type","radio"),r.onchange=function(t){var n,a,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important")),l.getCaptions(e.playerId).map((function(t){return l.disableCaptions(e.playerId,t.id)}))},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var c=l.getCaptions(this.playerId),s=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 s=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});s.onchange=function(t){l.enableCaptions(e.playerId,c[n].id)},s.setAttribute("type","radio"),i.dom.appendContent(o,s),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},d=0;d<c.length;d++)s(d);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 l=document.createElement("div");l.className="fontsize - ".concat(a),l.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var c=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)});c.setAttribute("type","radio"),c.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,c),i.dom.appendContent(r,l),i.dom.appendContent(e,r)}return e}}]),m}();exports.default=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-e42efcd8.js"),s=require("./renditions-b85edb07.js"),u=require("./localisation-56e0a999.js");function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){var t=p();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then((function(){return require("./caption-settings-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-e42efcd8.js"),s=require("./renditions-b85edb07.js"),u=require("./localisation-56e0a999.js");function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){var t=p();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then((function(){return require("./caption-settings-38d8182a.js")})).then((function(r){var n,o,l,s,u=r.default,c=a.getPlayer(e);i.registerComponent("captionSelector",u),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addDBClickFullScreen=function(e){var t=a.getPlayer(e).el(),r=0,n=a.getPlayer(e);n.addChild("fullscreenToggle");var o=function(){var e,r=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];r&&r.click()};n.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;n.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),n=e-r;if(n<300&&n>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}r=e})),window._multiplayer_dbTapHandler=o},exports.addMulticamSelector=function(e,t){Promise.resolve().then((function(){return require("./multicamv2-fcdee282.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},exports.addMulticamView=function(e,t){Promise.resolve().then((function(){return require("./multicam-b6fbcaad.js")})).then((function(r){var n=r.default,o=t.streams,l=a.getPlayer(e);i.registerComponent("multicamModule",n),l.getChild("controlBar").addChild("multicamModule",{playerId:e,streams:o,config:t},l.controlBar.children().length)}));var r=document.querySelector(".vjs-control-bar");r&&"live"==(null==t?void 0:t.skin)&&(r.style.background="transparent")},exports.addMwebPotraitTrayModule=function(e,t){Promise.resolve().then((function(){return require("./mwebPotraitTray-b1ce7492.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("mwebPotraitTray",n),o.getChild("controlBar").addChild("mwebPotraitTray",{playerId:e,config:t},0)}))},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then((function(){return require("./nextEpisodeButton-76cf9773.js")})).then((function(n){var o=n.default,l=a.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)}))},exports.addOutputtingOverlay=function(e,t){var r=a.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then((function(){return require("./playlist-3da8395c.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},exports.addResolutionModule=function(e,t,r){Promise.resolve().then((function(){return require("./resolution-08d6bb23.js")})).then((function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a.getPlayer(e),u=s.getRenditions(e);(null==u?void 0:u.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:u},l.controlBar.children().length-4))}))},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=d(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-rewind-button");var u=a.parseSvgString(l);return o.append(u),n}return r(s,[{key:"handleClick",value:function(){a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then((function(){return require("./series-297f6f27.js")})).then((function(n){var o=n.seriesModule,l=a.getPlayer(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var s=document.querySelectorAll(".season-title-sdk"),u=function(e){s[e].addEventListener("click",(function(){t[e]&&n.handleSeasonChange(t[e],e,l,r)}))},c=0;c<s.length;c++)u(c)}))},exports.addSeriesSelectorV2=function(t,r){Promise.resolve().then((function(){return require("./series-v2-81205652.js")})).then((function(n){var o=n.default,l=a.getPlayer(t);i.registerComponent("seriesV2",o),l.getChild("controlBar").addChild("seriesV2",function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?c(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({playerId:t},r),l.controlBar.children().length-3)}))},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then((function(){return require("./settings-icon-89ca6074.js")})).then((function(r){var n,o,l,s,u=r.default,c=a.getPlayer(e);i.registerComponent("settingsSelector",u),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=d(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-skip-button");var u=a.parseSvgString(l);return o.append(u),n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=d(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=u.getLocalisation("slowMoText")||"Slow Mo",n}return r(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},exports.addVideoSelector=function(e,t){Promise.resolve().then((function(){return require("./videoSelector-59ddf0d8.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))};
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-e42efcd8.js"),r=require("video.js"),l=require("./util-d4c56a2d.js"),a=require("./renditions-b85edb07.js"),s=require("./resolution-08d6bb23.js"),d=require("./localisation-56e0a999.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?v(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");function f(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=f(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.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)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=f(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))c("BUFFERING",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;c("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(g(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var g=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,h,g;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({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),e.t3={},e.t4=w(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,p();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var y,b,T=function(e){var t,n,i=o.getPlayer(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.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"==o.detectBrowser()?null==i||i.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},P=function(e,t){var n=o.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*d,v.seek()}}))};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function I(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?k(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var O=[],E=0,S=null;function j(e,t,n){var i,r,l,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];b=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f={};"v1"==b?f={videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==b&&(f=I(I({videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},S&&{seriesId:S}),m&&{originalObjectId:m})),o.saveWatchHistory(f,b).then((function(e){})).catch((function(e){})),E=u+n}var D=function(e,t,n){var i=o.getPlayer(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},C=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function R(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?A(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var F=function(e,t,n,i){var r,l,a=i.res,s=i.sres,d=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i;(null==d||!d.muted())&&D(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),n.resolve(R({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,u,c=R(R({},t),a);!function(e,t,n){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(S=null==t||null===(r=t.series)||void 0===r?void 0:r.id),O=[],E=0,y=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());O.includes(E)||(e==E?(O.push(e),j(s,t,a)):e>E&&(E=e+a))})),s.one("ended",(function(){j(s,t,a,!0)})))}(e,c,null==r||null===(l=r.video)||void 0===l||null===(u=l.gist)||void 0===u?void 0:u.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.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 w,p=f.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.one("error",(function(){var t,i;o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.message)||"Some error occured"})})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,r,l=null===(n=o.getCurrentVideo())||void 0===n||null===(i=n.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){console.log("chromecast - disconnected");var e=d.remoteTextTracks();console.log("im tracks",e),e.forEach((function(e){d.removeRemoteTextTrack(e)}))}))},x=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-129c8dfc.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-66b11b23.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-04e830af.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-b41805f9.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&Promise.resolve().then((function(){return require("./skin-151a2f9d.js")})).then((function(n){n.initialiseSkin(e,t)}))},B=function(e){return new Promise((function(t,n){if(M(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!1,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},M=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},H=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var _,V=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){B("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),B("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:V,loadEMELibrary:N});function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function W(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?L(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var U=function(i,l,a,s){var d,u,c,v,m,f,w,p,h,g,y,b,k,I,O,E,S,j,D,C,A,R,B,M,_,q,L,U,z,G,J,K,Q,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z,ee=(null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m?void 0:m.S)||void 0,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=(null===(f=X)||void 0===f?void 0:f.contentType)||"video",ie=o.impolicy16x9(null===(w=X)||void 0===w||null===(p=w[ne])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[ne])||void 0===y||null===(b=y.gist)||void 0===b||null===(k=b.imageGist)||void 0===k?void 0:k.r16x9),oe=(null===(I=X)||void 0===I||null===(O=I[ne])||void 0===O||null===(E=O.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,re=(null===(S=X)||void 0===S||null===(j=S[ne])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,le=(null==a?void 0:a.drmLibrary)||!1,ae=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(B=R.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(_=X)||void 0===_||null===(q=_.ads)||void 0===q||null===(L=q.preRoll)||void 0===L||null===(U=L.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=W(W({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var se=(Q={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",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)&&!ae),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",W(W({dash:W(W({},!r.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:W(W({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",te),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=w;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=p}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),de=r(i,se,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,m,f,w,p,h,g,y,b,k,I,O,E,S,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(a),re&&s.resolve(W({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&H(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[ne])||void 0===l?void 0:l.drmEnabled,k=null===(d=X)||void 0===d||null===(u=d[ne])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!le){e.next=21;break}if("Safari"!==o.detectBrowser()){e.next=14;break}return e.next=12,N();case 12:e.next=21;break;case 14:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=19;break}return e.next=17,N();case 17:e.next=21;break;case 19:return e.next=21,V();case 21:oe&&P(i,k),!ae||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,ae,X),(O=o.getSource(X,i))?o.loadVideo(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[ne])||void 0===f||null===(w=f.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=X)||void 0===h||null===(g=h[ne])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(R=(null===(S=X)||void 0===S||null===(j=S[ne])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[ne])||void 0===A?void 0:A.closedCaptions),E=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,E)),null!=a&&a.disableControls?o.disableControls(i):x(i,W(W(W({},a),se),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),F(i,W(W(W({},a),se),{},{liveVideo:re}),s,{res:X,sres:$});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,c,v,m,f,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=g;var b=null==e?void 0:e.token;if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),b&&!o.isTokenExpired(b)){_=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=_)||void 0===l?void 0:l.siteId,window.siteName=null===(a=_)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=_)||void 0===s||!s.anonymousId),e.siteOwner=(null===(c=_)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=_)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=_)||void 0===m?void 0:m.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b);var T=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,k=null==e?void 0:e.airplay,I=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,E=null==e?void 0:e.errors;E&&(window.customErrors=E),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),I&&(window.playerEntitlementUrl=I),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return q})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return q})).then((function(e){e.importChromecast()})),k&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),O&&B("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then((function(){return e=O,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var S=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(S&&S.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var j,D=null==e||null===(j=e.series)||void 0===j?void 0:j.id;o.getSeriesDetails(D,b).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=g||(null==d||null===(r=d[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(i){var r,l,a;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(i.data),U(T,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))})).catch((function(e){o.initiateErrorHandling(e,T,n)}))}else if(h){var C=null==e?void 0:e.epg;o.getLinearChannelDetails(C,b).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",U(T,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))}else o.getVideoDetails(g,b).then((function(i){var r,l,a,s;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==i?void 0:i.data);var d=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable?o.getVideoInfo(g,b).then((function(i){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",U(T,{res:d},e,{resolve:t,reject:n})})).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)),U(T,{res:d},e,{resolve:t,reject:n})})):U(T,{res:d},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))}else n({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}})}}))},getRenditions:a.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:o.getSource,setVolume:D,getVolume:C,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-e42efcd8.js"),r=require("video.js"),l=require("./util-d4c56a2d.js"),a=require("./renditions-b85edb07.js"),s=require("./resolution-08d6bb23.js"),d=require("./localisation-56e0a999.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?v(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");function f(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=f(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.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)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=f(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))c("BUFFERING",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;c("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(g(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var g=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,h,g;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({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),e.t3={},e.t4=w(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,p();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var y,b,T=function(e){var t,n,i=o.getPlayer(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.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"==o.detectBrowser()?null==i||i.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},P=function(e,t){var n=o.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*d,v.seek()}}))};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function I(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?k(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var O=[],E=0,S=null;function j(e,t,n){var i,r,l,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];b=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f={};"v1"==b?f={videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==b&&(f=I(I({videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},S&&{seriesId:S}),m&&{originalObjectId:m})),o.saveWatchHistory(f,b).then((function(e){})).catch((function(e){})),E=u+n}var D=function(e,t,n){var i=o.getPlayer(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},C=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function R(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?A(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var F=function(e,t,n,i){var r,l,a=i.res,s=i.sres,d=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i;(null==d||!d.muted())&&D(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),n.resolve(R({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,u,c=R(R({},t),a);!function(e,t,n){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(S=null==t||null===(r=t.series)||void 0===r?void 0:r.id),O=[],E=0,y=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());O.includes(E)||(e==E?(O.push(e),j(s,t,a)):e>E&&(E=e+a))})),s.one("ended",(function(){j(s,t,a,!0)})))}(e,c,null==r||null===(l=r.video)||void 0===l||null===(u=l.gist)||void 0===u?void 0:u.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.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 w,p=f.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.one("error",(function(){var t,i;o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.message)||"Some error occured"})})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,r,l=null===(n=o.getCurrentVideo())||void 0===n||null===(i=n.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){console.log("chromecast - disconnected");var e=d.remoteTextTracks();console.log("im tracks",e),e.forEach((function(e){d.removeRemoteTextTrack(e)}))}))},x=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-aee6fe54.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-d1d027c6.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-04e830af.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-c5155d46.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&Promise.resolve().then((function(){return require("./skin-eec5279f.js")})).then((function(n){n.initialiseSkin(e,t)}))},B=function(e){return new Promise((function(t,n){if(M(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!1,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},M=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},H=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var _,V=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){B("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),B("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:V,loadEMELibrary:N});function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function W(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?L(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var U=function(i,l,a,s){var d,u,c,v,m,f,w,p,h,g,y,b,k,I,O,E,S,j,D,C,A,R,B,M,_,q,L,U,z,G,J,K,Q,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z,ee=(null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m?void 0:m.S)||void 0,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=(null===(f=X)||void 0===f?void 0:f.contentType)||"video",ie=o.impolicy16x9(null===(w=X)||void 0===w||null===(p=w[ne])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[ne])||void 0===y||null===(b=y.gist)||void 0===b||null===(k=b.imageGist)||void 0===k?void 0:k.r16x9),oe=(null===(I=X)||void 0===I||null===(O=I[ne])||void 0===O||null===(E=O.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,re=(null===(S=X)||void 0===S||null===(j=S[ne])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,le=(null==a?void 0:a.drmLibrary)||!1,ae=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(B=R.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(_=X)||void 0===_||null===(q=_.ads)||void 0===q||null===(L=q.preRoll)||void 0===L||null===(U=L.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=W(W({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var se=(Q={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",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)&&!ae),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",W(W({dash:W(W({},!r.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:W(W({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",te),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=w;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=p}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),de=r(i,se,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,m,f,w,p,h,g,y,b,k,I,O,E,S,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(a),re&&s.resolve(W({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&H(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[ne])||void 0===l?void 0:l.drmEnabled,k=null===(d=X)||void 0===d||null===(u=d[ne])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!le){e.next=21;break}if("Safari"!==o.detectBrowser()){e.next=14;break}return e.next=12,N();case 12:e.next=21;break;case 14:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=19;break}return e.next=17,N();case 17:e.next=21;break;case 19:return e.next=21,V();case 21:oe&&P(i,k),!ae||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,ae,X),(O=o.getSource(X,i))?o.loadVideo(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[ne])||void 0===f||null===(w=f.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=X)||void 0===h||null===(g=h[ne])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(R=(null===(S=X)||void 0===S||null===(j=S[ne])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[ne])||void 0===A?void 0:A.closedCaptions),E=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,E)),null!=a&&a.disableControls?o.disableControls(i):x(i,W(W(W({},a),se),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),F(i,W(W(W({},a),se),{},{liveVideo:re}),s,{res:X,sres:$});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,c,v,m,f,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=g;var b=null==e?void 0:e.token;if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),b&&!o.isTokenExpired(b)){_=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=_)||void 0===l?void 0:l.siteId,window.siteName=null===(a=_)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=_)||void 0===s||!s.anonymousId),e.siteOwner=(null===(c=_)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=_)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=_)||void 0===m?void 0:m.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b);var T=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,k=null==e?void 0:e.airplay,I=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,E=null==e?void 0:e.errors;E&&(window.customErrors=E),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),I&&(window.playerEntitlementUrl=I),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return q})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return q})).then((function(e){e.importChromecast()})),k&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),O&&B("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then((function(){return e=O,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var S=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(S&&S.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var j,D=null==e||null===(j=e.series)||void 0===j?void 0:j.id;o.getSeriesDetails(D,b).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=g||(null==d||null===(r=d[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(i){var r,l,a;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(i.data),U(T,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))})).catch((function(e){o.initiateErrorHandling(e,T,n)}))}else if(h){var C=null==e?void 0:e.epg;o.getLinearChannelDetails(C,b).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",U(T,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))}else o.getVideoDetails(g,b).then((function(i){var r,l,a,s;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==i?void 0:i.data);var d=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable?o.getVideoInfo(g,b).then((function(i){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",U(T,{res:d},e,{resolve:t,reject:n})})).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)),U(T,{res:d},e,{resolve:t,reject:n})})):U(T,{res:d},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))}else n({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}})}}))},getRenditions:a.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:o.getSource,setVolume:D,getVolume:C,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=require("./features-
|
|
1
|
+
"use strict";var e,t=require("./features-8c5c9ab4.js"),n=require("./icons-0f7b3404.js"),r=require("./generic-e42efcd8.js"),s=require("@babel/runtime/helpers/defineProperty"),o=require("./keyboardShortcuts-efc31ea7.js");function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,o){var i=r.getPlayer(e);i.one("play",(function(){var u,c,d,m;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?l(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)),null!=o&&o.airplay&&"Safari"==r.detectBrowser()&&i.addChild("airPlayButton"),null!=o&&o.chromecastReceiverId&&i.addChild("chromecastButton"),i.addChild("FullscreenToggle"),null===(u=i.getChild("FullscreenToggle"))||void 0===u||null===(c=u.el())||void 0===c||c.appendChild(r.createIconMarkup(n.MinimizeSvg(window.controlsColor))),null===(d=i.getChild("FullscreenToggle"))||void 0===d||null===(m=d.el())||void 0===m||m.appendChild(r.createIconMarkup(n.MaximizeSvg(window.controlsColor))),a(e)})),i.on("loadedmetadata",(function(){window.endFirstFrame(i),"Safari"!==r.detectBrowser()&&t.addResolutionModule(e,"live",n.SettingsSvg())})),i.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-b85edb07.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 l;o.initialiseKeyboardEvents(e,s),(null==(l=s)||!l.liveui)&&(null==l||!l.liveVideo)||null!=l&&l.liveui&&null!=l&&l.liveVideo?Promise.resolve().then((function(){return require("./dvr_skin-f7f770ae.js")})).then((function(e){var t=document.createElement("style");t.id="dvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})):Promise.resolve().then((function(){return require("./nondvr_skin-ef2cb3b2.js")})).then((function(e){var t=document.createElement("style");t.id="nondvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e){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 l=document.createElement("div");l.classList.add("caption-header"),o.querySelector(".vjs-menu-content").insertBefore(l,o.querySelector(".vjs-menu-item"));var i=document.createElement("div");if(i.innerText="Captions",i.className="fs14",document.getElementsByClassName("vjs-subs-caps-button")[0].appendChild(i),"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),i(e,s)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./features-
|
|
1
|
+
"use strict";var e=require("./features-8c5c9ab4.js"),l=require("./icons-0f7b3404.js"),t=require("./generic-e42efcd8.js"),i=require("./renditions-b85edb07.js"),n=require("@babel/runtime/helpers/toConsumableArray"),o=require("./autoNextVideo-0d4d8ff0.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-d4c56a2d.js");var r=t.getCurrentSeries(),a=[];null==r||r.map((function(e){return a.push.apply(a,n(e.episodes))}));var d=function(e,l){var i=t.getPlayer(e),n=Math.floor(i.currentTime());if(Math.floor(i.duration())!=n){i.pause(e);var r=t.getVideoIdx();o.switchToNext(r,e,a)}};function u(l,n){var o=t.getPlayer(l);o.on("loadeddata",(function(){var r,u,s;(null===(r=i.getRenditions(l))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(l,n),(null===(u=t.getCaptions(l))||void 0===u?void 0:u.length)>0&&e.addCaptionButton(l,n),null!=n&&null!==(s=n.series)&&void 0!==s&&s.enable&&function(e,l){var i;null==l||null===(i=l.series)||void 0===i||i.cb;var n=t.getPlayer(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),i=n.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-l<=10&&t.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,l){return l==t.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var u,s,v,c,m,p,g,h,f,y,b;(null===(u=document.getElementsByClassName("next-ep-preview"))||void 0===u?void 0:u[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 d(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 d(e)},P.append(I),P.append(O)}}(l,n),function(e,l){var t,i=Math.floor(e/60),n=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];n&&(n.style.marginRight=i>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",n&&(n.style.marginRight="56px"))}(o.duration(),(null==n?void 0:n.liveVideo)||!1)})),o.one("play",(function(){var t,i,n,o;null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(l,null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}exports.initialiseSkin=function(i,n){!function(){"Chrome"==t.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));Promise.resolve().then((function(){return require("./skin-921d35a8.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),u(i,n),function(e,i){var n,o,r,a,d=t.getPlayer(e);null===(n=d.controlBar.getChild("FullscreenToggle"))||void 0===n||null===(o=n.el())||void 0===o||o.appendChild(t.createIconMarkup(l.MinimizeSvg(window.controlsColor))),null===(r=d.controlBar.getChild("FullscreenToggle"))||void 0===r||null===(a=r.el())||void 0===a||a.appendChild(t.createIconMarkup(l.MaximizeSvg(window.controlsColor)));var u=document.getElementsByClassName("vjs-time-control");i.liveVideo&&(u[0].style.display="none")}(i,n),function(t,i){var n,o,r,a,d,u;0==(null==i?void 0:i.liveVideo)&&0==(null==i?void 0:i.liveui)&&e.addSkipButton(t,"defaultV2",l.SkipSvgV2());(0==(null==i?void 0:i.liveVideo)&&0==(null==i?void 0:i.liveui)||1==(null==i?void 0:i.liveui))&&e.addRewindButton(t,"defaultV2",l.RewindSvgV2());i.liveVideo||e.addSlowMotion(t);(null==i||null===(n=i.relatedVideos)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(t,null==i?void 0:i.relatedVideos);(null==i||null===(r=i.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(t,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(t,null==i?void 0:i.playlist);null!=i&&null!==(u=i.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(t,i)}(i,n),function(e,l){var i=t.getPlayer(e),n=null==l?void 0:l.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("./features-
|
|
1
|
+
"use strict";var e=require("./features-8c5c9ab4.js"),r=require("./keyboardShortcuts-efc31ea7.js"),i=require("./icons-0f7b3404.js"),n=require("./generic-e42efcd8.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-b85edb07.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),exports.initialiseSkin=function(t,l){r.initialiseKeyboardEvents(t,l),Promise.resolve().then((function(){return require("./skin-983a2ea7.js")})).then((function(e){var r=document.createElement("style");r.id="def_skin",r.append("".concat(e.default)),document.head.appendChild(r)})),function(r,n){0==n.liveVideo&&0==n.liveui&&e.addSkipButton(r,"default",i.SkipSvg());(0==n.liveVideo&&0==n.liveui||1==n.liveui)&&e.addRewindButton(r,"default",i.RewindSvg())}(t,l),function(r,t){var l=n.getPlayer(r),s=(null==t?void 0:t.sres)||null;l.on("loadeddata",(function(){e.addResolutionModule(r,"default",i.SettingsSvg()),s&&Promise.resolve().then((function(){return require("./nextEpisodeButton-76cf9773.js")})).then((function(e){e.initaliseFunctionality(t.sres.seasons,n.getCurrentVideo())}))})),l.one("loadedmetadata",(function(){var i;s&&(e.addSeriesModule(r,null==t||null===(i=t.sres)||void 0===i?void 0:i.seasons,t),e.addNextEpisodeButton(t.sres,t.res,r))}))}(t,l),function(e,r){var t,l,s,o,a=n.getPlayer(e),u=document.getElementsByClassName("vjs-current-time")[0],d=document.getElementsByClassName("vjs-duration")[0],c=document.getElementsByClassName("vjs-time-divider")[0];r.liveVideo&&(u&&(u.style.display="none"),d&&(d.style.display="none"),c&&(c.style.display="none"));null===(t=a.controlBar.getChild("FullscreenToggle"))||void 0===t||null===(l=t.el())||void 0===l||l.appendChild(n.createIconMarkup(i.MinimizeSvg(window.controlsColor))),null===(s=a.controlBar.getChild("FullscreenToggle"))||void 0===s||null===(o=s.el())||void 0===o||o.appendChild(n.createIconMarkup(i.MaximizeSvg(window.controlsColor)));var m=a.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(n.createIconMarkup(i.NewCaptionsSvg()));var v=document.createElement("div");v.classList.add("caption-header"),m.querySelector(".vjs-menu-content").insertBefore(v,m.querySelector(".vjs-menu-item"))}(t,l)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./generic-e42efcd8.js"),r=require("./features-
|
|
1
|
+
"use strict";var e=require("./generic-e42efcd8.js"),r=require("./features-8c5c9ab4.js"),i=require("./renditions-b85edb07.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)};
|
package/esm/bundle.css
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
|
|
18
|
+
|
|
17
19
|
.widget-selection{
|
|
18
20
|
display: flex;
|
|
19
21
|
align-items: center;
|
|
@@ -134,8 +136,6 @@
|
|
|
134
136
|
.widget-selector-content #sr-widget{
|
|
135
137
|
padding: 0 18px;
|
|
136
138
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
139
|
.vjs-poster {
|
|
140
140
|
display: inline-block;
|
|
141
141
|
vertical-align: middle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as r,e as l}from"./icons-c2efba97.js";import{w as c,v as s,T as d,U as m,a as p,u}from"./generic-7c12a59f.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(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var f=i.getComponent("Component"),h=function(){n(C,f);var h,y,g=(h=C,y=v(),function(){var e,t=o(h);if(y){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function C(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,C),(i=g.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important"),i}return t(C,[{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"caption-selection vjs-control vjs-button"});e.style.position="unset";var t=i.dom.createEl("div",{className:"caption-selector-icon",innerHTML:"".concat(r())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./caption-settings-cb47408f.js").then((function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e,t,n,a,o=this;if(console.log("intialisefn",null===(e=document)||void 0===e||null===(t=e.getElementsByClassName("caption-selector-content"))||void 0===t?void 0:t[0]),null===(n=document)||void 0===n||null===(a=n.getElementsByClassName("caption-selector-content"))||void 0===a||!a[0]){var r=c(this.playerId);console.log("im triggered again from loadeddata",r),null==r||r.map((function(e){return s(o.playerId,e.id)}));var l=this.el(),p=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var e;null!==(e=p.classList)&&void 0!==e&&e.contains("hidden")?(d(),p.classList.remove("hidden"),l.classList.add("open"),p.style.right="0px"):(p.classList.add("hidden"),l.classList.remove("open"),p.style.right="-350px")};var u=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height");p.style.height="".concat(u),i.dom.appendContent(l,p),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(p),m(this.playerId,p)}}},{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(l())});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"}),c=i.dom.createEl("div",{className:"caption-selector-content"}),s=i.dom.createEl("div",{className:"caption-container"}),d=this.createLanguageContanier();i.dom.appendContent(s,d),i.dom.appendContent(a,o),i.dom.appendContent(a,r),i.dom.appendContent(e,a),i.dom.appendContent(e,c),i.dom.appendContent(c,s),p(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){var n,a,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important")),c(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 l=c(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==l||null===(a=l[n])||void 0===a?void 0:a.label;var c=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});c.onchange=function(t){u(e.playerId,l[n].id)},c.setAttribute("type","radio"),i.dom.appendContent(o,c),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},m=0;m<l.length;m++)d(m);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 l=document.createElement("div");l.className="fontsize - ".concat(a),l.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var c=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)});c.setAttribute("type","radio"),c.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,c),i.dom.appendContent(r,l),i.dom.appendContent(e,r)}return e}}]),C}();export{h 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-7c12a59f.js";import{g as u}from"./renditions-29c48da7.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-221410dd.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-8bf5df58.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-47aaf95c.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-341b0733.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-a623f3ab.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-08eb9757.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-
|
|
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-7c12a59f.js";import{g as u}from"./renditions-29c48da7.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-221410dd.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-8bf5df58.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-47aaf95c.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-341b0733.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-a623f3ab.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-08eb9757.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-5b759674.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-29d6bc04.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-257e6f0e.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-5312e899.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-f4e361cd.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};
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n 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 k,t as I,u as P,v as O,w as E,x as j,y as S,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-7c12a59f.js";import V from"video.js";import{o as U,g as W,a as q,s as z,b as G}from"./util-b0bc7e61.js";import{g as J}from"./renditions-29c48da7.js";import{playSelectedResolution as K}from"./resolution-8bf5df58.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,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function X(e,t){Y("event",e,t)}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}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 te(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function ne(){return ie.apply(this,arguments)}function ie(){return ie=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.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 t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());X(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),X("PLAY",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))X("BUFFERING",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,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:te(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;X("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),X("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(oe(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var oe=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,m,f,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=$,e.t1=$,e.t2=$({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),e.t3={},e.t4=te(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,ne();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),f=[e.t31],e.next=37,o();case 37: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 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re,le,ae=function(e){var t,n,i=r(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.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,t){var n=r(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=V.dom.getPointerPosition(a,t).x;V.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(n=window)||void 0===n||null===(i=n.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,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ue(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?de(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):de(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ce=[],ve=0,me=null;function fe(e,t,n){var i,o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];le=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.xapiKey,m=(null==t||null===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,f={};"v1"==le?f={videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==le&&(f=ue(ue({videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},me&&{seriesId:me}),m&&{originalObjectId:m})),a(f,le).then((function(e){})).catch((function(e){})),ve=u+n}var pe=function(e,t,n){var i=r(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},we=function(e){var t=r(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ge(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?he(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):he(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ye=function(e,t,n,i){var o,l,a=i.res,m=i.sres,f=r(e),p=(null==a?void 0:a.contentType)||"video",w=(null==a||null===(o=a[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(a),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&pe(e,sessionStorage.getItem("volume")||"100");var o=u();if(s(),n.resolve(ge({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,d,c=ge(ge({},t),a);!function(e,t,n){var i,o,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(me=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ce=[],ve=0,re=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=r(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ce.includes(ve)||(e==ve?(ce.push(e),fe(s,t,a)):e>ve&&(ve=e+a))})),s.one("ended",(function(){fe(s,t,a,!0)})))}(e,c,null==o||null===(l=o.video)||void 0===l||null===(d=l.gist)||void 0===d?void 0:d.id)}})),f.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",t)})),f.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.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=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),f.on("loadedmetadata",(function(){window.endFirstFrame(f)})),f.one("error",(function(){var t,i;d(e,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured"})})),f.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(){f.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){console.log("chromecast - disconnected");var e=f.remoteTextTracks();console.log("im tracks",e),e.forEach((function(e){f.removeRemoteTextTrack(e)}))}))},be=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-d4591693.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-6ce61902.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-84d9a239.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-c08afe97.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&import("./skin-de3a3d56.js").then((function(n){n.initialiseSkin(e,t)}))},Te=function(e){return new Promise((function(t,n){if(ke(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!1,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},ke=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ie=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Pe,Oe=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Te("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"),Te("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Oe,loadEMELibrary:Ee});function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function De(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Ae=function(i,o,a,s){var u,c,v,m,f,p,w,h,g,y,T,k,I,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,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=(null===(p=X)||void 0===p?void 0:p.contentType)||"video",ie=_(null===(w=X)||void 0===w||null===(h=w[ne])||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.videoImageUrl)||_(null===(y=X)||void 0===y||null===(T=y[ne])||void 0===T||null===(k=T.gist)||void 0===k||null===(I=k.imageGist)||void 0===I?void 0:I.r16x9),oe=(null===(P=X)||void 0===P||null===(O=P[ne])||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[ne])||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=De(De({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ue=(Q={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",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",De(De({dash:De(De({},!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:De(De({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",te),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=r(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=w}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),ce=V(i,ue,function(){var e=t(n.mark((function e(){var t,o,r,u,c,v,m,f,p,w,h,g,y,T,k,I,P,O,E,D,A,R,F,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(a),re&&s.resolve(De({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(ce),window.firstFrame(ce),"white"!==window.controlsColor&&Ie(window.controlsColor,ce),/Android/i.test(navigator.userAgent)&&(V.options.vhs.overrideNative=!0),T=null===(t=X)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,k=null===(r=X)||void 0===r||null===(u=r[ne])||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,Ee();case 12:e.next=21;break;case 14:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=19;break}return e.next=17,Ee();case 17:e.next=21;break;case 19:return e.next=21,Oe();case 21:oe&&se(i,k),!de||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||H(i,de,X),(P=j(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[ne])||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[ne])||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[ne])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[ne])||void 0===F?void 0:F.closedCaptions),O=C.filter((function(e){return"VTT"===e.format})),N(i,O)),null!=a&&a.disableControls?S(i):be(i,De(De(De({},a),ue),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),ye(i,De(De(De({},a),ue),{},{liveVideo:re}),s,{res:X,sres:$});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Re(){return{loadVideoInstantly:p,onTimeUpdate:U,getVideoDuration:W,onVideoEnded:q,init:function(e){return new Promise((function(t,n){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 k=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),k&&!A(k)){Pe=JSON.parse(atob(k.split(".")[1])),window.siteId=null===(r=Pe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Pe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Pe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Pe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Pe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Pe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=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,j=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,S=null==e?void 0:e.errors;S&&(window.customErrors=S),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 je})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return je})).then((function(e){e.importChromecast()})),O&&"Safari"==l()&&Promise.resolve().then((function(){return je})).then((function(e){e.importAirplay()})),j&&Te("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return e=j,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(I));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,k).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,t){var n=new Map;m({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),f(n)})).catch((function(e){return console.log(e)}))}(N,k),C(d,k).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),Ae(I,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){x(e,I,n,y)}))})).catch((function(e){x(e,I,n)}))}else if(g){var V=null==e?void 0:e.epg;B(V,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",Ae(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){x(e,I,n,y)}))}else C(y,k).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,k).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",Ae(I,{res:s},e,{resolve:t,reject:n})})).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)),Ae(I,{res:s},e,{resolve:t,reject:n})})):Ae(I,{res:s},e,{resolve:t,reject:n})})).catch((function(e){x(e,I,n,y)}))}else n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}})}}))},getRenditions:J,skip:w,getPlayer:r,play:h,pause:g,detectBrowser:l,rewind:y,loadVideo:b,seekToTimeStamp:z,isPlayerInitialised:T,load:k,dispose:I,enableCaptions:P,disableCaptions:O,getCaptions:E,playSelectedResolution:K,getSource:j,setVolume:pe,getVolume:we,disableControls:S,setPlaybackSpeed:G}}export{Re as default};
|
|
1
|
+
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n 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 k,t as I,u as P,v as O,w as E,x as j,y as S,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-7c12a59f.js";import V from"video.js";import{o as U,g as W,a as q,s as z,b as G}from"./util-b0bc7e61.js";import{g as J}from"./renditions-29c48da7.js";import{playSelectedResolution as K}from"./resolution-8bf5df58.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,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function X(e,t){Y("event",e,t)}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}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 te(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function ne(){return ie.apply(this,arguments)}function ie(){return ie=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.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 t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());X(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),X("PLAY",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))X("BUFFERING",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,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:te(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;X("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),X("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(oe(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var oe=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,m,f,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=$,e.t1=$,e.t2=$({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),e.t3={},e.t4=te(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,ne();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),f=[e.t31],e.next=37,o();case 37: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 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re,le,ae=function(e){var t,n,i=r(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.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,t){var n=r(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=V.dom.getPointerPosition(a,t).x;V.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(n=window)||void 0===n||null===(i=n.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,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ue(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?de(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):de(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ce=[],ve=0,me=null;function fe(e,t,n){var i,o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];le=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.xapiKey,m=(null==t||null===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,f={};"v1"==le?f={videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==le&&(f=ue(ue({videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},me&&{seriesId:me}),m&&{originalObjectId:m})),a(f,le).then((function(e){})).catch((function(e){})),ve=u+n}var pe=function(e,t,n){var i=r(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},we=function(e){var t=r(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ge(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?he(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):he(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ye=function(e,t,n,i){var o,l,a=i.res,m=i.sres,f=r(e),p=(null==a?void 0:a.contentType)||"video",w=(null==a||null===(o=a[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(a),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&pe(e,sessionStorage.getItem("volume")||"100");var o=u();if(s(),n.resolve(ge({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,d,c=ge(ge({},t),a);!function(e,t,n){var i,o,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(me=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ce=[],ve=0,re=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=r(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ce.includes(ve)||(e==ve?(ce.push(e),fe(s,t,a)):e>ve&&(ve=e+a))})),s.one("ended",(function(){fe(s,t,a,!0)})))}(e,c,null==o||null===(l=o.video)||void 0===l||null===(d=l.gist)||void 0===d?void 0:d.id)}})),f.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",t)})),f.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.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=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),f.on("loadedmetadata",(function(){window.endFirstFrame(f)})),f.one("error",(function(){var t,i;d(e,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured"})})),f.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(){f.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){console.log("chromecast - disconnected");var e=f.remoteTextTracks();console.log("im tracks",e),e.forEach((function(e){f.removeRemoteTextTrack(e)}))}))},be=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-030cc782.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-df37a954.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-84d9a239.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-19e32835.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&import("./skin-c75c4981.js").then((function(n){n.initialiseSkin(e,t)}))},Te=function(e){return new Promise((function(t,n){if(ke(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!1,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},ke=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ie=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Pe,Oe=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Te("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"),Te("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Oe,loadEMELibrary:Ee});function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function De(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Ae=function(i,o,a,s){var u,c,v,m,f,p,w,h,g,y,T,k,I,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,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=(null===(p=X)||void 0===p?void 0:p.contentType)||"video",ie=_(null===(w=X)||void 0===w||null===(h=w[ne])||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.videoImageUrl)||_(null===(y=X)||void 0===y||null===(T=y[ne])||void 0===T||null===(k=T.gist)||void 0===k||null===(I=k.imageGist)||void 0===I?void 0:I.r16x9),oe=(null===(P=X)||void 0===P||null===(O=P[ne])||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[ne])||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=De(De({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ue=(Q={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",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",De(De({dash:De(De({},!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:De(De({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",te),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=r(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=w}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),ce=V(i,ue,function(){var e=t(n.mark((function e(){var t,o,r,u,c,v,m,f,p,w,h,g,y,T,k,I,P,O,E,D,A,R,F,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(a),re&&s.resolve(De({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(ce),window.firstFrame(ce),"white"!==window.controlsColor&&Ie(window.controlsColor,ce),/Android/i.test(navigator.userAgent)&&(V.options.vhs.overrideNative=!0),T=null===(t=X)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,k=null===(r=X)||void 0===r||null===(u=r[ne])||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,Ee();case 12:e.next=21;break;case 14:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=19;break}return e.next=17,Ee();case 17:e.next=21;break;case 19:return e.next=21,Oe();case 21:oe&&se(i,k),!de||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||H(i,de,X),(P=j(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[ne])||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[ne])||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[ne])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[ne])||void 0===F?void 0:F.closedCaptions),O=C.filter((function(e){return"VTT"===e.format})),N(i,O)),null!=a&&a.disableControls?S(i):be(i,De(De(De({},a),ue),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),ye(i,De(De(De({},a),ue),{},{liveVideo:re}),s,{res:X,sres:$});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Re(){return{loadVideoInstantly:p,onTimeUpdate:U,getVideoDuration:W,onVideoEnded:q,init:function(e){return new Promise((function(t,n){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 k=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),k&&!A(k)){Pe=JSON.parse(atob(k.split(".")[1])),window.siteId=null===(r=Pe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Pe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Pe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Pe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Pe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Pe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=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,j=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,S=null==e?void 0:e.errors;S&&(window.customErrors=S),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 je})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return je})).then((function(e){e.importChromecast()})),O&&"Safari"==l()&&Promise.resolve().then((function(){return je})).then((function(e){e.importAirplay()})),j&&Te("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return e=j,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(I));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,k).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,t){var n=new Map;m({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),f(n)})).catch((function(e){return console.log(e)}))}(N,k),C(d,k).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),Ae(I,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){x(e,I,n,y)}))})).catch((function(e){x(e,I,n)}))}else if(g){var V=null==e?void 0:e.epg;B(V,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",Ae(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){x(e,I,n,y)}))}else C(y,k).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,k).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",Ae(I,{res:s},e,{resolve:t,reject:n})})).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)),Ae(I,{res:s},e,{resolve:t,reject:n})})):Ae(I,{res:s},e,{resolve:t,reject:n})})).catch((function(e){x(e,I,n,y)}))}else n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}})}}))},getRenditions:J,skip:w,getPlayer:r,play:h,pause:g,detectBrowser:l,rewind:y,loadVideo:b,seekToTimeStamp:z,isPlayerInitialised:T,load:k,dispose:I,enableCaptions:P,disableCaptions:O,getCaptions:E,playSelectedResolution:K,getSource:j,setVolume:pe,getVolume:we,disableControls:S,setPlaybackSpeed:G}}export{Re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as t,c as n,d as o}from"./features-
|
|
1
|
+
import{a as e,b as t,c as n,d as o}from"./features-a1f78f04.js";import{M as s,a as r,S as l,N as a}from"./icons-c2efba97.js";import{a as i,d as c,M as u}from"./generic-7c12a59f.js";import d from"@babel/runtime/helpers/defineProperty";import{i as m}from"./keyboardShortcuts-c00504c7.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-29c48da7.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function v(o,a){var m=i(o);m.one("play",(function(){var t,n,l,i;null!=a&&a.streams&&e(o,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},a)),null!=a&&a.airplay&&"Safari"==c()&&m.addChild("airPlayButton"),null!=a&&a.chromecastReceiverId&&m.addChild("chromecastButton"),m.addChild("FullscreenToggle"),null===(t=m.getChild("FullscreenToggle"))||void 0===t||null===(n=t.el())||void 0===n||n.appendChild(u(s(window.controlsColor))),null===(l=m.getChild("FullscreenToggle"))||void 0===l||null===(i=l.el())||void 0===i||i.appendChild(u(r(window.controlsColor))),h(o)})),m.on("loadedmetadata",(function(){window.endFirstFrame(m),"Safari"!==c()&&t(o,"live",l())})),m.one("loadedmetadata",(function(){var e;null!=a&&a.streams&&(null==a||null===(e=a.streams)||void 0===e?void 0:e.length)>=2&&n(o,a)}))}function f(e,t){var n;m(e,t),(null==(n=t)||!n.liveui)&&(null==n||!n.liveVideo)||null!=n&&n.liveui&&null!=n&&n.liveVideo?import("./dvr_skin-9cc1b144.js").then((function(e){var t=document.createElement("style");t.id="dvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})):import("./nondvr_skin-64be70e5.js").then((function(e){var t=document.createElement("style");t.id="nondvr_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e){o(e)}(e),function(e,t){var n=i(e),o=n.controlBar.getChild("SubsCapsButton").el();document.getElementsByClassName("vjs-subs-caps-button")[1].appendChild(u(a()));var s=document.createElement("div");s.classList.add("caption-header"),o.querySelector(".vjs-menu-content").insertBefore(s,o.querySelector(".vjs-menu-item"));var r=document.createElement("div");if(r.innerText="Captions",r.className="fs14",document.getElementsByClassName("vjs-subs-caps-button")[0].appendChild(r),"Safari"==c()){document.getElementsByClassName("vjs-subs-caps-button")[0].style.left="9.5rem"}null!=t&&t.liveui||null==t||!t.liveVideo||(document.getElementsByClassName("vjs-progress-control")[0].style.display="none")}(e,t),v(e,t)}var b;function h(e){var t=i(e);j(),t.on("pause",(function(){clearTimeout(b),y()})),t.on("play",(function(){j()}));var n=document.getElementById("".concat(e));n.addEventListener("mouseenter",(function(){y(),t.paused()||j()})),n.addEventListener("touchstart",(function(){y(),j()})),n.addEventListener("mousemove",(function(){y(),t.paused()||j()}))}function y(){var e=document.getElementsByClassName("vjs-chromecast-button")[0],t=document.getElementsByClassName("vjs-airplay-button")[0],n=document.getElementsByClassName("vjs-fullscreen-control")[0];null!=e&&e.classList.contains("hideoutsidecontrols")&&(null==e||e.classList.remove("hideoutsidecontrols")),n.classList.contains("hideoutsidecontrols")&&n.classList.remove("hideoutsidecontrols"),null!=t&&t.classList.contains("hideoutsidecontrols")&&t.classList.remove("hideoutsidecontrols")}function j(){var e=document.getElementsByClassName("vjs-chromecast-button")[0],t=document.getElementsByClassName("vjs-fullscreen-control")[0],n=document.getElementsByClassName("vjs-airplay-button")[0];clearTimeout(b),b=setTimeout((function(){null==e||e.classList.add("hideoutsidecontrols"),null==t||t.classList.add("hideoutsidecontrols"),null==n||n.classList.add("hideoutsidecontrols")}),2200)}export{h as hideControls,f as initialiseSkin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,j as l,k as t,g as n,h as i,d as o,l as a,m as r,n as s,o as d}from"./features-
|
|
1
|
+
import{i as e,j as l,k as t,g as n,h as i,d as o,l as a,m as r,n as s,o as d}from"./features-a1f78f04.js";import{M as u,a as v,c as m,d as c}from"./icons-c2efba97.js";import{N as p,a as f,O as g,w as h,M as y,d as b}from"./generic-7c12a59f.js";import{g as C}from"./renditions-29c48da7.js";import x from"@babel/runtime/helpers/toConsumableArray";import{s as j}from"./autoNextVideo-b16258f1.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./util-b0bc7e61.js";var E=p(),N=[];null==E||E.map((function(e){return N.push.apply(N,x(e.episodes))}));var w=function(e,l){var t=f(e),n=Math.floor(t.currentTime());if(Math.floor(t.duration())!=n){t.pause(e);var i=g();j(i,e,N)}};function B(n,i){var o=f(n);o.on("loadeddata",(function(){var t,a,r;(null===(t=C(n))||void 0===t?void 0:t.length)>0&&e(n,i),(null===(a=h(n))||void 0===a?void 0:a.length)>0&&l(n,i),null!=i&&null!==(r=i.series)&&void 0!==r&&r.enable&&function(e,l){var t;null==l||null===(t=l.series)||void 0===t||t.cb;var n=f(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),t=n.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];t-l<=10&&g()<=(null==N?void 0:N.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var i,o=N.filter((function(e,l){return l==g()}));if((null==o?void 0:o.length)>0)if(null!==(i=document.getElementsByClassName("next-ep-preview"))&&void 0!==i&&i[0]){var a,r,s,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(r=document.getElementsByClassName("next-ep-title"))||void 0===r?void 0:r[0],C=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],x=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],j=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=j)||void 0===v?void 0:v.length)>60&&(j=j.substr(0,60)+"..."),b.textContent="".concat(j),C.src=(null===(m=o[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),x.onclick=function(){return w(e)}}else{var E,B,V,k,M,I,P,T=document.createElement("div");T.className="next-ep-preview",T.style.visibility="hidden",document.getElementById(e).append(T);var D=document.createElement("div");D.className="next-ep-header",D.textContent="Next up";var L=null===(E=o[0])||void 0===E?void 0:E.title,O=document.createElement("img");O.className="next-ep-img",O.src=(null===(B=o[0])||void 0===B||null===(V=B.gist)||void 0===V||null===(k=V.imageGist)||void 0===k?void 0:k.r16x9)||(null===(M=window)||void 0===M||null===(I=M.customData)||void 0===I?void 0:I.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(P=L)||void 0===P?void 0:P.length)>60&&(L=L.substr(0,60)+"..."),F.textContent="".concat(L);var G=document.createElement("div");G.className="next-ep-content",G.append(O),G.append(F),G.onclick=function(){return w(e)},T.append(D),T.append(G)}}(n,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var e,l,i,o;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&t(n,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}function V(e,l){!function(){"Chrome"==b()&&import("./chromett-a3cbb2e1.js").then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));import("./skin-3470b8fa.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),B(e,l),function(e,l){var t,n,i,o,a=f(e);null===(t=a.controlBar.getChild("FullscreenToggle"))||void 0===t||null===(n=t.el())||void 0===n||n.appendChild(y(u(window.controlsColor))),null===(i=a.controlBar.getChild("FullscreenToggle"))||void 0===i||null===(o=i.el())||void 0===o||o.appendChild(y(v(window.controlsColor)));var r=document.getElementsByClassName("vjs-time-control");l.liveVideo&&(r[0].style.display="none")}(e,l),function(e,l){var t,u,v,p,f,g;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&i(e,"defaultV2",c());l.liveVideo||o(e);(null==l||null===(t=l.relatedVideos)||void 0===t||null===(u=t.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&r(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&s(e,null==l?void 0:l.playlist);null!=l&&null!==(g=l.series)&&void 0!==g&&g.enable&&d(e,l)}(e,l),function(e,l){var t=f(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(n),o.alt="Provider Image",i.append(o),t.el().appendChild(i),t.on("useractive",(function(){i.classList.remove("vjs-fade")})),t.on("userinactive",(function(){t.paused()||i.classList.add("vjs-fade")})),t.on("fullscreenchange",(function(){t.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}(e,l)}export{V as initialiseSkin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./generic-7c12a59f.js";import{i as r,p as t}from"./features-
|
|
1
|
+
import{a as e}from"./generic-7c12a59f.js";import{i as r,p as t}from"./features-a1f78f04.js";import{g as o}from"./renditions-29c48da7.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./localisation-0bf399a1.js";function i(i,a){import("./skin-271fa63f.js").then((function(e){var r=document.createElement("style");r.id="multiplayer_css",r.append("".concat(e.default)),document.head.appendChild(r)})),function(t,i){e(t).on("loadeddata",(function(){var e;(null===(e=o(t))||void 0===e?void 0:e.length)>0&&r(t,i)}))}(i,a),function(r){var o=e(r);o.controls(!1),t(r)}(i)}export{i as initialiseSkin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,e as t,f as o,g as s,h as n}from"./features-
|
|
1
|
+
import{b as e,e as t,f as o,g as s,h as n}from"./features-a1f78f04.js";import{i}from"./keyboardShortcuts-c00504c7.js";import{S as r,M as l,a,N as d,b as m,R as u}from"./icons-c2efba97.js";import{a as p,b as c,M as v}from"./generic-7c12a59f.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./renditions-29c48da7.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function b(b,f){i(b,f),import("./skin-cd537931.js").then((function(e){var t=document.createElement("style");t.id="def_skin",t.append("".concat(e.default)),document.head.appendChild(t)})),function(e,t){0==t.liveVideo&&0==t.liveui&&s(e,"default",m());(0==t.liveVideo&&0==t.liveui||1==t.liveui)&&n(e,"default",u())}(b,f),function(s,n){var i=p(s),l=(null==n?void 0:n.sres)||null;i.on("loadeddata",(function(){e(s,"default",r()),l&&import("./nextEpisodeButton-47aaf95c.js").then((function(e){e.initaliseFunctionality(n.sres.seasons,c())}))})),i.one("loadedmetadata",(function(){var e;l&&(t(s,null==n||null===(e=n.sres)||void 0===e?void 0:e.seasons,n),o(n.sres,n.res,s))}))}(b,f),function(e,t){var o,s,n,i,r=p(e),m=document.getElementsByClassName("vjs-current-time")[0],u=document.getElementsByClassName("vjs-duration")[0],c=document.getElementsByClassName("vjs-time-divider")[0];t.liveVideo&&(m&&(m.style.display="none"),u&&(u.style.display="none"),c&&(c.style.display="none"));null===(o=r.controlBar.getChild("FullscreenToggle"))||void 0===o||null===(s=o.el())||void 0===s||s.appendChild(v(l(window.controlsColor))),null===(n=r.controlBar.getChild("FullscreenToggle"))||void 0===n||null===(i=n.el())||void 0===i||i.appendChild(v(a(window.controlsColor)));var b=r.controlBar.getChild("SubsCapsButton").el();document.getElementById(e).getElementsByClassName("vjs-subs-caps-button")[1].appendChild(v(d()));var f=document.createElement("div");f.classList.add("caption-header"),b.querySelector(".vjs-menu-content").insertBefore(f,b.querySelector(".vjs-menu-item"))}(b,f)}export{b as initialiseSkin};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),r=require("./icons-0f7b3404.js"),l=require("./generic-e42efcd8.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var s=i.getComponent("Component"),d=function(){n(m,s);var d,u,p=(d=m,u=c(),function(){var e,t=o(d);if(u){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function m(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,m),(i=p.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important"),i}return t(m,[{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.CaptionsSvgV2())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./caption-settings-34ca0188.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,t,n=this;if(null===(e=document)||void 0===e||null===(t=e.getElementsByClassName("caption-selector-content"))||void 0===t||!t[0]){var a=l.getCaptions(this.playerId);console.log("im triggered again from loadeddata",a),null==a||a.map((function(e){return l.disableCaptions(n.playerId,e.id)}));var o=this.el(),r=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var e;null!==(e=r.classList)&&void 0!==e&&e.contains("hidden")?(l.closeOpenDrawers(),r.classList.remove("hidden"),o.classList.add("open"),r.style.right="0px"):(r.classList.add("hidden"),o.classList.remove("open"),r.style.right="-350px")};var c=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height");r.style.height="".concat(c),i.dom.appendContent(o,r),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(r),l.detectOrientationChange(this.playerId,r)}}},{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(r.crossIconSvg())});o.onclick=function(){e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px"};var c=i.dom.createEl("div",{className:"caption-selector-title",innerHTML:"Captions"}),s=i.dom.createEl("div",{className:"caption-selector-content"}),d=i.dom.createEl("div",{className:"caption-container"}),u=this.createLanguageContanier();i.dom.appendContent(d,u),i.dom.appendContent(a,o),i.dom.appendContent(a,c),i.dom.appendContent(e,a),i.dom.appendContent(e,s),i.dom.appendContent(s,d),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")}))}},{key:"createLanguageContanier",value:function(){var e=this,t=i.dom.createEl("div",{className:"caption-language-container"}),n=i.dom.createEl("div",{className:"caption-language-container-title",innerHTML:"Language"});i.dom.appendContent(t,n);var a=document.createElement("label");a.setAttribute("for","radio-off"),a.className="caption-language-holder";var o=document.createElement("div");o.className="caption",o.innerHTML="Off";var r=i.dom.createEl("input",{className:"radio - off",id:"radio-off",name:"language-radio",checked:"true"});r.setAttribute("type","radio"),r.onchange=function(t){var n,a,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important")),l.getCaptions(e.playerId).map((function(t){return l.disableCaptions(e.playerId,t.id)}))},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var c=l.getCaptions(this.playerId),s=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 s=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});s.onchange=function(t){l.enableCaptions(e.playerId,c[n].id)},s.setAttribute("type","radio"),i.dom.appendContent(o,s),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},d=0;d<c.length;d++)s(d);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 l=document.createElement("div");l.className="fontsize - ".concat(a),l.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var c=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)});c.setAttribute("type","radio"),c.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,c),i.dom.appendContent(r,l),i.dom.appendContent(e,r)}return e}}]),m}();exports.default=d;
|
|
@@ -1 +0,0 @@
|
|
|
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 l}from"./icons-c2efba97.js";import{w as c,v as s,T as d,U as m,a as p,u}from"./generic-7c12a59f.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(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var f=i.getComponent("Component"),h=function(){n(C,f);var h,y,g=(h=C,y=v(),function(){var e,t=o(h);if(y){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function C(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,C),(i=g.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important"),i}return t(C,[{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"caption-selection vjs-control vjs-button"});e.style.position="unset";var t=i.dom.createEl("div",{className:"caption-selector-icon",innerHTML:"".concat(r())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./caption-settings-cb47408f.js").then((function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e,t,n=this;if(null===(e=document)||void 0===e||null===(t=e.getElementsByClassName("caption-selector-content"))||void 0===t||!t[0]){var a=c(this.playerId);console.log("im triggered again from loadeddata",a),null==a||a.map((function(e){return s(n.playerId,e.id)}));var o=this.el(),r=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var e;null!==(e=r.classList)&&void 0!==e&&e.contains("hidden")?(d(),r.classList.remove("hidden"),o.classList.add("open"),r.style.right="0px"):(r.classList.add("hidden"),o.classList.remove("open"),r.style.right="-350px")};var l=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height");r.style.height="".concat(l),i.dom.appendContent(o,r),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(r),m(this.playerId,r)}}},{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(l())});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"}),c=i.dom.createEl("div",{className:"caption-selector-content"}),s=i.dom.createEl("div",{className:"caption-container"}),d=this.createLanguageContanier();i.dom.appendContent(s,d),i.dom.appendContent(a,o),i.dom.appendContent(a,r),i.dom.appendContent(e,a),i.dom.appendContent(e,c),i.dom.appendContent(c,s),p(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){var n,a,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important")),c(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 l=c(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==l||null===(a=l[n])||void 0===a?void 0:a.label;var c=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});c.onchange=function(t){u(e.playerId,l[n].id)},c.setAttribute("type","radio"),i.dom.appendContent(o,c),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},m=0;m<l.length;m++)d(m);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 l=document.createElement("div");l.className="fontsize - ".concat(a),l.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var c=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)});c.setAttribute("type","radio"),c.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,c),i.dom.appendContent(r,l),i.dom.appendContent(e,r)}return e}}]),C}();export{h as default};
|