@viewlift/player-backup 2.0.28-backup → 2.0.29-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-36d4f591.js → autoNextVideo-7a2ffaa6.js} +1 -1
- package/cjs/browser-9431352d.js +1 -0
- package/cjs/bundle.css +2 -2
- package/cjs/{features-523e8c65.js → features-2ccb04e9.js} +1 -1
- package/cjs/{generic-e8bd1537.js → generic-1446236a.js} +1 -1
- package/cjs/{index-4cbe9e83.js → index-12e3d234.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{keyboardShortcuts-8b540706.js → keyboardShortcuts-e051f089.js} +1 -1
- package/cjs/{multicamv2-bc547313.js → multicamv2-90c2d33a.js} +1 -1
- package/cjs/{multicamv2-fc0c9f8b.js → multicamv2-f9638124.js} +1 -1
- package/cjs/{nextEpisodeButton-4808ac62.js → nextEpisodeButton-88a1bca1.js} +1 -1
- package/cjs/{playlist-50e269bf.js → playlist-043e9e6c.js} +1 -1
- package/cjs/{resolution-268783f2.js → resolution-b2e683df.js} +1 -1
- package/cjs/{series-cf092d02.js → series-c1e5f9b2.js} +1 -1
- package/cjs/{series-v2-68f205cc.js → series-v2-8c29b37f.js} +1 -1
- package/cjs/{series-v2-711d6b3d.js → series-v2-f318388a.js} +1 -1
- package/cjs/{settings-icon-aa23d112.js → settings-icon-aa87cc13.js} +1 -1
- package/cjs/{skin-6fce42de.js → skin-453da306.js} +1 -1
- package/cjs/{skin-88c68611.js → skin-4872df7e.js} +1 -1
- package/cjs/{skin-7d3451a7.js → skin-5a948755.js} +1 -1
- package/cjs/{skin-3e127ea8.js → skin-ad68548a.js} +1 -1
- package/cjs/{skin-8a9476f5.js → skin-e634888b.js} +1 -1
- package/cjs/{skin-2d53c7ba.js → skin-ee1977be.js} +1 -1
- package/cjs/{videoSelector-36e5d142.js → videoSelector-2af8513b.js} +1 -1
- package/cjs/{videoSelector-1f5e1029.js → videoSelector-2c01053e.js} +1 -1
- package/esm/{autoNextVideo-218110f2.js → autoNextVideo-d1f16fc3.js} +1 -1
- package/esm/browser-c9dfe92f.js +1 -0
- package/esm/bundle.css +2 -2
- package/esm/{features-d3fd43f9.js → features-350ba5a2.js} +1 -1
- package/esm/{generic-fa33fce3.js → generic-259ac9ea.js} +1 -1
- package/esm/{index-c22e69a9.js → index-9026d02d.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{keyboardShortcuts-3b0664a2.js → keyboardShortcuts-47a8d21d.js} +1 -1
- package/esm/{multicamv2-3b26d832.js → multicamv2-4070c52a.js} +1 -1
- package/esm/{multicamv2-39f7b6fd.js → multicamv2-49ef8d7a.js} +1 -1
- package/esm/{nextEpisodeButton-bdc6d19a.js → nextEpisodeButton-7ff2f171.js} +1 -1
- package/esm/{playlist-00c047e6.js → playlist-83b15afc.js} +1 -1
- package/esm/{resolution-28e1d627.js → resolution-0afa0b07.js} +1 -1
- package/esm/{series-57b6d098.js → series-3399f3f3.js} +1 -1
- package/esm/{series-v2-6401672c.js → series-v2-5f425f8b.js} +1 -1
- package/esm/{series-v2-c71456da.js → series-v2-8f6066ae.js} +1 -1
- package/esm/{settings-icon-7f3aab78.js → settings-icon-106dd224.js} +1 -1
- package/esm/{skin-ffa11317.js → skin-3e654e7e.js} +1 -1
- package/esm/{skin-1ffee2bb.js → skin-51c067af.js} +1 -1
- package/esm/{skin-14b53128.js → skin-6b1812b7.js} +1 -1
- package/esm/{skin-e9236e41.js → skin-8bccac9a.js} +1 -1
- package/esm/{skin-085732f0.js → skin-99d39278.js} +1 -1
- package/esm/{skin-c7d3d63c.js → skin-9e72e406.js} +1 -1
- package/esm/{videoSelector-314267c2.js → videoSelector-0e12832d.js} +1 -1
- package/esm/{videoSelector-b8674ad9.js → videoSelector-e2041700.js} +1 -1
- package/package.json +1 -1
- package/cjs/browser-77c57718.js +0 -1
- package/esm/browser-d4613b36.js +0 -1
package/esm/bundle.css
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
.video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
|
|
7
8
|
height: 0.7em;
|
|
8
9
|
position: absolute;
|
|
@@ -148,7 +149,6 @@
|
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
|
|
151
|
-
|
|
152
152
|
/* CSS for videojs-dvr-seekbar */
|
|
153
153
|
|
|
154
154
|
.video-js.vjs-dvr-seekbar {
|
|
@@ -391,6 +391,7 @@
|
|
|
391
391
|
|
|
392
392
|
|
|
393
393
|
|
|
394
|
+
|
|
394
395
|
.video-js .multicamera-parent.default{
|
|
395
396
|
height: 345px;
|
|
396
397
|
position: absolute;
|
|
@@ -473,7 +474,6 @@
|
|
|
473
474
|
|
|
474
475
|
|
|
475
476
|
|
|
476
|
-
|
|
477
477
|
/* nextep */
|
|
478
478
|
.next-ep-preview{
|
|
479
479
|
position: absolute;
|
|
@@ -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{E as a,B as s}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{E as a,B as s}from"./generic-259ac9ea.js";import{g as c}from"./renditions-7d6c3151.js";import{g as d,p as u}from"./skin-88757661.js";import{g as p}from"./localisation-0bf399a1.js";function m(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 h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(e){var t=v();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 v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var g=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=p("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)},C=function(e,o,l){var s=function(o){r(s,o);var i=f(s);function s(e,n){var r;t(this,s);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var a=u(l);return o.append(a),r}return n(s,[{key:"handleClick",value:function(){a(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),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 s=u(l);return o.append(s),r}return n(a,[{key:"handleClick",value:function(){s(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-0afa0b07.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d(e),a=c(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:a},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-7ff2f171.js").then((function(r){var o=r.default,l=d(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,n){import("./series-3399f3f3.js").then((function(r){var o=r.seriesModule,l=d(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),s=function(e){a[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},c=0;c<a.length;c++)s(c)}))},k=function(e,t){import("./videoSelector-e2041700.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},S=function(e,t){import("./caption-settings-512647cd.js").then((function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("captionSelector",s),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===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},E=function(e,t){import("./settings-icon-106dd224.js").then((function(n){var r,o,l,a,s=n.default,c=d(e);i.registerComponent("settingsSelector",s),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===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},O=function(e,t){import("./playlist-83b15afc.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},w=function(e,t){import("./series-v2-5f425f8b.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},I=function(e,t){import("./multicamv2-4070c52a.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},M=function(e,t){var n=d(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=d(e).el(),n=0,r=d(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},L=function(e,t){import("./videoSelector-0e12832d.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},N=function(e,t){import("./series-v2-8f6066ae.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},_=function(e,t){import("./multicamv2-49ef8d7a.js").then((function(n){var r=n.default,o=d(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))};export{B as a,j as b,b as c,y as d,C as e,E as f,S as g,M as h,g as i,L as j,_ as k,O as l,N as m,P as n,k as o,w as p,I as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as a}from"./skin-88757661.js";import{i as l,d}from"./browser-d4613b36.js";import u from"js-cookie";import{UAParser as s}from"ua-parser-js";import{a as c,r as v}from"./captions-2401a9bd.js";function m(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,n){m("event",e,n)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function I(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function g(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?I(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var E={name:"@viewlift/player",version:"2.0.30",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=E.version;var T,h=function(e,n){var t,i,r,a,l,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:null!==(l=window)&&void 0!==l&&null!==(d=l.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":F.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,n){var t,i,r,a;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:F.get()+w.getLinearChannelDetails,params:g(g(g(g(g({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},_=function(e,n){var t,i,r=x(n),a=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})})):o({url:F.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},b=function(){var e=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return i=e.sent,e.abrupt("return",o({url:F.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},n),params:g({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),D=function(e,n){var t,i,r=window.contentType;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},O=function(e){var n=e.videoId;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},F=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),S=function(e,n,t,i){return o({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},P=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},R=null;function L(){return{set:function(e){e&&(R=e)},get:function(){return R}}}var V,W,A,C,N,j,B=function(){var e=n(t.mark((function e(){var n,i,r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=L().get(),i=F.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),U=null,M=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!P(n)){e.next=6;break}return U||(U=B().then((function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&L().set(r),o||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){U=null}))),e.abrupt("return",U);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},x=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){W=e},G=function(){return W},z=function(e){V=e},Y=function(){return V},X=function(){return A},q=function(e){A=e},J=function(){return N},K=function(e){C=new Map,e.map((function(e,n){C.set(e.id,n)}))},Q=function(e){if(C){var n=C.get(e);q(n+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ee(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var ne=0,te=function(){var e,n,t,i,o,r,a,l=G();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==l||null===(o=l.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)||(null==l?void 0:l.id)};function ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function oe(){var e=window.sessionStorage.getItem("uid");return e||(e=ie(),window.sessionStorage.setItem("uid",e),e)}function re(){return ae.apply(this,arguments)}function ae(){return(ae=n(t.mark((function e(){var n,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.initialise=function(e){window.sid=ie(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e,n){e.one("play",tryCatch((function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null}),100),p("PLAY",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":te(),watchTime:Math.floor(e.currentTime())})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&ne<4)ne++,p("BUFFERING",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var n,t,i,o,r,a;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var n=[];e.on("timeupdate",(function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(ne=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(le(n,r,a)){var l=Math.round(t-a);if(isFinite(l))return l}}}))()};var le=function(e,n,t){return e>=n&&e<=t};function de(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=r(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",(function(){window.endFirstFrame(t)}))}}window.fireEvent=function(){var e=n(t.mark((function e(n){var i,r,a,l,d,u,s,c,v,m,f,p,I,g,E,T,h,y,_,b;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return T=e.sent,h=x(T),y=null==h?void 0:h.site,_=null==h?void 0:h.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:y,cid:_,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=oe(),e.t5=te(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(l=n.videoPosition)&&void 0!==l?l:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?(t=n.adPosition)?String(t):"":"",e.next=26,re();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,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:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==n?void 0:n.duration)&&{duration:n.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(p=f.beacon)||void 0===p?void 0:p.params,e.t31=(0,e.t0)(e.t29,e.t30),b=[e.t31],o({url:(null===(I=window)||void 0===I||null===(g=I.customData)||void 0===g||null===(E=g.beacon)||void 0===E?void 0:E.url)||F.get()+w.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch((function(e){console.error(e)}));case 42:case"end":return e.stop()}var t}),e)})));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var ue=function(e,n){var t=new Map;O({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),N=t})).catch((function(e){return console.log(e)}))},se=function(){var e=Z.get();return e>=0?e+1:1},ce=function(){var e,n,t,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=Z.get(),l=null==i||null===(n=i[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1};function ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function me(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ve(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}window._deviceInfo=s(navigator.userAgent);var fe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},pe=function(e){var n=we(e,"video.tags",[]),t=we(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},we=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},Ie=function(){var e,n,t,i,o,a,l,d,s,c,v,m,f,p,w,I,g,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0,O=(null==D?void 0:D.contentType)||"video",F=(null==D||null===(e=D[O])||void 0===e?void 0:e.metadata)||(null==D||null===(n=D[O])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.metadata),S=r(b);if(!_.includes("VIEWLIFT_"))return _;var P,R=window.getComputedStyle(document.getElementById(b),null),L=Math.trunc(R.getPropertyValue("height").slice(0,-2)),V=Math.trunc(R.getPropertyValue("width").slice(0,-2)),W="linearchannel"===O?null==D||null===(i=D.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(a=o.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===a||null===(l=a.content)||void 0===l?void 0:l.id:we(D,"video.gist.id",""),A="linearchannel"===O?null==D||null===(d=D.linearchannel)||void 0===d||null===(s=d.channels)||void 0===s||null===(c=s.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===c?void 0:c.title:we(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),C=null,N=null;"function"==typeof window.__gpp&&(null===(P=window)||void 0===P||P.__gpp("ping",(function(e){C=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]})));var j=me(me({},ge(F)),{},{VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:L,VIEWLIFT_SIZE:fe(V,L),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:we(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:we(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:we(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==S||null===(m=S.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==S||null===(f=S.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:pe(D),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(we(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+we(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:we(null===(p=window)||void 0===p||null===(w=p.app_data)||void 0===w||null===(I=w.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:we(null===(g=window)||void 0===g||null===(E=g.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*we(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:we(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:A,VIEWLIFT_CONTENT_SERIES_TITLE:we(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:we(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ce(),VIEWLIFT_SEASON_NUMBER:se(),VIEWLIFT_CONTENT_TAGS:pe(D),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:C||"VIEWLIFT_GPP"},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var B in j){var U=new RegExp(B,"g");_=_.replace(U,j[B])}return _},ge=function(e){var n,t,i,o,r,a,d={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var s=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,c=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return s||c?(l()?s?d=me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):c&&(d=me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?d=me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):c&&(d=me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?d=me(me({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):c&&(d=me(me({},d),{},{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),d=l()?me(me({},d),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):me(me({},d),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(d=me(me({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),d=l()?me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),d=me(me({},d),{},{VIEWLIFT_AFID:u.get("afid")})},Ee=function(e,n){var t,i,o,r,a,l,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[w])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(l=e[w])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return he(E);if(I){var y=ye(g,n);return y.src=Ie(y.src,n,e),y}if("Safari"!==d()&&h)return Te(g);if(T){var _=he(g);return _.src=Ie(_.src,n,e),_}if(null!=g&&g.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return b.src=Ie(b.src,n,e),b}return null},Te=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},he=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},ye=function(e,n){var t=e.fairPlay,o=e.widevine,a=e.playReady,l=d();if(r(n),"Safari"===l){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,(function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,o,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,(function(e,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(t);return _e(n),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(_e(n),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var _e=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==d()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},be=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},De=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),o.appendChild(r),i.append(o)}}},Oe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Fe=!1,Se=function(e,n,t){var i=Ie(n,e,t),o=r(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i,o,a=r(e);if(null!==a.el_){Fe=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Fe&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()}),1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),a.one(u,(function(){s&&a.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;a.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),a.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}))})),a.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i)}};function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var Re=function(e){i(e).play()},Le=function(e){i(e).pause()},Ve=function(e,n){var t=i(e),o=t.currentTime()+n;t.currentTime(o)},We=function(e,n){var t=i(e),o=t.currentTime(),r=o<=n?0:o-n;t.currentTime(r)},Ae=function(e){return!!i.getPlayer("".concat(e))},Ce=function(e){return i(e).paused()},Ne=function(){var e=n(t.mark((function e(n,i){var o,a,l,d=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,M();case 3:return a=e.sent,l=r(n),e.abrupt("return",new Promise((function(e,t){y(i,a).then((function(t){var r=null==t?void 0:t.data;window.sid=ie(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=Ee(r,n);H(r),a&&o?(ke(n,a),l.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).catch((function(e){t({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),je=function(){var e=n(t.mark((function e(n,i,o){var a,l,d,u,s,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return u=e.sent,(Y()||null)&&Q(i),s=0,m=0,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(d=l.watchHistory)&&void 0!==d&&d.enable&&D(i,u).then((function(e){var n,t,i,o,r,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,m=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null})).catch((function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,t){h(i,u).then((function(i){var o,a,l,d,u,f,p,w,I,g,E=null==i?void 0:i.data,T=(null==E||null===(o=E.video)||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;H(i.data);var h=(null==E||null===(l=E.ads)||void 0===l||null===(d=l.preRoll)||void 0===d||null===(u=d.adTags)||void 0===u||null===(f=u.web)||void 0===f?void 0:f.active)&&(null==E||null===(p=E.ads)||void 0===p||null===(w=p.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(g=I.web)||void 0===g?void 0:g.url);h&&Se(n,h,E);var y=Ee(E,n);if(y){var _,b,D,O,F,S,P,R,L,V,W,A,C,N,j=(null==E||null===(_=E.video)||void 0===_||null===(b=_.gist)||void 0===b?void 0:b.videoImageUrl)||(null==E||null===(D=E.video)||void 0===D||null===(O=D.gist)||void 0===O||null===(F=O.imageGist)||void 0===F?void 0:F.r16x9),B=r(n);if(B.poster(j),ke(n,y),B.on("loadstart",(function(){T&&e({status:!0,msg:"Video Loaded",response:E})})),B.on("loadeddata",(function(){Oe(),e({status:!0,msg:"Video Loaded",response:E})})),B.one("play",(function(){s&&m<95&&setTimeout((function(){B.currentTime(s)}),0)})),B.one("error",(function(){var e;t({status:!1,msg:(null==B||null===(e=B.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==E||null===(S=E.video)||void 0===S||null===(P=S.contentDetails)||void 0===P||null===(R=P.closedCaptions)||void 0===R?void 0:R.length)>0||(null==E||null===(L=E.video)||void 0===L||null===(V=L.closedCaptions)||void 0===V?void 0:V.length)>0)W=((null==E||null===(A=E.video)||void 0===A||null===(C=A.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==E||null===(N=E.video)||void 0===N?void 0:N.closedCaptions)).filter((function(e){return"VTT"===e.format})),c(n,W);else v(n)}else De(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){xe(e,n,t,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),Be=function(e,n,t){var i=r(e);return i.src(n),new Promise((function(e,n){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Ue=function(e){var n=r(e);if(Me(),a(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Me=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},ke=function(e,n){var t=r(e);t&&t.src(n)},xe=function(n,t,i,o){var r,a,l,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);Ae(t)&&De(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Pe(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},o&&{videoId:o}))},He=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{Be as A,Ve as B,Re as C,Le as D,We as E,Ae as F,je as G,Ne as H,Ue as I,S as J,F as K,k as L,L as M,P as N,f as O,X as P,Ce as Q,q as R,Ie as S,O as T,K as U,Q as V,ce as a,Y as b,se as c,G as d,Ee as e,H as f,oe as g,Oe as h,De as i,J as j,de as k,ke as l,Se as m,be as n,He as o,x as p,h as q,D as r,b as s,xe as t,M as u,y as v,_ as w,ue as x,Z as y,z};
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"video.js";import o from"axios";import{g as r,c as a}from"./skin-88757661.js";import{i as l,d}from"./browser-c9dfe92f.js";import u from"js-cookie";import{UAParser as s}from"ua-parser-js";import{a as c,r as v}from"./captions-2401a9bd.js";function m(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function f(e){window.dataLayer=window.dataLayer||[],m("js",new Date),m("config",e)}function p(e,n){m("event",e,n)}var w={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function I(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function g(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?I(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var E={name:"@viewlift/player",version:"2.0.30",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=E.version;var T,h=function(e,n){var t,i,r,a,l,d,u,s;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:null!==(l=window)&&void 0!==l&&null!==(d=l.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":F.get()+"".concat(null==w?void 0:w.getVideoDetails),params:g({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,n){var t,i,r,a;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):o({url:F.get()+w.getLinearChannelDetails,params:g(g(g(g(g({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},_=function(e,n){var t,i,r=x(n),a=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(i=t.customData)&&void 0!==i&&i.seriesData?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})})):o({url:F.get()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},b=function(){var e=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return i=e.sent,e.abrupt("return",o({url:F.get()+"".concat(null==w?void 0:w.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:g({},n),params:g({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),D=function(e,n){var t,i,r=window.contentType;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(i=t.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},O=function(e){var n=e.videoId;return o({method:"GET",url:F.get()+"".concat(null==w?void 0:w.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},F=(T=null==w?void 0:w.apiBaseUrl,{set:function(e){e&&(T=e)},get:function(){return T}}),S=function(e,n,t,i){return o({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},P=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},R=null;function L(){return{set:function(e){e&&(R=e)},get:function(){return R}}}var V,W,A,C,N,j,B=function(){var e=n(t.mark((function e(){var n,i,r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=L().get(),i=F.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),U=null,M=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!P(n)){e.next=6;break}return U||(U=B().then((function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&L().set(r),o||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){U=null}))),e.abrupt("return",U);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},x=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},H=function(e){W=e},G=function(){return W},z=function(e){V=e},Y=function(){return V},X=function(){return A},q=function(e){A=e},J=function(){return N},K=function(e){C=new Map,e.map((function(e,n){C.set(e.id,n)}))},Q=function(e){if(C){var n=C.get(e);q(n+1)}},Z=(j=0,{set:function(e){e>=0&&(j=e)},get:function(){return j}});function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ee(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var ne=0,te=function(){var e,n,t,i,o,r,a,l=G();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===t||null===(i=t.content)||void 0===i?void 0:i.id:(null==l||null===(o=l.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)||(null==l?void 0:l.id)};function ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function oe(){var e=window.sessionStorage.getItem("uid");return e||(e=ie(),window.sessionStorage.setItem("uid",e),e)}function re(){return ae.apply(this,arguments)}function ae(){return(ae=n(t.mark((function e(){var n,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.initialise=function(e){window.sid=ie(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var t,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,p(r?"FAILED_TO_START":"DROPPED_STREAM",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e,n){e.one("play",tryCatch((function(){var t,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null}),100),p("PLAY",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",{"Video ID":te(),watchTime:Math.floor(e.currentTime())})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting")&&ne<4)ne++,p("BUFFERING",ee({pfm:window.platform,uid:oe(),vid:te(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,p("FIRST_FRAME",ee({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var n,t,i,o,r,a;p("AD_REQUEST",ee({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),p("AD_IMPRESSION",ee({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:te()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var n=[];e.on("timeupdate",(function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(ne=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(le(n,r,a)){var l=Math.round(t-a);if(isFinite(l))return l}}}))()};var le=function(e,n,t){return e>=n&&e<=t};function de(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=r(e);window.initialise(t,n),window.firstFrame(t,n),t.on("loadedmetadata",(function(){window.endFirstFrame(t)}))}}window.fireEvent=function(){var e=n(t.mark((function e(n){var i,r,a,l,d,u,s,c,v,m,f,p,I,g,E,T,h,y,_,b;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return T=e.sent,h=x(T),y=null==h?void 0:h.site,_=null==h?void 0:h.siteId,e.t0=ee,e.t1=ee,e.t2=ee({aid:y,cid:_,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=oe(),e.t5=te(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(l=n.videoPosition)&&void 0!==l?l:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?(t=n.adPosition)?String(t):"":"",e.next=26,re();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,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:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==n?void 0:n.duration)&&{duration:n.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(m=window)||void 0===m||null===(f=m.customData)||void 0===f||null===(p=f.beacon)||void 0===p?void 0:p.params,e.t31=(0,e.t0)(e.t29,e.t30),b=[e.t31],o({url:(null===(I=window)||void 0===I||null===(g=I.customData)||void 0===g||null===(E=g.beacon)||void 0===E?void 0:E.url)||F.get()+w.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:b}).catch((function(e){console.error(e)}));case 42:case"end":return e.stop()}var t}),e)})));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var ue=function(e,n){var t=new Map;O({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),N=t})).catch((function(e){return console.log(e)}))},se=function(){var e=Z.get();return e>=0?e+1:1},ce=function(){var e,n,t,i=Y(),o=G(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=Z.get(),l=null==i||null===(n=i[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1};function ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function me(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ve(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}window._deviceInfo=s(navigator.userAgent);var fe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},pe=function(e){var n=we(e,"video.tags",[]),t=we(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},we=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},Ie=function(){var e,n,t,i,o,a,l,d,s,c,v,m,f,p,w,I,g,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0,O=(null==D?void 0:D.contentType)||"video",F=(null==D||null===(e=D[O])||void 0===e?void 0:e.metadata)||(null==D||null===(n=D[O])||void 0===n||null===(t=n.gist)||void 0===t?void 0:t.metadata),S=r(b);if(!_.includes("VIEWLIFT_"))return _;var P,R=window.getComputedStyle(document.getElementById(b),null),L=Math.trunc(R.getPropertyValue("height").slice(0,-2)),V=Math.trunc(R.getPropertyValue("width").slice(0,-2)),W="linearchannel"===O?null==D||null===(i=D.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(a=o.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===a||null===(l=a.content)||void 0===l?void 0:l.id:we(D,"video.gist.id",""),A="linearchannel"===O?null==D||null===(d=D.linearchannel)||void 0===d||null===(s=d.channels)||void 0===s||null===(c=s.find((function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)})))||void 0===c?void 0:c.title:we(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),C=null,N=null;"function"==typeof window.__gpp&&(null===(P=window)||void 0===P||P.__gpp("ping",(function(e){C=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]})));var j=me(me({},ge(F)),{},{VIEWLIFT_WIDTH:V,VIEWLIFT_HEIGHT:L,VIEWLIFT_SIZE:fe(V,L),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:we(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:we(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:we(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==S||null===(m=S.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==S||null===(f=S.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:pe(D),VIEWLIFT_MEDIA_ID:W,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(we(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:W,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+we(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:u.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:we(null===(p=window)||void 0===p||null===(w=p.app_data)||void 0===w||null===(I=w.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:we(null===(g=window)||void 0===g||null===(E=g.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*we(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:we(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:W,VIEWLIFT_CONTENT_TITLE:A,VIEWLIFT_CONTENT_SERIES_TITLE:we(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:we(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ce(),VIEWLIFT_SEASON_NUMBER:se(),VIEWLIFT_CONTENT_TAGS:pe(D),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:C||"VIEWLIFT_GPP"},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var B in j){var U=new RegExp(B,"g");_=_.replace(U,j[B])}return _},ge=function(e){var n,t,i,o,r,a,d={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){u.set(e.name,e.value)})));var s=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.SVOD)||!1,c=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return s||c?(l()?s?d=me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):c&&(d=me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):s?d=me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):c&&(d=me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),s?d=me(me({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):c&&(d=me(me({},d),{},{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),d=l()?me(me({},d),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):me(me({},d),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(d=me(me({},d),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),d=l()?me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):me(me({},d),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),d=me(me({},d),{},{VIEWLIFT_AFID:u.get("afid")})},Ee=function(e,n){var t,i,o,r,a,l,u,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[w])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(i=e[w])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[w])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(l=e[w])||void 0===l||null===(u=l.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return he(E);if(I){var y=ye(g,n);return y.src=Ie(y.src,n,e),y}if("Safari"!==d()&&h)return Te(g);if(T){var _=he(g);return _.src=Ie(_.src,n,e),_}if(null!=g&&g.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return b.src=Ie(b.src,n,e),b}return null},Te=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},he=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},ye=function(e,n){var t=e.fairPlay,o=e.widevine,a=e.playReady,l=d();if(r(n),"Safari"===l){var u=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,(function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,o,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(a,(function(e,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(t);return _e(n),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(_e(n),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var _e=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==d()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},be=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},De=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),o.appendChild(r),i.append(o)}}},Oe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Fe=!1,Se=function(e,n,t){var i=Ie(n,e,t),o=r(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i,o,a=r(e);if(null!==a.el_){Fe=!0;var l={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};a.ima.initializeAdDisplayContainer&&a.ima.initializeAdDisplayContainer(),Fe&&null!==a.el_&&("function"==typeof a.ima?a.ima(l):setTimeout((function(){a.ima.setContentWithAdTag(null,n,!0),a.ima.requestAds()}),1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),a.one(u,(function(){s&&a.ima.initializeAdDisplayContainer()}));var c=(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;a.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),a.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}))})),a.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i)}};function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var Re=function(e){i(e).play()},Le=function(e){i(e).pause()},Ve=function(e,n){var t=i(e),o=t.currentTime()+n;t.currentTime(o)},We=function(e,n){var t=i(e),o=t.currentTime(),r=o<=n?0:o-n;t.currentTime(r)},Ae=function(e){return!!i.getPlayer("".concat(e))},Ce=function(e){return i(e).paused()},Ne=function(){var e=n(t.mark((function e(n,i){var o,a,l,d=arguments;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,M();case 3:return a=e.sent,l=r(n),e.abrupt("return",new Promise((function(e,t){y(i,a).then((function(t){var r=null==t?void 0:t.data;window.sid=ie(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var a=Ee(r,n);H(r),a&&o?(ke(n,a),l.on("loadstart",(function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})}))):e({status:!0,msg:"Feed authenticated",response:r})})).catch((function(e){t({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),je=function(){var e=n(t.mark((function e(n,i,o){var a,l,d,u,s,m;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:return u=e.sent,(Y()||null)&&Q(i),s=0,m=0,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(d=l.watchHistory)&&void 0!==d&&d.enable&&D(i,u).then((function(e){var n,t,i,o,r,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,m=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null})).catch((function(e){var n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,t){h(i,u).then((function(i){var o,a,l,d,u,f,p,w,I,g,E=null==i?void 0:i.data,T=(null==E||null===(o=E.video)||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;H(i.data);var h=(null==E||null===(l=E.ads)||void 0===l||null===(d=l.preRoll)||void 0===d||null===(u=d.adTags)||void 0===u||null===(f=u.web)||void 0===f?void 0:f.active)&&(null==E||null===(p=E.ads)||void 0===p||null===(w=p.preRoll)||void 0===w||null===(I=w.adTags)||void 0===I||null===(g=I.web)||void 0===g?void 0:g.url);h&&Se(n,h,E);var y=Ee(E,n);if(y){var _,b,D,O,F,S,P,R,L,V,W,A,C,N,j=(null==E||null===(_=E.video)||void 0===_||null===(b=_.gist)||void 0===b?void 0:b.videoImageUrl)||(null==E||null===(D=E.video)||void 0===D||null===(O=D.gist)||void 0===O||null===(F=O.imageGist)||void 0===F?void 0:F.r16x9),B=r(n);if(B.poster(j),ke(n,y),B.on("loadstart",(function(){T&&e({status:!0,msg:"Video Loaded",response:E})})),B.on("loadeddata",(function(){Oe(),e({status:!0,msg:"Video Loaded",response:E})})),B.one("play",(function(){s&&m<95&&setTimeout((function(){B.currentTime(s)}),0)})),B.one("error",(function(){var e;t({status:!1,msg:(null==B||null===(e=B.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==E||null===(S=E.video)||void 0===S||null===(P=S.contentDetails)||void 0===P||null===(R=P.closedCaptions)||void 0===R?void 0:R.length)>0||(null==E||null===(L=E.video)||void 0===L||null===(V=L.closedCaptions)||void 0===V?void 0:V.length)>0)W=((null==E||null===(A=E.video)||void 0===A||null===(C=A.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==E||null===(N=E.video)||void 0===N?void 0:N.closedCaptions)).filter((function(e){return"VTT"===e.format})),c(n,W);else v(n)}else De(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){xe(e,n,t,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),Be=function(e,n,t){var i=r(e);return i.src(n),new Promise((function(e,n){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Ue=function(e){var n=r(e);if(Me(),a(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Me=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},ke=function(e,n){var t=r(e);t&&t.src(n)},xe=function(n,t,i,o){var r,a,l,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);Ae(t)&&De(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Pe(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},o&&{videoId:o}))},He=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};export{Be as A,Ve as B,Re as C,Le as D,We as E,Ae as F,je as G,Ne as H,Ue as I,S as J,F as K,k as L,L as M,P as N,f as O,X as P,Ce as Q,q as R,Ie as S,O as T,K as U,Q as V,ce as a,Y as b,se as c,G as d,Ee as e,H as f,oe as g,Oe as h,De as i,J as j,de as k,ke as l,Se as m,be as n,He as o,x as p,h as q,D as r,b as s,xe as t,M as u,y as v,_ as w,ue as x,Z as y,z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,p as n}from"./skin-88757661.js";import{P as r,b as i,d as o}from"./generic-fa33fce3.js";import{s as a}from"./autoNextVideo-218110f2.js";import{e as l}from"./icons-8e47e640.js";import u from"@babel/runtime/helpers/typeof";import s from"video.js";import c from"@babel/runtime/helpers/asyncToGenerator";import d from"@babel/runtime/regenerator";import p from"@babel/runtime/helpers/defineProperty";import m from"@babel/runtime/helpers/slicedToArray";var v,f,h,g,x=[],b=!1,y=function(o,a){var u;if(b=!1,null!=a&&null!==(u=a.series)&&void 0!==u&&u.enable){var s;x=[];var c=i();null==c||c.map((function(t){var n;return(n=x).push.apply(n,e(t.episodes))})),null==a||null===(s=a.series)||void 0===s||s.cb}else{var d,p;x=(null==a||null===(d=a.relatedVideos)||void 0===d?void 0:d.content)||[],null==a||null===(p=a.relatedVideos)||void 0===p||p.cb}var m=t(o);m.on("timeupdate",(function(){var e,t;if(!b){var n=Math.floor(m.currentTime()),i=m.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-n<=10&&r()<=(null===(t=x)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}}));var v,f=x.filter((function(e,t){return t==r()}));if((null==f?void 0:f.length)>0)if(null!==(v=document.getElementsByClassName("next-ep-preview"))&&void 0!==v&&v[0]){var h,g,y,E,N,C,k,T,A,I,L,B;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var M=null===(g=document.getElementsByClassName("next-ep-title"))||void 0===g?void 0:g[0],P=null===(y=document.getElementsByClassName("next-ep-img"))||void 0===y?void 0:y[0],S=null===(E=document.getElementsByClassName("next-ep-content"))||void 0===E?void 0:E[0],j=null===(N=f[0])||void 0===N?void 0:N.title;(null===(C=j)||void 0===C?void 0:C.length)>60&&(j=j.substr(0,60)+"..."),M.textContent="".concat(j),P.src=(null===(k=f[0])||void 0===k||null===(T=k.gist)||void 0===T||null===(A=T.imageGist)||void 0===A?void 0:A.r16x9)||(null==f||null===(I=f[0])||void 0===I?void 0:I.img)||(null===(L=window)||void 0===L||null===(B=L.customData)||void 0===B?void 0:B.fallbackImage),S.onclick=function(){return w(o)}}else{var O,R,X,$,D,F,U,G,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(o).append(V);var _=document.createElement("div");_.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var q=document.createElement("div");q.className="next-ep-close",q.onclick=function(){V.style.visibility="hidden",b=!0},q.appendChild(n(l())),_.append(W),_.append(q);var H=null===(O=f[0])||void 0===O?void 0:O.title,Y=document.createElement("img");Y.className="next-ep-img",Y.src=(null===(R=f[0])||void 0===R||null===(X=R.gist)||void 0===X||null===($=X.imageGist)||void 0===$?void 0:$.r16x9)||(null==f||null===(D=f[0])||void 0===D?void 0:D.img)||(null===(F=window)||void 0===F||null===(U=F.customData)||void 0===U?void 0:U.fallbackImage);var z=document.createElement("div");z.className="next-ep-title",(null===(G=H)||void 0===G?void 0:G.length)>60&&(H=H.substr(0,60)+"..."),z.textContent="".concat(H);var J=document.createElement("div");J.className="next-ep-content",J.append(Y),J.append(z),J.onclick=function(){return w(o)},V.append(_),V.append(J)}},w=function(e,n){var i=t(e),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(e);var l=r();a(l,e,x)}};function E(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function N(e){return C.apply(this,arguments)}function C(){return(C=c(d.mark((function e(t){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=m(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return T.apply(this,arguments)}function T(){return(T=c(d.mark((function e(t){var n,r;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",E(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function A(e){return I.apply(this,arguments)}function I(){return(I=c(d.mark((function e(t){var n,r;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return N(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},p(n,"left","-60px"),p(n,"border","1px solid transparent"),p(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}v={0:{src:"example-thumbnail.png"}},f=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===u(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},h=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},g=function e(t){return"HTML"!==t.nodeName&&"static"===h(t)("position")?e(t.offsetParent):t},s.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=f({},v,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",f(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,x;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((x=g(o.el()).getBoundingClientRect()).width||x.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=g(o.el()).getBoundingClientRect().left+v,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&f(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=h(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var L=function(){var e=c(d.mark((function e(t,n){var r,i,o,a;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=m(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function B(e,t){return M.apply(this,arguments)}function M(){return(M=c(d.mark((function e(n,r){var i,a,l,u,s,c,p,v,f,h,g,x,b,y,w,E,N,C,k,T,A,I,L,B,M,j,O,R,X,$,D,F,U;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t(r),a=n.split("/").slice(0,n.split("/").indexOf("dash")+1).join("/")||n,e.prev=2,e.next=5,fetch(n);case 5:return c=e.sent,e.next=8,c.text();case 8:p=e.sent,v=new DOMParser,f=v.parseFromString(p,"application/xml"),h=(null==i?void 0:i.duration())||(null===(l=o())||void 0===l||null===(u=l.video)||void 0===u?void 0:u.runtime),g=(null==f||null===(s=f.querySelector("MPD > BaseURL"))||void 0===s?void 0:s.textContent)||a+"/",x=f.getElementsByTagName("AdaptationSet"),b=0;case 15:if(!(b<x.length)){e.next=43;break}if(("image"!==(y=x[b]).getAttribute("contentType")||"image/png"!==y.getAttribute("mimeType"))&&"image/jpeg"!==y.getAttribute("mimeType")){e.next=40;break}if(w=y.getElementsByTagName("SegmentTemplate")[0],E=y.getElementsByTagName("Representation")[0],N=E.getElementsByTagName("EssentialProperty")[0],C=N.getAttribute("value"),k=null==C?void 0:C.split("x"),T=m(k,2),A=T[0],I=T[1],!w){e.next=40;break}if(w.getAttribute("media"),L=w.getAttribute("duration"),B=w.getAttribute("timescale"),M=(B?L/B:L)/(A*I),j=E.getAttribute("id"),O=Math.round(h/M),R=Math.ceil(O/(A*I)),X=w.getAttribute("media"),$=parseInt(w.getAttribute("startNumber"))||0,!isNaN(parseInt(R))){e.next=36;break}return e.abrupt("return");case 36:for(D=[],F=P(X),b=0;b<R;b++)U=F?S(F,b+$):X,D.push({duration:M,layout:C,uri:g+U.replace("$Number$",b+$).replace("$RepresentationID$",j)});return e.abrupt("return",D);case 40:b++,e.next=15;break;case 43:return console.log("No trickplay segment found."),e.abrupt("return",null);case 47:e.prev=47,e.t0=e.catch(2),console.error("Error fetching or parsing MPD:",e.t0);case 50:case"end":return e.stop()}}),e,null,[[2,47]])})))).apply(this,arguments)}function P(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function S(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function j(e){return O.apply(this,arguments)}function O(){return(O=c(d.mark((function e(n){var r,i,o,a,l,u,s,c,p,m,v,f,h,g,x,b;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,k(c);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,L(f,v);case 12:return h=e.sent,e.next=15,A(h);case 15:g=e.sent,u.thumbnails(g);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,B(c,n);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,A(x);case 26:b=e.sent,u.thumbnails(b);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{y as a,R as b,j as i};
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,p as n}from"./skin-88757661.js";import{P as r,b as i,d as o}from"./generic-259ac9ea.js";import{s as a}from"./autoNextVideo-d1f16fc3.js";import{e as l}from"./icons-8e47e640.js";import u from"@babel/runtime/helpers/typeof";import s from"video.js";import c from"@babel/runtime/helpers/asyncToGenerator";import d from"@babel/runtime/regenerator";import p from"@babel/runtime/helpers/defineProperty";import m from"@babel/runtime/helpers/slicedToArray";var v,f,h,g,x=[],b=!1,y=function(o,a){var u;if(b=!1,null!=a&&null!==(u=a.series)&&void 0!==u&&u.enable){var s;x=[];var c=i();null==c||c.map((function(t){var n;return(n=x).push.apply(n,e(t.episodes))})),null==a||null===(s=a.series)||void 0===s||s.cb}else{var d,p;x=(null==a||null===(d=a.relatedVideos)||void 0===d?void 0:d.content)||[],null==a||null===(p=a.relatedVideos)||void 0===p||p.cb}var m=t(o);m.on("timeupdate",(function(){var e,t;if(!b){var n=Math.floor(m.currentTime()),i=m.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-n<=10&&r()<=(null===(t=x)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}}));var v,f=x.filter((function(e,t){return t==r()}));if((null==f?void 0:f.length)>0)if(null!==(v=document.getElementsByClassName("next-ep-preview"))&&void 0!==v&&v[0]){var h,g,y,E,N,C,k,T,A,I,L,B;(null===(h=document.getElementsByClassName("next-ep-preview"))||void 0===h?void 0:h[0]).style.visibility="hidden";var M=null===(g=document.getElementsByClassName("next-ep-title"))||void 0===g?void 0:g[0],P=null===(y=document.getElementsByClassName("next-ep-img"))||void 0===y?void 0:y[0],S=null===(E=document.getElementsByClassName("next-ep-content"))||void 0===E?void 0:E[0],j=null===(N=f[0])||void 0===N?void 0:N.title;(null===(C=j)||void 0===C?void 0:C.length)>60&&(j=j.substr(0,60)+"..."),M.textContent="".concat(j),P.src=(null===(k=f[0])||void 0===k||null===(T=k.gist)||void 0===T||null===(A=T.imageGist)||void 0===A?void 0:A.r16x9)||(null==f||null===(I=f[0])||void 0===I?void 0:I.img)||(null===(L=window)||void 0===L||null===(B=L.customData)||void 0===B?void 0:B.fallbackImage),S.onclick=function(){return w(o)}}else{var O,R,X,$,D,F,U,G,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(o).append(V);var _=document.createElement("div");_.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var q=document.createElement("div");q.className="next-ep-close",q.onclick=function(){V.style.visibility="hidden",b=!0},q.appendChild(n(l())),_.append(W),_.append(q);var H=null===(O=f[0])||void 0===O?void 0:O.title,Y=document.createElement("img");Y.className="next-ep-img",Y.src=(null===(R=f[0])||void 0===R||null===(X=R.gist)||void 0===X||null===($=X.imageGist)||void 0===$?void 0:$.r16x9)||(null==f||null===(D=f[0])||void 0===D?void 0:D.img)||(null===(F=window)||void 0===F||null===(U=F.customData)||void 0===U?void 0:U.fallbackImage);var z=document.createElement("div");z.className="next-ep-title",(null===(G=H)||void 0===G?void 0:G.length)>60&&(H=H.substr(0,60)+"..."),z.textContent="".concat(H);var J=document.createElement("div");J.className="next-ep-content",J.append(Y),J.append(z),J.onclick=function(){return w(o)},V.append(_),V.append(J)}},w=function(e,n){var i=t(e),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(e);var l=r();a(l,e,x)}};function E(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function N(e){return C.apply(this,arguments)}function C(){return(C=c(d.mark((function e(t){return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),o=m(i,2),a=o[0],l=o[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var o=i.width/l,u=i.height/a,s=0;s<a;s++)for(var c=0;c<l;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)},n.onerror=function(n){var r,i,o,a;e([{duration:t.duration,uri:"".concat(null===(r=window)||void 0===r||null===(i=r.app_data)||void 0===i||null===(o=i.appcmsMain)||void 0===o||null===(a=o.images)||void 0===a?void 0:a.placeholderCover)}])}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return T.apply(this,arguments)}function T(){return(T=c(d.mark((function e(t){var n,r;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",E(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function A(e){return I.apply(this,arguments)}function I(){return(I=c(d.mark((function e(t){var n,r;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return N(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n,i=e.duration;r[i*t]={src:e.uri,style:(n={left:"-60px",height:"85px",width:"130px"},p(n,"left","-60px"),p(n,"border","1px solid transparent"),p(n,"borderRadius","4px"),n)}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}v={0:{src:"example-thumbnail.png"}},f=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===u(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},h=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},g=function e(t){return"HTML"!==t.nodeName&&"static"===h(t)("position")?e(t.offsetParent):t},s.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,a,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=f({},v,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",f(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",(function(e){a=i.duration()})),i.on("loadedmetadata",(function(e){a=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,x;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((x=g(o.el()).getBoundingClientRect()).width||x.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=g(o.el()).getBoundingClientRect().left+v,i=Math.floor((s-o.el().offsetLeft)/o.width()*a),n)i>l&&(u=Math.max(u,l));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&f(r.style,c.style),s+(m=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=h(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>p?s-=s+m-p:s<m&&(s=m),t.style.left=s+"px"},o.on("mousemove",l),o.on("touchmove",l),o.on("pointerdown",(function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)})),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var L=function(){var e=c(d.mark((function e(t,n){var r,i,o,a;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,o=i.split("\n"),a=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=m(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),a.push(r))})),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function B(e,t){return M.apply(this,arguments)}function M(){return(M=c(d.mark((function e(n,r){var i,a,l,u,s,c,p,v,f,h,g,x,b,y,w,E,N,C,k,T,A,I,L,B,M,j,O,R,X,$,D,F,U;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t(r),a=n.split("/").slice(0,n.split("/").indexOf("dash")+1).join("/")||n,e.prev=2,e.next=5,fetch(n);case 5:return c=e.sent,e.next=8,c.text();case 8:p=e.sent,v=new DOMParser,f=v.parseFromString(p,"application/xml"),h=(null==i?void 0:i.duration())||(null===(l=o())||void 0===l||null===(u=l.video)||void 0===u?void 0:u.runtime),g=(null==f||null===(s=f.querySelector("MPD > BaseURL"))||void 0===s?void 0:s.textContent)||a+"/",x=f.getElementsByTagName("AdaptationSet"),b=0;case 15:if(!(b<x.length)){e.next=43;break}if(("image"!==(y=x[b]).getAttribute("contentType")||"image/png"!==y.getAttribute("mimeType"))&&"image/jpeg"!==y.getAttribute("mimeType")){e.next=40;break}if(w=y.getElementsByTagName("SegmentTemplate")[0],E=y.getElementsByTagName("Representation")[0],N=E.getElementsByTagName("EssentialProperty")[0],C=N.getAttribute("value"),k=null==C?void 0:C.split("x"),T=m(k,2),A=T[0],I=T[1],!w){e.next=40;break}if(w.getAttribute("media"),L=w.getAttribute("duration"),B=w.getAttribute("timescale"),M=(B?L/B:L)/(A*I),j=E.getAttribute("id"),O=Math.round(h/M),R=Math.ceil(O/(A*I)),X=w.getAttribute("media"),$=parseInt(w.getAttribute("startNumber"))||0,!isNaN(parseInt(R))){e.next=36;break}return e.abrupt("return");case 36:for(D=[],F=P(X),b=0;b<R;b++)U=F?S(F,b+$):X,D.push({duration:M,layout:C,uri:g+U.replace("$Number$",b+$).replace("$RepresentationID$",j)});return e.abrupt("return",D);case 40:b++,e.next=15;break;case 43:return console.log("No trickplay segment found."),e.abrupt("return",null);case 47:e.prev=47,e.t0=e.catch(2),console.error("Error fetching or parsing MPD:",e.t0);case 50:case"end":return e.stop()}}),e,null,[[2,47]])})))).apply(this,arguments)}function P(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function S(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function j(e){return O.apply(this,arguments)}function O(){return(O=c(d.mark((function e(n){var r,i,o,a,l,u,s,c,p,m,v,f,h,g,x,b;return d.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=t(n),s=u.currentSource(),c=s.src,c=null!==(r=c)&&void 0!==r&&r.includes("blob")?null===(i=window)||void 0===i||null===(o=i.player)||void 0===o?void 0:o.getSource():c,null===(a=c)||void 0===a||!a.includes("m3u8")){e.next=19;break}return e.next=6,k(c);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,v=m.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,L(f,v);case 12:return h=e.sent,e.next=15,A(h);case 15:g=e.sent,u.thumbnails(g);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,B(c,n);case 22:if(!((null==(x=e.sent)?void 0:x.length)>0)){e.next=28;break}return e.next=26,A(x);case 26:b=e.sent,u.thumbnails(b);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",o.append(a),r.el().appendChild(o),r.on("useractive",(function(){o.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||o.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}}export{y as a,R as b,j as i};
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import{g as e,a as n,b as t,c as o,d as i,s as r,e as l,l as a,f as s,h as u,i as c,j as d,k as v,m as p,n as f,o as m,p as y,q as g,r as h,t as b,u as w,v as k,w as O,x as j,y as S,z as P,A as T,B as I,C as D,D as E,E as x,F as C,G as R,H as N,I as A,J as L,K as _,L as V,M as H,N as M,O as U}from"./generic-fa33fce3.js";import B from"@babel/runtime/helpers/defineProperty";import F from"@babel/runtime/helpers/asyncToGenerator";import z from"@babel/runtime/regenerator";import q from"video.js";import{o as G,g as K,a as J,s as W,b as X}from"./util-efa87ada.js";import{g as Y,d as Q,a as Z,e as $}from"./captions-2401a9bd.js";import{g as ee}from"./renditions-7d6c3151.js";import{playSelectedResolution as ne}from"./resolution-28e1d627.js";import{g as te,i as oe,a as ie}from"./skin-88757661.js";import{d as re}from"./browser-d4613b36.js";import{s as le}from"./localisation-0bf399a1.js";import ae from"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var se=function(e){return new Promise((function(n,t){if(ue(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},ue=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ce=function(e,n,t){var o=te(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},de=function(e){var n=te(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ve=function(){var e=F(z.mark((function e(n){var t,o,i,r,l;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=te(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return r=e.sent,e.prev=5,e.next=8,se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,r.default(q),e.finish(13);case 16:(l=q.getTech("chromecast"))&&!l.prototype.seeking&&(l.prototype.seeking=function(){}),null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==re()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),pe=function(e,n){var t=te(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=q.dom.getPointerPosition(a,n).x;q.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var fe=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),se("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){q.getPlugin("eme")||q.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ye=function(){var e=F(z.mark((function e(){var n;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(q),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),ge=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs_contrib_dash-5ee2e52c.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),be=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(q)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(q)}))},loadAdsLibrary:fe,loadEMELibrary:me,loadMuxPlugin:ye,loadDvrSeekbar:ge,loadContribDash:he});function we(e){return ke.apply(this,arguments)}function ke(){return(ke=F(z.mark((function e(n){var t;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,fe();case 3:t&&"Safari"==re()&&Promise.resolve().then((function(){return be})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(e,n){return je.apply(this,arguments)}function je(){return(je=F(z.mark((function e(n,t){var o,i,r,l,a,s,u,c,d;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(null==t?void 0:t.contentType)||"video",u=null==t||null===(o=t[s])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[s])||void 0===i||null===(r=i.liveDetails)||void 0===r||r.isDvrEnabled,null==n||n.showPositiveSeekbar,c=(null==t||null===(l=t.video)||void 0===l?void 0:l.isSSAIEnabled)||!1,"Chrome"==re()&&(c||null===(a=["dirtvision"])||void 0===a||a.includes(null==t?void 0:t.siteName)),e.prev=6,e.next=9,Promise.allSettled([u?"Safari"==re()?me():"caliente"!=(null===(d=window)||void 0===d?void 0:d.siteName)?he():me():null,ve(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function Se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Te=new Set,Ie=null,De=function(n,o,i){var r,l,a,s,u,c,d,v={},p=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(r=n[p])||void 0===r?void 0:r.id)||"Null",v["c3.cm.contentType"]=Le(n),v[null==i||null===(l=i.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),v[null==i||null===(a=i.Constants)||void 0===a?void 0:a.STREAM_URL]=o.currentSrc(),v[null==i||null===(s=i.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e()?"NULL":e(),v["c3.cm.categoryType"]=Re(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=n[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=n[p])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[i.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=Ne(n),v["c3.cm.genreList"]=xe(n),v["c3.cm.genre"]=Ee(n),v["c3.cm.channel"]=Ce(n);var f=Ve(t(),n);return v=Pe(Pe({},v),f)},Ee=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},xe=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},Ce=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Re=function(e){return(null==e?void 0:e.contentType)||"null"},Ne=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Ae=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},Le=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var _e,Ve=function(e,t){var i,r,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!t||null!=t&&t.linearchannel)return u;var c=o(),d=n();return u["c3.cm.seriesName"]=(null==t||null===(i=t.video)||void 0===i||null===(r=i.series)||void 0===r?void 0:r.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},He=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Me=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ue=function(){var e=F(z.mark((function e(n,t){var o,r,l,a,s,u,c,d,v,p;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},r=o.trackConvivaPlayerEvent,l=o.paymentHandler,a=o.tveProvider,s=o.enable,u=o.appName,c=(t||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=te(n),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready((function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=He(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),d.on("loadstart",(function(){var e,n;Ie&&Ie!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Te.clear(),Ie=d.currentSrc();var o=Me(d.currentType()),r=i(),s=De(r,d,p);s[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",s[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=Ae(r,t),s.authToken=c||"NULL",s.streamType=o,s.D2CType=l||"NONE",s.subscriberType=a||(l?"D2C":"FREE"),s["c3.cm.affiliate"]=a||"NULL",v("contentInfo",s)})),d.on("loadedmetadata",(function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),d.on("play",(function(){Te.has(d.currentSrc())||(Te.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){Te.has(d.currentSrc())&&Te.delete(d.currentSrc()),v("playbackEnded")})),d.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})})),d.on("dispose",(function(){null==Te||Te.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Be=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-e9236e41.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-c7d3d63c.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-14b53128.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-ffa11317.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-085732f0.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-1ffee2bb.js").then((function(t){t.initialiseSkin(e,n)}))};function Fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fe(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qe=[],Ge=0,Ke=null;function Je(e,n,t){var o,i,l,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,d=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),y=u?100:Math.floor(d/v*100),g={};f?Xe(g={completed:u,watchedTime:m,watchedPercentage:y},c,n.siteOwner):(g=ze(ze({videoId:_e,watchedTime:m,watchedPercentage:y,doneWatching:u,profileId:c},Ke&&{seriesId:Ke}),p&&{originalObjectId:p}),r(g).then((function(e){})).catch((function(e){}))),Ge=d+t}function We(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Xe(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),r=We(o),l=(new Date).getTime(),a=i(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ze(ze({},e),{},B({},n,s[n]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===_e}));c<0?r.push(ze(ze({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=ze(ze(ze({},r[c]),e),{},{updateDate:l}),localStorage.setItem("".concat(o),JSON.stringify(r))}function Ye(e,n,t){var o=We(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var Qe=!1,Ze=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!Qe){var r=$e(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),Qe=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function $e(e,n,t){if(Array.isArray(e))return e.map((function(e){return $e(e,n,t)}));if(null!==e&&"object"===ae(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=$e(e[i],n,t)})),o}return e}function en(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function nn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?en(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):en(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var tn=function(e,n,t,o){var r,l,a,v,p=o.res,f=o.sres,m=te(e),y=(null==p?void 0:p.contentType)||"video",g=(null==p||null===(r=p[y])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1,h=(null==p||null===(a=p[y])||void 0===a||null===(v=a.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;s(p),m&&(m.on("loadstart",(function(){g?t.resolve({status:!0,msg:"Video Loaded",response:p}):t.resolve(nn({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))})),m.on("loadeddata",(function(){var t,o,r,l=Y(e);if(null==l||l.map((function(n){return Q(e,n.id)})),h&&"Safari"===re())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&ce(e,sessionStorage.getItem("volume")||"100");var s=i();if(u(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var c,d,v=nn(nn({},n),p);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(Ke=null==n||null===(i=n.series)||void 0===i?void 0:i.id),qe=[],Ge=0,_e=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=te(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());qe.includes(Ge)||(e==Ge?(qe.push(e),Je(a,n,l)):e>Ge&&(Ge=e+l))})),a.one("ended",(function(){Je(a,n,l,!0)})))}(e,v,null==s||null===(c=s.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(r=n.analytics)&&void 0!==r&&r.muxKey&&null!=m&&m.mux){var f,y,g,b,w,k,O=(null===(f=i())||void 0===f?void 0:f.video)||(null==p?void 0:p.video),j=null==O?void 0:O.gist,S={env_key:null==n||null===(y=n.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==j?void 0:j.id,video_title:null==j?void 0:j.title,video_series:null==O||null===(b=O.series)||void 0===b?void 0:b.title,video_stream_type:null!=O&&null!==(w=O.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};m.mux({debug:!1,data:S})}})),m.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){g&&Ze(p,e)})),m.on("error",(function(){var n,o;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&g)?Ze(p,e):(c(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(o=m.error())||void 0===o?void 0:o.message)||"Some error occured",response:p}))})),m.one("play",(function(){var e;if(null!=n&&null!==(e=n.series)&&void 0!==e&&e.enable){var t,o,r,l=null===(t=i())||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id,a=d(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){m.currentTime(u)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(g){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})))};function on(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function rn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?on(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ln=function(e,n,t,o){var i,r,s,u,d,y,g,h,b,w,k,O,j,S,P,T,I,D,E,x,C,R,N,A,L,_,V,H,M,U,G,K,J=n.res,W=void 0===J?null:J,X=n.sres,Y=void 0===X?null:X,Q=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],$=(null===(i=W)||void 0===i?void 0:i.contentType)||"video",ee=oe(null===(r=W)||void 0===r||null===(s=r[$])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||oe(null===(d=W)||void 0===d||null===(y=d[$])||void 0===y||null===(g=y.gist)||void 0===g||null===(h=g.imageGist)||void 0===h?void 0:h.r16x9),ne=(null===(b=W)||void 0===b||null===(w=b[$])||void 0===w||null===(k=w.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,ie=(null===(O=W)||void 0===O||null===(j=O[$])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,le=(null===(P=W)||void 0===P||null===(T=P.ads)||void 0===T||null===(I=T.preRoll)||void 0===I||null===(D=I.adTags)||void 0===D||null===(E=D.web)||void 0===E?void 0:E.active)&&(null===(x=W)||void 0===x||null===(C=x.ads)||void 0===C||null===(R=C.preRoll)||void 0===R||null===(N=R.adTags)||void 0===N||null===(A=N.web)||void 0===A?void 0:A.url),ae=(null===(L=W=rn(rn({},W),{},{audioAssetSource:null==t?void 0:t.audioAssetSource}))||void 0===L||null===(_=L.video)||void 0===_?void 0:_.isSSAIEnabled)||!1;"Chrome"==re()&&(ae||null===(V=["dirtvision"])||void 0===V||V.includes(null===(H=W)||void 0===H?void 0:H.siteName));var se=(null==t?void 0:t.latency)||6,ue=(K={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:ne},B(K,"autoplay",null==t?void 0:t.autoplay),B(K,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!le),B(K,"loop",(null==t?void 0:t.loop)||!1),B(K,"audioPosterMode",null==t?void 0:t.audioPosterMode),B(K,"html5",rn(rn({dash:rn(rn({},!q.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:se},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{useDefaultABRRules:!0,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:rn(rn({liveRangeSafeTimeDelta:se,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==t||null===(M=t.customData)||void 0===M?void 0:M.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),nativeTextTracks:"Safari"==re()},0==(null==t||null===(U=t.customData)||void 0===U?void 0:U.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(G=t.customData)||void 0===G?void 0:G.nativeVideoTracks)&&{nativeVideoTracks:!1})),B(K,"poster",ee),B(K,"techOrder",Q),B(K,"chromecast",{requestCustomDataFn:function(n){var t=te(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,y,g,h,b,w,k,O;f.isDrmEnabled=!0;var j=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==j?void 0:j.url)||(null==n||null===(y=n.keySystemOptions)||void 0===y||null===(g=y[0])||void 0===g||null===(h=g.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=S;var P=(null==j?void 0:j.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(O=k.httpRequestHeaders)||void 0===O?void 0:O["X-AxDRM-Message"]);f.licenseToken=P}var T=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=T;var I=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=I;var D=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=D;var E=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(W,n,o)}}),K);if(!q.getPlayers()[e])var ce=q(e,ue,function(){var n=F(z.mark((function n(){var i,r,s,u,d,y,g,h,b,w,k,O,j,S,P,T,I,D,E,x;return z.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ce),console.log(q.VERSION),console.log(q.getPlugins()),n.next=5,Oe(t,W);case 5:O=null===(i=W)||void 0===i||null===(r=i[$])||void 0===r||null===(s=r.liveDetails)||void 0===s?void 0:s.startOverTime,ie&&o.resolve(rn({status:!0,msg:"Player Initialised"},Y?{seriesResponse:Y,response:W}:{response:W})),v(e,null==t?void 0:t.analyticsCb),Ue(e,t),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),ne&&pe(e,O),!le||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||p(e,le,W),j=l(W,e),console.log(j),null!=t&&t.nearestClusterUrl&&(j=f(j,t.nearestClusterUrl)),j?a(e,j):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:W}),c(e,"Incompatible / Missing Source")),((null===(d=W)||void 0===d||null===(y=d[$])||void 0===y||null===(g=y.contentDetails)||void 0===g||null===(h=g.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(b=W)||void 0===b||null===(w=b[$])||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0)&&(x=(null===(P=W)||void 0===P||null===(T=P[$])||void 0===T||null===(I=T.contentDetails)||void 0===I?void 0:I.closedCaptions)||(null===(D=W)||void 0===D||null===(E=D[$])||void 0===E?void 0:E.closedCaptions),S=x.filter((function(e){return"VTT"===e.format})),Z(e,S)),null!=t&&t.disableControls?m(e):Be(e,rn(rn(rn({},t),ue),{},{liveVideo:ie,isDvrEnabled:ne,res:W,sres:Y})),tn(e,rn(rn(rn({},t),ue),{},{liveVideo:ie}),o,{res:W,sres:Y});case 19:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())},an={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function un(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sn(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var cn,dn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=vn(e);ln(i,{res:r},e,{resolve:t,reject:o})},vn=function(e){var n,t,o=null==e?void 0:e.streamingInfo,i=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,r=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,l=null==e?void 0:e.token,a=y(l),s=null==a?void 0:a.site;return un(un({id:null==an?void 0:an[s]},!r&&{directPlaybackUrl:null==i?void 0:i.url}),{},{video:{drmEnabled:r,streamingInfo:{videoAssets:{widevine:null==i?void 0:i.widevine,fairPlay:null==i?void 0:i.fairPlay,playReady:null==i?void 0:i.playReady}},liveDetails:{isDvrEnabled:null==o?void 0:o.isDvrEnabled}}})};function pn(e,n){return fn.apply(this,arguments)}function fn(){return(fn=F(z.mark((function e(n,t){var o,i,r,l,a,u;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,r=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,w();case 6:u=e.sent,g(r,u).then((function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,s(null==e?void 0:e.data);var p,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,b=Ye((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=b[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",ln(l,{res:f},n,{resolve:o,reject:i})}else h(r,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){ln(l,{res:f},n,{resolve:o,reject:i})}));else ln(l,{res:f},n,{resolve:o,reject:i})})).catch((function(e){b(e,l,i,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mn(e,n){return yn.apply(this,arguments)}function yn(){return(yn=F(z.mark((function e(n,t){var o,i,r,l,a;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,w();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,k(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,ln(l,{res:t},n,{resolve:o,reject:i})})).catch((function(e){b(e,l,i,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gn(e,n){return hn.apply(this,arguments)}function hn(){return(hn=F(z.mark((function e(n,t){var o,i,r,l,a,u,c;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,r=t.reject,e.next=3,w();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,S.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,O(c,l).then((function(e){var t,o,u,d=e.data,v=e.data.seasons;P(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);j(c,l),g(p,l).then((function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,s(e.data),ln(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:r})})).catch((function(e){b(e,a,r,videoId)}))})).catch((function(e){b(e,a,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bn(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function kn(){return{loadVideoInstantly:T,onTimeUpdate:G,getVideoDuration:K,onVideoEnded:J,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=F(z.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,y,h,w,k,O,j,S,P,T,I,D;return z.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!C(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(f=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,y=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,h=null==e?void 0:e.videoId,w=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,k=(null==e?void 0:e.streamingInfo)||!1,window.videoId=h,O=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",O),H().set(null==e?void 0:e.refreshToken),O&&!M(O)){n.next=16;break}return o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}}),n.abrupt("return");case 16:cn=JSON.parse(atob(O.split(".")[1]));case 17:return e.isAnonymousUser=!(null===(l=cn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=cn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=cn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=cn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,j=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,S=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(P=null==e?void 0:e.errors)&&(window.customErrors=P),window.customData=null==e?void 0:e.customData,le(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),_.set(e.apiBaseUrl),null!=e&&e.skin&&!ie(e.skin)||(e.skin="VL_ONE"),n.next=33,we(e);case 33:S&&se("https://www.googletagmanager.com/gtag/js?id=".concat(S)).then((function(){return U(S)})).catch((function(e){})),(T=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(j)))&&T.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(D={directPlaybackUrl:f,id:I="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?g(I,O).then((function(n){var i=(null==n?void 0:n.data)||{};ln(j,{res:wn(wn({},i),D)},e,{resolve:t,reject:o})})).catch((function(e){b(e,j,o,I)})):ln(j,{res:D},e,{resolve:t,reject:o})):k?dn(e,{resolve:t,reject:o}):w?gn(e,{resolve:t,reject:o}):y?mn(e,{resolve:t,reject:o}):pn(e,{resolve:t,reject:o});case 37:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ee,skip:I,getPlayer:te,play:D,pause:E,detectBrowser:re,rewind:x,loadVideo:a,seekToTimeStamp:W,isPlayerInitialised:C,load:R,authenticateLC:N,dispose:A,enableCaptions:$,disableCaptions:Q,getCaptions:Y,playSelectedResolution:ne,getSource:l,setVolume:ce,getVolume:de,disableControls:m,setPlaybackSpeed:X,getEntitlementData:L}}export{kn as default};
|
|
1
|
+
import"video.js/dist/video-js.min.css";import{g as e,a as n,b as t,c as o,d as i,s as r,e as l,l as a,f as s,h as u,i as c,j as d,k as v,m as p,n as f,o as m,p as y,q as g,r as h,t as b,u as w,v as k,w as O,x as j,y as S,z as P,A as T,B as I,C as D,D as E,E as x,F as C,G as R,H as N,I as A,J as L,K as _,L as V,M as H,N as M,O as U}from"./generic-259ac9ea.js";import B from"@babel/runtime/helpers/defineProperty";import F from"@babel/runtime/helpers/asyncToGenerator";import z from"@babel/runtime/regenerator";import q from"video.js";import{o as G,g as K,a as J,s as W,b as X}from"./util-efa87ada.js";import{g as Y,d as Q,a as Z,e as $}from"./captions-2401a9bd.js";import{g as ee}from"./renditions-7d6c3151.js";import{playSelectedResolution as ne}from"./resolution-0afa0b07.js";import{g as te,i as oe,a as ie}from"./skin-88757661.js";import{d as re}from"./browser-c9dfe92f.js";import{s as le}from"./localisation-0bf399a1.js";import ae from"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var se=function(e){return new Promise((function(n,t){if(ue(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},ue=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ce=function(e,n,t){var o=te(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},de=function(e){var n=te(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ve=function(){var e=F(z.mark((function e(n){var t,o,i,r,l;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=te(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return r=e.sent,e.prev=5,e.next=8,se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,r.default(q),e.finish(13);case 16:(l=q.getTech("chromecast"))&&!l.prototype.seeking&&(l.prototype.seeking=function(){}),null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==re()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),pe=function(e,n){var t=te(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=q.dom.getPointerPosition(a,n).x;q.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var fe=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),se("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){q.getPlugin("eme")||q.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ye=function(){var e=F(z.mark((function e(){var n;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(q),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),ge=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=F(z.mark((function e(){return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs_contrib_dash-5ee2e52c.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),be=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(q)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(q)}))},loadAdsLibrary:fe,loadEMELibrary:me,loadMuxPlugin:ye,loadDvrSeekbar:ge,loadContribDash:he});function we(e){return ke.apply(this,arguments)}function ke(){return(ke=F(z.mark((function e(n){var t;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,fe();case 3:t&&"Safari"==re()&&Promise.resolve().then((function(){return be})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(e,n){return je.apply(this,arguments)}function je(){return(je=F(z.mark((function e(n,t){var o,i,r,l,a,s,u,c,d;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(null==t?void 0:t.contentType)||"video",u=null==t||null===(o=t[s])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[s])||void 0===i||null===(r=i.liveDetails)||void 0===r||r.isDvrEnabled,null==n||n.showPositiveSeekbar,c=(null==t||null===(l=t.video)||void 0===l?void 0:l.isSSAIEnabled)||!1,"Chrome"==re()&&(c||null===(a=["dirtvision"])||void 0===a||a.includes(null==t?void 0:t.siteName)),e.prev=6,e.next=9,Promise.allSettled([u?"Safari"==re()?me():"caliente"!=(null===(d=window)||void 0===d?void 0:d.siteName)?he():me():null,ve(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function Se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Te=new Set,Ie=null,De=function(n,o,i){var r,l,a,s,u,c,d,v={},p=(null==n?void 0:n.contentType)||"video";v["c3.cm.id"]=(null===(r=n[p])||void 0===r?void 0:r.id)||"Null",v["c3.cm.contentType"]=Le(n),v[null==i||null===(l=i.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),v[null==i||null===(a=i.Constants)||void 0===a?void 0:a.STREAM_URL]=o.currentSrc(),v[null==i||null===(s=i.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===e()?"NULL":e(),v["c3.cm.categoryType"]=Re(n),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=n[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=n[p])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[i.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=Ne(n),v["c3.cm.genreList"]=xe(n),v["c3.cm.genre"]=Ee(n),v["c3.cm.channel"]=Ce(n);var f=Ve(t(),n);return v=Pe(Pe({},v),f)},Ee=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},xe=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},Ce=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Re=function(e){return(null==e?void 0:e.contentType)||"null"},Ne=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Ae=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},Le=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var _e,Ve=function(e,t){var i,r,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!t||null!=t&&t.linearchannel)return u;var c=o(),d=n();return u["c3.cm.seriesName"]=(null==t||null===(i=t.video)||void 0===i||null===(r=i.series)||void 0===r?void 0:r.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},He=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Me=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ue=function(){var e=F(z.mark((function e(n,t){var o,r,l,a,s,u,c,d,v,p;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},r=o.trackConvivaPlayerEvent,l=o.paymentHandler,a=o.tveProvider,s=o.enable,u=o.appName,c=(t||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=te(n),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready((function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=He(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),d.on("loadstart",(function(){var e,n;Ie&&Ie!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Te.clear(),Ie=d.currentSrc();var o=Me(d.currentType()),r=i(),s=De(r,d,p);s[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",s[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=Ae(r,t),s.authToken=c||"NULL",s.streamType=o,s.D2CType=l||"NONE",s.subscriberType=a||(l?"D2C":"FREE"),s["c3.cm.affiliate"]=a||"NULL",v("contentInfo",s)})),d.on("loadedmetadata",(function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),d.on("play",(function(){Te.has(d.currentSrc())||(Te.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){Te.has(d.currentSrc())&&Te.delete(d.currentSrc()),v("playbackEnded")})),d.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})})),d.on("dispose",(function(){null==Te||Te.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Be=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-8bccac9a.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-9e72e406.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-6b1812b7.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-3e654e7e.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-99d39278.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-51c067af.js").then((function(t){t.initialiseSkin(e,n)}))};function Fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fe(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qe=[],Ge=0,Ke=null;function Je(e,n,t){var o,i,l,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,d=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),y=u?100:Math.floor(d/v*100),g={};f?Xe(g={completed:u,watchedTime:m,watchedPercentage:y},c,n.siteOwner):(g=ze(ze({videoId:_e,watchedTime:m,watchedPercentage:y,doneWatching:u,profileId:c},Ke&&{seriesId:Ke}),p&&{originalObjectId:p}),r(g).then((function(e){})).catch((function(e){}))),Ge=d+t}function We(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Xe(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),r=We(o),l=(new Date).getTime(),a=i(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ze(ze({},e),{},B({},n,s[n]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===_e}));c<0?r.push(ze(ze({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=ze(ze(ze({},r[c]),e),{},{updateDate:l}),localStorage.setItem("".concat(o),JSON.stringify(r))}function Ye(e,n,t){var o=We(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var Qe=!1,Ze=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!Qe){var r=$e(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),Qe=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function $e(e,n,t){if(Array.isArray(e))return e.map((function(e){return $e(e,n,t)}));if(null!==e&&"object"===ae(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=$e(e[i],n,t)})),o}return e}function en(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function nn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?en(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):en(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var tn=function(e,n,t,o){var r,l,a,v,p=o.res,f=o.sres,m=te(e),y=(null==p?void 0:p.contentType)||"video",g=(null==p||null===(r=p[y])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1,h=(null==p||null===(a=p[y])||void 0===a||null===(v=a.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;s(p),m&&(m.on("loadstart",(function(){g?t.resolve({status:!0,msg:"Video Loaded",response:p}):t.resolve(nn({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))})),m.on("loadeddata",(function(){var t,o,r,l=Y(e);if(null==l||l.map((function(n){return Q(e,n.id)})),h&&"Safari"===re())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&ce(e,sessionStorage.getItem("volume")||"100");var s=i();if(u(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(o=n.watchHistory)&&void 0!==o&&o.saveOffline)){var c,d,v=nn(nn({},n),p);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(Ke=null==n||null===(i=n.series)||void 0===i?void 0:i.id),qe=[],Ge=0,_e=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=te(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());qe.includes(Ge)||(e==Ge?(qe.push(e),Je(a,n,l)):e>Ge&&(Ge=e+l))})),a.one("ended",(function(){Je(a,n,l,!0)})))}(e,v,null==s||null===(c=s.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(r=n.analytics)&&void 0!==r&&r.muxKey&&null!=m&&m.mux){var f,y,g,b,w,k,O=(null===(f=i())||void 0===f?void 0:f.video)||(null==p?void 0:p.video),j=null==O?void 0:O.gist,S={env_key:null==n||null===(y=n.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(g=window)||void 0===g?void 0:g.vl_player_version,video_id:null==j?void 0:j.id,video_title:null==j?void 0:j.title,video_series:null==O||null===(b=O.series)||void 0===b?void 0:b.title,video_stream_type:null!=O&&null!==(w=O.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};m.mux({debug:!1,data:S})}})),m.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){g&&Ze(p,e)})),m.on("error",(function(){var n,o;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&g)?Ze(p,e):(c(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(o=m.error())||void 0===o?void 0:o.message)||"Some error occured",response:p}))})),m.one("play",(function(){var e;if(null!=n&&null!==(e=n.series)&&void 0!==e&&e.enable){var t,o,r,l=null===(t=i())||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id,a=d(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){m.currentTime(u)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(g){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})))};function on(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function rn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?on(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ln=function(e,n,t,o){var i,r,s,u,d,y,g,h,b,w,k,O,j,S,P,T,I,D,E,x,C,R,N,A,L,_,V,H,M,U,G,K,J=n.res,W=void 0===J?null:J,X=n.sres,Y=void 0===X?null:X,Q=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],$=(null===(i=W)||void 0===i?void 0:i.contentType)||"video",ee=oe(null===(r=W)||void 0===r||null===(s=r[$])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||oe(null===(d=W)||void 0===d||null===(y=d[$])||void 0===y||null===(g=y.gist)||void 0===g||null===(h=g.imageGist)||void 0===h?void 0:h.r16x9),ne=(null===(b=W)||void 0===b||null===(w=b[$])||void 0===w||null===(k=w.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,ie=(null===(O=W)||void 0===O||null===(j=O[$])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,le=(null===(P=W)||void 0===P||null===(T=P.ads)||void 0===T||null===(I=T.preRoll)||void 0===I||null===(D=I.adTags)||void 0===D||null===(E=D.web)||void 0===E?void 0:E.active)&&(null===(x=W)||void 0===x||null===(C=x.ads)||void 0===C||null===(R=C.preRoll)||void 0===R||null===(N=R.adTags)||void 0===N||null===(A=N.web)||void 0===A?void 0:A.url),ae=(null===(L=W=rn(rn({},W),{},{audioAssetSource:null==t?void 0:t.audioAssetSource}))||void 0===L||null===(_=L.video)||void 0===_?void 0:_.isSSAIEnabled)||!1;"Chrome"==re()&&(ae||null===(V=["dirtvision"])||void 0===V||V.includes(null===(H=W)||void 0===H?void 0:H.siteName));var se=(null==t?void 0:t.latency)||6,ue=(K={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:ne},B(K,"autoplay",null==t?void 0:t.autoplay),B(K,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!le),B(K,"loop",(null==t?void 0:t.loop)||!1),B(K,"audioPosterMode",null==t?void 0:t.audioPosterMode),B(K,"html5",rn(rn({dash:rn(rn({},!q.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:se},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{useDefaultABRRules:!0,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:rn(rn({liveRangeSafeTimeDelta:se,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==t||null===(M=t.customData)||void 0===M?void 0:M.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),nativeTextTracks:"Safari"==re()},0==(null==t||null===(U=t.customData)||void 0===U?void 0:U.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(G=t.customData)||void 0===G?void 0:G.nativeVideoTracks)&&{nativeVideoTracks:!1})),B(K,"poster",ee),B(K,"techOrder",Q),B(K,"chromecast",{requestCustomDataFn:function(n){var t=te(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,y,g,h,b,w,k,O;f.isDrmEnabled=!0;var j=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==j?void 0:j.url)||(null==n||null===(y=n.keySystemOptions)||void 0===y||null===(g=y[0])||void 0===g||null===(h=g.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=S;var P=(null==j?void 0:j.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(O=k.httpRequestHeaders)||void 0===O?void 0:O["X-AxDRM-Message"]);f.licenseToken=P}var T=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=T;var I=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=I;var D=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=D;var E=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(W,n,o)}}),K);if(!q.getPlayers()[e])var ce=q(e,ue,function(){var n=F(z.mark((function n(){var i,r,s,u,d,y,g,h,b,w,k,O,j,S,P,T,I,D,E,x;return z.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ce),console.log(q.VERSION),console.log(q.getPlugins()),n.next=5,Oe(t,W);case 5:O=null===(i=W)||void 0===i||null===(r=i[$])||void 0===r||null===(s=r.liveDetails)||void 0===s?void 0:s.startOverTime,ie&&o.resolve(rn({status:!0,msg:"Player Initialised"},Y?{seriesResponse:Y,response:W}:{response:W})),v(e,null==t?void 0:t.analyticsCb),Ue(e,t),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),ne&&pe(e,O),!le||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||p(e,le,W),j=l(W,e),console.log(j),null!=t&&t.nearestClusterUrl&&(j=f(j,t.nearestClusterUrl)),j?a(e,j):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:W}),c(e,"Incompatible / Missing Source")),((null===(d=W)||void 0===d||null===(y=d[$])||void 0===y||null===(g=y.contentDetails)||void 0===g||null===(h=g.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(b=W)||void 0===b||null===(w=b[$])||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0)&&(x=(null===(P=W)||void 0===P||null===(T=P[$])||void 0===T||null===(I=T.contentDetails)||void 0===I?void 0:I.closedCaptions)||(null===(D=W)||void 0===D||null===(E=D[$])||void 0===E?void 0:E.closedCaptions),S=x.filter((function(e){return"VTT"===e.format})),Z(e,S)),null!=t&&t.disableControls?m(e):Be(e,rn(rn(rn({},t),ue),{},{liveVideo:ie,isDvrEnabled:ne,res:W,sres:Y})),tn(e,rn(rn(rn({},t),ue),{},{liveVideo:ie}),o,{res:W,sres:Y});case 19:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())},an={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function un(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sn(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var cn,dn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=vn(e);ln(i,{res:r},e,{resolve:t,reject:o})},vn=function(e){var n,t,o=null==e?void 0:e.streamingInfo,i=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,r=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,l=null==e?void 0:e.token,a=y(l),s=null==a?void 0:a.site;return un(un({id:null==an?void 0:an[s]},!r&&{directPlaybackUrl:null==i?void 0:i.url}),{},{video:{drmEnabled:r,streamingInfo:{videoAssets:{widevine:null==i?void 0:i.widevine,fairPlay:null==i?void 0:i.fairPlay,playReady:null==i?void 0:i.playReady}},liveDetails:{isDvrEnabled:null==o?void 0:o.isDvrEnabled}}})};function pn(e,n){return fn.apply(this,arguments)}function fn(){return(fn=F(z.mark((function e(n,t){var o,i,r,l,a,u;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,r=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,w();case 6:u=e.sent,g(r,u).then((function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,s(null==e?void 0:e.data);var p,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,b=Ye((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=b[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",ln(l,{res:f},n,{resolve:o,reject:i})}else h(r,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){ln(l,{res:f},n,{resolve:o,reject:i})}));else ln(l,{res:f},n,{resolve:o,reject:i})})).catch((function(e){b(e,l,i,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mn(e,n){return yn.apply(this,arguments)}function yn(){return(yn=F(z.mark((function e(n,t){var o,i,r,l,a;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,w();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,k(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,ln(l,{res:t},n,{resolve:o,reject:i})})).catch((function(e){b(e,l,i,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gn(e,n){return hn.apply(this,arguments)}function hn(){return(hn=F(z.mark((function e(n,t){var o,i,r,l,a,u,c;return z.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,r=t.reject,e.next=3,w();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,S.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,O(c,l).then((function(e){var t,o,u,d=e.data,v=e.data.seasons;P(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);j(c,l),g(p,l).then((function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,s(e.data),ln(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:r})})).catch((function(e){b(e,a,r,videoId)}))})).catch((function(e){b(e,a,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bn(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function kn(){return{loadVideoInstantly:T,onTimeUpdate:G,getVideoDuration:K,onVideoEnded:J,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=F(z.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,y,h,w,k,O,j,S,P,T,I,D;return z.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!C(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(f=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,y=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,h=null==e?void 0:e.videoId,w=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,k=(null==e?void 0:e.streamingInfo)||!1,window.videoId=h,O=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",O),H().set(null==e?void 0:e.refreshToken),O&&!M(O)){n.next=16;break}return o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}}),n.abrupt("return");case 16:cn=JSON.parse(atob(O.split(".")[1]));case 17:return e.isAnonymousUser=!(null===(l=cn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=cn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=cn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=cn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,j=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,S=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(P=null==e?void 0:e.errors)&&(window.customErrors=P),window.customData=null==e?void 0:e.customData,le(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),_.set(e.apiBaseUrl),null!=e&&e.skin&&!ie(e.skin)||(e.skin="VL_ONE"),n.next=33,we(e);case 33:S&&se("https://www.googletagmanager.com/gtag/js?id=".concat(S)).then((function(){return U(S)})).catch((function(e){})),(T=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(j)))&&T.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(D={directPlaybackUrl:f,id:I="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?g(I,O).then((function(n){var i=(null==n?void 0:n.data)||{};ln(j,{res:wn(wn({},i),D)},e,{resolve:t,reject:o})})).catch((function(e){b(e,j,o,I)})):ln(j,{res:D},e,{resolve:t,reject:o})):k?dn(e,{resolve:t,reject:o}):w?gn(e,{resolve:t,reject:o}):y?mn(e,{resolve:t,reject:o}):pn(e,{resolve:t,reject:o});case 37:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:ee,skip:I,getPlayer:te,play:D,pause:E,detectBrowser:re,rewind:x,loadVideo:a,seekToTimeStamp:W,isPlayerInitialised:C,load:R,authenticateLC:N,dispose:A,enableCaptions:$,disableCaptions:Q,getCaptions:Y,playSelectedResolution:ne,getSource:l,setVolume:ce,getVolume:de,disableControls:m,setPlaybackSpeed:X,getEntitlementData:L}}export{kn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,E as l}from"./generic-
|
|
1
|
+
import{B as e,E as l}from"./generic-259ac9ea.js";import{g as n}from"./skin-88757661.js";function a(a,r){var i,t,c,u=n(a),s=null==u||null===(i=u.controlBar)||void 0===i||null===(t=i.playToggle)||void 0===t?void 0:t.el_,d=document.getElementsByTagName("video")[0];null===(c=document)||void 0===c||c.addEventListener("keydown",(function(n){var i;if(o.enabled&&"input"!=n.target.localName){var t=n.key,c=!0===r.liveVideo||!0===r.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(t)&&(n.preventDefault(),null==d||d.focus()),t){case" ":null==s||s.click();break;case"m":case"M":u.muted(!u.muted());break;case"f":case"F":null===(i=document.querySelector(".vjs-fullscreen-control"))||void 0===i||i.click();break;case"ArrowLeft":c&&!1===r.liveui||l(a,10);break;case"ArrowRight":c||e(a,10)}}}),!0)}var r,o=(r=!0,{enable:function(){r=!0},disable:function(){r=!1},get enabled(){return r}});export{a as i,o as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{h as s,e as i,i as l}from"./icons-8e47e640.js";import{G as c,C as m}from"./generic-
|
|
1
|
+
import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import n from"video.js";import{h as s,e as i,i as l}from"./icons-8e47e640.js";import{G as c,C as m}from"./generic-259ac9ea.js";import{e as d,s as p,j as u}from"./skin-88757661.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./browser-c9dfe92f.js";import"js-cookie";import"ua-parser-js";import"./captions-2401a9bd.js";import"@babel/runtime/helpers/toConsumableArray";function v(e){var t=h();return function(){var a,n=o(e);if(t){var s=o(this).constructor;a=Reflect.construct(n,arguments,s)}else a=n.apply(this,arguments);return r(this,a)}}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=n.getComponent("Component"),y=function(r){a(h,f);var o=v(h);function h(t){var a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,h),(a=o.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.streams=r.streams,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a}return t(h,[{key:"createEl",value:function(){var e=n.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=n.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return n.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-b7cec0cf.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),a=n.dom.createEl("div",{className:"stream-container hidden"});n.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=a.classList)&&void 0!==r&&r.contains("hidden")?(d(),a.classList.remove("hidden"),t.classList.add("open"),p(e.playerId,a)):(a.classList.add("hidden"),t.classList.remove("open"))};var r=document.getElementById(this.playerId);if(r){var o=window.getComputedStyle(r,null).getPropertyValue("height").slice(0,-2);a.style.height="".concat(o,"px"),r.style.overflow="hidden",n.dom.appendContent(t,a),this.addFunctionality(a)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),r=n.dom.createEl("div",{className:"stream-selector-head"}),o=n.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(i())});o.onclick=function(){e.classList.add("hidden"),a.classList.remove("open")};for(var s=n.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=n.dom.createEl("div",{className:"stream-selector-content"}),p=n.dom.createEl("div",{className:"stream-tray"}),v=function(e){var a,r,o,s=n.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(l())});0==e&&(s.classList.add("selected"),s.style.border="2px solid #D2393B"),s.onclick=function(){for(var a=n.dom.$$(".stream"),r=0;r<a.length;r++)a[r].style.border="none",a[r].classList.remove("selected");s.classList.add("selected"),s.style.border="2px solid #D2393B",c(t.playerId,t.streams[e].id).then((function(e){m(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},s.style.backgroundImage="url(".concat(t.streams[e].img,")");var i=document.createElement("img");i.className="stream-thumbnail-image",i.src="".concat((null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img)||(null===(r=window)||void 0===r||null===(o=r.customData)||void 0===o?void 0:o.fallbackImage)),s.append(i),n.dom.appendContent(p,s),n.dom.appendContent(d,p)},h=0;h<this.streams.length;h++)v(h);n.dom.appendContent(r,o),n.dom.appendContent(r,s),n.dom.appendContent(e,r),n.dom.appendContent(e,d),u(this.playerId,e)}}]),h}();export{y as default};
|