@viewlift/player-backup 2.0.74-smartTv → 2.0.75-smartTv
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-b7e91ff3.js → autoNextVideo-b2664dca.js} +1 -1
- package/cjs/bundle.css +3 -3
- package/cjs/{features-6abeaa09.js → features-4324250b.js} +1 -1
- package/cjs/{generic-6bf3ba02.js → generic-d56b38ac.js} +1 -1
- package/cjs/{index-391dd643.js → index-510967ea.js} +1 -1
- package/cjs/{index-2ee2a39b.js → index-865afc31.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-4fdb520e.js → multicamv2-408075e5.js} +1 -1
- package/cjs/{multicamv2-421ec910.js → multicamv2-96ae1bef.js} +1 -1
- package/cjs/{nextEpisodeButton-076f0135.js → nextEpisodeButton-571ddebc.js} +1 -1
- package/cjs/{playlist-3861f880.js → playlist-2a9d8c3a.js} +1 -1
- package/cjs/{series-3e119ba2.js → series-23a6b96c.js} +1 -1
- package/cjs/{series-v2-88c9fe30.js → series-v2-656980f1.js} +1 -1
- package/cjs/{series-v2-26d49c70.js → series-v2-a128042a.js} +1 -1
- package/cjs/{skin-beebad4a.js → skin-2fa52c29.js} +1 -1
- package/cjs/{skin-ff25c748.js → skin-61950a20.js} +1 -1
- package/cjs/{skin-0131ea28.js → skin-6db027fa.js} +1 -1
- package/cjs/{skin-75c04f58.js → skin-95e27a9f.js} +1 -1
- package/cjs/{skin-5192bd86.js → skin-b5651b5b.js} +1 -1
- package/cjs/{skin-ebf1c61b.js → skin-d1d871d1.js} +1 -1
- package/cjs/{skin-eaccb61e.js → skin-edc7bca4.js} +1 -1
- package/cjs/{videoSelector-5e111200.js → videoSelector-e0dbb3af.js} +1 -1
- package/cjs/{videoSelector-6171c2a7.js → videoSelector-f32fc4b5.js} +1 -1
- package/esm/{autoNextVideo-69a951c0.js → autoNextVideo-b7900abb.js} +1 -1
- package/esm/bundle.css +3 -3
- package/esm/{features-9a994afb.js → features-58699d4f.js} +1 -1
- package/esm/{generic-ecdd66bc.js → generic-fe8a5419.js} +1 -1
- package/esm/{index-82c877d2.js → index-24d08aa6.js} +1 -1
- package/esm/{index-962dee5d.js → index-d7c8b33b.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-623eca21.js → multicamv2-8354e88e.js} +1 -1
- package/esm/{multicamv2-6b4b899a.js → multicamv2-99d2d9f1.js} +1 -1
- package/esm/{nextEpisodeButton-36ca385c.js → nextEpisodeButton-6a78af06.js} +1 -1
- package/esm/{playlist-854a1c2a.js → playlist-e4aff030.js} +1 -1
- package/esm/{series-ef0753e5.js → series-f895bf2d.js} +1 -1
- package/esm/{series-v2-9cec905e.js → series-v2-2505dab5.js} +1 -1
- package/esm/{series-v2-6d69b4c4.js → series-v2-55b5e1d5.js} +1 -1
- package/esm/{skin-1ce04d9e.js → skin-1c962a23.js} +1 -1
- package/esm/{skin-ea45bc48.js → skin-5ccd687d.js} +1 -1
- package/esm/{skin-5f4514f0.js → skin-a0bc6679.js} +1 -1
- package/esm/{skin-c82837a4.js → skin-b3625cf2.js} +1 -1
- package/esm/{skin-290e8407.js → skin-c5fd99ed.js} +1 -1
- package/esm/{skin-6c7025a3.js → skin-c7bbb999.js} +1 -1
- package/esm/{skin-f339b646.js → skin-e1abdefd.js} +1 -1
- package/esm/{videoSelector-e8d8f5e5.js → videoSelector-986c7677.js} +1 -1
- package/esm/{videoSelector-fec759ed.js → videoSelector-fd351fa1.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,i=require("./generic-
|
|
1
|
+
"use strict";var e,i=require("./generic-d56b38ac.js"),t=require("./util-c1962d91.js"),n=require("./skin-3397dca5.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
|
@@ -1881,9 +1881,6 @@ iframe {
|
|
|
1881
1881
|
|
|
1882
1882
|
|
|
1883
1883
|
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
1884
|
.video-js .multicamera-parent.default{
|
|
1888
1885
|
height: 345px;
|
|
1889
1886
|
position: absolute;
|
|
@@ -1964,6 +1961,9 @@ iframe {
|
|
|
1964
1961
|
|
|
1965
1962
|
|
|
1966
1963
|
|
|
1964
|
+
|
|
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/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/inherits"),l=require("video.js"),i=require("./generic-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/inherits"),l=require("video.js"),i=require("./generic-d56b38ac.js"),a=require("./renditions-26c6d0df.js"),s=require("./skin-3397dca5.js"),d=require("./localisation-56e0a999.js");function u(e,t,o){return t=n(t),r(e,c()?Reflect.construct(t,o||[],n(e).constructor):t.apply(e,o))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then(function(){return require("./caption-settings-5944a544.js")}).then(function(r){var n,o,i,a,d=r.default,u=s.getPlayer(e);l.registerComponent("captionSelector",d),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(i=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===i||null===(a=i[0])||void 0===a||a.remove(),u&&u.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},u.controlBar.children().length-3)})},exports.addDBClickFullScreen=function(e){var t=s.getPlayer(e).el(),r=0,n=s.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-408075e5.js")}).then(function(r){var n=r.default,o=s.getPlayer(e);l.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-96ae1bef.js")}).then(function(r){var n=r.default,o=s.getPlayer(e);l.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-571ddebc.js")}).then(function(n){var o=n.default,i=s.getPlayer(r);l.registerComponent("nextEpisodeButtonModule",o),i.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},i.controlBar.children().length-5)})},exports.addOutputtingOverlay=function(e,t){var r=s.getPlayer(e).el(),n=l.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-2a9d8c3a.js")}).then(function(r){var n=r.default,o=s.getPlayer(e);l.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-5a0df2be.js")}).then(function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var i=s.getPlayer(e),d=a.getRenditions(e);(null==d?void 0:d.length)>0&&(l.registerComponent("resolutionModule",o),i.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:d},i.controlBar.children().length-4))})},exports.addRewindButton=function(r,n,a){var d=function(n){function l(t,r){var n;e(this,l);var o=(n=u(this,l,[t,r])).el_;o.classList.add("vjs-rewind-button");var i=s.parseSvgString(a);return o.append(i),n}return o(l,n),t(l,[{key:"handleClick",value:function(){i.rewind(r,10)}}])}(l.getComponent("Button"));l.registerComponent("MyButton",d),l(r).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then(function(){return require("./series-23a6b96c.js")}).then(function(n){var o=n.seriesModule,i=s.getPlayer(e);l.registerComponent("seriesModule",o),i.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},i.controlBar.children().length-4);for(var a=document.querySelectorAll(".season-title-sdk"),d=function(e){a[e].addEventListener("click",function(){t[e]&&n.handleSeasonChange(t[e],e,i,r)})},u=0;u<a.length;u++)d(u)})},exports.addSeriesSelectorV2=function(e,t){Promise.resolve().then(function(){return require("./series-v2-656980f1.js")}).then(function(r){var n=r.default,o=s.getPlayer(e);l.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",Object.assign({playerId:e},t),o.controlBar.children().length-3)})},exports.addSeriesSelectorV2_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then(function(){return require("./series-v2-a128042a.js")}).then(function(r){var n=r.default,o=s.getPlayer(e);l.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",Object.assign({playerId:e},t),o.controlBar.children().length-3)})},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then(function(){return require("./settings-icon-12add1fe.js")}).then(function(r){var n,o,i,a,d=r.default,u=s.getPlayer(e);l.registerComponent("settingsSelector",d),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(i=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===i||null===(a=i[0])||void 0===a||a.remove(),u&&u.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},u.controlBar.children().length-3)})},exports.addSkipButton=function(r,n,a){var d=function(n){function l(t,r){var n;e(this,l);var o=(n=u(this,l,[t,r])).el_;o.classList.add("vjs-skip-button");var i=s.parseSvgString(a);return o.append(i),n}return o(l,n),t(l,[{key:"handleClick",value:function(){i.skip(r,10)}}])}(l.getComponent("Button"));l.registerComponent("MyButton",d),l(r).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(r){var n=function(r){function n(t,r){var o;e(this,n);var l=(o=u(this,n,[t,r])).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=d.getLocalisation("slowMoText")||"Slow Mo",o}return o(n,r),t(n,[{key:"handleClick",value:function(){1==i.playbackRate()?(i.playbackRate(.5),this.el().style.background="darkgray"):(i.playbackRate(1),this.el().style.background="none")}}])}(l.getComponent("Button"));l.registerComponent("MyButton",n);var i=l(r);i.getChild("controlBar").addChild("myButton",{},2)},exports.addVideoSelector=function(e,t){Promise.resolve().then(function(){return require("./videoSelector-f32fc4b5.js")}).then(function(r){var n=r.default,o=s.getPlayer(e);l.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-e0dbb3af.js")}).then(function(r){var n=r.default,o=s.getPlayer(e);l.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/asyncToGenerator"),t=require("@babel/runtime/regenerator"),n=require("video.js"),i=require("axios"),o=require("./skin-3397dca5.js"),r=require("./browser-38ff3331.js"),l=require("js-cookie"),a=require("ua-parser-js"),d=require("./captions-3c7ca3a7.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function s(e,t){u("event",e,t)}var c={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"},v={name:"@viewlift/player-backup",version:"2.0.74-smartTv",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=v.version;var m,f=function(e,t){var n,o,r,l,a,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.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})}):i({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":E.get()+"".concat(null==c?void 0:c.getVideoDetails),params:Object.assign({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":v.version},withCredentials:!0})},p=function(e,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.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})}):i({url:E.get()+c.getLinearChannelDetails,params:Object.assign({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"}})},g=function(){var n=e(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return o=e.sent,e.abrupt("return",i({url:E.get()+"".concat(null==c?void 0:c.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},n),params:Object.assign({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),I=function(e,t){var n,o,r=window.contentType;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},w=function(e){var t=e.videoId;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},E=(m=null==c?void 0:c.apiBaseUrl,{set:function(e){e&&(m=e)},get:function(){return m}}),T=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},h=null;function _(){return{set:function(e){e&&(h=e)},get:function(){return h}}}var y,b,F,D,L,V,R=function(){var n=e(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=_().get(),o=E.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return n.apply(this,arguments)}}(),S=null,W=function(){var n=e(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!T(n)){e.next=6;break}return S||(S=R().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&_().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){S=null})),e.abrupt("return",S);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),O=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){b=e},C=function(){return b},P=function(){return y},A=function(e){F=e},N=function(e){if(D){var t=D.get(e);A(t+1)}},B=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}}),M=0,U=function(){var e,t,n,i,o,r,l,a=C();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 j(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function k(){var e=window.sessionStorage.getItem("uid");return e||(e=j(),window.sessionStorage.setItem("uid",e),e)}function H(){return G.apply(this,arguments)}function G(){return(G=e(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(e){return e?String(e):""}window.initialise=function(e){window.sid=j(),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,s(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:k(),vid:U(),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),s("PLAY",Object.assign({pfm:window.platform,uid:k(),vid:U(),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":U(),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")&&M<4)M++,s("BUFFERING",Object.assign({pfm:window.platform,uid:k(),vid:U(),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,s("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U()},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;s("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U(),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}),s("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},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)&&(M=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(Y(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Y=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var n=e(t.mark(function e(n){var o,r,l,a,d,u,s,v,m,f,p,g,I,w,T,h,_,y,b,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return h=e.sent,_=O(h),y=null==_?void 0:_.site,b=null==_?void 0:_.siteId,e.t0=Object,e.t1={aid:y,cid:b,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=k(),e.t4=U(),e.t5=n.url||document.location.href,e.t6=n.ref||document.referrer,e.t7=n.eventName,e.t8=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=n.dp1||"",e.t11=n.dp2||"",e.t12=n.dp3||"",e.t13=n.dp4||"",e.t14=n.dp5||"",e.t15=!0===n.isAdEvent?n.videoPosition:null,e.t16=!0===n.isAdEvent?z(n.adPosition):"",e.next=25,H();case 25:e.t17=e.sent,e.t18=n.playerType||"native",e.t19=n.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t23=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t24=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t25=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==n?void 0:n.duration)&&{duration:n.duration},e.t28=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),F=[e.t29],i({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(T=w.beacon)||void 0===T?void 0:T.url)||E.get()+c.getBeaconUrl,method:"post",headers:{Authorization:h},contentType:"application/x-www-form-urlencoded",dataType:"text",data:F}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var q=function(){var e=B.get();return e>=0?e+1:1},X=function(){var e,t,n,i=P(),o=C(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=B.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};window._deviceInfo=a.UAParser(navigator.userAgent);var J=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},K=function(e){var t=Q(e,"video.tags",[]),n=Q(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},Q=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},Z=function(){var e,t,n,i,r,a,d,u,s,c,v,m,f,p,g,I,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",L=(null==F?void 0:F.contentType)||"video",V=(null==F||null===(e=F[L])||void 0===e?void 0:e.metadata)||(null==F||null===(t=F[L])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),R=o.getPlayer(b);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(b),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),x=Math.trunc(W.getPropertyValue("width").slice(0,-2)),C="linearchannel"===L?null==F||null===(i=F.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(a=r.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===a||null===(d=a.content)||void 0===d?void 0:d.id:Q(F,"video.gist.id",""),P="linearchannel"===L?null==F||null===(u=F.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==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=Object.assign({},$(V),{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:J(x,O),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:Q(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:K(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Q(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Q(null===(p=window)||void 0===p||null===(g=p.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"==D?"":Q(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*Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:P,VIEWLIFT_CONTENT_SERIES_TITLE:Q(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Q(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:X(),VIEWLIFT_SEASON_NUMBER:q(),VIEWLIFT_CONTENT_TAGS:K(F),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===(_=h.customData)||void 0===_?void 0:_.macros);for(var M in B){var U=new RegExp(M,"g");y=y.replace(U,B[M])}return y},$=function(e){var t,n,i,o,l,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ee(u);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===(l=window)||void 0===l||null===(a=l.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(r.isMobile()?c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=r.isMobile()?Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=r.isMobile()?Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=Object.assign({},u,{VIEWLIFT_AFID:s.get("afid")})},ee=function(e){var t,n,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(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;return(u||s)&&(s?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},te=function(e){var t=null;try{var n,i,o,r,l,a,d,u,s,c,v,m,f,p,g,I,w,E,T,h,_,y,b,F,D,L,V,R,S;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===(_=h.samsung_tv)||void 0===_?void 0:_.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 W,O,x,C;t=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(x=O.adTags)||void 0===x||null===(C=x.lg_tv)||void 0===C?void 0:C.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!==(f=m.vizioTv)&&void 0!==f&&f.active){var P,A,N,B;t=null==e||null===(P=e.ads)||void 0===P||null===(A=P.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!==(p=e.ads)&&void 0!==p&&null!==(g=p.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,U,j,k;t=null==e||null===(M=e.ads)||void 0===M||null===(U=M.preRoll)||void 0===U||null===(j=U.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(y=e.ads)||void 0===y||null===(b=y.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(V=L.preRoll)||void 0===V||null===(R=V.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return t},ne=function(e,t){var n,i,o,l,a,d,u,s,c,v,m,f,p,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===(l=e[g])||void 0===l||null===(a=l.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===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return oe(E);if(I){var _=re(w,t);return _.src=Z(_.src,t,e),_}if("Safari"!==r.detectBrowser()&&h)return ie(w);if(T){var y=oe(w);return y.src=Z(y.src,t,e),y}if(null!=w&&w.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return b.src=Z(b.src,t,e),b}return null},ie=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},oe=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},re=function(e,t){var i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=r.detectBrowser();if(o.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,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};n.xhr(o,function(e,t,n){console.log(e),e&&i(e),i(null,new Uint8Array(n))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,i,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}};n.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(i);return le(t),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(le(t),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url: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:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var le=function(e){var t=o.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==r.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ae=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)}}},de=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ue=!1,se=function(e,t,n){var i=Z(t,e,n),r=o.getPlayer(e);if(t&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,t){var n,i,r,l=o.getPlayer(e);if(null!==l.el_){ue=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ue&&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===(r=i.ads)||void 0===r?void 0:r.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)}},ce=function(e){return!!n.getPlayer("".concat(e))},ve=function(){var n=e(t.mark(function e(n,i){var r,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,W();case 3:return l=e.sent,a=o.getPlayer(n),e.abrupt("return",new Promise(function(e,t){p(i,l).then(function(t){var o=null==t?void 0:t.data;window.sid=j(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=ne(o,n);x(o),l&&r?(pe(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),me=function(){var n=e(t.mark(function e(n,i){var r,l,a,u,s,c,v=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,W();case 4:u=e.sent;case 5:return(P()||null)&&N(i),s=0,c=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&I(i,u).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,t){f(i,u).then(function(i){var r,l,a=null==i?void 0:i.data,u=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;x(i.data);var v=te(a);v&&se(n,v,a);var m=ne(a,n);if(m){var f,p,g,I,w,E,T,h,_,y,b,F,D,L,V=(null==a||null===(f=a.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.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),R=o.getPlayer(n);if(R.poster(V),pe(n,m),R.on("loadstart",function(){u&&e({status:!0,msg:"Video Loaded",response:a})}),R.on("loadeddata",function(){de(),e({status:!0,msg:"Video Loaded",response:a})}),R.one("play",function(){s&&c<95&&setTimeout(function(){R.currentTime(s)},0)}),R.one("error",function(){var e;t({status:!1,msg:(null==R||null===(e=R.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===(_=a.video)||void 0===_||null===(y=_.closedCaptions)||void 0===y?void 0:y.length)>0)b=((null==a||null===(F=a.video)||void 0===F||null===(D=F.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),d.addCaptions(n,b);else d.removeCaptions(n)}else ae(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ge(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),fe=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()},pe=function(e,t){var n=o.getPlayer(e);n&&n.src(t)},ge=function(e,t,n,i){var o,r,l,a,d,u,s=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);ce(t)&&ae(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[s])||"".concat(c)),n&&n(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))};exports.authenticateLC=ve,exports.baseUrlManager=E,exports.clearError=de,exports.createIdxMapping=function(e){D=new Map,e.map(function(e,t){D.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;w({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=o.getPlayer(e);if(fe(),o.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=te,exports.getCurrentSeries=P,exports.getCurrentVideo=C,exports.getDecodedToken=O,exports.getEntitlementData=function(e,t,n,o){return i({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getEpisodeNumber=X,exports.getLinearChannelDetails=p,exports.getSeasonNumber=q,exports.getSeriesDetails=function(e,t){var n,o,r=O(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.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})}):i({url:E.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=w,exports.getSeriesWatchMap=function(){return L},exports.getSource=ne,exports.getToken=W,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=k,exports.getVideoDetails=f,exports.getVideoIdx=function(){return F},exports.getVideoInfo=I,exports.handleError=ae,exports.initialiseAdvertisement=se,exports.initiateErrorHandling=ge,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=o.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return n(e).paused()},exports.isPlayerInitialised=ce,exports.isTokenExpired=T,exports.load=me,exports.loadVideo=pe,exports.loadVideoInstantly=function(e,t,n){var i=o.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){n(e).pause()},exports.play=function(e){n(e).play()},exports.refreshTokenManager=_,exports.replaceMacros=Z,exports.rewind=function(e,t){var i=n(e),o=i.currentTime(),r=o<=t?0:o-t;i.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)},exports.saveWatchHistory=g,exports.seasonIdxManager=B,exports.setCurrentSeries=function(e){y=e},exports.setCurrentVideo=x,exports.setVideoIdx=A,exports.setVideoIdxById=N,exports.skip=function(e,t){var i=n(e),o=i.currentTime()+t;i.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/asyncToGenerator"),t=require("@babel/runtime/regenerator"),n=require("video.js"),i=require("axios"),o=require("./skin-3397dca5.js"),r=require("./browser-38ff3331.js"),l=require("js-cookie"),a=require("ua-parser-js"),d=require("./captions-3c7ca3a7.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function s(e,t){u("event",e,t)}var c={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"},v={name:"@viewlift/player-backup",version:"2.0.75-smartTv",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=v.version;var m,f=function(e,t){var n,o,r,l,a,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.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})}):i({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":E.get()+"".concat(null==c?void 0:c.getVideoDetails),params:Object.assign({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":v.version},withCredentials:!0})},p=function(e,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.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})}):i({url:E.get()+c.getLinearChannelDetails,params:Object.assign({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"}})},g=function(){var n=e(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return o=e.sent,e.abrupt("return",i({url:E.get()+"".concat(null==c?void 0:c.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},n),params:Object.assign({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),I=function(e,t){var n,o,r=window.contentType;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},w=function(e){var t=e.videoId;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},E=(m=null==c?void 0:c.apiBaseUrl,{set:function(e){e&&(m=e)},get:function(){return m}}),T=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},h=null;function _(){return{set:function(e){e&&(h=e)},get:function(){return h}}}var y,b,F,D,L,V,R=function(){var n=e(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=_().get(),o=E.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return n.apply(this,arguments)}}(),S=null,W=function(){var n=e(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!T(n)){e.next=6;break}return S||(S=R().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&_().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){S=null})),e.abrupt("return",S);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),O=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){b=e},C=function(){return b},P=function(){return y},A=function(e){F=e},N=function(e){if(D){var t=D.get(e);A(t+1)}},B=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}}),M=0,U=function(){var e,t,n,i,o,r,l,a=C();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 j(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function k(){var e=window.sessionStorage.getItem("uid");return e||(e=j(),window.sessionStorage.setItem("uid",e),e)}function H(){return G.apply(this,arguments)}function G(){return(G=e(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(e){return e?String(e):""}window.initialise=function(e){window.sid=j(),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,s(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:k(),vid:U(),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),s("PLAY",Object.assign({pfm:window.platform,uid:k(),vid:U(),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":U(),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")&&M<4)M++,s("BUFFERING",Object.assign({pfm:window.platform,uid:k(),vid:U(),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,s("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U()},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;s("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U(),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}),s("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},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)&&(M=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(Y(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Y=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var n=e(t.mark(function e(n){var o,r,l,a,d,u,s,v,m,f,p,g,I,w,T,h,_,y,b,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return h=e.sent,_=O(h),y=null==_?void 0:_.site,b=null==_?void 0:_.siteId,e.t0=Object,e.t1={aid:y,cid:b,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=k(),e.t4=U(),e.t5=n.url||document.location.href,e.t6=n.ref||document.referrer,e.t7=n.eventName,e.t8=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=n.dp1||"",e.t11=n.dp2||"",e.t12=n.dp3||"",e.t13=n.dp4||"",e.t14=n.dp5||"",e.t15=!0===n.isAdEvent?n.videoPosition:null,e.t16=!0===n.isAdEvent?z(n.adPosition):"",e.next=25,H();case 25:e.t17=e.sent,e.t18=n.playerType||"native",e.t19=n.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t23=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t24=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t25=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==n?void 0:n.duration)&&{duration:n.duration},e.t28=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),F=[e.t29],i({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(T=w.beacon)||void 0===T?void 0:T.url)||E.get()+c.getBeaconUrl,method:"post",headers:{Authorization:h},contentType:"application/x-www-form-urlencoded",dataType:"text",data:F}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var q=function(){var e=B.get();return e>=0?e+1:1},X=function(){var e,t,n,i=P(),o=C(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=B.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};window._deviceInfo=a.UAParser(navigator.userAgent);var J=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},K=function(e){var t=Q(e,"video.tags",[]),n=Q(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},Q=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},Z=function(){var e,t,n,i,r,a,d,u,s,c,v,m,f,p,g,I,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",L=(null==F?void 0:F.contentType)||"video",V=(null==F||null===(e=F[L])||void 0===e?void 0:e.metadata)||(null==F||null===(t=F[L])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),R=o.getPlayer(b);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(b),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),x=Math.trunc(W.getPropertyValue("width").slice(0,-2)),C="linearchannel"===L?null==F||null===(i=F.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(a=r.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===a||null===(d=a.content)||void 0===d?void 0:d.id:Q(F,"video.gist.id",""),P="linearchannel"===L?null==F||null===(u=F.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==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=Object.assign({},$(V),{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:J(x,O),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:Q(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:K(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Q(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Q(null===(p=window)||void 0===p||null===(g=p.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"==D?"":Q(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*Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:P,VIEWLIFT_CONTENT_SERIES_TITLE:Q(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Q(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:X(),VIEWLIFT_SEASON_NUMBER:q(),VIEWLIFT_CONTENT_TAGS:K(F),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===(_=h.customData)||void 0===_?void 0:_.macros);for(var M in B){var U=new RegExp(M,"g");y=y.replace(U,B[M])}return y},$=function(e){var t,n,i,o,l,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ee(u);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===(l=window)||void 0===l||null===(a=l.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(r.isMobile()?c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=r.isMobile()?Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=r.isMobile()?Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=Object.assign({},u,{VIEWLIFT_AFID:s.get("afid")})},ee=function(e){var t,n,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(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;return(u||s)&&(s?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},te=function(e){var t=null;try{var n,i,o,r,l,a,d,u,s,c,v,m,f,p,g,I,w,E,T,h,_,y,b,F,D,L,V,R,S;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===(_=h.samsung_tv)||void 0===_?void 0:_.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 W,O,x,C;t=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(x=O.adTags)||void 0===x||null===(C=x.lg_tv)||void 0===C?void 0:C.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!==(f=m.vizioTv)&&void 0!==f&&f.active){var P,A,N,B;t=null==e||null===(P=e.ads)||void 0===P||null===(A=P.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!==(p=e.ads)&&void 0!==p&&null!==(g=p.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,U,j,k;t=null==e||null===(M=e.ads)||void 0===M||null===(U=M.preRoll)||void 0===U||null===(j=U.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(y=e.ads)||void 0===y||null===(b=y.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(V=L.preRoll)||void 0===V||null===(R=V.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return t},ne=function(e,t){var n,i,o,l,a,d,u,s,c,v,m,f,p,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===(l=e[g])||void 0===l||null===(a=l.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===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return oe(E);if(I){var _=re(w,t);return _.src=Z(_.src,t,e),_}if("Safari"!==r.detectBrowser()&&h)return ie(w);if(T){var y=oe(w);return y.src=Z(y.src,t,e),y}if(null!=w&&w.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return b.src=Z(b.src,t,e),b}return null},ie=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},oe=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},re=function(e,t){var i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=r.detectBrowser();if(o.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,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};n.xhr(o,function(e,t,n){console.log(e),e&&i(e),i(null,new Uint8Array(n))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,i,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}};n.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(i);return le(t),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(le(t),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url: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:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var le=function(e){var t=o.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==r.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ae=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)}}},de=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ue=!1,se=function(e,t,n){var i=Z(t,e,n),r=o.getPlayer(e);if(t&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,t){var n,i,r,l=o.getPlayer(e);if(null!==l.el_){ue=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ue&&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===(r=i.ads)||void 0===r?void 0:r.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)}},ce=function(e){return!!n.getPlayer("".concat(e))},ve=function(){var n=e(t.mark(function e(n,i){var r,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,W();case 3:return l=e.sent,a=o.getPlayer(n),e.abrupt("return",new Promise(function(e,t){p(i,l).then(function(t){var o=null==t?void 0:t.data;window.sid=j(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=ne(o,n);x(o),l&&r?(pe(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),me=function(){var n=e(t.mark(function e(n,i){var r,l,a,u,s,c,v=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,W();case 4:u=e.sent;case 5:return(P()||null)&&N(i),s=0,c=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&I(i,u).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,t){f(i,u).then(function(i){var r,l,a=null==i?void 0:i.data,u=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;x(i.data);var v=te(a);v&&se(n,v,a);var m=ne(a,n);if(m){var f,p,g,I,w,E,T,h,_,y,b,F,D,L,V=(null==a||null===(f=a.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.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),R=o.getPlayer(n);if(R.poster(V),pe(n,m),R.on("loadstart",function(){u&&e({status:!0,msg:"Video Loaded",response:a})}),R.on("loadeddata",function(){de(),e({status:!0,msg:"Video Loaded",response:a})}),R.one("play",function(){s&&c<95&&setTimeout(function(){R.currentTime(s)},0)}),R.one("error",function(){var e;t({status:!1,msg:(null==R||null===(e=R.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===(_=a.video)||void 0===_||null===(y=_.closedCaptions)||void 0===y?void 0:y.length)>0)b=((null==a||null===(F=a.video)||void 0===F||null===(D=F.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),d.addCaptions(n,b);else d.removeCaptions(n)}else ae(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ge(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),fe=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()},pe=function(e,t){var n=o.getPlayer(e);n&&n.src(t)},ge=function(e,t,n,i){var o,r,l,a,d,u,s=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);ce(t)&&ae(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[s])||"".concat(c)),n&&n(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))};exports.authenticateLC=ve,exports.baseUrlManager=E,exports.clearError=de,exports.createIdxMapping=function(e){D=new Map,e.map(function(e,t){D.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;w({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=o.getPlayer(e);if(fe(),o.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=te,exports.getCurrentSeries=P,exports.getCurrentVideo=C,exports.getDecodedToken=O,exports.getEntitlementData=function(e,t,n,o){return i({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getEpisodeNumber=X,exports.getLinearChannelDetails=p,exports.getSeasonNumber=q,exports.getSeriesDetails=function(e,t){var n,o,r=O(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.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})}):i({url:E.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=w,exports.getSeriesWatchMap=function(){return L},exports.getSource=ne,exports.getToken=W,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=k,exports.getVideoDetails=f,exports.getVideoIdx=function(){return F},exports.getVideoInfo=I,exports.handleError=ae,exports.initialiseAdvertisement=se,exports.initiateErrorHandling=ge,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=o.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return n(e).paused()},exports.isPlayerInitialised=ce,exports.isTokenExpired=T,exports.load=me,exports.loadVideo=pe,exports.loadVideoInstantly=function(e,t,n){var i=o.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){n(e).pause()},exports.play=function(e){n(e).play()},exports.refreshTokenManager=_,exports.replaceMacros=Z,exports.rewind=function(e,t){var i=n(e),o=i.currentTime(),r=o<=t?0:o-t;i.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)},exports.saveWatchHistory=g,exports.seasonIdxManager=B,exports.setCurrentSeries=function(e){y=e},exports.setCurrentVideo=x,exports.setVideoIdx=A,exports.setVideoIdxById=N,exports.skip=function(e,t){var i=n(e),o=i.currentTime()+t;i.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("./skin-3397dca5.js"),a=require("./generic-6bf3ba02.js"),l=require("./autoNextVideo-b7e91ff3.js"),o=require("@babel/runtime/helpers/typeof"),u=require("video.js"),s=require("@babel/runtime/helpers/asyncToGenerator"),c=require("@babel/runtime/regenerator"),d=require("@babel/runtime/helpers/defineProperty"),p=require("@babel/runtime/helpers/slicedToArray"),v=[],m=function(e,t){var n=i.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var o=a.getVideoIdx();l.switchToNext(o,e,v)}};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"===o(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},u.registerPlugin("thumbnails",function(i){var a,l,o,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))}(),(o=document.createElement("div")).className="vjs-thumbnail-holder",s=document.createElement("img"),o.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(o),v=function(e){var i,a,l,c,v,m,f,g,h,b;for(a in l=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&&(l=Math.max(l,a));(v=u[l]).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),o.style.left=c+"px"},null!==(a=window)&&void 0!==a&&null!==(l=a.customData)&&void 0!==l&&l.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,o.style.left=r+"px",s.style.opacity="1"):(o.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{o.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){o.style.left="-1000px"},d.on("mouseout",m),d.on("touchcancel",m),d.on("touchend",m),c.on("userinactive",m)});var f="my-player";function g(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 h(){return(h=s(c.mark(function e(t){var n,r,i,a,l,o,u,s,d,v,m,f,g,h,b,y,x,w,A,E,N,k,T,I;return c.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),l=p(a,2),o=l[0],u=l[1],s=i.width/u,d=i.height/o,v=[],m=0;m<o;m++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=d,g.getContext("2d").drawImage(i,f*s,m*d,s,d,0,0,s,d),h=g.toDataURL("image/png"),v.push({uri:h,duration:t.duration}),t._tiles=v;return e.abrupt("return",v);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=p(b,2),x=y[0],w=y[1],A=[],E=0;E<x*w;E++)A.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(T=k.appcmsMain)||void 0===T||null===(I=T.images)||void 0===I?void 0:I.placeholderCover,duration:t.duration});return e.abrupt("return",A);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function b(e,t){return y.apply(this,arguments)}function y(){return(y=s(c.mark(function e(t,n){var r,i;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f=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",g(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 x(e,t,n){var r=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=i.getPlayer(f);if(r&&a){var l=r.getBoundingClientRect(),o=(e.clientX-l.left)/l.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 l=Math.floor((i+a)/2),o=t[l];if(o===e)return o;o<e?i=l+1:a=l-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(o*a.duration()),n),s=t[u];s&&!s.loading&&(s.loading=!0,function(e){return h.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 w(e){return A.apply(this,arguments)}function A(){return(A=s(c.mark(function e(t){var n,r,a,l;return c.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=p(r,2),a=i[0]*i[1],l=e.duration,o=0;o<a;o++){var u,s=Math.round((t*a+o)*l);n[s]=Object.assign({},e,{duration:e.duration,tileIndex:o,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},d(u,"left","-60px"),d(u,"border","1px solid transparent"),d(u,"borderRadius","4px"),u)})}}),r=Object.keys(n).map(Number).sort(function(e,t){return e-t}),null==(a=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||a.addEventListener("mousemove",i.throttle(function(e){return x(e,n,r)},500)),null==(l=document.querySelector(".vjs-progress-control.vjs-control"))||l.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",i.throttle(function(e){return x(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var E=function(){var e=s(c.mark(function e(t,n){var r,i,a,l,o,u,s,d;return c.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()}),l=[],o=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}o={resolution:null,duration:null,uri:null,layout:null},d=s.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),n=p(t,2),r=n[0],i=n[1];r&&i&&(o[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"))&&(o.uri=s.includes("http")?s:t+s,l.push(o),o=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",l);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function N(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function k(e,t){return T.apply(this,arguments)}function T(){return(T=s(c.mark(function e(t,n){var r,l,o,u,s,d,v,m,g,h,b,y,x,w,A,E,k,T,L,B,j,M,S,P,R,q,O,$,X,D,V,_,F,U,W,G,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,le,oe,ue,se,ce,de,pe,ve,me;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f=n,r=i.getPlayer(n),l=t.split("/"),o=l.findIndex(function(e){return"dash"===e.toLowerCase()}),u=N(-1!==o?l.slice(0,o+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:g=e.sent,h=new DOMParser,b=h.parseFromString(g,"application/xml"),y=(null==r?void 0:r.duration())||(null===(s=a.getCurrentVideo())||void 0===s||null===(d=s.video)||void 0===d?void 0:d.runtime),x=(null==b||null===(v=b.querySelector("MPD > BaseURL"))||void 0===v?void 0:v.textContent)||u+"/",w=b.getElementsByTagName("AdaptationSet"),A=0;case 18:if(!(A<w.length)){e.next=72;break}if(("image"!==(E=w[A]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(T=E.getElementsByTagName("SegmentTemplate")[0],L=null===(k=T.getElementsByTagName("SegmentTimeline"))||void 0===k?void 0:k[0],!T||!L){e.next=48;break}if(M=L.getElementsByTagName("S"),S=parseInt(null===(B=M[0])||void 0===B?void 0:B.getAttribute("t")),P=parseInt(null===(j=M[0])||void 0===j?void 0:j.getAttribute("d")),R=E.getElementsByTagName("Representation")[0],q=R.getElementsByTagName("EssentialProperty")[0],O=q.getAttribute("value"),$=null==O?void 0:O.split("x"),X=p($,2),D=X[0],V=X[1],!T){e.next=46;break}if(T.getAttribute("media"),_=T.getAttribute("timescale"),F=(_?P/_:P)/(D*V),U=R.getAttribute("id"),W=Math.round(y/F),G=Math.ceil(W/(D*V)),z=T.getAttribute("media"),parseInt(T.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],A=0;A<G;A++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:F,layout:O,uri:Y+Q.replace("$Time$",S+A*P).replace("$RepresentationID$",U)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=p(ee,2),ne=te[0],re=te[1],!T){e.next=69;break}if(T.getAttribute("media"),ie=T.getAttribute("duration"),ae=T.getAttribute("timescale"),le=(ae?ie/ae:ie)/(ne*re),oe=J.getAttribute("id"),ue=Math.round(y/le),se=Math.ceil(ue/(ne*re)),ce=T.getAttribute("media"),de=parseInt(T.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],ve=I(ce),A=0;A<se;A++)me=ve?C(ve,A+de):ce,pe.push({duration:le,layout:Z,uri:x+me.replace("$Number$",A+de).replace("$RepresentationID$",oe)});return e.abrupt("return",pe);case 69:A++,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 I(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function C(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=s(c.mark(function e(t){var n,r,a,l,o,u,s,d,p,v,m,f,g,h,y,x;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=i.getPlayer(t),s=u.currentSource(),d=s.src,d=null!==(n=d)&&void 0!==n&&n.includes("blob")?null===(r=window)||void 0===r||null===(a=r.player)||void 0===a?void 0:a.getSource():d,null===(l=d)||void 0===l||!l.includes("m3u8")){e.next=19;break}return e.next=6,b(d,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=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,E(f,m);case 12:return g=e.sent,e.next=15,w(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(o=d)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,k(d,t);case 22:if(!((null==(y=e.sent)?void 0:y.length)>0)){e.next=28;break}return e.next=26,w(y);case 26:x=e.sent,u.thumbnails(x);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;v=[];var l=a.getCurrentSeries();null==l||l.map(function(e){var t;return(t=v).push.apply(t,e.episodes)}),null==t||null===(r=t.series)||void 0===r||r.cb}else{var o,u;v=(null==t||null===(o=t.relatedVideos)||void 0===o?void 0:o.content)||[],null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var s=i.getPlayer(e);s.on("timeupdate",function(){var e,t,n=Math.floor(s.currentTime()),r=s.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&a.getVideoIdx()<=(null===(t=v)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")});var c,d=v.filter(function(e,t){return t==a.getVideoIdx()});if((null==d?void 0:d.length)>0)if(null!==(c=document.getElementsByClassName("next-ep-preview"))&&void 0!==c&&c[0]){var p,f,g,h,b,y,x,w,A,E,N,k;(null===(p=document.getElementsByClassName("next-ep-preview"))||void 0===p?void 0:p[0]).style.visibility="hidden";var T=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],I=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],C=null===(h=document.getElementsByClassName("next-ep-content"))||void 0===h?void 0:h[0],L=null===(b=d[0])||void 0===b?void 0:b.title;(null===(y=L)||void 0===y?void 0:y.length)>60&&(L=L.substr(0,60)+"..."),T.textContent="".concat(L),I.src=(null===(x=d[0])||void 0===x||null===(w=x.gist)||void 0===w||null===(A=w.imageGist)||void 0===A?void 0:A.r16x9)||(null==d||null===(E=d[0])||void 0===E?void 0:E.img)||(null===(N=window)||void 0===N||null===(k=N.customData)||void 0===k?void 0:k.fallbackImage),C.onclick=function(){return m(e)}}else{var B,j,M,S,P,R,q,O,$=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 D=null===(B=d[0])||void 0===B?void 0:B.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(j=d[0])||void 0===j||null===(M=j.gist)||void 0===M||null===(S=M.imageGist)||void 0===S?void 0:S.r16x9)||(null==d||null===(P=d[0])||void 0===P?void 0:P.img)||(null===(R=window)||void 0===R||null===(q=R.customData)||void 0===q?void 0:q.fallbackImage);var _=document.createElement("div");_.className="next-ep-title",(null===(O=D)||void 0===O?void 0:O.length)>60&&(D=D.substr(0,60)+"..."),_.textContent="".concat(D);var F=document.createElement("div");F.className="next-ep-content",F.append(V),F.append(_),F.onclick=function(){return m(e)},$.append(X),$.append(F)}},exports.addTVProviderImage=function(e,t){var n=i.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var a=document.createElement("div");a.className="tvProviderImage";var l=document.createElement("img");l.src="".concat(r),l.alt="Provider Image",a.append(l),n.el().appendChild(a),n.on("useractive",function(){a.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||a.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}},exports.initiateTrickplay=function(e){return L.apply(this,arguments)};
|
|
1
|
+
"use strict";var e,t,n,r,i=require("./skin-3397dca5.js"),a=require("./generic-d56b38ac.js"),l=require("./autoNextVideo-b2664dca.js"),o=require("@babel/runtime/helpers/typeof"),u=require("video.js"),s=require("@babel/runtime/helpers/asyncToGenerator"),c=require("@babel/runtime/regenerator"),d=require("@babel/runtime/helpers/defineProperty"),p=require("@babel/runtime/helpers/slicedToArray"),v=[],m=function(e,t){var n=i.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var o=a.getVideoIdx();l.switchToNext(o,e,v)}};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"===o(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},u.registerPlugin("thumbnails",function(i){var a,l,o,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))}(),(o=document.createElement("div")).className="vjs-thumbnail-holder",s=document.createElement("img"),o.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(o),v=function(e){var i,a,l,c,v,m,f,g,h,b;for(a in l=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&&(l=Math.max(l,a));(v=u[l]).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),o.style.left=c+"px"},null!==(a=window)&&void 0!==a&&null!==(l=a.customData)&&void 0!==l&&l.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,o.style.left=r+"px",s.style.opacity="1"):(o.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{o.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){o.style.left="-1000px"},d.on("mouseout",m),d.on("touchcancel",m),d.on("touchend",m),c.on("userinactive",m)});var f="my-player";function g(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 h(){return(h=s(c.mark(function e(t){var n,r,i,a,l,o,u,s,d,v,m,f,g,h,b,y,x,w,A,E,N,k,T,I;return c.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),l=p(a,2),o=l[0],u=l[1],s=i.width/u,d=i.height/o,v=[],m=0;m<o;m++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=d,g.getContext("2d").drawImage(i,f*s,m*d,s,d,0,0,s,d),h=g.toDataURL("image/png"),v.push({uri:h,duration:t.duration}),t._tiles=v;return e.abrupt("return",v);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=p(b,2),x=y[0],w=y[1],A=[],E=0;E<x*w;E++)A.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(T=k.appcmsMain)||void 0===T||null===(I=T.images)||void 0===I?void 0:I.placeholderCover,duration:t.duration});return e.abrupt("return",A);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function b(e,t){return y.apply(this,arguments)}function y(){return(y=s(c.mark(function e(t,n){var r,i;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f=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",g(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 x(e,t,n){var r=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=i.getPlayer(f);if(r&&a){var l=r.getBoundingClientRect(),o=(e.clientX-l.left)/l.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 l=Math.floor((i+a)/2),o=t[l];if(o===e)return o;o<e?i=l+1:a=l-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(o*a.duration()),n),s=t[u];s&&!s.loading&&(s.loading=!0,function(e){return h.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 w(e){return A.apply(this,arguments)}function A(){return(A=s(c.mark(function e(t){var n,r,a,l;return c.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=p(r,2),a=i[0]*i[1],l=e.duration,o=0;o<a;o++){var u,s=Math.round((t*a+o)*l);n[s]=Object.assign({},e,{duration:e.duration,tileIndex:o,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},d(u,"left","-60px"),d(u,"border","1px solid transparent"),d(u,"borderRadius","4px"),u)})}}),r=Object.keys(n).map(Number).sort(function(e,t){return e-t}),null==(a=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||a.addEventListener("mousemove",i.throttle(function(e){return x(e,n,r)},500)),null==(l=document.querySelector(".vjs-progress-control.vjs-control"))||l.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",i.throttle(function(e){return x(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var E=function(){var e=s(c.mark(function e(t,n){var r,i,a,l,o,u,s,d;return c.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()}),l=[],o=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}o={resolution:null,duration:null,uri:null,layout:null},d=s.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),n=p(t,2),r=n[0],i=n[1];r&&i&&(o[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"))&&(o.uri=s.includes("http")?s:t+s,l.push(o),o=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",l);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function N(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function k(e,t){return T.apply(this,arguments)}function T(){return(T=s(c.mark(function e(t,n){var r,l,o,u,s,d,v,m,g,h,b,y,x,w,A,E,k,T,L,B,j,M,S,P,R,q,O,$,X,D,V,_,F,U,W,G,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,le,oe,ue,se,ce,de,pe,ve,me;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f=n,r=i.getPlayer(n),l=t.split("/"),o=l.findIndex(function(e){return"dash"===e.toLowerCase()}),u=N(-1!==o?l.slice(0,o+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:g=e.sent,h=new DOMParser,b=h.parseFromString(g,"application/xml"),y=(null==r?void 0:r.duration())||(null===(s=a.getCurrentVideo())||void 0===s||null===(d=s.video)||void 0===d?void 0:d.runtime),x=(null==b||null===(v=b.querySelector("MPD > BaseURL"))||void 0===v?void 0:v.textContent)||u+"/",w=b.getElementsByTagName("AdaptationSet"),A=0;case 18:if(!(A<w.length)){e.next=72;break}if(("image"!==(E=w[A]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(T=E.getElementsByTagName("SegmentTemplate")[0],L=null===(k=T.getElementsByTagName("SegmentTimeline"))||void 0===k?void 0:k[0],!T||!L){e.next=48;break}if(M=L.getElementsByTagName("S"),S=parseInt(null===(B=M[0])||void 0===B?void 0:B.getAttribute("t")),P=parseInt(null===(j=M[0])||void 0===j?void 0:j.getAttribute("d")),R=E.getElementsByTagName("Representation")[0],q=R.getElementsByTagName("EssentialProperty")[0],O=q.getAttribute("value"),$=null==O?void 0:O.split("x"),X=p($,2),D=X[0],V=X[1],!T){e.next=46;break}if(T.getAttribute("media"),_=T.getAttribute("timescale"),F=(_?P/_:P)/(D*V),U=R.getAttribute("id"),W=Math.round(y/F),G=Math.ceil(W/(D*V)),z=T.getAttribute("media"),parseInt(T.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],A=0;A<G;A++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:F,layout:O,uri:Y+Q.replace("$Time$",S+A*P).replace("$RepresentationID$",U)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=p(ee,2),ne=te[0],re=te[1],!T){e.next=69;break}if(T.getAttribute("media"),ie=T.getAttribute("duration"),ae=T.getAttribute("timescale"),le=(ae?ie/ae:ie)/(ne*re),oe=J.getAttribute("id"),ue=Math.round(y/le),se=Math.ceil(ue/(ne*re)),ce=T.getAttribute("media"),de=parseInt(T.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],ve=I(ce),A=0;A<se;A++)me=ve?C(ve,A+de):ce,pe.push({duration:le,layout:Z,uri:x+me.replace("$Number$",A+de).replace("$RepresentationID$",oe)});return e.abrupt("return",pe);case 69:A++,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 I(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function C(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=s(c.mark(function e(t){var n,r,a,l,o,u,s,d,p,v,m,f,g,h,y,x;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=i.getPlayer(t),s=u.currentSource(),d=s.src,d=null!==(n=d)&&void 0!==n&&n.includes("blob")?null===(r=window)||void 0===r||null===(a=r.player)||void 0===a?void 0:a.getSource():d,null===(l=d)||void 0===l||!l.includes("m3u8")){e.next=19;break}return e.next=6,b(d,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=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,E(f,m);case 12:return g=e.sent,e.next=15,w(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(o=d)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,k(d,t);case 22:if(!((null==(y=e.sent)?void 0:y.length)>0)){e.next=28;break}return e.next=26,w(y);case 26:x=e.sent,u.thumbnails(x);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;v=[];var l=a.getCurrentSeries();null==l||l.map(function(e){var t;return(t=v).push.apply(t,e.episodes)}),null==t||null===(r=t.series)||void 0===r||r.cb}else{var o,u;v=(null==t||null===(o=t.relatedVideos)||void 0===o?void 0:o.content)||[],null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var s=i.getPlayer(e);s.on("timeupdate",function(){var e,t,n=Math.floor(s.currentTime()),r=s.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&a.getVideoIdx()<=(null===(t=v)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")});var c,d=v.filter(function(e,t){return t==a.getVideoIdx()});if((null==d?void 0:d.length)>0)if(null!==(c=document.getElementsByClassName("next-ep-preview"))&&void 0!==c&&c[0]){var p,f,g,h,b,y,x,w,A,E,N,k;(null===(p=document.getElementsByClassName("next-ep-preview"))||void 0===p?void 0:p[0]).style.visibility="hidden";var T=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],I=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],C=null===(h=document.getElementsByClassName("next-ep-content"))||void 0===h?void 0:h[0],L=null===(b=d[0])||void 0===b?void 0:b.title;(null===(y=L)||void 0===y?void 0:y.length)>60&&(L=L.substr(0,60)+"..."),T.textContent="".concat(L),I.src=(null===(x=d[0])||void 0===x||null===(w=x.gist)||void 0===w||null===(A=w.imageGist)||void 0===A?void 0:A.r16x9)||(null==d||null===(E=d[0])||void 0===E?void 0:E.img)||(null===(N=window)||void 0===N||null===(k=N.customData)||void 0===k?void 0:k.fallbackImage),C.onclick=function(){return m(e)}}else{var B,j,M,S,P,R,q,O,$=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 D=null===(B=d[0])||void 0===B?void 0:B.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(j=d[0])||void 0===j||null===(M=j.gist)||void 0===M||null===(S=M.imageGist)||void 0===S?void 0:S.r16x9)||(null==d||null===(P=d[0])||void 0===P?void 0:P.img)||(null===(R=window)||void 0===R||null===(q=R.customData)||void 0===q?void 0:q.fallbackImage);var _=document.createElement("div");_.className="next-ep-title",(null===(O=D)||void 0===O?void 0:O.length)>60&&(D=D.substr(0,60)+"..."),_.textContent="".concat(D);var F=document.createElement("div");F.className="next-ep-content",F.append(V),F.append(_),F.onclick=function(){return m(e)},$.append(X),$.append(F)}},exports.addTVProviderImage=function(e,t){var n=i.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var a=document.createElement("div");a.className="tvProviderImage";var l=document.createElement("img");l.src="".concat(r),l.alt="Provider Image",a.append(l),n.el().appendChild(a),n.on("useractive",function(){a.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||a.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}},exports.initiateTrickplay=function(e){return L.apply(this,arguments)};
|