@viewlift/player-backup 2.0.92-smartTv-test8 → 2.0.92-smartTv-test10
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-c350df7b.js → autoNextVideo-6842bf1e.js} +1 -1
- package/cjs/autoNextVideo-e09dd4b5.js +1 -0
- package/cjs/bundle.css +4 -4
- package/cjs/{features-eb94500c.js → features-164d9559.js} +1 -1
- package/cjs/features-194d4a4a.js +1 -0
- package/cjs/{generic-0c35f368.js → generic-c19ce514.js} +1 -1
- package/cjs/generic-def54bbe.js +1 -0
- package/cjs/{index-5fc16e9e.js → index-0c84da35.js} +1 -1
- package/cjs/{index-1838c329.js → index-1bc6e4e1.js} +1 -1
- package/cjs/index-66c8779a.js +1 -0
- package/cjs/index-c7da0bd6.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-0a17293d.js → multicamv2-1ac4ccf1.js} +1 -1
- package/cjs/{multicamv2-063ef4b5.js → multicamv2-73c22260.js} +1 -1
- package/cjs/multicamv2-936f60ff.js +1 -0
- package/cjs/multicamv2-fee75fc1.js +1 -0
- package/cjs/{nextEpisodeButton-13952866.js → nextEpisodeButton-05c5a9dc.js} +1 -1
- package/cjs/nextEpisodeButton-86065304.js +1 -0
- package/cjs/{playlist-8ef107a3.js → playlist-55d7cfe6.js} +1 -1
- package/cjs/playlist-64dbfa4a.js +1 -0
- package/cjs/{series-24d7cb4e.js → series-1914b8bc.js} +1 -1
- package/cjs/series-5b4f0d53.js +1 -0
- package/cjs/{series-v2-62db0e36.js → series-v2-0ca89367.js} +1 -1
- package/cjs/{series-v2-cef236d8.js → series-v2-2f4f32b3.js} +1 -1
- package/cjs/series-v2-d07a7942.js +1 -0
- package/cjs/series-v2-d1d7ceff.js +1 -0
- package/cjs/{skin-38f1a2fc.js → skin-15d13e48.js} +1 -1
- package/cjs/{skin-e12a0fef.js → skin-1d18fba7.js} +1 -1
- package/cjs/{skin-b1633de8.js → skin-4d8917b6.js} +1 -1
- package/cjs/skin-53a84878.js +1 -0
- package/cjs/{skin-12bc785c.js → skin-634c2100.js} +1 -1
- package/cjs/skin-70c07a7e.js +1 -0
- package/cjs/skin-aba2ebf4.js +1 -0
- package/cjs/skin-b9d750c7.js +1 -0
- package/cjs/{skin-d9e4f8fc.js → skin-d29ebe60.js} +1 -1
- package/cjs/{skin-a1ee643b.js → skin-e203c087.js} +1 -1
- package/cjs/skin-f370223b.js +1 -0
- package/cjs/{skin-e067a109.js → skin-f4d42976.js} +1 -1
- package/cjs/skin-f694c50c.js +1 -0
- package/cjs/skin-fdb52765.js +1 -0
- package/cjs/{videoSelector-65192a98.js → videoSelector-7b96e887.js} +1 -1
- package/cjs/videoSelector-9da40745.js +1 -0
- package/cjs/{videoSelector-7f301deb.js → videoSelector-f7367197.js} +1 -1
- package/cjs/videoSelector-f80fd578.js +1 -0
- package/esm/{autoNextVideo-89bf12ac.js → autoNextVideo-57e39c2b.js} +1 -1
- package/esm/autoNextVideo-eb7653f5.js +1 -0
- package/esm/bundle.css +4 -4
- package/esm/{features-7ebeedef.js → features-0fa41453.js} +1 -1
- package/esm/features-bee4be78.js +1 -0
- package/esm/{generic-c2920429.js → generic-8c232113.js} +1 -1
- package/esm/generic-d036e0c3.js +1 -0
- package/esm/{index-28856e72.js → index-2c81a570.js} +1 -1
- package/esm/{index-041e7de7.js → index-397c761f.js} +1 -1
- package/esm/index-9204c12e.js +1 -0
- package/esm/index-e8a8d6bc.js +1 -0
- package/esm/index.js +1 -1
- package/esm/{multicamv2-401586c5.js → multicamv2-19227feb.js} +1 -1
- package/esm/multicamv2-243a2d0d.js +1 -0
- package/esm/{multicamv2-6c33d338.js → multicamv2-5011595d.js} +1 -1
- package/esm/multicamv2-82f420e3.js +1 -0
- package/esm/{nextEpisodeButton-2fef2e20.js → nextEpisodeButton-0e6e9a99.js} +1 -1
- package/esm/nextEpisodeButton-1bfc42cd.js +1 -0
- package/esm/{playlist-016d4588.js → playlist-08aae44b.js} +1 -1
- package/esm/playlist-d62f0e1d.js +1 -0
- package/esm/{series-45a2c046.js → series-3890c03d.js} +1 -1
- package/esm/series-38d43d02.js +1 -0
- package/esm/{series-v2-e5e65d24.js → series-v2-48a526b1.js} +1 -1
- package/esm/series-v2-575f3828.js +1 -0
- package/esm/{series-v2-832edccb.js → series-v2-5e24f55e.js} +1 -1
- package/esm/series-v2-ad505b62.js +1 -0
- package/esm/{skin-c4585908.js → skin-0d8cbec3.js} +1 -1
- package/esm/{skin-dbfebb49.js → skin-101250f3.js} +1 -1
- package/esm/{skin-67ccd73a.js → skin-1bf9ceff.js} +1 -1
- package/esm/{skin-c4fe4f21.js → skin-52a2c45b.js} +1 -1
- package/esm/{skin-aed7b0ac.js → skin-8285699e.js} +1 -1
- package/esm/skin-91ea9846.js +1 -0
- package/esm/{skin-b720eeaf.js → skin-b11f07c9.js} +1 -1
- package/esm/skin-d0b8a20f.js +1 -0
- package/esm/skin-dedcfa56.js +1 -0
- package/esm/{skin-af71c222.js → skin-e0d75fb2.js} +1 -1
- package/esm/skin-e4470dd0.js +1 -0
- package/esm/skin-ebe075ff.js +1 -0
- package/esm/skin-ecc6caf9.js +1 -0
- package/esm/skin-fd8ab03a.js +1 -0
- package/esm/{videoSelector-f235608d.js → videoSelector-135b3f39.js} +1 -1
- package/esm/{videoSelector-67bbbd4e.js → videoSelector-408efa97.js} +1 -1
- package/esm/videoSelector-7dfef6f4.js +1 -0
- package/esm/videoSelector-9f4b211e.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,i=require("./generic-
|
|
1
|
+
"use strict";var e,i=require("./generic-c19ce514.js"),t=require("./util-47af43d1.js"),n=require("./skin-f87e1c22.js"),o=0,u=0,d=function e(t,o,d,r){u=t,t>d.length-1||(i.setVideoIdx(u+1),i.load(o,d[t].id).then(function(e){n.highlightVideo(u,o),u++,c(e)}).catch(function(i){c(i),setTimeout(function(){n.highlightVideo(u,o),u++,e(u,o,d)},5e3)}))},c=function(i){e&&e(i)};exports.autoPlayNext=function(r){clearTimeout(o);var h=null==r?void 0:r.content;e=null==r?void 0:r.cb;var l=r.playerId;t.onVideoEnded(l,function(){var e=n.getPlayer(l);0!==(null==e?void 0:e.currentTime())&&((u=i.getVideoIdx())>h.length-1||(i.setVideoIdx(u+1),i.load(l,h[u].id).then(function(e){n.highlightVideo(u,l),i.setCurrentVideo(e.response),u++,c(e)}).catch(function(e){c(e),n.highlightVideo(u,l),u++,o=setTimeout(function(){i.isPaused(l)&&d(u,l,h)},5e3)})))})},exports.switchToNext=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,i=require("./generic-def54bbe.js"),t=require("./util-47af43d1.js"),n=require("./skin-f87e1c22.js"),o=0,u=0,d=function e(t,o,d,r){u=t,t>d.length-1||(i.setVideoIdx(u+1),i.load(o,d[t].id).then(function(e){n.highlightVideo(u,o),u++,c(e)}).catch(function(i){c(i),setTimeout(function(){n.highlightVideo(u,o),u++,e(u,o,d)},5e3)}))},c=function(i){e&&e(i)};exports.autoPlayNext=function(r){clearTimeout(o);var h=null==r?void 0:r.content;e=null==r?void 0:r.cb;var l=r.playerId;t.onVideoEnded(l,function(){var e=n.getPlayer(l);0!==(null==e?void 0:e.currentTime())&&((u=i.getVideoIdx())>h.length-1||(i.setVideoIdx(u+1),i.load(l,h[u].id).then(function(e){n.highlightVideo(u,l),i.setCurrentVideo(e.response),u++,c(e)}).catch(function(e){c(e),n.highlightVideo(u,l),u++,o=setTimeout(function(){i.isPaused(l)&&d(u,l,h)},5e3)})))})},exports.switchToNext=d;
|
package/cjs/bundle.css
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
.video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
|
|
6
5
|
height: 0.7em;
|
|
7
6
|
position: absolute;
|
|
@@ -148,6 +147,8 @@
|
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
|
|
150
|
+
|
|
151
|
+
|
|
151
152
|
/*
|
|
152
153
|
* Styles the icon size and line height for button icons in the SmartTV skin.
|
|
153
154
|
*
|
|
@@ -1707,7 +1708,6 @@ iframe {
|
|
|
1707
1708
|
|
|
1708
1709
|
|
|
1709
1710
|
|
|
1710
|
-
|
|
1711
1711
|
/* CSS for videojs-dvr-seekbar */
|
|
1712
1712
|
|
|
1713
1713
|
.video-js.vjs-dvr-seekbar {
|
|
@@ -1880,6 +1880,8 @@ iframe {
|
|
|
1880
1880
|
|
|
1881
1881
|
|
|
1882
1882
|
|
|
1883
|
+
|
|
1884
|
+
|
|
1883
1885
|
.video-js .multicamera-parent.default{
|
|
1884
1886
|
height: 345px;
|
|
1885
1887
|
position: absolute;
|
|
@@ -1962,8 +1964,6 @@ iframe {
|
|
|
1962
1964
|
|
|
1963
1965
|
|
|
1964
1966
|
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
1967
|
/* nextep */
|
|
1968
1968
|
.next-ep-preview{
|
|
1969
1969
|
position: absolute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-def54bbe.js"),s=require("./renditions-89042a16.js"),d=require("./skin-f87e1c22.js"),c=require("./localisation-56e0a999.js");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function h(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function p(e){var t=v();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then(function(){return require("./caption-settings-7f7ed041.js")}).then(function(r){var n,o,l,a,s=r.default,c=d.getPlayer(e);i.registerComponent("captionSelector",s),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},exports.addDBClickFullScreen=function(e){var t=d.getPlayer(e).el(),r=0,n=d.getPlayer(e);n.addChild("fullscreenToggle");var o=function(){var e,r=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];r&&r.click()};n.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;n.el().addEventListener("touchend",function(){var e=(new Date).getTime(),n=e-r;if(n<300&&n>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}r=e}),window._multiplayer_dbTapHandler=o},exports.addMulticamSelector=function(e,t){Promise.resolve().then(function(){return require("./multicamv2-936f60ff.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},exports.addMulticamSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./multicamv2-1ac4ccf1.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then(function(){return require("./nextEpisodeButton-05c5a9dc.js")}).then(function(n){var o=n.default,l=d.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)})},exports.addOutputtingOverlay=function(e,t){var r=d.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then(function(){return require("./playlist-55d7cfe6.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},exports.addResolutionModule=function(e,t,r){Promise.resolve().then(function(){return require("./resolution-5e1f1897.js")}).then(function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d.getPlayer(e),a=s.getRenditions(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:a},l.controlBar.children().length-4))})},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=p(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-rewind-button");var a=d.parseSvgString(l);return o.append(a),n}return r(s,[{key:"handleClick",value:function(){a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then(function(){return require("./series-1914b8bc.js")}).then(function(n){var o=n.seriesModule,l=d.getPlayer(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]&&n.handleSeasonChange(t[e],e,l,r)})},c=0;c<a.length;c++)s(c)})},exports.addSeriesSelectorV2=function(e,t){Promise.resolve().then(function(){return require("./series-v2-d1d7ceff.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},exports.addSeriesSelectorV2_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./series-v2-d07a7942.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then(function(){return require("./settings-icon-743e2d7d.js")}).then(function(r){var n,o,l,a,s=r.default,c=d.getPlayer(e);i.registerComponent("settingsSelector",s),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=p(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-skip-button");var a=d.parseSvgString(l);return o.append(a),n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=p(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=c.getLocalisation("slowMoText")||"Slow Mo",n}return r(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},exports.addVideoSelector=function(e,t){Promise.resolve().then(function(){return require("./videoSelector-f7367197.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},exports.addVideoSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./videoSelector-9da40745.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./generic-c19ce514.js"),s=require("./renditions-89042a16.js"),d=require("./skin-f87e1c22.js"),c=require("./localisation-56e0a999.js");function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function h(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach(function(r){e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function p(e){var t=v();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then(function(){return require("./caption-settings-7f7ed041.js")}).then(function(r){var n,o,l,a,s=r.default,c=d.getPlayer(e);i.registerComponent("captionSelector",s),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},exports.addDBClickFullScreen=function(e){var t=d.getPlayer(e).el(),r=0,n=d.getPlayer(e);n.addChild("fullscreenToggle");var o=function(){var e,r=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];r&&r.click()};n.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;n.el().addEventListener("touchend",function(){var e=(new Date).getTime(),n=e-r;if(n<300&&n>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}r=e}),window._multiplayer_dbTapHandler=o},exports.addMulticamSelector=function(e,t){Promise.resolve().then(function(){return require("./multicamv2-73c22260.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},exports.addMulticamSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./multicamv2-fee75fc1.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)})},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then(function(){return require("./nextEpisodeButton-86065304.js")}).then(function(n){var o=n.default,l=d.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)})},exports.addOutputtingOverlay=function(e,t){var r=d.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then(function(){return require("./playlist-64dbfa4a.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)})},exports.addResolutionModule=function(e,t,r){Promise.resolve().then(function(){return require("./resolution-5e1f1897.js")}).then(function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=d.getPlayer(e),a=s.getRenditions(e);(null==a?void 0:a.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:a},l.controlBar.children().length-4))})},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=p(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-rewind-button");var a=d.parseSvgString(l);return o.append(a),n}return r(s,[{key:"handleClick",value:function(){a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then(function(){return require("./series-5b4f0d53.js")}).then(function(n){var o=n.seriesModule,l=d.getPlayer(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]&&n.handleSeasonChange(t[e],e,l,r)})},c=0;c<a.length;c++)s(c)})},exports.addSeriesSelectorV2=function(e,t){Promise.resolve().then(function(){return require("./series-v2-2f4f32b3.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},exports.addSeriesSelectorV2_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./series-v2-0ca89367.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)})},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then(function(){return require("./settings-icon-743e2d7d.js")}).then(function(r){var n,o,l,a,s=r.default,c=d.getPlayer(e);i.registerComponent("settingsSelector",s),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(a=l[0])||void 0===a||a.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)})},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=p(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-skip-button");var a=d.parseSvgString(l);return o.append(a),n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=p(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=c.getLocalisation("slowMoText")||"Slow Mo",n}return r(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},exports.addVideoSelector=function(e,t){Promise.resolve().then(function(){return require("./videoSelector-f80fd578.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})},exports.addVideoSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./videoSelector-7b96e887.js")}).then(function(r){var n=r.default,o=d.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("axios"),r=require("./skin-f87e1c22.js"),l=require("./browser-38ff3331.js"),a=require("js-cookie"),d=require("ua-parser-js"),u=require("./captions-afd38b2e.js");function s(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){s("event",e,t)}var v={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 m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function p(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?m(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):m(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var f={name:"@viewlift/player-backup",version:"2.0.92-smartTv-test8",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0",install:"^0.13.0","js-cookie":"^3.0.5",npm:"^11.5.2","ua-parser-js":"^2.0.3","video.js":"^7.3.26","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-contrib-quality-menu":"^1.0.3","videojs-mux":"^4.21.7"}};window.vl_player_version=f.version;var g,I=function(e,t){var n,i,r,l,a,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":y.get()+"".concat(null==v?void 0:v.getVideoDetails),params:p({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:t,"Sdk-Version":f.version},withCredentials:!0})},w=function(e,t){var n,i,r,l;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:y.get()+v.getLinearChannelDetails,params:p(p(p(p(p({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:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},E=function(){var e=t(n.mark(function e(t){var i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:return i=e.sent,e.abrupt("return",o({url:y.get()+"".concat(null==v?void 0:v.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:p({},t),params:p({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),T=function(e,t){var n,i,r=window.contentType;return o({method:"GET",url:y.get()+"".concat(null==v?void 0:v.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},h=function(e){var t=e.videoId;return o({method:"GET",url:y.get()+"".concat(null==v?void 0:v.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},y=(g=null==v?void 0:v.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),_=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},b=null;function D(){return{set:function(e){e&&(b=e)},get:function(){return b}}}var F,O,P,S,L,V,R=function(){var e=t(n.mark(function e(){var t,i,r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=D().get(),i=y.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});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)}}(),W=null,x=function(){var e=t(n.mark(function e(){var t;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!_(t)){e.next=6;break}return W||(W=R().then(function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&D().set(r),o||t}).catch(function(e){return console.error("Error fetching refresh token",e),t}).finally(function(){W=null})),e.abrupt("return",W);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),C=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},A=function(e){O=e},N=function(){return O},B=function(){return F},M=function(e){P=e},j=function(e){if(S){var t=S.get(e);M(t+1)}},U=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}});function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function H(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?k(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var G=0,z=function(){var e,t,n,i,o,r,l,a=N();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.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 Y(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function q(){var e=window.sessionStorage.getItem("uid");return e||(e=Y(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=t(n.mark(function e(){var t,i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function K(e){return e?String(e):""}window.initialise=function(e){window.sid=Y(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,c(r?"FAILED_TO_START":"DROPPED_STREAM",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),c("PLAY",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":z(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&G<4)G++,c("BUFFERING",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",H({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),vid:z()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;c("AD_REQUEST",H({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),vid:z(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",H({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:z()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(G=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Q(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Q=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark(function e(t){var i,r,l,a,d,u,s,c,m,p,f,g,I,w,E,T,h,_,b,D;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:return T=e.sent,h=C(T),_=null==h?void 0:h.site,b=null==h?void 0:h.siteId,e.t0=H,e.t1=H,e.t2=H({aid:_,cid:b,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=q(),e.t5=z(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=null!==(a=t.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:null,e.t17=!0===t.isAdEvent?K(t.adPosition):"",e.next=26,X();case 26:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=t.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=t.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=t.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=t.resWidth)&&void 0!==c?c:null,e.t26=null!==(m=t.bufferHealth)&&void 0!==m?m:null,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(p=window)||void 0===p||null===(f=p.customData)||void 0===f||null===(g=f.beacon)||void 0===g?void 0:g.params,e.t31=(0,e.t0)(e.t29,e.t30),D=[e.t31],o({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||y.get()+v.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:D}).catch(function(e){console.error(e)});case 42:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var Z=function(){var e=U.get();return e>=0?e+1:1},$=function(){var e,t,n,i=B(),o=N(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=U.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function te(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ee(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ee(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}window._deviceInfo=d.UAParser(navigator.userAgent);var ne=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},ie=function(e){var t=oe(e,"video.tags",[]),n=oe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},oe=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},re=function(){var e,t,n,i,o,l,d,u,s,c,v,m,p,f,g,I,w,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0,F=(null==D?void 0:D.siteName)||"",O=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(e=D[O])||void 0===e?void 0:e.metadata)||(null==D||null===(t=D[O])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),S=r.getPlayer(b);if(!_.includes("VIEWLIFT_"))return _;var L,V=window.getComputedStyle(document.getElementById(b),null),R=Math.trunc(V.getPropertyValue("height").slice(0,-2)),W=Math.trunc(V.getPropertyValue("width").slice(0,-2)),x="linearchannel"===O?null==D||null===(i=D.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(l=o.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===l||null===(d=l.content)||void 0===d?void 0:d.id:oe(D,"video.gist.id",""),C="linearchannel"===O?null==D||null===(u=D.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===c?void 0:c.title:oe(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(L=window)||void 0===L||L.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=te(te({},le(P)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:R,VIEWLIFT_SIZE:ne(W,R),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:oe(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==S||null===(m=S.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==S||null===(p=S.options_)||void 0===p?void 0:p.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==F?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ie(D),VIEWLIFT_MEDIA_ID:x,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(oe(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:x,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+oe(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:oe(null===(f=window)||void 0===f||null===(g=f.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==F?"":oe(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:x,VIEWLIFT_CONTENT_TITLE:C,VIEWLIFT_CONTENT_SERIES_TITLE:oe(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:oe(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:$(),VIEWLIFT_SEASON_NUMBER:Z(),VIEWLIFT_CONTENT_TAGS:ie(D),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var M in B){var j=new RegExp(M,"g");_=_.replace(j,B[M])}return _},le=function(e){var t,n,i,o,r,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ae(e);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(l.isMobile()?c?u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=l.isMobile()?te(te({},u),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):te(te({},u),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=l.isMobile()?te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=te(te({},u),{},{VIEWLIFT_AFID:s.get("afid")})},ae=function(e){var t,n,i,o,r,l,a={},d=new Map;return(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)})),null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i||i.SVOD,(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1?(a=te(te({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.tve")||d.get("sfid.tve")}),a="lgTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=te(te({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.dtc")||d.get("sfid.dtc")}),a="lgTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})),a},de=function(e){var t=null;try{var n,i,o,r,l,a,d,u,s,c,v,m,p,f,g,I,w,E,T,h,y,_,b,D,F,O,P,S,L;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(y=h.samsung_tv)||void 0===y?void 0:y.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var V,R,W,x;t=null==e||null===(V=e.ads)||void 0===V||null===(R=V.preRoll)||void 0===R||null===(W=R.adTags)||void 0===W||null===(x=W.lg_tv)||void 0===x?void 0:x.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(p=m.vizioTv)&&void 0!==p&&p.active){var C,A,N,B;t=null==e||null===(C=e.ads)||void 0===C||null===(A=C.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(f=e.ads)&&void 0!==f&&null!==(g=f.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,j,U,k;t=null==e||null===(M=e.ads)||void 0===M||null===(j=M.preRoll)||void 0===j||null===(U=j.adTags)||void 0===U||null===(k=U.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(_=e.ads)||void 0===_||null===(b=_.preRoll)||void 0===b||null===(D=b.adTags)||void 0===D||null===(F=D.web)||void 0===F?void 0:F.active)&&(null==e||null===(O=e.ads)||void 0===O||null===(P=O.preRoll)||void 0===P||null===(S=P.adTags)||void 0===S||null===(L=S.web)||void 0===L?void 0:L.url)}catch(e){}return t},ue=function(e,t){var n,i,o,r,a,d,u,s,c,v,m,p,f,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(p=m.streamingInfo)||void 0===p||null===(f=p.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return ce(E);if(I){var y=ve(w,t);return y.src=re(y.src,t,e),y}if("Safari"!==l.detectBrowser()&&h){var _=se(w);return _.src=re(_.src,t,e),_}if(T){var b=ce(w);return b.src=re(b.src,t,e),b}if(null!=w&&w.mpeg){var D=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return D.src=re(D.src,t,e),D}return null},se=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},ce=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},ve=function(e,t){var n=e.fairPlayCmaf||e.fairPlay,o=e.widevine,a=e.playReady,d=l.detectBrowser();if(r.getPlayer(t),"Safari"===d){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(n);return me(t),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(me(t),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var me=function(e){var t=r.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==l.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},pe=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},fe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ge=!1,Ie=function(e,t,n){var i=re(t,e,n),o=r.getPlayer(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,l=r.getPlayer(e);if(null!==l.el_){ge=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ge&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.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,i)}};function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var Ee=function(e){return!!i.getPlayer("".concat(e))},Te=function(){var e=t(n.mark(function e(t,i){var o,l,a,d=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,x();case 3:return l=e.sent,a=r.getPlayer(t),e.abrupt("return",new Promise(function(e,n){w(i,l).then(function(n){var r=null==n?void 0:n.data;window.sid=Y(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ue(r,t);A(r),l&&o?(_e(t,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){n({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),he=function(){var e=t(n.mark(function e(t,i){var o,l,a,d,s,c,v=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,x();case 4:d=e.sent;case 5:return(B()||null)&&j(i),s=0,c=0,null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&T(i,d).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,n){I(i,d).then(function(i){var o,l,a=null==i?void 0:i.data,d=(null==a||null===(o=a.video)||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;A(i.data);var v=de(a);v&&Ie(t,v,a);var m=ue(a,t);if(m){var p,f,g,I,w,E,T,h,y,_,b,D,F,O,P=(null==a||null===(p=a.video)||void 0===p||null===(f=p.gist)||void 0===f?void 0:f.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),S=r.getPlayer(t);if(S.poster(P),_e(t,m),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){fe(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){s&&c<95&&setTimeout(function(){S.currentTime(s)},0)}),S.one("error",function(){var e;n({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(y=a.video)||void 0===y||null===(_=y.closedCaptions)||void 0===_?void 0:_.length)>0)b=((null==a||null===(D=a.video)||void 0===D||null===(F=D.contentDetails)||void 0===F?void 0:F.closedCaptions)||(null==a||null===(O=a.video)||void 0===O?void 0:O.closedCaptions)).filter(function(e){return"VTT"===e.format}),u.addCaptions(t,b);else u.removeCaptions(t)}else pe(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){be(e,t,n,i)})}));case 11:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),ye=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()},_e=function(e,t){var n=r.getPlayer(e);n&&n.src(t)},be=function(t,n,i,o){var r,l,a,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==t||null===(a=t.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ee(n)&&pe(n,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?we(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):we(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))};exports.authenticateLC=Te,exports.baseUrlManager=y,exports.clearError=fe,exports.createIdxMapping=function(e){S=new Map,e.map(function(e,t){S.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;h({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=r.getPlayer(e);if(ye(),r.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=de,exports.getCurrentSeries=B,exports.getCurrentVideo=N,exports.getDecodedToken=C,exports.getEntitlementData=function(e,t,n,i){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getEpisodeNumber=$,exports.getLinearChannelDetails=w,exports.getSeasonNumber=Z,exports.getSeriesDetails=function(e,t){var n,i,r=C(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):o({url:y.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=h,exports.getSeriesWatchMap=function(){return L},exports.getSource=ue,exports.getToken=x,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=q,exports.getVideoDetails=I,exports.getVideoIdx=function(){return P},exports.getVideoInfo=T,exports.handleError=pe,exports.initialiseAdvertisement=Ie,exports.initiateErrorHandling=be,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=r.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return i(e).paused()},exports.isPlayerInitialised=Ee,exports.isTokenExpired=_,exports.load=he,exports.loadVideo=_e,exports.loadVideoInstantly=function(e,t,n){var i=r.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){i(e).pause()},exports.play=function(e){i(e).play()},exports.refreshTokenManager=D,exports.replaceMacros=re,exports.rewind=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],s("js",new Date),s("config",e)},exports.saveWatchHistory=E,exports.seasonIdxManager=U,exports.setCurrentSeries=function(e){F=e},exports.setCurrentVideo=A,exports.setVideoIdx=M,exports.setVideoIdxById=j,exports.skip=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("axios"),r=require("./skin-f87e1c22.js"),l=require("./browser-38ff3331.js"),a=require("js-cookie"),d=require("ua-parser-js"),u=require("./captions-afd38b2e.js");function s(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){s("event",e,t)}var v={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 m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function p(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?m(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):m(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var f={name:"@viewlift/player-backup",version:"2.0.92-smartTv-test9",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0",install:"^0.13.0","js-cookie":"^3.0.5",npm:"^11.5.2","ua-parser-js":"^2.0.3","video.js":"^7.3.26","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-contrib-quality-menu":"^1.0.3","videojs-mux":"^4.21.7"}};window.vl_player_version=f.version;var g,I=function(e,t){var n,i,r,l,a,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":y.get()+"".concat(null==v?void 0:v.getVideoDetails),params:p({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:t,"Sdk-Version":f.version},withCredentials:!0})},w=function(e,t){var n,i,r,l;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:y.get()+v.getLinearChannelDetails,params:p(p(p(p(p({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:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},E=function(){var e=t(n.mark(function e(t){var i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:return i=e.sent,e.abrupt("return",o({url:y.get()+"".concat(null==v?void 0:v.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:p({},t),params:p({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),T=function(e,t){var n,i,r=window.contentType;return o({method:"GET",url:y.get()+"".concat(null==v?void 0:v.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},h=function(e){var t=e.videoId;return o({method:"GET",url:y.get()+"".concat(null==v?void 0:v.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},y=(g=null==v?void 0:v.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),_=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},b=null;function D(){return{set:function(e){e&&(b=e)},get:function(){return b}}}var F,O,P,S,L,V,R=function(){var e=t(n.mark(function e(){var t,i,r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=D().get(),i=y.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});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)}}(),W=null,x=function(){var e=t(n.mark(function e(){var t;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!_(t)){e.next=6;break}return W||(W=R().then(function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&D().set(r),o||t}).catch(function(e){return console.error("Error fetching refresh token",e),t}).finally(function(){W=null})),e.abrupt("return",W);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),C=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},A=function(e){O=e},N=function(){return O},B=function(){return F},M=function(e){P=e},j=function(e){if(S){var t=S.get(e);M(t+1)}},U=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}});function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function H(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?k(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var G=0,z=function(){var e,t,n,i,o,r,l,a=N();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.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 Y(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function q(){var e=window.sessionStorage.getItem("uid");return e||(e=Y(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=t(n.mark(function e(){var t,i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function K(e){return e?String(e):""}window.initialise=function(e){window.sid=Y(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,c(r?"FAILED_TO_START":"DROPPED_STREAM",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),c("PLAY",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":z(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&G<4)G++,c("BUFFERING",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",H({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),vid:z()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;c("AD_REQUEST",H({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),vid:z(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",H({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:z()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(G=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Q(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Q=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark(function e(t){var i,r,l,a,d,u,s,c,m,p,f,g,I,w,E,T,h,_,b,D;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:return T=e.sent,h=C(T),_=null==h?void 0:h.site,b=null==h?void 0:h.siteId,e.t0=H,e.t1=H,e.t2=H({aid:_,cid:b,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=q(),e.t5=z(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=null!==(a=t.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:null,e.t17=!0===t.isAdEvent?K(t.adPosition):"",e.next=26,X();case 26:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=t.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=t.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=t.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=t.resWidth)&&void 0!==c?c:null,e.t26=null!==(m=t.bufferHealth)&&void 0!==m?m:null,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(p=window)||void 0===p||null===(f=p.customData)||void 0===f||null===(g=f.beacon)||void 0===g?void 0:g.params,e.t31=(0,e.t0)(e.t29,e.t30),D=[e.t31],o({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||y.get()+v.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:D}).catch(function(e){console.error(e)});case 42:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var Z=function(){var e=U.get();return e>=0?e+1:1},$=function(){var e,t,n,i=B(),o=N(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=U.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function te(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ee(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ee(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}window._deviceInfo=d.UAParser(navigator.userAgent);var ne=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},ie=function(e){var t=oe(e,"video.tags",[]),n=oe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},oe=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},re=function(){var e,t,n,i,o,l,d,u,s,c,v,m,p,f,g,I,w,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0,F=(null==D?void 0:D.siteName)||"",O=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(e=D[O])||void 0===e?void 0:e.metadata)||(null==D||null===(t=D[O])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),S=r.getPlayer(b);if(!_.includes("VIEWLIFT_"))return _;var L,V=window.getComputedStyle(document.getElementById(b),null),R=Math.trunc(V.getPropertyValue("height").slice(0,-2)),W=Math.trunc(V.getPropertyValue("width").slice(0,-2)),x="linearchannel"===O?null==D||null===(i=D.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(l=o.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===l||null===(d=l.content)||void 0===d?void 0:d.id:oe(D,"video.gist.id",""),C="linearchannel"===O?null==D||null===(u=D.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===c?void 0:c.title:oe(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(L=window)||void 0===L||L.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=te(te({},le(P)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:R,VIEWLIFT_SIZE:ne(W,R),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:oe(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==S||null===(m=S.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==S||null===(p=S.options_)||void 0===p?void 0:p.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==F?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ie(D),VIEWLIFT_MEDIA_ID:x,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(oe(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:x,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+oe(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:oe(null===(f=window)||void 0===f||null===(g=f.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==F?"":oe(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:x,VIEWLIFT_CONTENT_TITLE:C,VIEWLIFT_CONTENT_SERIES_TITLE:oe(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:oe(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:$(),VIEWLIFT_SEASON_NUMBER:Z(),VIEWLIFT_CONTENT_TAGS:ie(D),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var M in B){var j=new RegExp(M,"g");_=_.replace(j,B[M])}return _},le=function(e){var t,n,i,o,r,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ae(e);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(l.isMobile()?c?u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=l.isMobile()?te(te({},u),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):te(te({},u),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=l.isMobile()?te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=te(te({},u),{},{VIEWLIFT_AFID:s.get("afid")})},ae=function(e){var t,n,i,o,r,l,a={},d=new Map;return(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)})),null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i||i.SVOD,(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1?(a=te(te({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.tve")||d.get("sfid.tve")}),a="lgTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=te(te({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.dtc")||d.get("sfid.dtc")}),a="lgTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})),a},de=function(e){var t=null;try{var n,i,o,r,l,a,d,u,s,c,v,m,p,f,g,I,w,E,T,h,y,_,b,D,F,O,P,S,L;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(y=h.samsung_tv)||void 0===y?void 0:y.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var V,R,W,x;t=null==e||null===(V=e.ads)||void 0===V||null===(R=V.preRoll)||void 0===R||null===(W=R.adTags)||void 0===W||null===(x=W.lg_tv)||void 0===x?void 0:x.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(p=m.vizioTv)&&void 0!==p&&p.active){var C,A,N,B;t=null==e||null===(C=e.ads)||void 0===C||null===(A=C.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(f=e.ads)&&void 0!==f&&null!==(g=f.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,j,U,k;t=null==e||null===(M=e.ads)||void 0===M||null===(j=M.preRoll)||void 0===j||null===(U=j.adTags)||void 0===U||null===(k=U.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(_=e.ads)||void 0===_||null===(b=_.preRoll)||void 0===b||null===(D=b.adTags)||void 0===D||null===(F=D.web)||void 0===F?void 0:F.active)&&(null==e||null===(O=e.ads)||void 0===O||null===(P=O.preRoll)||void 0===P||null===(S=P.adTags)||void 0===S||null===(L=S.web)||void 0===L?void 0:L.url)}catch(e){}return t},ue=function(e,t){var n,i,o,r,a,d,u,s,c,v,m,p,f,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(p=m.streamingInfo)||void 0===p||null===(f=p.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return ce(E);if(I){var y=ve(w,t);return y.src=re(y.src,t,e),y}if("Safari"!==l.detectBrowser()&&h){var _=se(w);return _.src=re(_.src,t,e),_}if(T){var b=ce(w);return b.src=re(b.src,t,e),b}if(null!=w&&w.mpeg){var D=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return D.src=re(D.src,t,e),D}return null},se=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},ce=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},ve=function(e,t){var n=e.fairPlayCmaf||e.fairPlay,o=e.widevine,a=e.playReady,d=l.detectBrowser();if(r.getPlayer(t),"Safari"===d){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(n);return me(t),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(me(t),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var me=function(e){var t=r.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==l.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},pe=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},fe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ge=!1,Ie=function(e,t,n){var i=re(t,e,n),o=r.getPlayer(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,l=r.getPlayer(e);if(null!==l.el_){ge=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ge&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.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,i)}};function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var Ee=function(e){return!!i.getPlayer("".concat(e))},Te=function(){var e=t(n.mark(function e(t,i){var o,l,a,d=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,x();case 3:return l=e.sent,a=r.getPlayer(t),e.abrupt("return",new Promise(function(e,n){w(i,l).then(function(n){var r=null==n?void 0:n.data;window.sid=Y(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ue(r,t);A(r),l&&o?(_e(t,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){n({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),he=function(){var e=t(n.mark(function e(t,i){var o,l,a,d,s,c,v=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,x();case 4:d=e.sent;case 5:return(B()||null)&&j(i),s=0,c=0,null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&T(i,d).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,n){I(i,d).then(function(i){var o,l,a=null==i?void 0:i.data,d=(null==a||null===(o=a.video)||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;A(i.data);var v=de(a);v&&Ie(t,v,a);var m=ue(a,t);if(m){var p,f,g,I,w,E,T,h,y,_,b,D,F,O,P=(null==a||null===(p=a.video)||void 0===p||null===(f=p.gist)||void 0===f?void 0:f.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),S=r.getPlayer(t);if(S.poster(P),_e(t,m),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){fe(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){s&&c<95&&setTimeout(function(){S.currentTime(s)},0)}),S.one("error",function(){var e;n({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(y=a.video)||void 0===y||null===(_=y.closedCaptions)||void 0===_?void 0:_.length)>0)b=((null==a||null===(D=a.video)||void 0===D||null===(F=D.contentDetails)||void 0===F?void 0:F.closedCaptions)||(null==a||null===(O=a.video)||void 0===O?void 0:O.closedCaptions)).filter(function(e){return"VTT"===e.format}),u.addCaptions(t,b);else u.removeCaptions(t)}else pe(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){be(e,t,n,i)})}));case 11:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),ye=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()},_e=function(e,t){var n=r.getPlayer(e);n&&n.src(t)},be=function(t,n,i,o){var r,l,a,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==t||null===(a=t.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ee(n)&&pe(n,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?we(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):we(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))};exports.authenticateLC=Te,exports.baseUrlManager=y,exports.clearError=fe,exports.createIdxMapping=function(e){S=new Map,e.map(function(e,t){S.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;h({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=r.getPlayer(e);if(ye(),r.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=de,exports.getCurrentSeries=B,exports.getCurrentVideo=N,exports.getDecodedToken=C,exports.getEntitlementData=function(e,t,n,i){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getEpisodeNumber=$,exports.getLinearChannelDetails=w,exports.getSeasonNumber=Z,exports.getSeriesDetails=function(e,t){var n,i,r=C(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):o({url:y.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=h,exports.getSeriesWatchMap=function(){return L},exports.getSource=ue,exports.getToken=x,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=q,exports.getVideoDetails=I,exports.getVideoIdx=function(){return P},exports.getVideoInfo=T,exports.handleError=pe,exports.initialiseAdvertisement=Ie,exports.initiateErrorHandling=be,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=r.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return i(e).paused()},exports.isPlayerInitialised=Ee,exports.isTokenExpired=_,exports.load=he,exports.loadVideo=_e,exports.loadVideoInstantly=function(e,t,n){var i=r.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){i(e).pause()},exports.play=function(e){i(e).play()},exports.refreshTokenManager=D,exports.replaceMacros=re,exports.rewind=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],s("js",new Date),s("config",e)},exports.saveWatchHistory=E,exports.seasonIdxManager=U,exports.setCurrentSeries=function(e){F=e},exports.setCurrentVideo=A,exports.setVideoIdx=M,exports.setVideoIdxById=j,exports.skip=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("axios"),r=require("./skin-f87e1c22.js"),l=require("./browser-38ff3331.js"),a=require("js-cookie"),d=require("ua-parser-js"),u=require("./captions-afd38b2e.js");function s(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){s("event",e,t)}var v={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 m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function p(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?m(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):m(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var f={name:"@viewlift/player-backup",version:"2.0.92-smartTv-test10",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0",install:"^0.13.0","js-cookie":"^3.0.5",npm:"^11.5.2","ua-parser-js":"^2.0.3","video.js":"^7.3.26","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-contrib-quality-menu":"^1.0.3","videojs-mux":"^4.21.7"}};window.vl_player_version=f.version;var g,I=function(e,t){var n,i,r,l,a,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":y.get()+"".concat(null==v?void 0:v.getVideoDetails),params:p({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:t,"Sdk-Version":f.version},withCredentials:!0})},w=function(e,t){var n,i,r,l;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:y.get()+v.getLinearChannelDetails,params:p(p(p(p(p({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:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},E=function(){var e=t(n.mark(function e(t){var i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:return i=e.sent,e.abrupt("return",o({url:y.get()+"".concat(null==v?void 0:v.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:p({},t),params:p({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),T=function(e,t){var n,i,r=window.contentType;return o({method:"GET",url:y.get()+"".concat(null==v?void 0:v.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},h=function(e){var t=e.videoId;return o({method:"GET",url:y.get()+"".concat(null==v?void 0:v.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},y=(g=null==v?void 0:v.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),_=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},b=null;function D(){return{set:function(e){e&&(b=e)},get:function(){return b}}}var F,O,P,S,L,V,R=function(){var e=t(n.mark(function e(){var t,i,r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=D().get(),i=y.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});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)}}(),W=null,x=function(){var e=t(n.mark(function e(){var t;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!_(t)){e.next=6;break}return W||(W=R().then(function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&D().set(r),o||t}).catch(function(e){return console.error("Error fetching refresh token",e),t}).finally(function(){W=null})),e.abrupt("return",W);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),C=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},A=function(e){O=e},N=function(){return O},B=function(){return F},M=function(e){P=e},j=function(e){if(S){var t=S.get(e);M(t+1)}},U=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}});function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function H(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?k(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var G=0,z=function(){var e,t,n,i,o,r,l,a=N();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.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 Y(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function q(){var e=window.sessionStorage.getItem("uid");return e||(e=Y(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=t(n.mark(function e(){var t,i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function K(e){return e?String(e):""}window.initialise=function(e){window.sid=Y(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,c(r?"FAILED_TO_START":"DROPPED_STREAM",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),c("PLAY",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":z(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&G<4)G++,c("BUFFERING",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",H({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),vid:z()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;c("AD_REQUEST",H({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),vid:z(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",H({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:z()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(G=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Q(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Q=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark(function e(t){var i,r,l,a,d,u,s,c,m,p,f,g,I,w,E,T,h,_,b,D;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:return T=e.sent,h=C(T),_=null==h?void 0:h.site,b=null==h?void 0:h.siteId,e.t0=H,e.t1=H,e.t2=H({aid:_,cid:b,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=q(),e.t5=z(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=null!==(a=t.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:null,e.t17=!0===t.isAdEvent?K(t.adPosition):"",e.next=26,X();case 26:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=t.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=t.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=t.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=t.resWidth)&&void 0!==c?c:null,e.t26=null!==(m=t.bufferHealth)&&void 0!==m?m:null,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(p=window)||void 0===p||null===(f=p.customData)||void 0===f||null===(g=f.beacon)||void 0===g?void 0:g.params,e.t31=(0,e.t0)(e.t29,e.t30),D=[e.t31],o({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||y.get()+v.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:D}).catch(function(e){console.error(e)});case 42:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var Z=function(){var e=U.get();return e>=0?e+1:1},$=function(){var e,t,n,i=B(),o=N(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=U.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function te(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ee(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ee(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}window._deviceInfo=d.UAParser(navigator.userAgent);var ne=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},ie=function(e){var t=oe(e,"video.tags",[]),n=oe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},oe=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},re=function(){var e,t,n,i,o,l,d,u,s,c,v,m,p,f,g,I,w,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0,F=(null==D?void 0:D.siteName)||"",O=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(e=D[O])||void 0===e?void 0:e.metadata)||(null==D||null===(t=D[O])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),S=r.getPlayer(b);if(!_.includes("VIEWLIFT_"))return _;var L,V=window.getComputedStyle(document.getElementById(b),null),R=Math.trunc(V.getPropertyValue("height").slice(0,-2)),W=Math.trunc(V.getPropertyValue("width").slice(0,-2)),x="linearchannel"===O?null==D||null===(i=D.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(l=o.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===l||null===(d=l.content)||void 0===d?void 0:d.id:oe(D,"video.gist.id",""),C="linearchannel"===O?null==D||null===(u=D.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===c?void 0:c.title:oe(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(L=window)||void 0===L||L.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=te(te({},le(P)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:R,VIEWLIFT_SIZE:ne(W,R),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:oe(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==S||null===(m=S.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==S||null===(p=S.options_)||void 0===p?void 0:p.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==F?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ie(D),VIEWLIFT_MEDIA_ID:x,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(oe(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:x,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+oe(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:oe(null===(f=window)||void 0===f||null===(g=f.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==F?"":oe(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:x,VIEWLIFT_CONTENT_TITLE:C,VIEWLIFT_CONTENT_SERIES_TITLE:oe(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:oe(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:$(),VIEWLIFT_SEASON_NUMBER:Z(),VIEWLIFT_CONTENT_TAGS:ie(D),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var M in B){var j=new RegExp(M,"g");_=_.replace(j,B[M])}return _},le=function(e){var t,n,i,o,r,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ae(e);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(l.isMobile()?c?u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=l.isMobile()?te(te({},u),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):te(te({},u),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=l.isMobile()?te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=te(te({},u),{},{VIEWLIFT_AFID:s.get("afid")})},ae=function(e){var t,n,i,o,r,l,a={},d=new Map;return(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)})),null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i||i.SVOD,(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1?(a=te(te({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.tve")||d.get("sfid.tve")}),a="lgTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=te(te({},a),{},{VIEWLIFT_SFID:d.get("sfid.samsungtv.dtc")||d.get("sfid.dtc")}),a="lgTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})),a},de=function(e){var t=null;try{var n,i,o,r,l,a,d,u,s,c,v,m,p,f,g,I,w,E,T,h,y,_,b,D,F,O,P,S,L;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(y=h.samsung_tv)||void 0===y?void 0:y.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var V,R,W,x;t=null==e||null===(V=e.ads)||void 0===V||null===(R=V.preRoll)||void 0===R||null===(W=R.adTags)||void 0===W||null===(x=W.lg_tv)||void 0===x?void 0:x.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(p=m.vizioTv)&&void 0!==p&&p.active){var C,A,N,B;t=null==e||null===(C=e.ads)||void 0===C||null===(A=C.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(f=e.ads)&&void 0!==f&&null!==(g=f.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,j,U,k;t=null==e||null===(M=e.ads)||void 0===M||null===(j=M.preRoll)||void 0===j||null===(U=j.adTags)||void 0===U||null===(k=U.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(_=e.ads)||void 0===_||null===(b=_.preRoll)||void 0===b||null===(D=b.adTags)||void 0===D||null===(F=D.web)||void 0===F?void 0:F.active)&&(null==e||null===(O=e.ads)||void 0===O||null===(P=O.preRoll)||void 0===P||null===(S=P.adTags)||void 0===S||null===(L=S.web)||void 0===L?void 0:L.url)}catch(e){}return t},ue=function(e,t){var n,i,o,r,a,d,u,s,c,v,m,p,f,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(p=m.streamingInfo)||void 0===p||null===(f=p.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return ce(E);if(I){var y=ve(w,t);return y.src=re(y.src,t,e),y}if("Safari"!==l.detectBrowser()&&h){var _=se(w);return _.src=re(_.src,t,e),_}if(T){var b=ce(w);return b.src=re(b.src,t,e),b}if(null!=w&&w.mpeg){var D=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return D.src=re(D.src,t,e),D}return null},se=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},ce=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},ve=function(e,t){var n=e.fairPlayCmaf||e.fairPlay,o=e.widevine,a=e.playReady,d=l.detectBrowser();if(r.getPlayer(t),"Safari"===d){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(n);return me(t),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(me(t),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var me=function(e){var t=r.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==l.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},pe=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},fe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ge=!1,Ie=function(e,t,n){var i=re(t,e,n),o=r.getPlayer(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,l=r.getPlayer(e);if(null!==l.el_){ge=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ge&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.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,i)}};function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var Ee=function(e){return!!i.getPlayer("".concat(e))},Te=function(){var e=t(n.mark(function e(t,i){var o,l,a,d=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,x();case 3:return l=e.sent,a=r.getPlayer(t),e.abrupt("return",new Promise(function(e,n){w(i,l).then(function(n){var r=null==n?void 0:n.data;window.sid=Y(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ue(r,t);A(r),l&&o?(_e(t,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){n({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),he=function(){var e=t(n.mark(function e(t,i){var o,l,a,d,s,c,v=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,x();case 4:d=e.sent;case 5:return(B()||null)&&j(i),s=0,c=0,null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&T(i,d).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,n){I(i,d).then(function(i){var o,l,a=null==i?void 0:i.data,d=(null==a||null===(o=a.video)||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;A(i.data);var v=de(a);v&&Ie(t,v,a);var m=ue(a,t);if(m){var p,f,g,I,w,E,T,h,y,_,b,D,F,O,P=(null==a||null===(p=a.video)||void 0===p||null===(f=p.gist)||void 0===f?void 0:f.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),S=r.getPlayer(t);if(S.poster(P),_e(t,m),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){fe(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){s&&c<95&&setTimeout(function(){S.currentTime(s)},0)}),S.one("error",function(){var e;n({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(y=a.video)||void 0===y||null===(_=y.closedCaptions)||void 0===_?void 0:_.length)>0)b=((null==a||null===(D=a.video)||void 0===D||null===(F=D.contentDetails)||void 0===F?void 0:F.closedCaptions)||(null==a||null===(O=a.video)||void 0===O?void 0:O.closedCaptions)).filter(function(e){return"VTT"===e.format}),u.addCaptions(t,b);else u.removeCaptions(t)}else pe(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){be(e,t,n,i)})}));case 11:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),ye=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()},_e=function(e,t){var n=r.getPlayer(e);n&&n.src(t)},be=function(t,n,i,o){var r,l,a,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==t||null===(a=t.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ee(n)&&pe(n,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?we(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):we(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))};exports.authenticateLC=Te,exports.baseUrlManager=y,exports.clearError=fe,exports.createIdxMapping=function(e){S=new Map,e.map(function(e,t){S.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;h({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=r.getPlayer(e);if(ye(),r.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=de,exports.getCurrentSeries=B,exports.getCurrentVideo=N,exports.getDecodedToken=C,exports.getEntitlementData=function(e,t,n,i){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getEpisodeNumber=$,exports.getLinearChannelDetails=w,exports.getSeasonNumber=Z,exports.getSeriesDetails=function(e,t){var n,i,r=C(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):o({url:y.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=h,exports.getSeriesWatchMap=function(){return L},exports.getSource=ue,exports.getToken=x,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=q,exports.getVideoDetails=I,exports.getVideoIdx=function(){return P},exports.getVideoInfo=T,exports.handleError=pe,exports.initialiseAdvertisement=Ie,exports.initiateErrorHandling=be,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=r.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return i(e).paused()},exports.isPlayerInitialised=Ee,exports.isTokenExpired=_,exports.load=he,exports.loadVideo=_e,exports.loadVideoInstantly=function(e,t,n){var i=r.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){i(e).pause()},exports.play=function(e){i(e).play()},exports.refreshTokenManager=D,exports.replaceMacros=re,exports.rewind=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],s("js",new Date),s("config",e)},exports.saveWatchHistory=E,exports.seasonIdxManager=U,exports.setCurrentSeries=function(e){F=e},exports.setCurrentVideo=A,exports.setVideoIdx=M,exports.setVideoIdxById=j,exports.skip=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),a=require("./skin-f87e1c22.js"),o=require("./generic-0c35f368.js"),l=require("./autoNextVideo-c350df7b.js"),u=require("@babel/runtime/helpers/typeof"),s=require("video.js"),c=require("@babel/runtime/helpers/asyncToGenerator"),d=require("@babel/runtime/regenerator"),p=require("@babel/runtime/helpers/defineProperty"),v=require("@babel/runtime/helpers/slicedToArray"),m=[],f=function(e,t){var n=a.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=o.getVideoIdx();l.switchToNext(i,e,m)}};function g(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(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}e={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},t=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"===u(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},r=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},s.registerPlugin("thumbnails",function(i){var a,o,l,u,s,c,d,p,v,m;if(u=t({},e,i),c=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=c.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",s=document.createElement("img"),l.appendChild(s),s.src=u[0].src,s.className="vjs-thumbnail",t(s.style,u[0].style),s.style.left||s.style.right||(s.onload=function(){s.style.left=-s.naturalWidth/2+"px"}),p=c.duration(),c.on("durationchange",function(e){p=c.duration()}),c.on("loadedmetadata",function(e){p=c.duration()}),(d=c.controlBar.progressControl).el().appendChild(l),v=function(e){var i,a,o,c,v,m,f,g,h,b;for(a in o=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((b=r(d.el()).getBoundingClientRect()).width||b.right)+h,m=e.pageX,e.changedTouches&&(m=e.changedTouches[0].pageX),c=m||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c-=r(d.el()).getBoundingClientRect().left+h,i=Math.floor((c-d.el().offsetLeft)/d.width()*p),u)i>a&&(o=Math.max(o,a));(v=u[o]).src&&s.src!=v.src&&(s.src=v.src),v.style&&s.style!=v.style&&t(s.style,v.style),c+(g=function(e,t){var r;return t?parseFloat(t):"auto"!==(r=n(e)("clip"))&&"inherit"!==r&&4===(r=r.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(r[1])-parseFloat(r[3]):0}(s,v.width||u[0].width)/2)>f?c-=c+g-f:c<g&&(c=g),l.style.left=c+"px"},null!==(a=window)&&void 0!==a&&null!==(o=a.customData)&&void 0!==o&&o.isSmartTV){var f=function(){var e,t,n=0,r=(null===(e=d.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;r<65?r=5:r>=c.el().offsetWidth-180?r=c.el().offsetWidth-240:r-=58;var i=c.currentTime();for(t in u)i>t&&(n=Math.max(n,t));var a=u[n];a.uri&&""!=a.uri&&s.src!=a.uri?(s.src=a.uri,l.style.left=r+"px",s.style.opacity="1"):(l.style.left="-1000px",s.style.opacity="0")},g=null;d.el_.children[0].onfocus=function(){f(),g=setInterval(function(){f()},250)},d.el_.children[0].addEventListener("blur",function(){try{l.style.left="-1000px",s.style.opacity="0",g&&(clearInterval(g),g=null)}catch(e){}})}else d.on("mousemove",v),d.on("touchmove",v);function h(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",h),m()}d.on("pointerdown",function(e){document.addEventListener("pointermove",v),document.addEventListener("pointerup",h)}),m=function(e){l.style.left="-1000px"},d.on("mouseout",m),d.on("touchcancel",m),d.on("touchend",m),c.on("userinactive",m)});var b="my-player";function y(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 x(){return(x=c(d.mark(function e(t){var n,r,i,a,o,l,u,s,c,p,m,f,g,h,b,y,x,w,E,A,N,k,j,T;return d.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,p=[],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"),p.push({uri:h,duration:t.duration}),t._tiles=p;return e.abrupt("return",p);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===(T=j.images)||void 0===T?void 0:T.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function w(e,t){return E.apply(this,arguments)}function E(){return(E=c(d.mark(function e(t,n){var r,i;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return b=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",y(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 A(e,t,n){var r=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),i=a.getPlayer(b);if(r&&i){var o=r.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*i.duration()),n),s=t[u];s&&!s.loading&&(s.loading=!0,function(e){return x.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 N(e){return k.apply(this,arguments)}function k(){return(k=c(d.mark(function e(t){var n,r,i,o;return d.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]=h(h({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},p(u,"left","-60px"),p(u,"border","1px solid transparent"),p(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",a.throttle(function(e){return A(e,n,r)},500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",a.throttle(function(e){return A(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var j=function(){var e=c(d.mark(function e(t,n){var r,i,a,o,l,u,s,c;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5: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 T(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function C(e,t){return I.apply(this,arguments)}function I(){return(I=c(d.mark(function e(t,n){var r,i,l,u,s,c,p,m,f,g,h,y,x,w,E,A,N,k,j,C,I,L,B,S,M,R,q,D,$,X,V,_,F,U,W,G,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,ve,me;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return b=n,r=a.getPlayer(n),i=t.split("/"),l=i.findIndex(function(e){return"dash"===e.toLowerCase()}),u=T(-1!==l?i.slice(0,l+1).join("/"):new URL(t).origin),e.prev=5,e.next=8,fetch(t);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"),y=(null==r?void 0:r.duration())||(null===(s=o.getCurrentVideo())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),x=(null==h||null===(p=h.querySelector("MPD > BaseURL"))||void 0===p?void 0:p.textContent)||u+"/",w=h.getElementsByTagName("AdaptationSet"),E=0;case 18:if(!(E<w.length)){e.next=72;break}if(("image"!==(A=w[E]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(k=A.getElementsByTagName("SegmentTemplate")[0],j=null===(N=k.getElementsByTagName("SegmentTimeline"))||void 0===N?void 0:N[0],!k||!j){e.next=48;break}if(L=j.getElementsByTagName("S"),B=parseInt(null===(C=L[0])||void 0===C?void 0:C.getAttribute("t")),S=parseInt(null===(I=L[0])||void 0===I?void 0:I.getAttribute("d")),M=A.getElementsByTagName("Representation")[0],R=M.getElementsByTagName("EssentialProperty")[0],q=R.getAttribute("value"),D=null==q?void 0:q.split("x"),$=v(D,2),X=$[0],V=$[1],!k){e.next=46;break}if(k.getAttribute("media"),_=k.getAttribute("timescale"),F=(_?S/_:S)/(X*V),U=M.getAttribute("id"),W=Math.round(y/F),G=Math.ceil(W/(X*V)),z=k.getAttribute("media"),parseInt(k.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],E=0;E<G;E++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:F,layout:q,uri:Y+Q.replace("$Time$",B+E*S).replace("$RepresentationID$",U)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=A.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],!k){e.next=69;break}if(k.getAttribute("media"),ie=k.getAttribute("duration"),ae=k.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(y/oe),se=Math.ceil(ue/(ne*re)),ce=k.getAttribute("media"),de=parseInt(k.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],ve=P(ce),E=0;E<se;E++)me=ve?O(ve,E+de):ce,pe.push({duration:oe,layout:Z,uri:x+me.replace("$Number$",E+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:E++,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 P(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function O(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 L(){return(L=c(d.mark(function e(t){var n,r,i,o,l,u,s,c,p,v,m,f,g,h,b,y;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=a.getPlayer(t),s=u.currentSource(),c=s.src,c=null!==(n=c)&&void 0!==n&&n.includes("blob")?null===(r=window)||void 0===r||null===(i=r.player)||void 0===i?void 0:i.getSource():c,null===(o=c)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,w(c,t);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return v=(null==p?void 0:p[0])||null,m=v.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,j(f,m);case 12:return g=e.sent,e.next=15,N(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,C(c,t);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,N(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}exports.addNextEpPreview=function(e,t){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r;m=[];var l=o.getCurrentSeries();null==l||l.map(function(e){var t;return(t=m).push.apply(t,i(e.episodes))}),null==t||null===(r=t.series)||void 0===r||r.cb}else{var u,s;m=(null==t||null===(u=t.relatedVideos)||void 0===u?void 0:u.content)||[],null==t||null===(s=t.relatedVideos)||void 0===s||s.cb}var c=a.getPlayer(e);c.on("timeupdate",function(){var e,t,n=Math.floor(c.currentTime()),r=c.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&o.getVideoIdx()<=(null===(t=m)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")});var d,p=m.filter(function(e,t){return t==o.getVideoIdx()});if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var v,g,h,b,y,x,w,E,A,N,k,j;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var T=null===(g=document.getElementsByClassName("next-ep-title"))||void 0===g?void 0:g[0],C=null===(h=document.getElementsByClassName("next-ep-img"))||void 0===h?void 0:h[0],I=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],P=null===(y=p[0])||void 0===y?void 0:y.title;(null===(x=P)||void 0===x?void 0:x.length)>60&&(P=P.substr(0,60)+"..."),T.textContent="".concat(P),C.src=(null===(w=p[0])||void 0===w||null===(E=w.gist)||void 0===E||null===(A=E.imageGist)||void 0===A?void 0:A.r16x9)||(null==p||null===(N=p[0])||void 0===N?void 0:N.img)||(null===(k=window)||void 0===k||null===(j=k.customData)||void 0===j?void 0:j.fallbackImage),I.onclick=function(){return f(e)}}else{var O,L,B,S,M,R,q,D,$=document.createElement("div");$.className="next-ep-preview",$.style.visibility="hidden",document.getElementById(e).append($);var X=document.createElement("div");X.className="next-ep-header",X.textContent="Next up";var V=null===(O=p[0])||void 0===O?void 0:O.title,_=document.createElement("img");_.className="next-ep-img",_.src=(null===(L=p[0])||void 0===L||null===(B=L.gist)||void 0===B||null===(S=B.imageGist)||void 0===S?void 0:S.r16x9)||(null==p||null===(M=p[0])||void 0===M?void 0:M.img)||(null===(R=window)||void 0===R||null===(q=R.customData)||void 0===q?void 0:q.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(D=V)||void 0===D?void 0:D.length)>60&&(V=V.substr(0,60)+"..."),F.textContent="".concat(V);var U=document.createElement("div");U.className="next-ep-content",U.append(_),U.append(F),U.onclick=function(){return f(e)},$.append(X),$.append(U)}},exports.addTVProviderImage=function(e,t){var n=a.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(r),o.alt="Provider Image",i.append(o),n.el().appendChild(i),n.on("useractive",function(){i.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||i.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"})}},exports.initiateTrickplay=function(e){return L.apply(this,arguments)};
|
|
1
|
+
"use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),a=require("./skin-f87e1c22.js"),o=require("./generic-def54bbe.js"),l=require("./autoNextVideo-e09dd4b5.js"),u=require("@babel/runtime/helpers/typeof"),s=require("video.js"),c=require("@babel/runtime/helpers/asyncToGenerator"),d=require("@babel/runtime/regenerator"),p=require("@babel/runtime/helpers/defineProperty"),v=require("@babel/runtime/helpers/slicedToArray"),m=[],f=function(e,t){var n=a.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=o.getVideoIdx();l.switchToNext(i,e,m)}};function g(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(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}e={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},t=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"===u(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},r=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},s.registerPlugin("thumbnails",function(i){var a,o,l,u,s,c,d,p,v,m;if(u=t({},e,i),c=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=c.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",s=document.createElement("img"),l.appendChild(s),s.src=u[0].src,s.className="vjs-thumbnail",t(s.style,u[0].style),s.style.left||s.style.right||(s.onload=function(){s.style.left=-s.naturalWidth/2+"px"}),p=c.duration(),c.on("durationchange",function(e){p=c.duration()}),c.on("loadedmetadata",function(e){p=c.duration()}),(d=c.controlBar.progressControl).el().appendChild(l),v=function(e){var i,a,o,c,v,m,f,g,h,b;for(a in o=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((b=r(d.el()).getBoundingClientRect()).width||b.right)+h,m=e.pageX,e.changedTouches&&(m=e.changedTouches[0].pageX),c=m||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c-=r(d.el()).getBoundingClientRect().left+h,i=Math.floor((c-d.el().offsetLeft)/d.width()*p),u)i>a&&(o=Math.max(o,a));(v=u[o]).src&&s.src!=v.src&&(s.src=v.src),v.style&&s.style!=v.style&&t(s.style,v.style),c+(g=function(e,t){var r;return t?parseFloat(t):"auto"!==(r=n(e)("clip"))&&"inherit"!==r&&4===(r=r.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(r[1])-parseFloat(r[3]):0}(s,v.width||u[0].width)/2)>f?c-=c+g-f:c<g&&(c=g),l.style.left=c+"px"},null!==(a=window)&&void 0!==a&&null!==(o=a.customData)&&void 0!==o&&o.isSmartTV){var f=function(){var e,t,n=0,r=(null===(e=d.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;r<65?r=5:r>=c.el().offsetWidth-180?r=c.el().offsetWidth-240:r-=58;var i=c.currentTime();for(t in u)i>t&&(n=Math.max(n,t));var a=u[n];a.uri&&""!=a.uri&&s.src!=a.uri?(s.src=a.uri,l.style.left=r+"px",s.style.opacity="1"):(l.style.left="-1000px",s.style.opacity="0")},g=null;d.el_.children[0].onfocus=function(){f(),g=setInterval(function(){f()},250)},d.el_.children[0].addEventListener("blur",function(){try{l.style.left="-1000px",s.style.opacity="0",g&&(clearInterval(g),g=null)}catch(e){}})}else d.on("mousemove",v),d.on("touchmove",v);function h(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",h),m()}d.on("pointerdown",function(e){document.addEventListener("pointermove",v),document.addEventListener("pointerup",h)}),m=function(e){l.style.left="-1000px"},d.on("mouseout",m),d.on("touchcancel",m),d.on("touchend",m),c.on("userinactive",m)});var b="my-player";function y(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 x(){return(x=c(d.mark(function e(t){var n,r,i,a,o,l,u,s,c,p,m,f,g,h,b,y,x,w,E,A,N,k,j,T;return d.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,p=[],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"),p.push({uri:h,duration:t.duration}),t._tiles=p;return e.abrupt("return",p);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===(T=j.images)||void 0===T?void 0:T.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function w(e,t){return E.apply(this,arguments)}function E(){return(E=c(d.mark(function e(t,n){var r,i;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return b=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",y(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 A(e,t,n){var r=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),i=a.getPlayer(b);if(r&&i){var o=r.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*i.duration()),n),s=t[u];s&&!s.loading&&(s.loading=!0,function(e){return x.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 N(e){return k.apply(this,arguments)}function k(){return(k=c(d.mark(function e(t){var n,r,i,o;return d.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]=h(h({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},p(u,"left","-60px"),p(u,"border","1px solid transparent"),p(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",a.throttle(function(e){return A(e,n,r)},500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",a.throttle(function(e){return A(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var j=function(){var e=c(d.mark(function e(t,n){var r,i,a,o,l,u,s,c;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5: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 T(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function C(e,t){return I.apply(this,arguments)}function I(){return(I=c(d.mark(function e(t,n){var r,i,l,u,s,c,p,m,f,g,h,y,x,w,E,A,N,k,j,C,I,L,B,S,M,R,q,D,$,X,V,_,F,U,W,G,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,ve,me;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return b=n,r=a.getPlayer(n),i=t.split("/"),l=i.findIndex(function(e){return"dash"===e.toLowerCase()}),u=T(-1!==l?i.slice(0,l+1).join("/"):new URL(t).origin),e.prev=5,e.next=8,fetch(t);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"),y=(null==r?void 0:r.duration())||(null===(s=o.getCurrentVideo())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),x=(null==h||null===(p=h.querySelector("MPD > BaseURL"))||void 0===p?void 0:p.textContent)||u+"/",w=h.getElementsByTagName("AdaptationSet"),E=0;case 18:if(!(E<w.length)){e.next=72;break}if(("image"!==(A=w[E]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(k=A.getElementsByTagName("SegmentTemplate")[0],j=null===(N=k.getElementsByTagName("SegmentTimeline"))||void 0===N?void 0:N[0],!k||!j){e.next=48;break}if(L=j.getElementsByTagName("S"),B=parseInt(null===(C=L[0])||void 0===C?void 0:C.getAttribute("t")),S=parseInt(null===(I=L[0])||void 0===I?void 0:I.getAttribute("d")),M=A.getElementsByTagName("Representation")[0],R=M.getElementsByTagName("EssentialProperty")[0],q=R.getAttribute("value"),D=null==q?void 0:q.split("x"),$=v(D,2),X=$[0],V=$[1],!k){e.next=46;break}if(k.getAttribute("media"),_=k.getAttribute("timescale"),F=(_?S/_:S)/(X*V),U=M.getAttribute("id"),W=Math.round(y/F),G=Math.ceil(W/(X*V)),z=k.getAttribute("media"),parseInt(k.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],E=0;E<G;E++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:F,layout:q,uri:Y+Q.replace("$Time$",B+E*S).replace("$RepresentationID$",U)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=A.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],!k){e.next=69;break}if(k.getAttribute("media"),ie=k.getAttribute("duration"),ae=k.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(y/oe),se=Math.ceil(ue/(ne*re)),ce=k.getAttribute("media"),de=parseInt(k.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],ve=P(ce),E=0;E<se;E++)me=ve?O(ve,E+de):ce,pe.push({duration:oe,layout:Z,uri:x+me.replace("$Number$",E+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:E++,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 P(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function O(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 L(){return(L=c(d.mark(function e(t){var n,r,i,o,l,u,s,c,p,v,m,f,g,h,b,y;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=a.getPlayer(t),s=u.currentSource(),c=s.src,c=null!==(n=c)&&void 0!==n&&n.includes("blob")?null===(r=window)||void 0===r||null===(i=r.player)||void 0===i?void 0:i.getSource():c,null===(o=c)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,w(c,t);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return v=(null==p?void 0:p[0])||null,m=v.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,j(f,m);case 12:return g=e.sent,e.next=15,N(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,C(c,t);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,N(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}exports.addNextEpPreview=function(e,t){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r;m=[];var l=o.getCurrentSeries();null==l||l.map(function(e){var t;return(t=m).push.apply(t,i(e.episodes))}),null==t||null===(r=t.series)||void 0===r||r.cb}else{var u,s;m=(null==t||null===(u=t.relatedVideos)||void 0===u?void 0:u.content)||[],null==t||null===(s=t.relatedVideos)||void 0===s||s.cb}var c=a.getPlayer(e);c.on("timeupdate",function(){var e,t,n=Math.floor(c.currentTime()),r=c.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&o.getVideoIdx()<=(null===(t=m)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")});var d,p=m.filter(function(e,t){return t==o.getVideoIdx()});if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var v,g,h,b,y,x,w,E,A,N,k,j;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var T=null===(g=document.getElementsByClassName("next-ep-title"))||void 0===g?void 0:g[0],C=null===(h=document.getElementsByClassName("next-ep-img"))||void 0===h?void 0:h[0],I=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],P=null===(y=p[0])||void 0===y?void 0:y.title;(null===(x=P)||void 0===x?void 0:x.length)>60&&(P=P.substr(0,60)+"..."),T.textContent="".concat(P),C.src=(null===(w=p[0])||void 0===w||null===(E=w.gist)||void 0===E||null===(A=E.imageGist)||void 0===A?void 0:A.r16x9)||(null==p||null===(N=p[0])||void 0===N?void 0:N.img)||(null===(k=window)||void 0===k||null===(j=k.customData)||void 0===j?void 0:j.fallbackImage),I.onclick=function(){return f(e)}}else{var O,L,B,S,M,R,q,D,$=document.createElement("div");$.className="next-ep-preview",$.style.visibility="hidden",document.getElementById(e).append($);var X=document.createElement("div");X.className="next-ep-header",X.textContent="Next up";var V=null===(O=p[0])||void 0===O?void 0:O.title,_=document.createElement("img");_.className="next-ep-img",_.src=(null===(L=p[0])||void 0===L||null===(B=L.gist)||void 0===B||null===(S=B.imageGist)||void 0===S?void 0:S.r16x9)||(null==p||null===(M=p[0])||void 0===M?void 0:M.img)||(null===(R=window)||void 0===R||null===(q=R.customData)||void 0===q?void 0:q.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(D=V)||void 0===D?void 0:D.length)>60&&(V=V.substr(0,60)+"..."),F.textContent="".concat(V);var U=document.createElement("div");U.className="next-ep-content",U.append(_),U.append(F),U.onclick=function(){return f(e)},$.append(X),$.append(U)}},exports.addTVProviderImage=function(e,t){var n=a.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(r),o.alt="Provider Image",i.append(o),n.el().appendChild(i),n.on("useractive",function(){i.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||i.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"})}},exports.initiateTrickplay=function(e){return L.apply(this,arguments)};
|