@viewlift/player-backup 2.0.118-backup → 2.0.119-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-5fd08f6b.js → autoNextVideo-30f8c89c.js} +1 -1
- package/cjs/bundle.css +32 -32
- package/cjs/{features-dfab79d7.js → features-e3fdf1e7.js} +1 -1
- package/cjs/{generic-090f20e4.js → generic-bfd81e0e.js} +1 -1
- package/cjs/{index-a2c88360.js → index-a5c150cc.js} +1 -1
- package/cjs/{index-c5bb1c0f.js → index-c6124c2a.js} +1 -1
- package/cjs/index-de801167.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-f64e8e6e.js → multicamv2-6f471fb0.js} +1 -1
- package/cjs/{multicamv2-9b16e7b4.js → multicamv2-83af7dc3.js} +1 -1
- package/cjs/{nextEpisodeButton-174ce343.js → nextEpisodeButton-f7d4f8e9.js} +1 -1
- package/cjs/playlist-a6555cdd.js +1 -0
- package/cjs/{series-d787a3c5.js → series-72eca3c2.js} +1 -1
- package/cjs/series-v2-4d51cc69.js +1 -0
- package/cjs/series-v2-add2a53f.js +1 -0
- package/cjs/skin-12adbfdb.js +1 -0
- package/cjs/{skin-6da45dd8.js → skin-19f5ee87.js} +1 -1
- package/cjs/{skin-00cff21e.js → skin-4849e82b.js} +1 -1
- package/cjs/{skin-fb780f09.js → skin-5b2feda8.js} +1 -1
- package/cjs/{skin-4cf0f454.js → skin-e6d5161d.js} +1 -1
- package/cjs/{skin-17344da4.js → skin-ec8cb4ba.js} +1 -1
- package/cjs/{start-begin-btn-b8828163.js → start-begin-btn-d17055ca.js} +1 -1
- package/cjs/util-a3ed1133.js +1 -0
- package/cjs/videoSelector-7599aaf6.js +1 -0
- package/cjs/videoSelector-8834cfd9.js +1 -0
- package/cjs/{videojs-dash5.es-0c89add5.js → videojs-dash5.es-ced4b564.js} +1 -1
- package/esm/{autoNextVideo-cfe8aa87.js → autoNextVideo-068e496c.js} +1 -1
- package/esm/bundle.css +32 -32
- package/esm/core/util.d.ts +1 -0
- package/esm/{features-15befb53.js → features-96af00c0.js} +1 -1
- package/esm/{generic-63e4557c.js → generic-dd89c778.js} +1 -1
- package/esm/{index-0e07d7c1.js → index-8bf8b43f.js} +1 -1
- package/esm/index-a012aae4.js +1 -0
- package/esm/{index-6884c042.js → index-b8fa8e61.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-879ad44b.js → multicamv2-7fe85e6a.js} +1 -1
- package/esm/{multicamv2-c67371c1.js → multicamv2-8e508c51.js} +1 -1
- package/esm/{nextEpisodeButton-68eb0785.js → nextEpisodeButton-591509b7.js} +1 -1
- package/esm/playlist-4c796e1f.js +1 -0
- package/esm/{series-016bb1c9.js → series-d46535b8.js} +1 -1
- package/esm/series-v2-730cd221.js +1 -0
- package/esm/series-v2-cb05c6df.js +1 -0
- package/esm/{skin-01b0e1a5.js → skin-5ff2a543.js} +1 -1
- package/esm/{skin-c169e7d8.js → skin-70cec92b.js} +1 -1
- package/esm/skin-8dbcb656.js +1 -0
- package/esm/{skin-a31850f0.js → skin-a9816629.js} +1 -1
- package/esm/{skin-160448cf.js → skin-f2e99bd5.js} +1 -1
- package/esm/{skin-072e0b5c.js → skin-fa5461e2.js} +1 -1
- package/esm/{start-begin-btn-798fe08c.js → start-begin-btn-ff036cfe.js} +1 -1
- package/esm/util-28923483.js +1 -0
- package/esm/videoSelector-48609307.js +1 -0
- package/esm/videoSelector-da42dc2c.js +1 -0
- package/esm/{videojs-dash5.es-6c1ba1fe.js → videojs-dash5.es-2dcf13b7.js} +1 -1
- package/package.json +1 -1
- package/cjs/index-36a39813.js +0 -1
- package/cjs/playlist-975d63e2.js +0 -1
- package/cjs/series-v2-90b35eef.js +0 -1
- package/cjs/series-v2-dc89938a.js +0 -1
- package/cjs/skin-3874c0d0.js +0 -1
- package/cjs/util-db87d399.js +0 -1
- package/cjs/videoSelector-9c7be217.js +0 -1
- package/cjs/videoSelector-9eb3d659.js +0 -1
- package/esm/index-2068da20.js +0 -1
- package/esm/playlist-26e445f5.js +0 -1
- package/esm/series-v2-0d2dd639.js +0 -1
- package/esm/series-v2-6b9fe00e.js +0 -1
- package/esm/skin-43ce728e.js +0 -1
- package/esm/util-9649ae40.js +0 -1
- package/esm/videoSelector-b4b6876d.js +0 -1
- package/esm/videoSelector-bb89e286.js +0 -1
- /package/esm/components/{dvr-overlay → dvr-startover}/index.d.ts +0 -0
- /package/esm/components/{dvr-overlay → dvr-startover}/start-begin-btn.d.ts +0 -0
- /package/esm/components/{dvr-overlay → dvr-startover}/watch-live-btn.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as n,j as t,T as i,S as o,U as a}from"./generic-
|
|
1
|
+
import{I as n,j as t,T as i,S as o,U as a}from"./generic-dd89c778.js";import{a as e}from"./util-28923483.js";import{h as c}from"./skin-16f83185.js";import{g as s}from"./player_instance-34118a5b.js";var r,u=0,f=0,l=function(l){clearTimeout(u);var h=null==l?void 0:l.content;r=null==l?void 0:l.cb;var v=l.playerId;e(v,function(){var e=s(v);0!==(null==e?void 0:e.currentTime())&&((f=o())>h.length-1||(a(f+1),n(v,h[f].id).then(function(n){c(f,v),t(n.response),f++,p(n)}).catch(function(n){p(n),c(f,v),f++,u=setTimeout(function(){i(v)&&m(f,v,h)},5e3)})))})},m=function t(i,o,e,s){f=i,i>e.length-1||(a(f+1),n(o,e[i].id).then(function(n){c(f,o),f++,p(n)}).catch(function(n){p(n),setTimeout(function(){c(f,o),f++,t(f,o,e)},5e3)}))},p=function(n){r&&r(n)};export{l as a,m as s};
|
package/esm/bundle.css
CHANGED
|
@@ -548,38 +548,6 @@
|
|
|
548
548
|
margin-left: 8px;
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
/* a wrapper element that tracks the mouse vertically */
|
|
552
|
-
.vjs-thumbnail-holder {
|
|
553
|
-
position: absolute;
|
|
554
|
-
left: -1000px;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
/* the thumbnail image itself */
|
|
558
|
-
.vjs-thumbnail {
|
|
559
|
-
position: absolute;
|
|
560
|
-
left: 0;
|
|
561
|
-
bottom: 1.3em;
|
|
562
|
-
opacity: 0;
|
|
563
|
-
transition: opacity .2s ease;
|
|
564
|
-
-webkit-transition: opacity .2s ease;
|
|
565
|
-
-moz-transition: opacity .2s ease;
|
|
566
|
-
-mz-transition: opacity .2s ease;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
/* fade in the thumbnail when hovering over the progress bar */
|
|
570
|
-
/* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
|
|
571
|
-
.vjs-progress-control:hover .vjs-thumbnail,
|
|
572
|
-
.vjs-progress-control.fake-active .vjs-thumbnail,
|
|
573
|
-
.vjs-progress-control:active .vjs-thumbnail {
|
|
574
|
-
opacity: 1;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
/* ... but hide the thumbnail when hovering directly over it */
|
|
578
|
-
.vjs-progress-control:hover .vjs-thumbnail:hover,
|
|
579
|
-
.vjs-progress-control:active .vjs-thumbnail:active {
|
|
580
|
-
opacity: 0;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
551
|
.vjs-marker {
|
|
584
552
|
position: absolute;
|
|
585
553
|
left: 0;
|
|
@@ -630,6 +598,38 @@
|
|
|
630
598
|
text-align: center;
|
|
631
599
|
}
|
|
632
600
|
|
|
601
|
+
/* a wrapper element that tracks the mouse vertically */
|
|
602
|
+
.vjs-thumbnail-holder {
|
|
603
|
+
position: absolute;
|
|
604
|
+
left: -1000px;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/* the thumbnail image itself */
|
|
608
|
+
.vjs-thumbnail {
|
|
609
|
+
position: absolute;
|
|
610
|
+
left: 0;
|
|
611
|
+
bottom: 1.3em;
|
|
612
|
+
opacity: 0;
|
|
613
|
+
transition: opacity .2s ease;
|
|
614
|
+
-webkit-transition: opacity .2s ease;
|
|
615
|
+
-moz-transition: opacity .2s ease;
|
|
616
|
+
-mz-transition: opacity .2s ease;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/* fade in the thumbnail when hovering over the progress bar */
|
|
620
|
+
/* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
|
|
621
|
+
.vjs-progress-control:hover .vjs-thumbnail,
|
|
622
|
+
.vjs-progress-control.fake-active .vjs-thumbnail,
|
|
623
|
+
.vjs-progress-control:active .vjs-thumbnail {
|
|
624
|
+
opacity: 1;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/* ... but hide the thumbnail when hovering directly over it */
|
|
628
|
+
.vjs-progress-control:hover .vjs-thumbnail:hover,
|
|
629
|
+
.vjs-progress-control:active .vjs-thumbnail:active {
|
|
630
|
+
opacity: 0;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
633
|
.video-js.vjs-quality-menu {
|
|
634
634
|
display: block;
|
|
635
635
|
}
|
package/esm/core/util.d.ts
CHANGED
|
@@ -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{r as a,m 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{r as a,m as s}from"./generic-dd89c778.js";import{g as c}from"./resolution-62be852a.js";import{p as d}from"./skin-16f83185.js";import{g as u}from"./localisation-0bf399a1.js";import{g as m}from"./player_instance-34118a5b.js";function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}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=u("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=d(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=d(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-v2-6446fe47.js").then(function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=m(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-591509b7.js").then(function(r){var o=r.default,l=m(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-d46535b8.js").then(function(r){var o=r.seriesModule,l=m(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-48609307.js").then(function(n){var r=n.default,o=m(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-c9b18ef8.js").then(function(n){var r,o,l,a,s=n.default,c=m(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)})},w=function(e,t){import("./settings-icon-e8ed293a.js").then(function(n){var r,o,l,a,s=n.default,c=m(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)})},I=function(e,t){import("./playlist-4c796e1f.js").then(function(n){var r=n.default,o=m(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},E=function(e,t){import("./series-v2-cb05c6df.js").then(function(n){var r=n.default,o=m(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},O=function(e,t){import("./multicamv2-8e508c51.js").then(function(n){var r=n.default,o=m(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=m(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=m(e).el(),n=0,r=m(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-da42dc2c.js").then(function(n){var r=n.default,o=m(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},_=function(e,t){import("./series-v2-730cd221.js").then(function(n){var r=n.default,o=m(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},x=function(e,t){import("./multicamv2-7fe85e6a.js").then(function(n){var r=n.default,o=m(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},N=function(e,t){import("./start-begin-btn-ff036cfe.js").then(function(n){var r=n.default,o=m(e);i.registerComponent("startFromBeginingButton",r);var l=o.getChild("controlBar").addChild("startFromBeginingButton",h({playerId:e},t),o.controlBar.children().findIndex(function(e){return"PlayToggle"===e.name_}));o.startFromBeginningButton=l})},T=function(e,t){import("./watch-live-btn-d4d27011.js").then(function(n){var r=n.default,o=m(e);i.registerComponent("watchLiveButton",r);var l=o.getChild("controlBar").addChild("watchLiveButton",h({playerId:e},t),o.controlBar.children().findIndex(function(e){return"PlayToggle"===e.name_})+1);o.watchLiveButton=l})};export{B as a,j as b,b as c,y as d,C as e,w as f,S as g,M as h,g as i,L as j,x as k,I as l,_ as m,P as n,k as o,E as p,O as q,N as r,T as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r}from"./player_instance-34118a5b.js";import l from"js-cookie";import{UAParser as a}from"ua-parser-js";import{a as u,r as d}from"./captions-b619441b.js";import{c as s}from"./skin-16f83185.js";function c(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function v(e){window.dataLayer=window.dataLayer||[],c("js",new Date),c("config",e)}function m(e,n){c("event",e,n)}var p={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 f(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 I(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?f(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var E={name:"@viewlift/player",version:"2.0.54",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",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 g,T=function(e,n){var t,o,r,l,a,u,d,s;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(u=a.customData)&&void 0!==u&&u.overrideEntitlementBaseUrl?(null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":O.get()+"".concat(null==p?void 0:p.getVideoDetails),params:I({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":E.version},withCredentials:!0})},h=function(e,n){var t,o,r,l;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:O.get()+p.getLinearChannelDetails,params:I(I(I(I(I({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===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},y=function(e,n){var t,o,r=B(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):i({url:O.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},w=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return o=e.sent,e.abrupt("return",i({url:O.get()+"".concat(null==p?void 0:p.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:I({},n),params:I({},(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)}}(),_=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:O.get()+"".concat(null==p?void 0:p.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},b=function(e){var n=e.videoId;return i({method:"GET",url:O.get()+"".concat(null==p?void 0:p.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},O=(g=null==p?void 0:p.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),D=function(e,n,t,o){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},S=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},P=null;function L(){return{set:function(e){e&&(P=e)},get:function(){return P}}}var R,V,W,F,C,A,N=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=L().get(),o=O.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),U=null,j=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"))||!S(n)){e.next=6;break}return U||(U=N().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&L().set(r),i||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,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},B=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},M=function(e){V=e},x=function(){return V},H=function(e){R=e},G=function(){return R},Y=function(){return W},z=function(e){W=e},q=function(){return C},X=function(e){F=new Map,e.map(function(e,n){F.set(e.id,n)})},J=function(e){if(F){var n=F.get(e);z(n+1)}},K=(A=0,{set:function(e){e>=0&&(A=e)},get:function(){return A}});function Q(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 Z(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Q(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $=function(){var e,n,t,o,i,r,l,a=x();return"linearchannel"===((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.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==a?void 0:a.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==a||null===(i=a.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function ne(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function te(){return oe.apply(this,arguments)}function oe(){return(oe=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ie(e){return e?String(e):""}var re=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function le(e,o){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&function(e,o){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=ee(),u="WEBSITE",d=null,s=0,c=null,v=0,f=0,I=!1,E=[],g=r(e);if(g){var T,h,y,w,_=re(function(){for(var e=g.currentTime(),n=g.buffered(),t=0;t<n.length;t++){var o=n.start(t),i=n.end(t);if(e>=o&&e<=i)return Math.round(i-e)}return 0}),b=function(){var e=n(t.mark(function e(n){var o,r,d,s,c,v,m,f,I,E,g;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return I=e.sent,E=B(I),e.t0=Z,e.t1=Z,e.t2=null==E?void 0:E.site,e.t3=null==E?void 0:E.siteId,e.t4=u,e.t5=ne(),e.t6=$(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11="production",e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?ie(n.adPosition):"",e.next=25,te();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=a,e.t23=null!==(r=n.ttFirstFrame)&&void 0!==r?r:null,e.t24=null!==(d=n.bitrate)&&void 0!==d?d:null,e.t25=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t26=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t27=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==l||null===(m=l.beacon)||void 0===m?void 0:m.params,e.t32=(0,e.t0)(e.t30,e.t31),g=[e.t32],i({url:(null==l||null===(f=l.beacon)||void 0===f?void 0:f.url)||O.get()+p.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:g}).catch(function(e){return console.error(e)});case 41:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=function(e){if(!g.paused()&&g.readyState()>2)return clearInterval(d),clearInterval(c),e;var n,t=e+.1;return+t.toFixed(2)>=5&&f<4&&I?(f++,m("BUFFERING",Z({pfm:u,uid:ne(),vid:$(),videoPosition:Math.floor(g.currentTime)},null==l||null===(n=l.beacon)||void 0===n?void 0:n.params)),b({eventName:"BUFFERING",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),0):t};T=Math.floor(g.currentTime),g.on("error",function(){var e,n=Math.floor(g.currentTime);clearInterval(d);var t=T===n?"FAILED_TO_START":"DROPPED_STREAM";m(t,Z({pfm:u,uid:ne(),vid:$(),videoPosition:n},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:t,videoPosition:n,isAdEvent:!1})}),h=!1,g.on("waiting",re(function(){I&&(h=!0,clearInterval(d),d=setInterval(function(){h&&!g.paused()?v=D(v):clearInterval(d)},100))})),g.on("playing",re(function(){h=!1,clearInterval(d)})),y=function(e){var n,t,o,i=Z({videoPosition:Math.floor(g.currentTime),isAdEvent:!0,bufferHealth:_(),pfm:u,uid:ne(),vid:$(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==l||null===(o=l.beacon)||void 0===o?void 0:o.params);m(e,Z({},i)),b(Z({eventName:e,adPosition:1},i))},g.on("adstart",function(){y("AD_REQUEST"),y("AD_IMPRESSION")}),g.on("adskip",function(){s=0}),g.on("adend",function(){s=0}),g.on("timeupdate",function(){var e,n,t,o,i=Math.floor(g.currentTime());if(console.log(i,E),i>=30&&i%30==0&&!E.includes(i)){var r,l=null===(r=g.el().getElementsByTagName("video"))||void 0===r?void 0:r[0];f=0,E.push(i),b({eventName:"PING",videoPosition:i,isAdEvent:!1,duration:30,resHeight:(null==l?void 0:l.videoHeight)||null,resWidth:(null==l?void 0:l.videoWidth)||null,bufferHealth:_(),bitrate:Math.round((null==g||null===(e=g.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)})}}),w=re(function(){var e;s=0,c=setInterval(function(){s=D(s)},100),m("PLAY",Z({pfm:u,uid:ne(),vid:$(),videoPosition:Math.floor(g.currentTime)},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:"PLAY",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":$(),watchTime:Math.floor(g.currentTime)})}),g.one("play",w),g.on("loadeddata",function(){g.one("timeupdate",function(){var e;clearInterval(c),clearInterval(d),v=s||0,m("FIRST_FRAME",Z({pfm:u,uid:ne(),vid:$(),videoPosition:Math.floor(g.currentTime),ttFirstFrame:s,bufferHealth:_()},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:"FIRST_FRAME",videoPosition:Math.floor(g.currentTime),isAdEvent:!1,ttFirstFrame:s,bufferHealth:_()}),I=!0,s=0})})}else console.error("Videojs: Player instance not found.")}(e,o,l)}var ae=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},ue=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},de=function(e,n){var t=new Map;b({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),C=t}).catch(function(e){return console.log(e)})},se=function(){var e=K.get();return e>=0?e+1:1},ce=function(){var e,n,t,o=G(),i=x(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=K.get(),a=null==o||null===(n=o[l])||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 a>=0?a+1:1};function ve(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 me(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ve(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}window._deviceInfo=a(navigator.userAgent);var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},fe=function(e){var n=Ie(e,"video.tags",[]),t=Ie(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ie=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},Ee=function(){var n,t,o,i,a,u,d,s,c,v,m,p,f,I,E,g,T,h,y,w,_,b,O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",D=arguments.length>1?arguments[1]:void 0,S=arguments.length>2?arguments[2]:void 0,P=(null==S?void 0:S.siteName)||"",L=(null==S?void 0:S.contentType)||"video",R=(null==S||null===(n=S[L])||void 0===n?void 0:n.metadata)||(null==S||null===(t=S[L])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.metadata),V=r(D);if(!O.includes("VIEWLIFT_"))return O;var W,F=window.getComputedStyle(document.getElementById(D),null),C=Math.trunc(F.getPropertyValue("height").slice(0,-2)),A=Math.trunc(F.getPropertyValue("width").slice(0,-2)),N="linearchannel"===L?null==S||null===(i=S.linearchannel)||void 0===i||null===(a=i.channels)||void 0===a||null===(u=a.find(function(e){return(null==e?void 0:e.id)===(null==S?void 0:S.channelId)}))||void 0===u||null===(d=u.content)||void 0===d?void 0:d.id:Ie(S,"video.gist.id",""),U="linearchannel"===L?null==S||null===(s=S.linearchannel)||void 0===s||null===(c=s.channels)||void 0===c||null===(v=c.find(function(e){return(null==e?void 0:e.id)===(null==S?void 0:S.channelId)}))||void 0===v?void 0:v.title:Ie(S,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),j=null,k=null;"function"==typeof window.__gpp&&(null===(W=window)||void 0===W||W.__gpp("ping",function(e){j=null==e?void 0:e.gppString,k=null==e?void 0:e.sectionList[0]}));var B=me(me({},ge(R)),{},(w={VIEWLIFT_WIDTH:A,VIEWLIFT_HEIGHT:C,VIEWLIFT_SIZE:pe(A,C),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===(m=window)||void 0===m?void 0:m.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ie(S,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ie(S,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ie(S,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==V||null===(p=V.options_)||void 0===p?void 0:p.autoplay)||1,VIEWLIFT_MUTE:(null==V||null===(f=V.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==P||"usanetwork"==P?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:fe(S),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ie(S,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ie(S,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ie(null===(I=window)||void 0===I||null===(E=I.app_data)||void 0===E||null===(g=E.site)||void 0===g?void 0:g.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==P||"usanetwork"==P?"":Ie(null===(T=window)||void 0===T||null===(h=T.app_data)||void 0===h||null===(y=h.site)||void 0===y?void 0:y.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Ie(S,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ie(S,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:Ie(S,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ie(S,"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:fe(S),VIEWLIFT_GPP_SID:k||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:j||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(w,"VIEWLIFT_LAT",""),e(w,"VIEWLIFT_APP_BUNDLE",""),e(w,"VIEWLIFT_ATT_CONSENT",""),w),null===(_=window)||void 0===_||null===(b=_.customData)||void 0===b?void 0:b.macros);for(var M in B){var x=new RegExp(M,"g");O=O.replace(x,B[M])}return O},ge=function(e){var n,t,o,i,r,l,a={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){u.set(e.name,e.value)}));var d=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return d||s?(ue()?d?a=me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):d?a=me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),d?a=me(me({},a),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),a=ue()?me(me({},a),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(a=me(me({},a),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),a=ue()?me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),a=me(me({},a),{},{VIEWLIFT_AFID:u.get("afid")})},Te=function(e,n){var t,o,i,r,l,a,u,d,s,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[f])||void 0===t?void 0:t.drmEnabled,E=null==e||null===(o=e[f])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,g=null==e||null===(r=e[f])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(a=e[f])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(d=u.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(s=e[f])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var h=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=g&&g.hls)return ye(g);if(I){var y=we(E,n);return y.src=Ee(y.src,n,e),y}if("Safari"!==ae()&&h)return he(E);if(T){var w=ye(E);return w.src=Ee(w.src,n,e),w}if(null!=E&&E.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(E);return _.src=Ee(_.src,n,e),_}return null},he=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},ye=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},we=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,u=ae();if(r(n),"Safari"===u){var d=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return _e(n),d}var s,c={src:l.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:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0: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"==ae()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},be=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Oe=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},De=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Se=!1,Pe=function(e,n,t){var o=Ee(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima)return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(e);if(null!==l.el_){Se=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),Se&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var u=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&u.hasAttribute("controls")&&u.removeAttribute("controls");var d="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,d="touchend"),l.one(d,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};function Le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var Re=function(e){o(e).play()},Ve=function(e){o(e).pause()},We=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Fe=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Ce=function(e){return!!o.getPlayer("".concat(e))},Ae=function(e){return o(e).paused()},Ne=function(){var e=n(t.mark(function e(n,o){var i,l,a,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>2&&void 0!==u[2]&&u[2],e.next=3,j();case 3:return l=e.sent,a=r(n),e.abrupt("return",new Promise(function(e,t){h(o,l).then(function(t){var r=null==t?void 0:t.data;window.sid=ee(),r.contentType="linearchannel",r.channelId=null==o?void 0:o.channelId;var l=Te(r,n);M(r),l&&i?(Me(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})})):e({status:!0,msg:"Feed authenticated",response:r})}).catch(function(e){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)}}(),Ue=function(){var e=n(t.mark(function e(n,o,i){var l,a,s,c,v,m;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return c=e.sent,(G()||null)&&J(o),v=0,m=0,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(a=window)&&void 0!==a&&null!==(s=a.watchHistory)&&void 0!==s&&s.enable&&_(o,c).then(function(e){var n,t,o,i,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),v=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,m=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}),e.abrupt("return",new Promise(function(e,t){T(o,c).then(function(o){var i,l,a,s,c,p,f,I,E,g,T=null==o?void 0:o.data,h=(null==T||null===(i=T.video)||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;M(o.data);var y=(null==T||null===(a=T.ads)||void 0===a||null===(s=a.preRoll)||void 0===s||null===(c=s.adTags)||void 0===c||null===(p=c.web)||void 0===p?void 0:p.active)&&(null==T||null===(f=T.ads)||void 0===f||null===(I=f.preRoll)||void 0===I||null===(E=I.adTags)||void 0===E||null===(g=E.web)||void 0===g?void 0:g.url);y&&Pe(n,y,T);var w=Te(T,n);if(w){var _,b,O,D,S,P,L,R,V,W,F,C,A,N,U=(null==T||null===(_=T.video)||void 0===_||null===(b=_.gist)||void 0===b?void 0:b.videoImageUrl)||(null==T||null===(O=T.video)||void 0===O||null===(D=O.gist)||void 0===D||null===(S=D.imageGist)||void 0===S?void 0:S.r16x9),j=r(n);if(j.poster(U),Me(n,w),j.on("loadstart",function(){h&&e({status:!0,msg:"Video Loaded",response:T})}),j.on("loadeddata",function(){De(),e({status:!0,msg:"Video Loaded",response:T})}),j.one("play",function(){v&&m<95&&setTimeout(function(){j.currentTime(v)},0)}),j.one("error",function(){var e;t({status:!1,msg:(null==j||null===(e=j.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==T||null===(P=T.video)||void 0===P||null===(L=P.contentDetails)||void 0===L||null===(R=L.closedCaptions)||void 0===R?void 0:R.length)>0||(null==T||null===(V=T.video)||void 0===V||null===(W=V.closedCaptions)||void 0===W?void 0:W.length)>0)F=((null==T||null===(C=T.video)||void 0===C||null===(A=C.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null==T||null===(N=T.video)||void 0===N?void 0:N.closedCaptions)).filter(function(e){return"VTT"===e.format}),u(n,F);else d(n)}else Oe(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,o)})}));case 9:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),je=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},ke=function(e){var n=r(e);if(Be(),s(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Be=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()},Me=function(e,n){var t=r(e);t&&t.src(n)},xe=function(n,t,o,i){var r,l,a,u,d,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.errorMessage)||(null==n?void 0:n.message);Ce(t)&&Oe(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Le(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},He=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{y as A,de as B,K as C,H as D,je as E,Re as F,Ve as G,Ce as H,Ue as I,Ne as J,ke as K,D as L,O as M,k as N,L as O,S as P,v as Q,ue as R,Y as S,Ae as T,z as U,b as V,X as W,J as X,ce as a,G as b,se as c,ae as d,x as e,Te as f,ne as g,De as h,Oe as i,M as j,q as k,Me as l,We as m,Ee as n,He as o,le as p,Pe as q,Fe as r,w as s,be as t,B as u,T as v,_ as w,xe as x,j as y,h as z};
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r}from"./player_instance-34118a5b.js";import l from"js-cookie";import{UAParser as a}from"ua-parser-js";import{a as u,r as d}from"./captions-b619441b.js";import{c as s}from"./skin-16f83185.js";function c(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function v(e){window.dataLayer=window.dataLayer||[],c("js",new Date),c("config",e)}function m(e,n){c("event",e,n)}var p={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 f(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 I(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?f(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var E={name:"@viewlift/player",version:"2.0.55",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",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 g,T=function(e,n){var t,o,r,l,a,u,d,s;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(u=a.customData)&&void 0!==u&&u.overrideEntitlementBaseUrl?(null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":O.get()+"".concat(null==p?void 0:p.getVideoDetails),params:I({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":E.version},withCredentials:!0})},y=function(e,n){var t,o,r,l;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:O.get()+p.getLinearChannelDetails,params:I(I(I(I(I({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===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},h=function(e,n){var t,o,r=B(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):i({url:O.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},w=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return o=e.sent,e.abrupt("return",i({url:O.get()+"".concat(null==p?void 0:p.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:I({},n),params:I({},(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)}}(),_=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:O.get()+"".concat(null==p?void 0:p.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},b=function(e){var n=e.videoId;return i({method:"GET",url:O.get()+"".concat(null==p?void 0:p.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},O=(g=null==p?void 0:p.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),D=function(e,n,t,o){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n},withCredentials:!0})},S=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},L=null;function P(){return{set:function(e){e&&(L=e)},get:function(){return L}}}var R,V,W,F,C,A,N=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=P().get(),o=O.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),U=null,j=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"))||!S(n)){e.next=6;break}return U||(U=N().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&P().set(r),i||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,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},B=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},M=function(e){V=e},x=function(){return V},H=function(e){R=e},G=function(){return R},Y=function(){return W},z=function(e){W=e},q=function(){return C},X=function(e){F=new Map,e.map(function(e,n){F.set(e.id,n)})},J=function(e){if(F){var n=F.get(e);z(n+1)}},K=(A=0,{set:function(e){e>=0&&(A=e)},get:function(){return A}});function Q(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 Z(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Q(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var $=function(){var e,n,t,o,i,r,l,a=x();return"linearchannel"===((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.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==a?void 0:a.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==a||null===(i=a.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function ne(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function te(){return oe.apply(this,arguments)}function oe(){return(oe=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:if(!(n=e.sent)){e.next=6;break}return o=JSON.parse(atob(n.split(".")[1])),e.abrupt("return",null!=o&&o.anonymousId?"guest-user":null==o?void 0:o.userId);case 6:return e.abrupt("return","guest-user");case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ie(e){return e?String(e):""}var re=function(e){return function(){try{return e.apply(void 0,arguments)}catch(e){return console.error(e),null}}};function le(e,o){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&function(e,o){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=ee(),u="WEBSITE",d=null,s=0,c=null,v=0,f=0,I=!1,E=[],g=r(e);if(g){var T,y,h,w,_=re(function(){for(var e=g.currentTime(),n=g.buffered(),t=0;t<n.length;t++){var o=n.start(t),i=n.end(t);if(e>=o&&e<=i)return Math.round(i-e)}return 0}),b=function(){var e=n(t.mark(function e(n){var o,r,d,s,c,v,m,f,I,E,g;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return I=e.sent,E=B(I),e.t0=Z,e.t1=Z,e.t2=null==E?void 0:E.site,e.t3=null==E?void 0:E.siteId,e.t4=u,e.t5=ne(),e.t6=$(),e.t7=n.url||document.location.href,e.t8=n.ref||document.referrer,e.t9=n.eventName,e.t10=null!==(o=n.videoPosition)&&void 0!==o?o:null,e.t11="production",e.t12=n.dp1||"",e.t13=n.dp2||"",e.t14=n.dp3||"",e.t15=n.dp4||"",e.t16=n.dp5||"",e.t17=n.isAdEvent?n.videoPosition:null,e.t18=n.isAdEvent?ie(n.adPosition):"",e.next=25,te();case 25:e.t19=e.sent,e.t20=n.playerType||"videojs",e.t21=n.mediaType||"VIDEO",e.t22=a,e.t23=null!==(r=n.ttFirstFrame)&&void 0!==r?r:null,e.t24=null!==(d=n.bitrate)&&void 0!==d?d:null,e.t25=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t26=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t27=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t28={aid:e.t2,cid:e.t3,pfm:e.t4,uid:e.t5,vid:e.t6,url:e.t7,ref:e.t8,pa:e.t9,vpos:e.t10,environment:e.t11,dp1:e.t12,dp2:e.t13,dp3:e.t14,dp4:e.t15,dp5:e.t16,apos:e.t17,apod:e.t18,profid:e.t19,player:e.t20,media_type:e.t21,stream_id:e.t22,embedurl:"",ttfirstframe:e.t23,bitrate:e.t24,connectionspeed:null,resolutionheight:e.t25,resolutionwidth:e.t26,bufferhealth:e.t27},e.t29=(null==n?void 0:n.duration)&&{duration:n.duration},e.t30=(0,e.t1)(e.t28,e.t29),e.t31=null==l||null===(m=l.beacon)||void 0===m?void 0:m.params,e.t32=(0,e.t0)(e.t30,e.t31),g=[e.t32],i({url:(null==l||null===(f=l.beacon)||void 0===f?void 0:f.url)||O.get()+p.getBeaconUrl,method:"post",headers:{Authorization:I},contentType:"application/x-www-form-urlencoded",dataType:"text",data:g}).catch(function(e){return console.error(e)});case 41:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),D=function(e){if(!g.paused()&&g.readyState()>2)return clearInterval(d),clearInterval(c),e;var n,t=e+.1;return+t.toFixed(2)>=5&&f<4&&I?(f++,m("BUFFERING",Z({pfm:u,uid:ne(),vid:$(),videoPosition:Math.floor(g.currentTime)},null==l||null===(n=l.beacon)||void 0===n?void 0:n.params)),b({eventName:"BUFFERING",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),0):t};T=Math.floor(g.currentTime),g.on("error",function(){var e,n=Math.floor(g.currentTime);clearInterval(d);var t=T===n?"FAILED_TO_START":"DROPPED_STREAM";m(t,Z({pfm:u,uid:ne(),vid:$(),videoPosition:n},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:t,videoPosition:n,isAdEvent:!1})}),y=!1,g.on("waiting",re(function(){I&&(y=!0,clearInterval(d),d=setInterval(function(){y&&!g.paused()?v=D(v):clearInterval(d)},100))})),g.on("playing",re(function(){y=!1,clearInterval(d)})),h=function(e){var n,t,o,i=Z({videoPosition:Math.floor(g.currentTime),isAdEvent:!0,bufferHealth:_(),pfm:u,uid:ne(),vid:$(),resHeight:(null===(n=videoElement)||void 0===n?void 0:n.videoHeight)||null,resWidth:(null===(t=videoElement)||void 0===t?void 0:t.videoWidth)||null},null==l||null===(o=l.beacon)||void 0===o?void 0:o.params);m(e,Z({},i)),b(Z({eventName:e,adPosition:1},i))},g.on("adstart",function(){h("AD_REQUEST"),h("AD_IMPRESSION")}),g.on("adskip",function(){s=0}),g.on("adend",function(){s=0}),g.on("timeupdate",function(){var e,n,t,o,i=Math.floor(g.currentTime());if(console.log(i,E),i>=30&&i%30==0&&!E.includes(i)){var r,l=null===(r=g.el().getElementsByTagName("video"))||void 0===r?void 0:r[0];f=0,E.push(i),b({eventName:"PING",videoPosition:i,isAdEvent:!1,duration:30,resHeight:(null==l?void 0:l.videoHeight)||null,resWidth:(null==l?void 0:l.videoWidth)||null,bufferHealth:_(),bitrate:Math.round((null==g||null===(e=g.tech_)||void 0===e||null===(n=e.vhs)||void 0===n||null===(t=n.selectPlaylist())||void 0===t||null===(o=t.attributes)||void 0===o?void 0:o.BANDWIDTH)/1e3)})}}),w=re(function(){var e;s=0,c=setInterval(function(){s=D(s)},100),m("PLAY",Z({pfm:u,uid:ne(),vid:$(),videoPosition:Math.floor(g.currentTime)},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:"PLAY",videoPosition:Math.floor(g.currentTime),isAdEvent:!1}),o&&o("started_video_playback",{"Video ID":$(),watchTime:Math.floor(g.currentTime)})}),g.one("play",w),g.on("loadeddata",function(){g.one("timeupdate",function(){var e;clearInterval(c),clearInterval(d),v=s||0,m("FIRST_FRAME",Z({pfm:u,uid:ne(),vid:$(),videoPosition:Math.floor(g.currentTime),ttFirstFrame:s,bufferHealth:_()},null==l||null===(e=l.beacon)||void 0===e?void 0:e.params)),b({eventName:"FIRST_FRAME",videoPosition:Math.floor(g.currentTime),isAdEvent:!1,ttFirstFrame:s,bufferHealth:_()}),I=!0,s=0})})}else console.error("Videojs: Player instance not found.")}(e,o,l)}var ae=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},ue=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},de=function(e,n){var t=new Map;b({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),C=t}).catch(function(e){return console.log(e)})},se=function(){var e=K.get();return e>=0?e+1:1},ce=function(){var e,n,t,o=G(),i=x(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=K.get(),a=null==o||null===(n=o[l])||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 a>=0?a+1:1};function ve(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 me(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ve(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}window._deviceInfo=a(navigator.userAgent);var pe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},fe=function(e){var n=Ie(e,"video.tags",[]),t=Ie(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ie=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},Ee=function(){var n,t,o,i,a,u,d,s,c,v,m,p,f,I,E,g,T,y,h,w,_,b,O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",D=arguments.length>1?arguments[1]:void 0,S=arguments.length>2?arguments[2]:void 0,L=(null==S?void 0:S.siteName)||"",P=(null==S?void 0:S.contentType)||"video",R=(null==S||null===(n=S[P])||void 0===n?void 0:n.metadata)||(null==S||null===(t=S[P])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.metadata),V=r(D);if(!O.includes("VIEWLIFT_"))return O;var W,F=window.getComputedStyle(document.getElementById(D),null),C=Math.trunc(F.getPropertyValue("height").slice(0,-2)),A=Math.trunc(F.getPropertyValue("width").slice(0,-2)),N="linearchannel"===P?null==S||null===(i=S.linearchannel)||void 0===i||null===(a=i.channels)||void 0===a||null===(u=a.find(function(e){return(null==e?void 0:e.id)===(null==S?void 0:S.channelId)}))||void 0===u||null===(d=u.content)||void 0===d?void 0:d.id:Ie(S,"video.gist.id",""),U="linearchannel"===P?null==S||null===(s=S.linearchannel)||void 0===s||null===(c=s.channels)||void 0===c||null===(v=c.find(function(e){return(null==e?void 0:e.id)===(null==S?void 0:S.channelId)}))||void 0===v?void 0:v.title:Ie(S,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),j=null,k=null;"function"==typeof window.__gpp&&(null===(W=window)||void 0===W||W.__gpp("ping",function(e){j=null==e?void 0:e.gppString,k=null==e?void 0:e.sectionList[0]}));var B=me(me({},ge(R)),{},(w={VIEWLIFT_WIDTH:A,VIEWLIFT_HEIGHT:C,VIEWLIFT_SIZE:pe(A,C),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===(m=window)||void 0===m?void 0:m.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ie(S,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ie(S,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ie(S,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==V||null===(p=V.options_)||void 0===p?void 0:p.autoplay)||1,VIEWLIFT_MUTE:(null==V||null===(f=V.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==L||"usanetwork"==L?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:fe(S),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ie(S,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ie(S,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ie(null===(I=window)||void 0===I||null===(E=I.app_data)||void 0===E||null===(g=E.site)||void 0===g?void 0:g.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==L||"usanetwork"==L?"":Ie(null===(T=window)||void 0===T||null===(y=T.app_data)||void 0===y||null===(h=y.site)||void 0===h?void 0:h.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Ie(S,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ie(S,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:Ie(S,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ie(S,"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:fe(S),VIEWLIFT_GPP_SID:k||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:j||"VIEWLIFT_GPP",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:"",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},e(w,"VIEWLIFT_LAT",""),e(w,"VIEWLIFT_APP_BUNDLE",""),e(w,"VIEWLIFT_ATT_CONSENT",""),w),null===(_=window)||void 0===_||null===(b=_.customData)||void 0===b?void 0:b.macros);for(var M in B){var x=new RegExp(M,"g");O=O.replace(x,B[M])}return O},ge=function(e){var n,t,o,i,r,l,a={},u=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){u.set(e.name,e.value)}));var d=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,s=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return d||s?(ue()?d?a=me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.tve")||""})):d?a=me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.web.tve")||""})),d?a=me(me({},a),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}):s&&(a=me(me({},a),{},{VIEWLIFT_SFID:u.get("sfid.tve")||u.get("sfid.web.tve")||""})),a=ue()?me(me({},a),{},{VIEWLIFT_PROF:u.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_PROF:u.get("prof.web")||""})):(a=me(me({},a),{},{VIEWLIFT_SFID:u.get("sfid.dtc")||u.get("sfid.web.dtc")||""}),a=ue()?me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:u.get("prof.mweb")||""}):me(me({},a),{},{VIEWLIFT_CSID:u.get("csid.web.dtc")||"",VIEWLIFT_PROF:u.get("prof.web")||""})),a=me(me({},a),{},{VIEWLIFT_AFID:u.get("afid")})},Te=function(e,n){var t,o,i,r,l,a,u,d,s,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[f])||void 0===t?void 0:t.drmEnabled,E=null==e||null===(o=e[f])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,g=null==e||null===(r=e[f])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,T=(null==e||null===(a=e[f])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(d=u.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(s=e[f])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var y=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=g&&g.hls)return he(g);if(I){var h=we(E,n);return h.src=Ee(h.src,n,e),h}if("Safari"!==ae()&&y)return ye(E);if(T){var w=he(E);return w.src=Ee(w.src,n,e),w}if(null!=E&&E.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(E);return _.src=Ee(_.src,n,e),_}return null},ye=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},we=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,u=ae();if(r(n),"Safari"===u){var d=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return _e(n),d}var s,c={src:l.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:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0: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"==ae()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},be=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Oe=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},De=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var Se=!1,Le=function(e,n,t){var o=Ee(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima)return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(e);if(null!==l.el_){Se=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),Se&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!0),l.ima.requestAds()},1e3));var u=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&u.hasAttribute("controls")&&u.removeAttribute("controls");var d="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,d="touchend"),l.one(d,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var Re=function(e){o(e).play()},Ve=function(e){o(e).pause()},We=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Fe=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Ce=function(e){return!!o.getPlayer("".concat(e))},Ae=function(e){return o(e).paused()},Ne=function(){var e=n(t.mark(function e(n,o){var i,l,a,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>2&&void 0!==u[2]&&u[2],e.next=3,j();case 3:return l=e.sent,a=r(n),e.abrupt("return",new Promise(function(e,t){y(o,l).then(function(t){var r=null==t?void 0:t.data;window.sid=ee(),r.contentType="linearchannel",r.channelId=null==o?void 0:o.channelId;var l=Te(r,n);M(r),l&&i?(Me(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})})):e({status:!0,msg:"Feed authenticated",response:r})}).catch(function(e){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)}}(),Ue=function(){var e=n(t.mark(function e(n,o,i){var l,a,s,c,v,m;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return c=e.sent,(G()||null)&&J(o),v=0,m=0,null!==(l=window)&&void 0!==l&&l.watchHistory&&null!==(a=window)&&void 0!==a&&null!==(s=a.watchHistory)&&void 0!==s&&s.enable&&_(o,c).then(function(e){var n,t,o,i,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),v=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,m=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}),e.abrupt("return",new Promise(function(e,t){T(o,c).then(function(o){var i,l,a,s,c,p,f,I,E,g,T=null==o?void 0:o.data,y=(null==T||null===(i=T.video)||void 0===i||null===(l=i.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;M(o.data);var h=(null==T||null===(a=T.ads)||void 0===a||null===(s=a.preRoll)||void 0===s||null===(c=s.adTags)||void 0===c||null===(p=c.web)||void 0===p?void 0:p.active)&&(null==T||null===(f=T.ads)||void 0===f||null===(I=f.preRoll)||void 0===I||null===(E=I.adTags)||void 0===E||null===(g=E.web)||void 0===g?void 0:g.url);h&&Le(n,h,T);var w=Te(T,n);if(w){var _,b,O,D,S,L,P,R,V,W,F,C,A,N,U=(null==T||null===(_=T.video)||void 0===_||null===(b=_.gist)||void 0===b?void 0:b.videoImageUrl)||(null==T||null===(O=T.video)||void 0===O||null===(D=O.gist)||void 0===D||null===(S=D.imageGist)||void 0===S?void 0:S.r16x9),j=r(n);if(j.poster(U),Me(n,w),j.on("loadstart",function(){y&&e({status:!0,msg:"Video Loaded",response:T})}),j.on("loadeddata",function(){De(),e({status:!0,msg:"Video Loaded",response:T})}),j.one("play",function(){v&&m<95&&setTimeout(function(){j.currentTime(v)},0)}),j.one("error",function(){var e;t({status:!1,msg:(null==j||null===(e=j.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==T||null===(L=T.video)||void 0===L||null===(P=L.contentDetails)||void 0===P||null===(R=P.closedCaptions)||void 0===R?void 0:R.length)>0||(null==T||null===(V=T.video)||void 0===V||null===(W=V.closedCaptions)||void 0===W?void 0:W.length)>0)F=((null==T||null===(C=T.video)||void 0===C||null===(A=C.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null==T||null===(N=T.video)||void 0===N?void 0:N.closedCaptions)).filter(function(e){return"VTT"===e.format}),u(n,F);else d(n)}else Oe(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,o)})}));case 9:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),je=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},ke=function(e){var n=r(e);if(Be(),s(),window.onresize=null,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Be=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()},Me=function(e,n){var t=r(e);t&&t.src(n)},xe=function(n,t,o,i){var r,l,a,u,d,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.errorMessage)||(null==n?void 0:n.message);Ce(t)&&Oe(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Pe(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},He=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{h as A,de as B,K as C,H as D,je as E,Re as F,Ve as G,Ce as H,Ue as I,Ne as J,ke as K,D as L,O as M,k as N,P as O,S as P,v as Q,ue as R,Y as S,Ae as T,z as U,b as V,X as W,J as X,ce as a,G as b,se as c,ae as d,x as e,Te as f,ne as g,De as h,Oe as i,M as j,q as k,Me as l,We as m,Ee as n,He as o,le as p,Le as q,Fe as r,w as s,be as t,B as u,T as v,_ as w,xe as x,j as y,y as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{S as n,b as r,e as i}from"./generic-63e4557c.js";import{s as a}from"./autoNextVideo-cfe8aa87.js";import{e as o}from"./icons-c139587c.js";import{p as l,t as u}from"./skin-16f83185.js";import s from"@babel/runtime/helpers/typeof";import c from"video.js";import d from"@babel/runtime/helpers/asyncToGenerator";import p from"@babel/runtime/regenerator";import m from"@babel/runtime/helpers/defineProperty";import v from"@babel/runtime/helpers/slicedToArray";var f,g,h,b,y=[],x=!1,w=function(i,a){var u;if(x=!1,null!=a&&null!==(u=a.series)&&void 0!==u&&u.enable){var s;y=[];var c=r();null==c||c.map(function(t){var n;return(n=y).push.apply(n,e(t.episodes))}),null==a||null===(s=a.series)||void 0===s||s.cb}else{var d,p;y=(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(i);m.on("timeupdate",function(){var e,t;if(!x){var r=Math.floor(m.currentTime()),i=m.duration(),a=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=y)||void 0===t?void 0:t.length)-1?a&&(a.style.visibility="visible"):a&&(a.style.visibility="hidden")}});var v,f=y.filter(function(e,t){return t==n()});if((null==f?void 0:f.length)>0)if(null!==(v=document.getElementsByClassName("next-ep-preview"))&&void 0!==v&&v[0]){var g,h,b,w,A,N,k,j,C,O,T,I;(null===(g=document.getElementsByClassName("next-ep-preview"))||void 0===g?void 0:g[0]).style.visibility="hidden";var B=null===(h=document.getElementsByClassName("next-ep-title"))||void 0===h?void 0:h[0],L=null===(b=document.getElementsByClassName("next-ep-img"))||void 0===b?void 0:b[0],S=null===(w=document.getElementsByClassName("next-ep-content"))||void 0===w?void 0:w[0],M=null===(A=f[0])||void 0===A?void 0:A.title;(null===(N=M)||void 0===N?void 0:N.length)>60&&(M=M.substr(0,60)+"..."),B.textContent="".concat(M),L.src=(null===(k=f[0])||void 0===k||null===(j=k.gist)||void 0===j||null===(C=j.imageGist)||void 0===C?void 0:C.r16x9)||(null==f||null===(O=f[0])||void 0===O?void 0:O.img)||(null===(T=window)||void 0===T||null===(I=T.customData)||void 0===I?void 0:I.fallbackImage),S.onclick=function(){return E(i)}}else{var P,R,D,$,X,F,U,_,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var G=document.createElement("div");G.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var V=document.createElement("div");V.className="next-ep-close",V.onclick=function(){q.style.visibility="hidden",x=!0},V.appendChild(l(o())),G.append(W),G.append(V);var z=null===(P=f[0])||void 0===P?void 0:P.title,H=document.createElement("img");H.className="next-ep-img",H.src=(null===(R=f[0])||void 0===R||null===(D=R.gist)||void 0===D||null===($=D.imageGist)||void 0===$?void 0:$.r16x9)||(null==f||null===(X=f[0])||void 0===X?void 0:X.img)||(null===(F=window)||void 0===F||null===(U=F.customData)||void 0===U?void 0:U.fallbackImage);var Q=document.createElement("div");Q.className="next-ep-title",(null===(_=z)||void 0===_?void 0:_.length)>60&&(z=z.substr(0,60)+"..."),Q.textContent="".concat(z);var Y=document.createElement("div");Y.className="next-ep-content",Y.append(H),Y.append(Q),Y.onclick=function(){return E(i)},q.append(G),q.append(Y)}},E=function(e,r){var i=t(e),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(e);var l=n();a(l,e,y)}};function A(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}f={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},g=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===s(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);return n},h=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},b=function e(t){return"HTML"!==t.nodeName&&"static"===h(t)("position")?e(t.offsetParent):t},c.registerPlugin("thumbnails",function(e){var t,n,r,i,a,o,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=g({},f,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",g(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",function(e){o=i.duration()}),i.on("loadedmetadata",function(e){o=i.duration()}),(a=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=b(a.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=b(a.el()).getBoundingClientRect().left+v,i=Math.floor((s-a.el().offsetLeft)/a.width()*o),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&&g(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"},a.on("mousemove",l),a.on("touchmove",l),a.on("pointerdown",function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)}),u=function(e){t.style.left="-1000px"},a.on("mouseout",u),a.on("touchcancel",u),a.on("touchend",u),i.on("userinactive",u)});var k="my-player";function j(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 C(){return(C=d(p.mark(function e(t){var n,r,i,a,o,l,u,s,c,d,m,f,g,h,b,y,x,w,E,A,N,k,j,C;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),o=v(a,2),l=o[0],u=o[1],s=i.width/u,c=i.height/l,d=[],m=0;m<l;m++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,f*s,m*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=v(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(j=k.appcmsMain)||void 0===j||null===(C=j.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function O(e,t){return T.apply(this,arguments)}function T(){return(T=d(p.mark(function e(t,n){var r,i;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",j(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function I(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=t(k);if(i&&a){var o=i.getBoundingClientRect(),l=(e.clientX-o.left)/o.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var o=Math.floor((i+a)/2),l=t[o];if(l===e)return l;l<e?i=o+1:a=o-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*a.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return C.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function B(e){return L.apply(this,arguments)}function L(){return(L=d(p.mark(function e(t){var n,r,i,a;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),i=v(r,2),a=i[0]*i[1],o=e.duration,l=0;l<a;l++){var u,s=Math.round((t*a+l)*o);n[s]=N(N({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},m(u,"left","-60px"),m(u,"border","1px solid transparent"),m(u,"borderRadius","4px"),u)})}}),r=Object.keys(n).map(Number).sort(function(e,t){return e-t}),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",u(function(e){return I(e,n,r)},500)),null==(a=document.querySelector(".vjs-progress-control.vjs-control"))||a.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",u(function(e){return I(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var S=function(){var e=d(p.mark(function e(t,n){var r,i,a,o,l,u,s,c;return p.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:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),o=[],l=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(s=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach(function(e){var t=e.split("="),n=v(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,o.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function M(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function P(e,t){return R.apply(this,arguments)}function R(){return(R=d(p.mark(function e(n,r){var a,o,l,u,s,c,d,m,f,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,P,R,X,F,U,_,q,G,W,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,me,ve;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,a=t(r),o=n.split("/"),l=o.findIndex(function(e){return"dash"===e.toLowerCase()}),u=M(-1!==l?o.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return m=e.sent,e.next=11,m.text();case 11:f=e.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==a?void 0:a.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],P=S.getAttribute("value"),R=null==P?void 0:P.split("x"),X=v(R,2),F=X[0],U=X[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),q=(_?B/_:B)/(F*U),G=L.getAttribute("id"),W=Math.round(b/q),V=Math.ceil(W/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(V))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<V;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:q,layout:P,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",G)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=v(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),ae=N.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/oe),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=D(ce),w=0;w<se;w++)ve=me?$(me,w+de):ce,pe.push({duration:oe,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function D(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function $(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 X(e){return F.apply(this,arguments)}function F(){return(F=d(p.mark(function e(n){var r,i,a,o,l,u,s,c,d,m,v,f,g,h,b,y;return p.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===(a=i.player)||void 0===a?void 0:a.getSource():c,null===(o=c)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,O(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return m=(null==d?void 0:d[0])||null,v=m.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,S(f,v);case 12:return g=e.sent,e.next=15,B(g);case 15:h=e.sent,u.thumbnails(h);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,P(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,B(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function U(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var a=document.createElement("div");a.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",a.append(o),r.el().appendChild(a),r.on("useractive",function(){a.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||a.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}}export{w as a,U as b,X as i};
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t}from"./player_instance-34118a5b.js";import{S as n,b as r,e as i}from"./generic-dd89c778.js";import{s as a}from"./autoNextVideo-068e496c.js";import{e as o}from"./icons-c139587c.js";import{p as l,t as u}from"./skin-16f83185.js";import s from"@babel/runtime/helpers/typeof";import c from"video.js";import d from"@babel/runtime/helpers/asyncToGenerator";import p from"@babel/runtime/regenerator";import m from"@babel/runtime/helpers/defineProperty";import v from"@babel/runtime/helpers/slicedToArray";var f,g,h,b,y=[],x=!1,w=function(i,a){var u;if(x=!1,null!=a&&null!==(u=a.series)&&void 0!==u&&u.enable){var s;y=[];var c=r();null==c||c.map(function(t){var n;return(n=y).push.apply(n,e(t.episodes))}),null==a||null===(s=a.series)||void 0===s||s.cb}else{var d,p;y=(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(i);m.on("timeupdate",function(){var e,t;if(!x){var r=Math.floor(m.currentTime()),i=m.duration(),a=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=y)||void 0===t?void 0:t.length)-1?a&&(a.style.visibility="visible"):a&&(a.style.visibility="hidden")}});var v,f=y.filter(function(e,t){return t==n()});if((null==f?void 0:f.length)>0)if(null!==(v=document.getElementsByClassName("next-ep-preview"))&&void 0!==v&&v[0]){var g,h,b,w,A,N,k,j,C,O,T,I;(null===(g=document.getElementsByClassName("next-ep-preview"))||void 0===g?void 0:g[0]).style.visibility="hidden";var B=null===(h=document.getElementsByClassName("next-ep-title"))||void 0===h?void 0:h[0],L=null===(b=document.getElementsByClassName("next-ep-img"))||void 0===b?void 0:b[0],S=null===(w=document.getElementsByClassName("next-ep-content"))||void 0===w?void 0:w[0],M=null===(A=f[0])||void 0===A?void 0:A.title;(null===(N=M)||void 0===N?void 0:N.length)>60&&(M=M.substr(0,60)+"..."),B.textContent="".concat(M),L.src=(null===(k=f[0])||void 0===k||null===(j=k.gist)||void 0===j||null===(C=j.imageGist)||void 0===C?void 0:C.r16x9)||(null==f||null===(O=f[0])||void 0===O?void 0:O.img)||(null===(T=window)||void 0===T||null===(I=T.customData)||void 0===I?void 0:I.fallbackImage),S.onclick=function(){return E(i)}}else{var P,R,D,$,X,F,U,_,q=document.createElement("div");q.className="next-ep-preview",q.style.visibility="hidden",document.getElementById(i).append(q);var G=document.createElement("div");G.className="next-heading-wrapper";var W=document.createElement("div");W.className="next-ep-header",W.textContent="Next up";var V=document.createElement("div");V.className="next-ep-close",V.onclick=function(){q.style.visibility="hidden",x=!0},V.appendChild(l(o())),G.append(W),G.append(V);var z=null===(P=f[0])||void 0===P?void 0:P.title,H=document.createElement("img");H.className="next-ep-img",H.src=(null===(R=f[0])||void 0===R||null===(D=R.gist)||void 0===D||null===($=D.imageGist)||void 0===$?void 0:$.r16x9)||(null==f||null===(X=f[0])||void 0===X?void 0:X.img)||(null===(F=window)||void 0===F||null===(U=F.customData)||void 0===U?void 0:U.fallbackImage);var Q=document.createElement("div");Q.className="next-ep-title",(null===(_=z)||void 0===_?void 0:_.length)>60&&(z=z.substr(0,60)+"..."),Q.textContent="".concat(z);var Y=document.createElement("div");Y.className="next-ep-content",Y.append(H),Y.append(Q),Y.onclick=function(){return E(i)},q.append(G),q.append(Y)}},E=function(e,r){var i=t(e),o=Math.floor(i.currentTime());if(Math.floor(i.duration())!=o){i.pause(e);var l=n();a(l,e,y)}};function A(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}f={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},g=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===s(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);return n},h=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},b=function e(t){return"HTML"!==t.nodeName&&"static"===h(t)("position")?e(t.offsetParent):t},c.registerPlugin("thumbnails",function(e){var t,n,r,i,a,o,l,u;function s(){document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",s),u()}n=g({},f,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",g(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",function(e){o=i.duration()}),i.on("loadedmetadata",function(e){o=i.duration()}),(a=i.controlBar.progressControl).el().appendChild(t),l=function(e){var i,l,u,s,c,d,p,m,v,f;for(l in u=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,p=((f=b(a.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=b(a.el()).getBoundingClientRect().left+v,i=Math.floor((s-a.el().offsetLeft)/a.width()*o),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&&g(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"},a.on("mousemove",l),a.on("touchmove",l),a.on("pointerdown",function(e){document.addEventListener("pointermove",l),document.addEventListener("pointerup",s)}),u=function(e){t.style.left="-1000px"},a.on("mouseout",u),a.on("touchcancel",u),a.on("touchend",u),i.on("userinactive",u)});var k="my-player";function j(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 C(){return(C=d(p.mark(function e(t){var n,r,i,a,o,l,u,s,c,d,m,f,g,h,b,y,x,w,E,A,N,k,j,C;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),o=v(a,2),l=o[0],u=o[1],s=i.width/u,c=i.height/l,d=[],m=0;m<l;m++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,f*s,m*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),d.push({uri:h,duration:t.duration}),t._tiles=d;return e.abrupt("return",d);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=v(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(j=k.appcmsMain)||void 0===j||null===(C=j.images)||void 0===C?void 0:C.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function O(e,t){return T.apply(this,arguments)}function T(){return(T=d(p.mark(function e(t,n){var r,i;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",j(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function I(e,n,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=t(k);if(i&&a){var o=i.getBoundingClientRect(),l=(e.clientX-o.left)/o.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var o=Math.floor((i+a)/2),l=t[o];if(l===e)return l;l<e?i=o+1:a=o-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*a.duration()),r),s=n[u];s&&!s.loading&&(s.loading=!0,function(e){return C.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function B(e){return L.apply(this,arguments)}function L(){return(L=d(p.mark(function e(t){var n,r,i,a;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),i=v(r,2),a=i[0]*i[1],o=e.duration,l=0;l<a;l++){var u,s=Math.round((t*a+l)*o);n[s]=N(N({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},m(u,"left","-60px"),m(u,"border","1px solid transparent"),m(u,"borderRadius","4px"),u)})}}),r=Object.keys(n).map(Number).sort(function(e,t){return e-t}),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",u(function(e){return I(e,n,r)},500)),null==(a=document.querySelector(".vjs-progress-control.vjs-control"))||a.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",u(function(e){return I(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var S=function(){var e=d(p.mark(function e(t,n){var r,i,a,o,l,u,s,c;return p.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:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),o=[],l=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(s=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach(function(e){var t=e.split("="),n=v(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,o.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function M(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function P(e,t){return R.apply(this,arguments)}function R(){return(R=d(p.mark(function e(n,r){var a,o,l,u,s,c,d,m,f,g,h,b,y,x,w,E,A,N,j,C,O,T,I,B,L,S,P,R,X,F,U,_,q,G,W,V,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,me,ve;return p.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k=r,a=t(r),o=n.split("/"),l=o.findIndex(function(e){return"dash"===e.toLowerCase()}),u=M(-1!==l?o.slice(0,l+1).join("/"):new URL(n).origin),e.prev=5,e.next=8,fetch(n);case 8:return m=e.sent,e.next=11,m.text();case 11:f=e.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),b=(null==a?void 0:a.duration())||(null===(s=i())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),y=(null==h||null===(d=h.querySelector("MPD > BaseURL"))||void 0===d?void 0:d.textContent)||u+"/",x=h.getElementsByTagName("AdaptationSet"),w=0;case 18:if(!(w<x.length)){e.next=72;break}if(("image"!==(E=x[w]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(N=E.getElementsByTagName("SegmentTemplate")[0],j=null===(A=N.getElementsByTagName("SegmentTimeline"))||void 0===A?void 0:A[0],!N||!j){e.next=48;break}if(T=j.getElementsByTagName("S"),I=parseInt(null===(C=T[0])||void 0===C?void 0:C.getAttribute("t")),B=parseInt(null===(O=T[0])||void 0===O?void 0:O.getAttribute("d")),L=E.getElementsByTagName("Representation")[0],S=L.getElementsByTagName("EssentialProperty")[0],P=S.getAttribute("value"),R=null==P?void 0:P.split("x"),X=v(R,2),F=X[0],U=X[1],!N){e.next=46;break}if(N.getAttribute("media"),_=N.getAttribute("timescale"),q=(_?B/_:B)/(F*U),G=L.getAttribute("id"),W=Math.round(b/q),V=Math.ceil(W/(F*U)),z=N.getAttribute("media"),parseInt(N.getAttribute("startNumber")),!isNaN(parseInt(V))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],w=0;w<V;w++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:q,layout:P,uri:Y+Q.replace("$Time$",I+w*B).replace("$RepresentationID$",G)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=v(ee,2),ne=te[0],re=te[1],!N){e.next=69;break}if(N.getAttribute("media"),ie=N.getAttribute("duration"),ae=N.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(b/oe),se=Math.ceil(ue/(ne*re)),ce=N.getAttribute("media"),de=parseInt(N.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],me=D(ce),w=0;w<se;w++)ve=me?$(me,w+de):ce,pe.push({duration:oe,layout:Z,uri:y+ve.replace("$Number$",w+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:w++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function D(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function $(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 X(e){return F.apply(this,arguments)}function F(){return(F=d(p.mark(function e(n){var r,i,a,o,l,u,s,c,d,m,v,f,g,h,b,y;return p.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===(a=i.player)||void 0===a?void 0:a.getSource():c,null===(o=c)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,O(c,n);case 6:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=17;break}return m=(null==d?void 0:d[0])||null,v=m.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,S(f,v);case 12:return g=e.sent,e.next=15,B(g);case 15:h=e.sent,u.thumbnails(h);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,P(c,n);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,B(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}function U(e,n){var r=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var a=document.createElement("div");a.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",a.append(o),r.el().appendChild(a),r.on("useractive",function(){a.classList.remove("vjs-fade")}),r.on("userinactive",function(){r.paused()||a.classList.add("vjs-fade")}),r.on("fullscreenchange",function(){r.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}}export{w as a,U as b,X as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./player_instance-34118a5b.js";import{w as t,s as n}from"./icons-c139587c.js";function o(o,l){var u=l.dvrConfig,s=l.videoId,d=(l.userId,(null==u?void 0:u.buttonConfig)||{}),v=d.watchLive,f=d.resume,b=d.startFromBegining,m=(null==u?void 0:u.programs)||[],g=e(o),y=(null==u?void 0:u.playLive)||!1;if((null==u?void 0:u.playFromBegining)||!1)!function(e){e.one("canplay",function(){e.seekable()&&(e.currentTime(e.seekable().start(0)),e.play())})}(g);else if(y)!function(e){e.one("canplay",function(){e.seekable()&&(e.currentTime(e.seekable().end(0)),e.play())})}(g);else{var h=document.querySelector(".vjs-dvr-btn-overlay");h||((h=document.createElement("div")).className="vjs-dvr-btn-overlay"),g.el().appendChild(h);var p=!!i(s);h.innerHTML=function(e,o){var a=(null==e?void 0:e.buttonConfig)||{},i=a.watchLive,r=a.resume,c=a.startFromBegining,l='<button id="watch-live-btn">'.concat(t()," ").concat((null==i?void 0:i.text)||"Watch Live","</button>"),u='<button id="resume-btn">'.concat(t()," ").concat((null==r?void 0:r.text)||"Resume","</button>"),s='<button id="watch-begining-btn">\n '.concat(n()," ").concat((null==c?void 0:c.text)||"Start From Begining","\n </button>"),d=o?u:l;return'<div class="dvr-button">'.concat(d," ").concat(s,"</div>")}(u,p),g.pause(),g.bigPlayButton.hide(),g.controlBar.hide(),a("watch-live-btn",v,function(){g&&g.seekable()&&g.currentTime(g.seekable().end(0)),r(g,h),v&&"function"==typeof v.cb&&(null==v||v.cb())}),a("resume-btn",f,function(){if(g&&g.seekable()){var e=i(s),t=Math.min(e,g.seekable().end(0));g.currentTime(t)}r(g,h),f&&"function"==typeof f.cb&&(null==f||f.cb())}),a("watch-begining-btn",b,function(){var e=g.seekable();if(e&&e.length>0){var t=c(m,e);g.currentTime(t)}r(g,h),b&&"function"==typeof b.cb&&(null==b||b.cb())})}!function(e,t){var n=e.currentTime(),o=!1;e.on("seeking",function(){o=!0}),e.on("seeked",function(){o=!1,n=e.currentTime()}),e.on("timeupdate",function(){if(!o){var a=e.currentTime();if(a-n>=30&&(!function(e,t,n){sessionStorage.setItem("lastWatchedPosition-".concat(e),n.toFixed(2))}(t,0,a),n=a),e.liveTracker){var i=e.liveTracker.atLiveEdge(),r=e.controlBar.getChild("SeekToLive");i?null==r||r.show():null==r||r.hide()}}})}(g,s)}function a(e,t,n){var o,a,i=document.getElementById(e);i&&(a=t,(o=i)&&(o.style.color="".concat((null==a?void 0:a.textColor)||"#000"),o.style.backgroundColor="".concat((null==a?void 0:a.backGroundColor)||"#DCF95B")),i.addEventListener("click",n))}function i(e,t){return sessionStorage.getItem("lastWatchedPosition-".concat(e))||0}function r(e,t){e.play(),e.bigPlayButton.show(),e.controlBar.show(),t.style.display="none"}function c(e,t){var n=new Date,o=e.find(function(e){var t=new Date(e.formatted_startdate),o=new Date(e.formatted_enddate);return n>=t&&n<o}),a=t.start(0),i=a;if(null!=o&&o.formatted_startdate){var r=t.end(t.length-1)-a;i=a+(new Date(o.formatted_startdate).getTime()-new Date(n-1e3*r).getTime())/1e3}return i}export{o as a,c as g};
|