@viewlift/player-backup 2.0.268-backup → 2.0.269-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-509e6228.js → autoNextVideo-a0684b2e.js} +1 -1
- package/cjs/bundle.css +772 -772
- package/cjs/{features-2a457d5b.js → features-5af9462c.js} +1 -1
- package/cjs/generic-9ede01a7.js +1 -0
- package/cjs/index-3ab4a71e.js +1 -0
- package/cjs/{index-9d25f2c1.js → index-daed42a3.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-2e528142.js → multicamv2-36e8ec8a.js} +1 -1
- package/cjs/{multicamv2-a20d415c.js → multicamv2-7a48b087.js} +1 -1
- package/cjs/{nextEpisodeButton-2b96c8f7.js → nextEpisodeButton-e749739c.js} +1 -1
- package/cjs/{playlist-769b630e.js → playlist-d805fa90.js} +1 -1
- package/cjs/{series-8bf8c9e0.js → series-354a0322.js} +1 -1
- package/cjs/{series-v2-1488458a.js → series-v2-4b0ad742.js} +1 -1
- package/cjs/{series-v2-61844655.js → series-v2-4c5d40a8.js} +1 -1
- package/cjs/{skin-064df3a0.js → skin-210f2812.js} +1 -1
- package/cjs/{skin-89130570.js → skin-25675970.js} +1 -1
- package/cjs/{skin-14a3a4f1.js → skin-2fabea5e.js} +1 -1
- package/cjs/{skin-3a067c3a.js → skin-7149e823.js} +1 -1
- package/cjs/{skin-90812f3f.js → skin-b237d7b1.js} +1 -1
- package/cjs/{skin-848294e2.js → skin-baa82c8e.js} +1 -1
- package/cjs/{skin-abf69bec.js → skin-c500edc5.js} +1 -1
- package/cjs/{skin-013181d1.js → skin-c661670e.js} +1 -1
- package/cjs/{skin-b130340a.js → skin-da2bf9bc.js} +1 -1
- package/cjs/{util-6c68bfbb.js → util-8ad9d630.js} +1 -1
- package/cjs/{videoSelector-0f7ec82d.js → videoSelector-57152f21.js} +1 -1
- package/cjs/{videoSelector-dad7e0d5.js → videoSelector-68d8d84e.js} +1 -1
- package/esm/apis/index.d.ts +11 -0
- package/esm/assets/icons.d.ts +22 -0
- package/esm/autoNextVideo-6ab2b97a.js +1 -0
- package/esm/bundle.css +772 -772
- package/esm/components/advertisement/advertisement.d.ts +1 -0
- package/esm/components/auto-next-video/autoNextVideo.d.ts +2 -0
- package/esm/components/big-mute-btn/index.d.ts +9 -0
- package/esm/components/broadcaster_image/index.d.ts +1 -0
- package/esm/components/caption-settings/caption-settings.d.ts +14 -0
- package/esm/components/dvr-seekbar/index.d.ts +14 -0
- package/esm/components/multicam/multicam.d.ts +18 -0
- package/esm/components/multicam-v2/multicamv2.d.ts +13 -0
- package/esm/components/multicam-v2_TEMP/multicamv2.d.ts +13 -0
- package/esm/components/next-ep-preview/next-ep-preview.d.ts +1 -0
- package/esm/components/next-episode/nextEpisodeButton.d.ts +13 -0
- package/esm/components/playlist-tray/playlist.d.ts +15 -0
- package/esm/components/quality-selector/index.d.ts +1 -0
- package/esm/components/resolution/resolution.d.ts +19 -0
- package/esm/components/series/series.d.ts +10 -0
- package/esm/components/series-v2/helper.d.ts +3 -0
- package/esm/components/series-v2/series-v2.d.ts +25 -0
- package/esm/components/series-v2_TEMP/helper.d.ts +1 -0
- package/esm/components/series-v2_TEMP/series-v2.d.ts +21 -0
- package/esm/components/settings-icon/settings-icon.d.ts +17 -0
- package/esm/components/timer/index.d.ts +5 -0
- package/esm/components/trickplay/helper.d.ts +13 -0
- package/esm/components/trickplay/index.d.ts +1 -0
- package/esm/components/trickplay/videojs.thumbnails.d.ts +1 -0
- package/esm/components/video-selector/videoSelector.d.ts +18 -0
- package/esm/components/video-selector_TEMP/videoSelector.d.ts +16 -0
- package/esm/components/watch-history/handleWatchHistory.d.ts +2 -0
- package/esm/contentHandler/content_types/epg.d.ts +4 -0
- package/esm/contentHandler/content_types/external.d.ts +4 -0
- package/esm/contentHandler/content_types/index.d.ts +5 -0
- package/esm/contentHandler/content_types/series.d.ts +4 -0
- package/esm/contentHandler/content_types/vod.d.ts +4 -0
- package/esm/contentHandler/firePlayer.d.ts +4 -0
- package/esm/core/captions.d.ts +10 -0
- package/esm/core/generic.d.ts +48 -0
- package/esm/core/player_instance.d.ts +6 -0
- package/esm/core/renditions.d.ts +6 -0
- package/esm/core/util.d.ts +19 -0
- package/esm/core/volume.d.ts +2 -0
- package/esm/dash/dashHandler.d.ts +1 -0
- package/esm/dash/linear_ssai.d.ts +1 -0
- package/esm/dash/sgai.d.ts +10 -0
- package/esm/{features-06330d47.js → features-b3526a7a.js} +1 -1
- package/esm/features.d.ts +31 -0
- package/esm/generic-740ffc07.js +1 -0
- package/esm/globalPlayerEvents.d.ts +8 -0
- package/esm/helpers/browser.d.ts +2 -0
- package/esm/helpers/currentVideoInfo.d.ts +19 -0
- package/esm/helpers/errorHandling.d.ts +2 -0
- package/esm/helpers/loader.d.ts +2 -0
- package/esm/helpers/localisation.d.ts +2 -0
- package/esm/helpers/scriptLoader.d.ts +2 -0
- package/esm/helpers/secondary-switching.d.ts +1 -0
- package/esm/helpers/skin.d.ts +20 -0
- package/esm/helpers/sourceRetriever.d.ts +11 -0
- package/esm/helpers/ssaiEventHandler.d.ts +27 -0
- package/esm/helpers/token.d.ts +10 -0
- package/esm/index-26dcbfc3.js +1 -0
- package/esm/index-7fc3bd1b.js +1 -0
- package/esm/index.d.ts +39 -0
- package/esm/index.js +1 -1
- package/esm/{multicamv2-d68842ee.js → multicamv2-dd70a6aa.js} +1 -1
- package/esm/{multicamv2-acd74932.js → multicamv2-f85dfa0b.js} +1 -1
- package/esm/{nextEpisodeButton-338de4e8.js → nextEpisodeButton-4ceda14d.js} +1 -1
- package/esm/playlist-b267f666.js +1 -0
- package/esm/plugins/chromecast.d.ts +18 -0
- package/esm/plugins/comscore_dist/index.d.ts +50 -0
- package/esm/plugins/index.d.ts +2 -0
- package/esm/plugins/library.d.ts +8 -0
- package/esm/plugins/videojs-dash5.es.d.ts +51 -0
- package/esm/plugins/videojs_contrib_dash.d.ts +51 -0
- package/esm/{series-535d9397.js → series-8fd3310e.js} +1 -1
- package/esm/{series-v2-7de596f8.js → series-v2-752ab4ec.js} +1 -1
- package/esm/{series-v2-fa13b138.js → series-v2-ac589b22.js} +1 -1
- package/esm/skin/carousel/skin.d.ts +1 -0
- package/esm/skin/default/events.d.ts +1 -0
- package/esm/skin/default/skin.d.ts +1 -0
- package/esm/skin/defaultV2/events.d.ts +1 -0
- package/esm/skin/defaultV2/skin.d.ts +1 -0
- package/esm/skin/index.d.ts +1 -0
- package/esm/skin/mini/events.d.ts +1 -0
- package/esm/skin/mini/skin.d.ts +1 -0
- package/esm/skin/minimalist/skin.d.ts +1 -0
- package/esm/skin/multiplayer/events.d.ts +1 -0
- package/esm/skin/multiplayer/skin.d.ts +1 -0
- package/esm/skin/news/events.d.ts +1 -0
- package/esm/skin/news/skin.d.ts +1 -0
- package/esm/skin/news_live/events.d.ts +1 -0
- package/esm/skin/news_live/skin.d.ts +1 -0
- package/esm/skin/vl_one/events.d.ts +1 -0
- package/esm/skin/vl_one/skin.d.ts +1 -0
- package/esm/{skin-479a40b3.js → skin-2e4d0ad8.js} +1 -1
- package/esm/skin-6a775f92.js +1 -0
- package/esm/{skin-665917ca.js → skin-765a4c47.js} +1 -1
- package/esm/skin-8a65a5d9.js +1 -0
- package/esm/skin-a08c5bc3.js +1 -0
- package/esm/{skin-f83590a2.js → skin-a625396e.js} +1 -1
- package/esm/{skin-fd7cd709.js → skin-bd79d907.js} +1 -1
- package/esm/skin-c998863a.js +1 -0
- package/esm/skin-cf049658.js +1 -0
- package/esm/{util-40db3943.js → util-e0435c60.js} +1 -1
- package/esm/utilities/analytics.d.ts +3 -0
- package/esm/utilities/beacon.d.ts +3 -0
- package/esm/utilities/comscore.d.ts +5 -0
- package/esm/utilities/controlsColor.d.ts +1 -0
- package/esm/utilities/conviva.d.ts +5 -0
- package/esm/utilities/keyboardShortcuts.d.ts +5 -0
- package/esm/utilities/replaceMacros.d.ts +1 -0
- package/esm/videoSelector-f86775c4.js +1 -0
- package/esm/videoSelector-fd411c45.js +1 -0
- package/package.json +1 -1
- package/cjs/generic-b9f32717.js +0 -1
- package/cjs/index-1b56425c.js +0 -1
- package/esm/autoNextVideo-281b09dd.js +0 -1
- package/esm/generic-355cc8c6.js +0 -1
- package/esm/index-1a4369e9.js +0 -1
- package/esm/index-66169052.js +0 -1
- package/esm/playlist-d3eb7e41.js +0 -1
- package/esm/skin-02bec45a.js +0 -1
- package/esm/skin-6819b99b.js +0 -1
- package/esm/skin-68558a96.js +0 -1
- package/esm/skin-9638eb22.js +0 -1
- package/esm/skin-f9f02a42.js +0 -1
- package/esm/videoSelector-465a0eee.js +0 -1
- package/esm/videoSelector-97f0b9a4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import{g as r,t as l,c as a}from"./skin-4f84b841.js";import{i as d,d as u}from"./browser-d4613b36.js";import s from"md5";import c from"js-cookie";import{a as v,r as m}from"./captions-2b4caf69.js";import f from"@babel/runtime/helpers/typeof";import p from"@babel/runtime/helpers/toConsumableArray";import w from"@babel/runtime/helpers/slicedToArray";import{destroyComscoreTag as g,formulateComscorePayload as I,createComscoreStreamingTag as h,setComscorePlayerInstance as E}from"@viewlift/comscore/index.js";function y(){var e,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function T(e){window.dataLayer=window.dataLayer||[],y("js",new Date),y("config",e)}function b(e,n){y("event",e,n)}var _={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function O(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?S(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):S(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var D={name:"@viewlift/player",version:"2.1.37",main:"dist/bundle.cjs.js",types:"dist/@viewlift/player/esm/index.d.ts",amdName:"_playerCore",scripts:{prepublishOnly:"release-assistant"},dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1","@viewlift/comscore":"^1.0.13",axios:"^1.2.3",md5:"^2.3.0",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","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"},overrides:{"min-document":"^2.19.1"}};window.vl_player_version=D.version;var A,L=function(){var e,n,t,o;return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementBaseUrl)+"/video/status":V.get()+"".concat(null==_?void 0:_.getVideoDetails)},F=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:L(),params:O({id:e,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,"Sdk-Version":D.version,"x-player-name":"videojs",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken},withCredentials:!0})},P=function(e,n){var t,o,r,l,a,d,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})}):i({url:V.get()+_.getLinearChannelDetails,params:O(O(O(O(O({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web",ssaiDisable:u},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:n,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO",adbTempToken:null===(a=window)||void 0===a||null===(d=a.customData)||void 0===d?void 0:d.adbTempToken}})},C=function(e,n){var t,o,r=$(n),l=(null==r?void 0:r.site)||null;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,n){var t,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})}):i({url:V.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:n}})},k=function(){var e=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:return o=e.sent,e.abrupt("return",i({url:V.get()+"".concat(null==_?void 0:_.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:O({},n),params:O({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),R=function(e,n){var t,o,r=window.contentType;return i({method:"GET",url:V.get()+"".concat(null==_?void 0:_.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:n,"x-api-key":null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},j=function(e){var n=e.videoId;return i({method:"GET",url:V.get()+"".concat(null==_?void 0:_.getSeriesWatchHistoryV2,"/").concat(n),headers:{Authorization:e.token},timeout:15e3})},V=(A=null==_?void 0:_.apiBaseUrl,{set:function(e){e&&(A=e)},get:function(){return A}}),W=function(e,n,t,o){var r,l;return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:n,adbTempToken:null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.adbTempToken},withCredentials:!0})},N=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},U=null;function B(){return{set:function(e){e&&(U=e)},get:function(){return U}}}var M,x,H,G,Y,Q,z,q=function(){var e=n(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=B().get(),o=V.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),K=null,X=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!N(n)){e.next=6;break}return K||(K=q().then(function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&B().set(r),i||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){K=null})),e.abrupt("return",K);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),J=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,o=null==e?void 0:e.asat;return t&&!o&&(n=!1),n},$=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},Z=function(e){e&&"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem("uid",e)},ee=(Q=new Map,{set:function(e){var n,t=(null==e||null===(n=e.video)||void 0===n?void 0:n.id)||e||null;Q.set(t,(Q.get(t)||0)+1)},get:function(e){return Q.get(e)},clear:function(){Q.clear()}}),ne=function(e){x=e},te=function(){return x},oe=function(e){M=e},ie=function(){return M},re=function(){return H},le=function(e){H=e},ae=function(){return Y},de=function(e){G=new Map,e.map(function(e,n){G.set(e.id,n)})},ue=function(e){if(G){var n=G.get(e);le(n+1)}},se=(z=0,{set:function(e){e>=0&&(z=e)},get:function(){return z}});function ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ve(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ce(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var me=0,fe=null,pe=function(){var e,n,t,o,i,r,l,a=te();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===t||null===(o=t.content)||void 0===o?void 0:o.id:(null==a||null===(i=a.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function we(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ge(){return fe||window.sessionStorage.getItem("uid")}function Ie(){return he.apply(this,arguments)}function he(){return(he=n(t.mark(function e(){var n,o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(o=JSON.parse(atob(n.split(".")[1])))||!o.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==o?void 0:o.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ee(e){return e?String(e):""}window.initialise=function(e){window.sid=we(),window.environment="production",window.platform="WEBSITE",window.failedToStartTimer=null,window.droppedStreamTimer=null,window.firstFrameFired=!1,streamFailures(e),buffering(e),ads(e),ping(e)},window.cleanupTimers=function(){clearInterval(window.bufferingTimer),clearInterval(window.ttFirstFrameTimer),clearTimeout(window.failedToStartTimer),clearTimeout(window.droppedStreamTimer),window.failedToStartTimer=null,window.droppedStreamTimer=null},window.fireStreamFailure=function(e){var n,t,o,i=r(),l=null!=i&&i.el_?Math.floor(i.currentTime()):0;window.cleanupTimers(),b(e,ve({pfm:window.platform,uid:ge(),vid:pe(),videoPosition:l},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:e,videoPosition:l,isAdEvent:!1})},window.streamFailures=function(e){e.on("error",function(){var e=window.firstFrameFired?"DROPPED_STREAM":"FAILED_TO_START";window.fireStreamFailure(e)})},window.firstFrame=function(e,n,t){e.one("play",tryCatch(function(){var o,i,r;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),window.failedToStartTimer=setTimeout(function(){window.firstFrameFired||window.fireStreamFailure("FAILED_TO_START")},3e4),b("PLAY",ve({pfm:window.platform,uid:ge(),vid:pe(),videoPosition:Math.floor(e.currentTime())},null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i||null===(r=i.beacon)||void 0===r?void 0:r.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),n&&n("started_video_playback",ve({"Video ID":pe(),watchTime:Math.floor(e.currentTime())},t))}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:(clearInterval(window.bufferingTimer),clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=null)},100),window.firstFrameFired&&(clearTimeout(window.droppedStreamTimer),window.droppedStreamTimer=setTimeout(function(){var n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()&&window.fireStreamFailure("DROPPED_STREAM")},45e3)))}))},window.handleBufferTimer=function(e,n){var t,o;if(n.el_){var i,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(o=t.className)&&void 0!==o&&o.includes("vjs-waiting")&&me<4)me++,b("BUFFERING",ve({pfm:window.platform,uid:ge(),vid:pe(),videoPosition:n.el_&&Math.floor(n.currentTime())},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var n,t,o;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),clearTimeout(window.failedToStartTimer),window.failedToStartTimer=null,window.firstFrameFired=!0,window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,b("FIRST_FRAME",ve({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ge(),vid:pe()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var n,t,o,i,r,l;b("AD_REQUEST",ve({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ge(),vid:pe(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),b("AD_IMPRESSION",ve({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ge(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:pe()},null===(i=window)||void 0===i||null===(r=i.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 n=[];e.on("timeupdate",function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(me=0,n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var n=e.currentTime(),t=e.duration(),o=e.buffered(),i=0;i<o.length;i++){var r=o.start(i),l=o.end(i);if(ye(n,r,l)){var a=Math.round(t-l);if(isFinite(a))return a}}})()};var ye=function(e,n,t){return e>=n&&e<=t},Te=function(){var e,n=te(),t=(null==n?void 0:n.contentType)||"video";return(null==n||null===(e=n[t])||void 0===e?void 0:e.network)||null};function be(e,n){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){null!=n&&n.userId&&(fe=n.userId);var t=r(e);window.initialise(t,null==n?void 0:n.analyticsCb),window.firstFrame(t,null==n?void 0:n.analyticsCb,null==n?void 0:n.analyticsEventParams),t.on("loadedmetadata",function(){window.endFirstFrame(t)})}}window.fireEvent=function(){var e=n(t.mark(function e(n){var o,r,l,a,d,u,s,c,v,m,f,p,w,g,I,h,E,y,T,b,S;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:return E=e.sent,y=$(E),T=null==y?void 0:y.site,b=null==y?void 0:y.siteId,e.t0=ve,e.t1=ve,e.t2=ve({aid:T,cid:b,pfm:window.platform},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={},e.t4=ge(),e.t5=pe(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:null,e.t17=!0===n.isAdEvent?Ee(n.adPosition):"",e.next=26,Ie();case 26:e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=n.resWidth)&&void 0!==c?c:null,e.t26=null!==(v=n.bufferHealth)&&void 0!==v?v:null,e.t27=null!==(m=Te())&&void 0!==m?m:null,e.t28=null!=T?T:null,e.t29={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26,networkname:e.t27,brandname:e.t28},e.t30=(null==n?void 0:n.duration)&&{duration:n.duration},e.t31=(0,e.t1)(e.t2,e.t3,e.t29,e.t30),e.t32=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(w=p.beacon)||void 0===w?void 0:w.params,e.t33=(0,e.t0)(e.t31,e.t32),S=[e.t33],i({url:(null===(g=window)||void 0===g||null===(I=g.customData)||void 0===I||null===(h=I.beacon)||void 0===h?void 0:h.url)||V.get()+_.getBeaconUrl,method:"post",headers:{Authorization:E},contentType:"application/x-www-form-urlencoded",dataType:"text",data:S}).catch(function(e){console.error(e)});case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var _e=function(e,n){var t=new Map;j({videoId:e,token:n}).then(function(e){e.data.map(function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),Y=t}).catch(function(e){return console.log(e)})},Se=function(){var e=se.get();return e>=0?e+1:1},Oe=function(){var e,n,t,o=ie(),i=te(),r=null==i||null===(e=i.video)||void 0===e?void 0:e.id,l=se.get(),a=null==o||null===(n=o[l])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function De(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Ae(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?De(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):De(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Le=s,Fe=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},Pe=function(e){var n=Ce(e,"video.tags",[]),t=Ce(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map(function(e){return e.title}).join(","):t},Ce=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},ke=function(){var e,n,t,o,i,l,a,d,u,s,v,m,f,p,w,g,I,h,E,y,T,b,_,S,O,D=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",A=arguments.length>1?arguments[1]:void 0,L=arguments.length>2?arguments[2]:void 0;if(null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.disableMacros)return D;var F=(null==L?void 0:L.siteName)||(null==L?void 0:L.site)||"",P=(null==L?void 0:L.contentType)||"video",C=(null==L||null===(t=L[P])||void 0===t?void 0:t.metadata)||(null==L||null===(o=L[P])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.metadata),k=r(A);if(!D.includes("VIEWLIFT_"))return D;var R,j=window.getComputedStyle(document.getElementById(A),null),V=Math.trunc(j.getPropertyValue("height").slice(0,-2)),W=Math.trunc(j.getPropertyValue("width").slice(0,-2)),N="linearchannel"===P?null==L||null===(l=L.linearchannel)||void 0===l||null===(a=l.channels)||void 0===a||null===(d=a.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===d||null===(u=d.content)||void 0===u?void 0:u.id:Ce(L,"video.gist.id",""),U="linearchannel"===P?null==L||null===(s=L.linearchannel)||void 0===s||null===(v=s.channels)||void 0===v||null===(m=v.find(function(e){return(null==e?void 0:e.id)===(null==L?void 0:L.channelId)}))||void 0===m?void 0:m.title:Ce(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),B=null,M=null;"function"==typeof window.__gpp&&(null===(R=window)||void 0===R||R.__gpp("ping",function(e){B=null==e?void 0:e.gppString,M=null==e?void 0:e.sectionList[0]}));var x=c.get("us_privacy")||c.get("usprivacy"),H=void 0!==x?x:"1YNN",G=null!==(f=null===(p=JSON.parse(localStorage.getItem("selectedMvpdProvider")||"{}"))||void 0===p?void 0:p.fwIdentifier)&&void 0!==f?f:null,Y=Ae(Ae({},Re(C)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:V,VIEWLIFT_SIZE:Fe(W,V),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===(w=window)||void 0===w?void 0:w.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Ce(L,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==k||null===(g=k.options_)||void 0===g?void 0:g.autoplay)||1,VIEWLIFT_MUTE:(null==k||null===(I=k.options_)||void 0===I?void 0:I.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==F||"usanetwork"==F?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:Pe(L),VIEWLIFT_MEDIA_ID:N,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Ce(L,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:N,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Ce(L,"video.gist.permalink","")),VIEWLIFT_CONSENT:c.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Ce(null===(h=window)||void 0===h||null===(E=h.app_data)||void 0===E||null===(y=E.site)||void 0===y?void 0:y.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_ROKU_AD_ID:"",VIEWLIFT_ROKU_AD_KEYS:"",VIEWLIFT_RDID:"",VIEWLIFT_GDPR:"spinco"==F||"usanetwork"==F||"golfchannel"==F?"":Ce(null===(T=window)||void 0===T||null===(b=T.app_data)||void 0===b||null===(_=b.site)||void 0===_?void 0:_.settings,"compliance.gdpr")?1:0,VIEWLIFT_US_PRIVACY:H,VIEWLIFT_TVE_PROVIDER:G?Le(G):"",VIEWLIFT_CONTENT_DURATION_MS:1e3*Ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Ce(L,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:N,VIEWLIFT_CONTENT_TITLE:U,VIEWLIFT_CONTENT_SERIES_TITLE:Ce(L,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Ce(L,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:Oe(),VIEWLIFT_SEASON_NUMBER:Se(),VIEWLIFT_CONTENT_TAGS:Pe(L),VIEWLIFT_GPP_SID:M||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:B||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:"",VIEWLIFT_LAT:"",VIEWLIFT_APP_BUNDLE:"",VIEWLIFT_ATT_CONSENT:""},null===(S=window)||void 0===S||null===(O=S.customData)||void 0===O?void 0:O.macros);for(var Q in Y){var z=new RegExp(Q,"g");D=D.replace(z,Y[Q])}return D},Re=function(e){var n,t,o,i,r,l,a,u,s,c={},v=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){v.set(e.name,e.value)}));var m=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,f=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return m||f?(d()?m?c=Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||""}):f&&(c=Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.tve.csai")||""})):m?c=Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||""}):f&&(c=Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.web.tve")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.tve.csai")||""})),m?c=Ae(Ae({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(d()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}):f&&(c=Ae(Ae({},c),{},{VIEWLIFT_SFID:v.get("sfid.tve")||v.get("sfid.web.tve")||"",VIEWLIFT_SFID_CSAI:v.get(d()?"sfid.mweb.tve.csai":"sfid.web.tve.csai")||""})),c=d()?Ae(Ae({},c),{},{VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):Ae(Ae({},c),{},{VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})):(c=Ae(Ae({},c),{},{VIEWLIFT_SFID:v.get("sfid.dtc")||v.get("sfid.web.dtc")||"",VIEWLIFT_SFID_CSAI:v.get(d()?"sfid.mweb.dtc.csai":"sfid.web.dtc.csai")||""}),c=d()?Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:v.get("prof.mweb")||"",VIEWLIFT_CSID_CSAI:v.get("csid.mweb.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.mweb.csai")||""}):Ae(Ae({},c),{},{VIEWLIFT_CSID:v.get("csid.web.dtc")||"",VIEWLIFT_PROF:v.get("prof.web")||"",VIEWLIFT_CSID_CSAI:v.get("csid.web.dtc.csai")||"",VIEWLIFT_PROF_CSAI:v.get("prof.web.csai")||""})),c=Ae(Ae({},c),{},{VIEWLIFT_AFID:v.get("afid"),VIEWLIFT_NIELSEN_APP_ID:Ce(null===(a=window)||void 0===a||null===(u=a.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s?void 0:s.analytics,"nielsen.id")||v.get("VIEWLIFT_NIELSEN_APP_ID")||"",VIEWLIFT_CHANNEL:v.get("VIEWLIFT_CHANNEL")||"",VIEWLIFT_GRACE_NOTE_ID:v.get("VIEWLIFT_GRACE_NOTE_ID")||"",VIEWLIFT_EXTERNAL_AD_ID:v.get("VIEWLIFT_EXTERNAL_AD_ID")||""})},je=function(e,n){var t,o,i,r,l,a,d,s,c,v,m,f,p,w=(null==e?void 0:e.contentType)||"video",g=null==e||null===(t=e[w])||void 0===t?void 0:t.drmEnabled,I=null==e||null===(o=e[w])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,h=null==e||null===(r=e[w])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,E=(null==e||null===(a=e[w])||void 0===a||null===(d=a.streamingInfo)||void 0===d||null===(s=d.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[w])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var y=(null==e||null===(m=e[w])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=h&&h.hls)return We(h);if(g){var T=Ne(I,n);return T.src=ke(T.src,n,e),T}if("Safari"!==u()&&y)return Ve(I);if(E){var b=We(I);return b.src=ke(b.src,n,e),b}if(null!=I&&I.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(I);return _.src=ke(_.src,n,e),_}return null},Ve=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},We=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},Ne=function(e,n){var t=(null==e?void 0:e.drmProvider)||null,i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=u();if(r(n),"Safari"===d){var s=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))})},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,function(e,n,t){console.log(e),e&&r(e),r(null,t)})}}}}}(i);return Ue(n),s}var c,v={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(c=window)||void 0===c?void 0:c.siteName)?(Ue(n),v.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:null==a?void 0:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):"custom"==t?(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"Content-Type":"application/octet-stream"},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})):(v.keySystemOptions=[],v.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),v.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:null==a?void 0:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":null==a?void 0:a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),v};var Ue=function(e){var n=r(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==u()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Be=function(e,n){var t=e.src,o=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:o};n=n.replace(/\/$/,"");var i=t.split(".com")[1]||"";return{src:i?"".concat(n).concat(i):t,type:o}},Me=function(e,n){if(import("./error-2395864b.js").then(function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)}),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e);if(o){var i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}}},xe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var He=!1,Ge=function(e,n,t){var o=ke(n,e,t),i=r(e);if(n&&window.google){if("function"!=typeof i.ima&&"object"!==f(i.ima))return;i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,l=r(e);if(null!==l.el_){He=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),He&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,n,!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===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){var n=e.adsManager;n.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}),n.addEventListener(google.ima.AdEvent.Type.LOADED,function(e){c&&c({status:"LOADED",msg:"Advertisement Loaded",data:e})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,o)}};function Ye(e,n){var t,o,i,l=r(e),a=null==l||null===(t=l.controlBar)||void 0===t||null===(o=t.playToggle)||void 0===o?void 0:o.el_,d=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(t){var o,i,r,u,s,c,v,m,f;if(ze.enabled&&!t.metaKey&&!t.ctrlKey&&"input"!=t.target.localName&&"textarea"!=t.target.localName){var p=t.key,w=!0===n.liveVideo||!0===n.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(p)&&(t.preventDefault(),null==d||d.focus()),p){case" ":null==a||a.click();break;case"m":case"M":l.muted(!l.muted());break;case"f":case"F":null===(o=document.querySelector(".vjs-fullscreen-control"))||void 0===o||o.click();break;case"ArrowLeft":w&&!1===n.liveui||Bn(e,10);break;case"ArrowRight":if("MEDIA_TAILOR"==(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(u=r.appcmsMain)||void 0===u||null===(s=u.adsConfig)||void 0===s?void 0:s.vodAdSticherProvider)&&null!==(c=window)&&void 0!==c&&null!==(v=c.app_data)&&void 0!==v&&null!==(m=v.appcmsMain)&&void 0!==m&&null!==(f=m.adsConfig)&&void 0!==f&&f.vodAdClientSideTracking)return;w||Un(e,10)}}},!0)}var Qe,ze=(Qe=!0,{enable:function(){Qe=!0},disable:function(){Qe=!1},get enabled(){return Qe}}),qe="ssai-breakStart",Ke="ssai-adImpression",Xe="ssai-firstQuartile",Je="ssai-midpoint",$e="ssai-thirdQuartile",Ze="ssai-complete",en="ssai-breakEnd",nn={breakStart:qe,impression:Ke,firstQuartile:Xe,midpoint:Je,thirdQuartile:$e,complete:Ze,breakEnd:en};function tn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r(e);if(!t)return console.error("[SSAI] Player instance not found"),{};var o=n.eventType,i=nn[o];i&&t.trigger(i,n)}function on(e){var n=r(e);if(!n)return console.error("[SSAI] Player instance not found"),{};var t=function(e,t){var o=function(e,n){return t(n)};return n.on(e,o),function(){return n.off(e,o)}};return{adBreakStart:function(e){return t(qe,e)},adImpression:function(e){return t(Ke,e)},adFirstQuartile:function(e){return t(Xe,e)},adMidpoint:function(e){return t(Je,e)},adThirdQuartile:function(e){return t($e,e)},adComplete:function(e){return t(Ze,e)},adBreakEnd:function(e){return t(en,e)}}}function rn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function ln(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?rn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):rn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var an,dn=(an={},{get:function(){return an},set:function(e){an=e}});function un(e,n){var t,o,i,l,a,d,u,s,c,v,m,f,p,w,y,T,b,_,S,O,D,A=null==e?void 0:e.playerId,L=r(A);if(null!=e&&null!==(t=e.comscore)&&void 0!==t&&t.enable){var F=te(),P=(null==F||null===(o=F.video)||void 0===o?void 0:o.metadata)||[],C=(null==P?void 0:P.length)&&P.filter(function(e){return"advertisingGenre"===e.name});if(null!==(i=C)&&void 0!==i&&i.length){var k=C.map(function(e){return e.value});C=null==k?void 0:k.join(",")}g();var R,j,V,W=null===(l=window)||void 0===l?void 0:l.lcProgrammeDetails,N=Array.isArray(null==W?void 0:W.category)?null==W||null===(a=W.category)||void 0===a?void 0:a.join(","):(null==W?void 0:W.category)||null,U=ln(ln(ln({},null==F?void 0:F.video),null==F?void 0:F.linearchannel),{},{siteName:(null==e||null===(d=e.comscore)||void 0===d?void 0:d.applicationName)||(null==e||null===(u=e.comscore)||void 0===u||null===(s=u.metadata)||void 0===s?void 0:s.siteName)||(null==F?void 0:F.site)||null,programId:(null==W?void 0:W.videotmsid)||null,programTitle:(null==W?void 0:W.lcProgrammeName)||null,episodeId:(null==W?void 0:W.videotmsid)||null,seasonNumber:(null==F||null===(c=F.video)||void 0===c||null===(v=c.series)||void 0===v?void 0:v.seasonNumber)||(null==W||null===(m=W.seriesDetails)||void 0===m?void 0:m.season)||null,episodeNumber:(null==F||null===(f=F.video)||void 0===f||null===(p=f.series)||void 0===p?void 0:p.episodeNumber)||(null==W||null===(w=W.seriesDetails)||void 0===w?void 0:w.episode)||null,episodeTitle:(null==W?void 0:W.lcSubTitle)||null,isCompleteEpisode:!!(null!=F&&null!==(y=F.video)&&void 0!==y&&y.series||null!=W&&null!==(T=W.seriesDetails)&&void 0!==T&&T.episode),genre:C||N,comscoreConfig:{implementationId:(null==e||null===(b=e.comscore)||void 0===b?void 0:b.implementationId)||null,projectId:(null==e||null===(_=e.comscore)||void 0===_?void 0:_.projectId)||null}}),B=null==e||null===(S=e.comscore)||void 0===S||null===(O=S.metadata)||void 0===O?void 0:O.contentType;if(null!=U&&null!==(D=U.streamingInfo)&&void 0!==D&&D.isLiveStream?U.contentType="Live":U.contentType=B||"LongFormOnDemand",null==U||!U.network){var M,x=(null==U?void 0:U.metadata)||[],H=null==x||null===(M=x.find(function(e){return"network"===e.name}))||void 0===M?void 0:M.value;U.network=H||null}null!=U&&U.network&&null!=U&&U.genre&&(U.customGenre="".concat(U.network,"_").concat((null==U?void 0:U.programTitle)||(R=U,null!=R&&R.series?null==R||null===(V=R.series)||void 0===V?void 0:V.title:null==R||null===(j=R.gist)||void 0===j?void 0:j.title),"_").concat(U.genre)),null!=W&&W.airDate&&(U.publishDate=W.airDate),null!=U&&U.runtime&&"function"==typeof L.duration&&(U.runtime=1e3*Math.ceil(L.duration()));var G=I(U,L);console.log("comscoreOptions player data",G),h(ln({playerName:"Video.js"},G)),E(L)}}function sn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function cn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):sn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}function vn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return mn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?mn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function mn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}var fn,pn=function(){var e="";return{set:function(n){n&&(e=n)},get:function(){return e}}}(),wn=(fn=null,{set:function(e){fn=e},get position(){return fn}});function gn(e,n){return In.apply(this,arguments)}function In(){return(In=n(t.mark(function e(n,o){var i,l,a,d,u,s,c,v,m,f,p,g,I,h,E,y,T,b;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r(n),a=je(o,n),d=a.src,u=(null==o?void 0:o.contentType)||"video",null==o||null===(i=o[u])||void 0===i||null===(l=i.streamingInfo)||void 0===l||l.isLiveStream,s=d.replace("/dash/","/session/").replace("/master/","/session/"),s=ke(s,n,o),c=En(s),v=w(c,2),m=v[0],f=v[1],p=hn(f)||{},s=new URL(s.split("?")[0]),Object.keys(f).length>0&&Object.entries(f).forEach(function(e){var n=w(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),e.prev=11,e.next=14,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(cn({adsParams:cn({},m)},p))});case 14:return g=e.sent,e.next=17,g.json();case 17:return I=e.sent,h="https://"+new URL(s).hostname,E=I.trackingUrl,y=I.manifestUrl,T=h+E,b=h+y,pn.set(T),console.log("%c TRACKING URL","background: #bdf369; color: #000",T),a.src=b,e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(11),e.abrupt("return",a);case 32:case"end":return e.stop()}},e,null,[[11,29]])}))).apply(this,arguments)}function hn(e){var n;return Object.fromEntries(null==Object||null===(n=Object.entries(e))||void 0===n?void 0:n.map(function(e){var n=w(e,2),t=n[0],o=n[1];return[null==t?void 0:t.replace(/^aws\./,""),String(o)]}))||{}}function En(e){var n={};if(!e.split("?")[1])return[{},{}];var t,o=new URL(e,window.location.origin),i=vn((null==o?void 0:o.searchParams)||[]);try{for(i.s();!(t=i.n()).done;){var r=w(t.value,2),l=r[0],a=r[1];n[decodeURIComponent(l)]=decodeURIComponent(a||"")}}catch(e){i.e(e)}finally{i.f()}for(var d={},u={},s=0,c=Object.entries(n);s<c.length;s++){var v=w(c[s],2),m=v[0],f=v[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=f;else u[m]=f}return[d,u]}var yn,Tn,bn,_n=new Map;function Sn(e,n){return On.apply(this,arguments)}function On(){return On=n(t.mark(function e(o,i){var a,d,u,s,c,v,m,f,w,g,I,h,E,y,T,b,_,S,O,D,A,L,F,P,C;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:C=function(e,n,t,i,l,a){var d,u,s=r(o);if(!s.seeking()){var c=n.startTimeInSeconds;n.durationInSeconds,e<F&&L.clear(),F=e;var v=(null==n||null===(d=n.ads)||void 0===d||null===(u=d[i])||void 0===u?void 0:u.adId)||c;Math.floor(s.currentTime());var m,f=vn(t);try{var p=function(){var t,r,d,u=m.value,c=u.eventType,f=u.beaconUrls,p=u.startTimeInSeconds,w=u.startTime,g=u.durationInSeconds,I=p||0,h=f,E=(null===(t=window)||void 0===t||null===(r=t.customData)||void 0===r||null===(d=r.ads)||void 0===d?void 0:d.adEventHandler)||null,y="".concat(I,"_").concat(c),T=_n.get("pod-".concat(l))||[];if(console.warn(e,I,"map:",c,"condition1:",e>=I,"map:",_n),e>=I&&!T.includes(y)){T.push(y),_n.set("pod-".concat(l),T);try{P(c,n,h,s)}catch(e){console.error("Error when calling triggerAdBeacon:",e,c,n)}if("breakEnd"==c){var b=wn.position;wn.set(null),setTimeout(function(){null!=b&&(s.currentTime(b),a())},500)}if("function"==typeof E)try{var _,S={eventType:c,startTimeInSeconds:p,startTime:w,durationInSeconds:g,ad:null==n||null===(_=n.ads)||void 0===_?void 0:_[i],adIndex:i};E({adsData:S}),tn(o,S)}catch(e){console.error("Error when calling ads callback:",e)}var O=dn.get();if(O&&0!==Object.keys(O).length){var D=O.formulateComscoreAdPayload,A=O.startComscoreAdTracking,F=O.finishComscoreAdTracking,C=O.endComscoreAdTracking,k="".concat(I,"_").concat(v,"_").concat(c);if(!L.has(k))if(L.set(k,!0),"impression"===c){var R,j=pn.get();A(D(cn(cn({},null==n||null===(R=n.ads)||void 0===R?void 0:R[i]),{},{trackingUrl:j})))}else"complete"===c?F():"breakEnd"===c&&C()}}};for(f.s();!(m=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}}},P=function(e,n,t,o){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},A=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},_n.clear(),wn.set(i),w=pn.get(),(g=r(o)).one("loadeddata",function(){w&&D(w)}),I=new Map,h=new Map,E=-1,y=(null===(a=document)||void 0===a||null===(d=a.getElementsByClassName("tvProviderImage"))||void 0===d?void 0:d[0])||null,T=(null==g||null===(u=g.controlBar)||void 0===u?void 0:u.getChild("videoSelector"))||null,b=(null==g||null===(s=g.controlBar)||void 0===s?void 0:s.getChild("seriesV2"))||null,_=(null==g||null===(c=g.el())||void 0===c||null===(v=c.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===v?void 0:v[0])||null,S=(null==g||null===(m=g.el())||void 0===m||null===(f=m.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===f?void 0:f[0])||null,O=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return p(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return cn(cn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},D=function(){var e=n(t.mark(function e(n){var a,d,u,s,c,v,m,f,w,g,D,L,F,P,k,R,j,V,W,N,U,B,M,x;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return N=function(e){document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",N),0===e.button&&j()},W=function(e){},V=function(){var e,n=g.currentTime(),t=null,o=vn(w);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=(i.ads,Math.floor(r+l));n>=r&&n<=a&&(t=a,I.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking to end of the ad pod:",t),setTimeout(function(){g.currentTime(t+2.2)},100))},j=function(){var e,n=g.currentTime(),t=null,o=vn(w);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,d=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>d||n>r)&&!I.has(r)||n>=r&&n<=d)&&(t=r,I.set(r,!0),h.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){g.currentTime(t+.4)},100))},c=!1,e.next=7,fetch(n);case 7:return v=e.sent,e.next=10,v.json();case 10:m=e.sent,f=m.avails,w=[],g=r(o),D=g.controlBar.progressControl,L=D.seekBar.el(),null===(a=document)||void 0===a||a.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),f.map(function(e,n){var t;0==n&&Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&(c=!0),w.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:O(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),!c&&i&&(g.currentTime(i),V()),null!=w&&w.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",w),window.adsQueueList=w,"function"==typeof(R=(null===(F=window)||void 0===F||null===(P=F.customData)||void 0===P||null===(k=P.ads)||void 0===k?void 0:k.onAdBreaksLoaded)||null)&&R(w)),console.log(w,"data"),w.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=g.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",L.appendChild(r)}}),g._timeUpdateHandler&&g.off("timeupdate",g._timeUpdateHandler),g._timeUpdateHandler=l(function(){var e=g.currentTime();if(e!==E){E=e;for(var n=!1,t=function(){var t=w[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-1.2&&e<=a+1.2){var d;e>=i&&e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&I.set(i,!0),ze.disable(),y&&y.classList.add("vjs-hidden"),_&&(_.style.pointerEvents="none",_.classList.add("vjs-hidden")),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),T&&(T.el().style.pointerEvents="none",T.el().classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),D.el().classList.add("hide-progress-bar");for(var u=e-i,s=0,c=0,v=0;v<l.length;v++){var m,f=null==l||null===(m=l[v])||void 0===m?void 0:m.durationInSeconds;if(u<s+f){c=v;break}s+=f}l[c];var g=Math.max(0,r-u),E=Math.round(g);U.style.display="block",x.textContent="".concat(c+1," of ").concat(l.length," • ").concat(A(E));var O=[];return null==l||l.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});O.push.apply(O,p(n))}),(null==t||null===(d=t.podSlotImpressionBeacon)||void 0===d?void 0:d.length)>0&&O.push.apply(O,p(null==t?void 0:t.podSlotImpressionBeacon)),C(e,t,O,c,o,V),"break"}h.delete(i)},o=0;o<w.length;o++){if("break"===t())break}n||(U.style.display="none",D.el().classList.remove("hide-progress-bar"),T&&(T.el().style.pointerEvents="auto",T.el().classList.remove("vjs-hidden")),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),y&&y.classList.remove("vjs-hidden"),_&&(_.style.pointerEvents="auto",_.classList.remove("vjs-hidden")),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),ze.enable())}},1e3),g.on("timeupdate",g._timeUpdateHandler),null===(d=document)||void 0===d||d.addEventListener("keydown",function(e){ze.enabled&&"ArrowRight"==e.key&&(j(),Un(o,10),e.stopPropagation())}),D.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",N))}),null===(u=document)||void 0===u||null===(s=u.querySelectorAll(".ssai-ad-container"))||void 0===s||s.forEach(function(e){return null==e?void 0:e.remove()}),(U=document.createElement("div")).className="ssai-ad-container",(B=document.createElement("div")).className="sponsored-adbox",(M=document.createElement("div")).className="sponsored-text",M.textContent="Sponsored Ad",B.append(M),(x=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",U.append(B),U.append(x),g.el().appendChild(U);case 44:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),L=new Map,F=-1;case 21:case"end":return e.stop()}},e)})),On.apply(this,arguments)}function Dn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return An(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?An(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function An(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Fn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ln(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}var Pn={},Cn=(null===(yn=window)||void 0===yn||null===(Tn=yn.location)||void 0===Tn||null===(bn=Tn.search)||void 0===bn?void 0:bn.includes("debug=true"))||!1,kn=null;function Rn(e){return jn.apply(this,arguments)}function jn(){return jn=n(t.mark(function e(o){var i,a,d,u,s,c,v,m,f,w,g,I,h,E,y,T,b,_,S,O,D,A,L,F,P,C,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:k=function(e,n,t,i,l){var a,d,u=r(o);if(!u.seeking()){var s=n.startTimeInSeconds;n.durationInSeconds;var c=(null==n||null===(a=n.ads)||void 0===a||null===(d=a[i])||void 0===d?void 0:d.adId)||s;Math.floor(u.currentTime());var v,m=Dn(t);try{for(m.s();!(v=m.n()).done;){var f,p,w,g=v.value,I=g.eventType,h=g.beaconUrls,E=g.startTimeInSeconds,y=g.startTime,T=g.durationInSeconds,b=(g.eventId,E||s),_=h,S=(null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(w=p.ads)||void 0===w?void 0:w.adEventHandler)||null,O="".concat(c,"_").concat(I),D="pod-".concat(s);F.has(D)||F.set(D,new Set);var A=F.get(D);if(Cn&&console.warn(e,b,"map:",I,"condition1:",e>=b,"map:",F),e>=b&&e<=b+P&&!A.has(O)){A.add(O);try{C(I,n,_,u)}catch(e){console.error("Error when calling triggerAdBeacon:",e,I,n)}if("function"==typeof S)try{var L,k={eventType:I,startTimeInSeconds:E,startTime:y,durationInSeconds:T,ad:null==n||null===(L=n.ads)||void 0===L?void 0:L[i],adIndex:i};S({adsData:k}),tn(o,k)}catch(e){console.error("Error when calling ads callback:",e)}var R=dn.get();if(R&&0!==Object.keys(R).length){var j=R.formulateComscoreAdPayload,V=R.startComscoreAdTracking,W=R.finishComscoreAdTracking,N=R.endComscoreAdTracking;if("impression"===I){var U,B=pn.get();V(j(Fn(Fn({},null==n||null===(U=n.ads)||void 0===U?void 0:U[i]),{},{trackingUrl:B})))}else"complete"===I?W():"breakEnd"===I&&N()}}}}catch(e){m.e(e)}finally{m.f()}}},C=function(e,n,t,o){var i,r,l;"breakEnd"===e&&(null===(i=Pn)||void 0===i?void 0:i.currentAdIndex)+1!=(null===(r=Pn)||void 0===r?void 0:r.totalAds)&&(null==n||null===(l=n.ads)||void 0===l?void 0:l.length)>0||(Cn&&console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})}))},g=function(){kn&&clearInterval(kn)},f=pn.get(),(w=r(o)).one("loadeddata",function(){g(),kn=setInterval(function(){f&&!w.paused()&&L(f)},2e3)}),w.on("dispose",function(){g()}),I=new Map,h=new Map,E=-1,y=null,T=(null===(i=document)||void 0===i||null===(a=i.getElementsByClassName("tvProviderImage"))||void 0===a?void 0:a[0])||null,b=(null==w||null===(d=w.controlBar)||void 0===d?void 0:d.getChild("videoSelector"))||null,_=(null==w||null===(u=w.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,S=(null==w||null===(s=w.el())||void 0===s||null===(c=s.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===c?void 0:c[0])||null,O=(null==w||null===(v=w.el())||void 0===v||null===(m=v.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===m?void 0:m[0])||null,D=!1,A=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0==(null==t?void 0:t.length))return p(o);var i=[],r=null==o?void 0:o.find(function(e){return"breakEnd"===(null==e?void 0:e.eventType)}),l=(null==r||null===(e=r.beaconUrls)||void 0===e?void 0:e.find(function(e){return e.includes("videoView")}))||null,a=(null==t?void 0:t.length)>1?null==t?void 0:t[(null==t?void 0:t.length)-1]:null==t?void 0:t[0],d=null==a||null===(n=a.trackingEvents)||void 0===n?void 0:n.filter(function(e){return["breakEnd"].includes(null==e?void 0:e.eventType)}),u=(null==d?void 0:d.some(function(e){var n;return null==e||null===(n=e.beaconUrls)||void 0===n?void 0:n.some(function(e){return e.includes("videoView")})}))||!1;if(!u&&l){var s=null==d?void 0:d.map(function(e){return Fn(Fn({},e),{},{eventType:"videoView",beaconUrls:[l]})});null!=s&&s[0]&&i.push(null==s?void 0:s[0])}return i},L=function(){var e=n(t.mark(function e(n){var i,a,d,u,s,c,v,m,f,w;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=new URL(n),y&&a.searchParams.append("nextToken",y),e.next=4,fetch(a.toString(),{method:"GET"});case 4:return d=e.sent,e.next=7,d.json();case 7:u=e.sent,s=u.avails,c=u.nextToken||null,y=c,v=[],m=r(o),f=m.controlBar.progressControl,w=f.seekBar.el(),null===(i=document)||void 0===i||i.querySelectorAll(".vjs-seekbar-marker").forEach(function(e){return null==e?void 0:e.remove()}),s.map(function(e,n){v.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:A(null==e?void 0:e.ads,null==e?void 0:e.adBreakTrackingEvents)})}),Cn&&console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",v),null!=v&&v.length&&(window.adsQueueList=v),v.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,o=m.duration();if(!(n>o||Array.isArray(t)&&0==(null==t?void 0:t.length))){var i=n/o*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(i,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(i,"%"),r.style.pointerEvents="none",w.appendChild(r)}}),m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=l(function(){var e=m.currentTime();if(e!==E){E=e;for(var n=function(){var n=v[t],o=n.startTimeInSeconds,i=n.durationInSeconds,r=n.ads,l=o+i;if(e>=o-1.2&&e<=l+1.2){var a;D=!!(e>=o&&e<=l&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>l&&I.set(o,!0),ze.disable(),T&&T.classList.add("vjs-hidden"),S&&(S.style.pointerEvents="none",S.classList.add("vjs-hidden")),O&&(O.style.pointerEvents="none",O.classList.add("vjs-hidden")),b&&(b.el().style.pointerEvents="none",b.el().classList.add("vjs-hidden")),_&&(_.el().style.pointerEvents="none",_.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var d=e-o,u=0,s=0,c=0;c<r.length;c++){var m,w=null==r||null===(m=r[c])||void 0===m?void 0:m.durationInSeconds;if(d<u+w){s=c;break}u+=w}setTimeout(function(){Pn.totalAds=null==r?void 0:r.length,Pn.currentAdIndex=s},1e3);var g=[];return null==r||r.forEach(function(e){var n=e.trackingEvents.filter(function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)});g.push.apply(g,p(n))}),(null==n||null===(a=n.podSlotImpressionBeacon)||void 0===a?void 0:a.length)>0&&g.push.apply(g,p(null==n?void 0:n.podSlotImpressionBeacon)),k(e,n,g,s),"break"}h.delete(o)},t=0;t<v.length;t++){if("break"===n())break}D||(Pn={},f.el().classList.remove("hide-progress-bar"),b&&(b.el().style.pointerEvents="auto",b.el().classList.remove("vjs-hidden")),_&&(_.el().style.pointerEvents="auto",_.el().classList.remove("vjs-hidden")),T&&T.classList.remove("vjs-hidden"),S&&(S.style.pointerEvents="auto",S.classList.remove("vjs-hidden")),O&&(O.style.pointerEvents="auto",O.classList.remove("vjs-hidden")),ze.enable())}},1e3),m.on("timeupdate",m._timeUpdateHandler);case 23:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),F=new Map,P=2.5;case 22:case"end":return e.stop()}},e)})),jn.apply(this,arguments)}function Vn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}var Wn=function(e){o(e).play()},Nn=function(e){o(e).pause()},Un=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Bn=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Mn=function(e){return!!o.getPlayer("".concat(e))},xn=function(e){return o(e).paused()},Hn=function(){var e=n(t.mark(function e(o,i){var l,a,d,u=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.length>2&&void 0!==u[2]&&u[2],e.next=3,X();case 3:return a=e.sent,d=r(o),e.abrupt("return",new Promise(function(e,r){P(i,a).then(function(){var r=n(t.mark(function n(r){var a,u,s,c,v,m,f,p;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(m=null==r?void 0:r.data,window.sid=we(),m.contentType="linearchannel",m.channelId=null==i?void 0:i.channelId,f=(null==m||null===(a=m.linearchannel)||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(v=c.adsConfig)||void 0===v?void 0:v.vodAdSticherProvider)||!1,p=je(m,o),!f){n.next=11;break}return n.next=9,gn(o,m);case 9:p=n.sent,l=!0;case 11:ne(m),p&&l?(qn(o,p),f&&Rn(o),d.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:m})})):(dn.get()&&0!==Object.keys(dn.get()).length&&un({playerId:o,comscore:{enable:!0}}),e({status:!0,msg:"Feed authenticated",response:m}));case 13:case"end":return n.stop()}},n)}));return function(e){return r.apply(this,arguments)}}()).catch(function(e){r({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Gn=function(){var e=n(t.mark(function e(o,i,l){var a,d,u,s,c,f,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:return s=e.sent,(ie()||null)&&ue(i),c=0,f=0,p=null,null!==(a=window)&&void 0!==a&&a.watchHistory&&null!==(d=window)&&void 0!==d&&null!==(u=d.watchHistory)&&void 0!==u&&u.enable&&R(i,s).then(function(e){var n,t,o,i,r,l,a;(null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),c=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,(f=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null)<95)&&(p=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedTime)||null)}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}),e.abrupt("return",new Promise(function(e,l){F(i,s).then(function(){var i=n(t.mark(function n(i){var a,d,u,s,w,g,I,h,E,y,T,b,_,S,O,D,A,L,F,P,C,k,R,j,V,W,N,U,B,M,x,H,G,Y,Q,z,q,K;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(D=null==i?void 0:i.data,A=(null==D?void 0:D.contentType)||"video",L=(null==D||null===(a=D[A])||void 0===a?void 0:a.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(s=u.appcmsMain)||void 0===s||null===(w=s.adsConfig)||void 0===w?void 0:w.vodAdSticherProvider)||!1,F=(null==D||null===(g=D.video)||void 0===g||null===(I=g.streamingInfo)||void 0===I?void 0:I.isLiveStream)||!1,ne(i.data),(P=(null==D||null===(h=D.ads)||void 0===h||null===(E=h.preRoll)||void 0===E||null===(y=E.adTags)||void 0===y||null===(T=y.web)||void 0===T?void 0:T.active)&&(null==D||null===(b=D.ads)||void 0===b||null===(_=b.preRoll)||void 0===_||null===(S=_.adTags)||void 0===S||null===(O=S.web)||void 0===O?void 0:O.url))&&Ge(o,P,D),C=je(D,o),!L){n.next=12;break}return n.next=11,gn(o,D);case 11:C=n.sent;case 12:C?(H=(null==D||null===(k=D.video)||void 0===k||null===(R=k.gist)||void 0===R?void 0:R.videoImageUrl)||(null==D||null===(j=D.video)||void 0===j||null===(V=j.gist)||void 0===V||null===(W=V.imageGist)||void 0===W?void 0:W.r16x9),(G=r(o)).poster(H),qn(o,C),L&&Sn(o,p),G.on("loadstart",function(){F&&e({status:!0,msg:"Video Loaded",response:D})}),G.on("loadeddata",function(){xe(),e({status:!0,msg:"Video Loaded",response:D})}),G.one("play",function(){c&&!L&&f<95&&setTimeout(function(){G.currentTime(c)},0)}),G.one("error",function(){var e;l({status:!1,msg:(null==G||null===(e=G.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==D||null===(N=D.video)||void 0===N||null===(U=N.contentDetails)||void 0===U||null===(B=U.closedCaptions)||void 0===B?void 0:B.length)>0||(null==D||null===(M=D.video)||void 0===M||null===(x=M.closedCaptions)||void 0===x?void 0:x.length)>0?(K=(null==D||null===(Q=D.video)||void 0===Q||null===(z=Q.contentDetails)||void 0===z?void 0:z.closedCaptions)||(null==D||null===(q=D.video)||void 0===q?void 0:q.closedCaptions),Y=K.filter(function(e){return"VTT"===e.format}),v(o,Y)):m(o)):(Me(o,"Incompatible Source, only hls,mp4,drm content is allowed"),l("Incompatible Source, only hls,mp4,drm content is allowed"));case 13:case"end":return n.stop()}},n)}));return function(e){return i.apply(this,arguments)}}()).catch(function(e){Kn(e,o,l,i)})}));case 10:case"end":return e.stop()}},e)}));return function(n,t,o){return e.apply(this,arguments)}}(),Yn=function(e,n,t){var o=r(e);return o.src(n),new Promise(function(e,n){var i=0;o.one("loadedmetadata",function(){clearTimeout(i),e({status:!0,msg:"video loaded"})}),o.one("loadstart",function(e){i=setTimeout(function(){n("FAILED: Took too long to load")},t)})})},Qn=function(e){var n=r(e),t=(dn.get()||{}).destroyComscoreTag;if(zn(),t&&t(),a(),window.onresize=null,n)n.dispose();else{var o=document.getElementById(e);o&&o.remove()}},zn=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()},qn=function(e,n){var t=r(e);t&&t.src(n)},Kn=function(n,t,o,i){var r,l,a,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==n||null===(a=n.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);Mn(t)&&Me(t,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(o),!0).forEach(function(t){e(n,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Vn(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))})}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Xn=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{Sn as $,C as A,_e as B,se as C,oe as D,Yn as E,Un as F,Wn as G,Nn as H,Bn as I,Mn as J,Gn as K,Hn as L,Qn as M,W as N,on as O,Z as P,V as Q,J as R,B as S,N as T,T as U,_n as V,Ye as W,re as X,xn as Y,le as Z,Rn as _,Oe as a,j as a0,de as a1,ue as a2,ie as b,dn as c,Se as d,te as e,je as f,ge as g,ne as h,un as i,xe as j,Me as k,qn as l,ae as m,Xn as n,be as o,Ge as p,Be as q,gn as r,k as s,$ as t,F as u,ee as v,R as w,Kn as x,X as y,P as z};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fires internal player events which are generic for all skins
|
|
3
|
+
* @param {String} [playerId] [playerId of the player]
|
|
4
|
+
*/
|
|
5
|
+
export function globalPlayerEvents(playerId?: string, config: any, feedback: any, { res, sres }: {
|
|
6
|
+
res: any;
|
|
7
|
+
sres: any;
|
|
8
|
+
}): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function setCurrentSeries(data: any): void;
|
|
2
|
+
export function setCurrentVideo(data: any): void;
|
|
3
|
+
export function getCurrentSeries(): any;
|
|
4
|
+
export function getCurrentVideo(): any;
|
|
5
|
+
export function setVideoIdx(val: any): void;
|
|
6
|
+
export function getVideoIdx(): any;
|
|
7
|
+
export function createIdxMapping(arr: any): void;
|
|
8
|
+
export function setVideoIdxById(videoId: any): void;
|
|
9
|
+
export function setSeriesWatchMap(val: any): void;
|
|
10
|
+
export function getSeriesWatchMap(): any;
|
|
11
|
+
export namespace seasonIdxManager {
|
|
12
|
+
function set(idx: any): void;
|
|
13
|
+
function get(): number;
|
|
14
|
+
}
|
|
15
|
+
export namespace videoReplayTracker {
|
|
16
|
+
function set(res: any): void;
|
|
17
|
+
function get(videoId: any): any;
|
|
18
|
+
function clear(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function switchToSecondaryAsset(res: any, playerId: any): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function throttle(fn: any, delay: any): (...args: any[]) => void;
|
|
2
|
+
export function setUpdatedElHeight(playerId: any, el: any): void;
|
|
3
|
+
export function handleDrawerResizing(playerId: any, drawerEl: any): void;
|
|
4
|
+
export function createIconMarkup(icon: any): SVGSVGElement;
|
|
5
|
+
export function isNotAValidSkin(skin: any): boolean;
|
|
6
|
+
export function highlightVideo(i: any, DEFAULTV2_TEMP_PLAYER_ID: any): void;
|
|
7
|
+
export function closeOpenDrawers(): void;
|
|
8
|
+
export function parseSvgString(svgString: any): SVGSVGElement;
|
|
9
|
+
export function parseHtmlString(htmlString: any): HTMLBodyElement;
|
|
10
|
+
export function impolicy16x9(img: any): string;
|
|
11
|
+
export function on_orientation_change(playerId: any, element: any): void;
|
|
12
|
+
export function detectOrientationChange(playerId: any, element: any): void;
|
|
13
|
+
export function clearEventListeners(): void;
|
|
14
|
+
export function highlightVideo_DEFAULTV2_TEMP(i: any): void;
|
|
15
|
+
export function createSVGWithUse(iconId: any, viewBox?: string): {
|
|
16
|
+
svg: SVGSVGElement;
|
|
17
|
+
use: SVGUseElement;
|
|
18
|
+
};
|
|
19
|
+
export function injectSVG(targetElement: any, iconId: any): SVGUseElement;
|
|
20
|
+
export function debounce(fn: any, delay: any): (...args: any[]) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export namespace SSAI_EVENTS {
|
|
2
|
+
const BREAK_START: string;
|
|
3
|
+
const IMPRESSION: string;
|
|
4
|
+
const FIRST_QUARTILE: string;
|
|
5
|
+
const MIDPOINT: string;
|
|
6
|
+
const THIRD_QUARTILE: string;
|
|
7
|
+
const COMPLETE: string;
|
|
8
|
+
const BREAK_END: string;
|
|
9
|
+
}
|
|
10
|
+
export function triggerSSAIEvents(playerId: any, adsData?: {}): {};
|
|
11
|
+
export function getSsaiEvents(playerId: any): {
|
|
12
|
+
adBreakStart?: undefined;
|
|
13
|
+
adImpression?: undefined;
|
|
14
|
+
adFirstQuartile?: undefined;
|
|
15
|
+
adMidpoint?: undefined;
|
|
16
|
+
adThirdQuartile?: undefined;
|
|
17
|
+
adComplete?: undefined;
|
|
18
|
+
adBreakEnd?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
adBreakStart: (cb: any) => () => any;
|
|
21
|
+
adImpression: (cb: any) => () => any;
|
|
22
|
+
adFirstQuartile: (cb: any) => () => any;
|
|
23
|
+
adMidpoint: (cb: any) => () => any;
|
|
24
|
+
adThirdQuartile: (cb: any) => () => any;
|
|
25
|
+
adComplete: (cb: any) => () => any;
|
|
26
|
+
adBreakEnd: (cb: any) => () => any;
|
|
27
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function token_authentication_enabled(params: any): boolean;
|
|
2
|
+
export function getToken(): Promise<any>;
|
|
3
|
+
export function fetchRefreshToken(): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
4
|
+
export function refreshTokenManager(): {
|
|
5
|
+
set(token: any): void;
|
|
6
|
+
get(): any;
|
|
7
|
+
};
|
|
8
|
+
export function isTokenExpired(token: any): boolean;
|
|
9
|
+
export function getDecodedToken(token: any): any;
|
|
10
|
+
export function setUserId(userId: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,p as n,d as o}from"./skin-4f84b841.js";import{X as i,b as l}from"./generic-740ffc07.js";import{s as a}from"./autoNextVideo-6ab2b97a.js";import{e as r}from"./icons-699e8cf0.js";import s from"@babel/runtime/helpers/typeof";import d from"video.js";var c,u,m,v,p=[],f=!1,g=function(a,s){var d;if(f=!1,null!=s&&null!==(d=s.series)&&void 0!==d&&d.enable){var c;p=[];var u=l();null==u||u.map(function(t){var n;return(n=p).push.apply(n,e(t.episodes))}),null==s||null===(c=s.series)||void 0===c||c.cb}else{var m,v;p=(null==s||null===(m=s.relatedVideos)||void 0===m?void 0:m.content)||[],null==s||null===(v=s.relatedVideos)||void 0===v||v.cb}var g=t(a);g.on("timeupdate",function(){var e,t;if(!f){var n=Math.floor(g.currentTime()),o=g.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];o-n<=10&&i()<=(null===(t=p)||void 0===t?void 0:t.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}});var y,A=p.filter(function(e,t){return t==i()});if((null==A?void 0:A.length)>0)if(null!==(y=document.getElementsByClassName("next-ep-preview"))&&void 0!==y&&y[0]){var x,w,E,b,C,N,B,L,j,k,P,O;(null===(x=document.getElementsByClassName("next-ep-preview"))||void 0===x?void 0:x[0]).style.visibility="hidden";var I=null===(w=document.getElementsByClassName("next-ep-title"))||void 0===w?void 0:w[0],M=null===(E=document.getElementsByClassName("next-ep-img"))||void 0===E?void 0:E[0],T=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],X=null===(C=A[0])||void 0===C?void 0:C.title;(null===(N=X)||void 0===N?void 0:N.length)>60&&(X=X.substr(0,60)+"..."),I.textContent="".concat(X),M.src=(null===(B=A[0])||void 0===B||null===(L=B.gist)||void 0===L||null===(j=L.imageGist)||void 0===j?void 0:j.r16x9)||(null==A||null===(k=A[0])||void 0===k?void 0:k.img)||(null===(P=window)||void 0===P||null===(O=P.customData)||void 0===O?void 0:O.fallbackImage),T.onclick=function(){return h(a)}}else{var F,R,D,G,S,V,H,Q,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(a).append(U);var W=document.createElement("div");W.className="next-heading-wrapper";var Y=document.createElement("div");Y.className="next-ep-header",Y.textContent="Next up";var _=document.createElement("div");_.className="next-ep-close",_.onclick=function(){U.style.visibility="hidden",f=!0},_.appendChild(n(r())),W.append(Y),W.append(_);var q=null===(F=A[0])||void 0===F?void 0:F.title,z=document.createElement("img");z.className="next-ep-img",z.src=(null===(R=A[0])||void 0===R||null===(D=R.gist)||void 0===D||null===(G=D.imageGist)||void 0===G?void 0:G.r16x9)||(null==A||null===(S=A[0])||void 0===S?void 0:S.img)||(null===(V=window)||void 0===V||null===(H=V.customData)||void 0===H?void 0:H.fallbackImage);var J=document.createElement("div");J.className="next-ep-title",(null===(Q=q)||void 0===Q?void 0:Q.length)>60&&(q=q.substr(0,60)+"..."),J.textContent="".concat(q);var K=document.createElement("div");K.className="next-ep-content",K.append(z),K.append(J),K.onclick=o(function(){null==U||U.remove(),f=!0,h(a)},400),U.append(W),U.append(K)}},h=function(e,n){var o=t(e),l=Math.floor(o.currentTime());if(Math.floor(o.duration())!=l){o.pause(e);var r=i();a(r,e,p)}};function y(e,n){var o=t(e),i=null==n?void 0:n.tvProviderLogoUrl;if(i){var l=document.createElement("div");l.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(i),a.alt="Provider Image",l.append(a),o.el().appendChild(l),o.on("useractive",function(){l.classList.remove("vjs-fade")}),o.on("userinactive",function(){o.paused()||l.classList.add("vjs-fade")}),o.on("fullscreenchange",function(){o.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"})}}c={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},u=function e(){var t,n,o,i,l;for(o in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[o])i.hasOwnProperty(l)&&("object"===s(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},m=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},v=function e(t){return"HTML"!==t.nodeName&&"static"===m(t)("position")?e(t.offsetParent):t},d.registerPlugin("thumbnails",function(e){var t,n,o,i,l,a,r,s;function d(){document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",d),s()}n=u({},c,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",o=document.createElement("img"),t.appendChild(o),o.src=n[0].src,o.className="vjs-thumbnail",u(o.style,n[0].style),o.style.left||o.style.right||(o.onload=function(){o.style.left=-o.naturalWidth/2+"px"}),a=i.duration(),i.on("durationchange",function(e){a=i.duration()}),i.on("loadedmetadata",function(e){a=i.duration()}),(l=i.controlBar.progressControl).el().appendChild(t),r=function(e){var i,r,s,d,c,p,f,g,h,y;for(r in s=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((y=v(l.el()).getBoundingClientRect()).width||y.right)+h,p=e.pageX,e.changedTouches&&(p=e.changedTouches[0].pageX),d=p||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,d-=v(l.el()).getBoundingClientRect().left+h,i=Math.floor((d-l.el().offsetLeft)/l.width()*a),n)i>r&&(s=Math.max(s,r));(c=n[s]).src&&o.src!=c.src&&(o.src=c.src),c.style&&o.style!=c.style&&u(o.style,c.style),d+(g=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=m(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(o,c.width||n[0].width)/2)>f?d-=d+g-f:d<g&&(d=g),t.style.left=d+"px"},l.on("mousemove",r),l.on("touchmove",r),l.on("pointerdown",function(e){document.addEventListener("pointermove",r),document.addEventListener("pointerup",d)}),s=function(e){t.style.left="-1000px"},l.on("mouseout",s),l.on("touchcancel",s),l.on("touchend",s),i.on("userinactive",s)});export{g as a,y as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./index-26dcbfc3.js";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{t as r,g as n}from"./skin-4f84b841.js";import i from"@babel/runtime/helpers/defineProperty";import a from"@babel/runtime/helpers/slicedToArray";import{e as u}from"./generic-740ffc07.js";function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="my-player";function c(e){var t=e.split("\n"),r=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),n={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(n.resolution=e.split("=")[1]),e.includes("URI")&&(n.uri=e.split("=")[1].replace(/"/g,""))}),r.push(n)}}),r}function p(){return(p=e(t.mark(function e(r){var n,i,u,o,s,l,c,p,d,m,f,b,g,v,h,x,y,w,k,E,j,N,A,T;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r._tiles){e.next=2;break}return e.abrupt("return",r._tiles);case 2:return e.prev=2,e.next=5,fetch(r.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return i=e.sent,e.next=11,createImageBitmap(i);case 11:for(u=e.sent,o=r.layout.split("x").map(Number),s=a(o,2),l=s[0],c=s[1],p=u.width/c,d=u.height/l,m=[],f=0;f<l;f++)for(b=0;b<c;b++)(g=document.createElement("canvas")).width=p,g.height=d,g.getContext("2d").drawImage(u,b*p,f*d,p,d,0,0,p,d),v=g.toDataURL("image/png"),m.push({uri:v,duration:r.duration}),r._tiles=m;return e.abrupt("return",m);case 20:for(e.prev=20,e.t0=e.catch(2),h=r.layout.split("x").map(Number),x=a(h,2),y=x[0],w=x[1],k=[],E=0;E<y*w;E++)k.push({uri:null===(j=window)||void 0===j||null===(N=j.app_data)||void 0===N||null===(A=N.appcmsMain)||void 0===A||null===(T=A.images)||void 0===T?void 0:T.placeholderCover,duration:r.duration});return e.abrupt("return",k);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return(m=e(t.mark(function e(r,n){var i,a;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=n,e.prev=1,e.next=4,fetch(r);case 4:return i=e.sent,e.next=7,i.text();case 7:return a=e.sent,e.abrupt("return",c(a));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 f(e,t,r){var i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=n(l);if(i&&a){var u=i.getBoundingClientRect(),o=(e.clientX-u.left)/u.width,s=function(e,t){var r,n;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var u=Math.floor((i+a)/2),o=t[u];if(o===e)return o;o<e?i=u+1:a=u-1}var s=null!==(r=t[i])&&void 0!==r?r:1/0,l=null!==(n=t[a])&&void 0!==n?n:-1/0;return Math.abs(s-e)<Math.abs(l-e)?s:l}(Math.round(o*a.duration()),r),c=t[s];c&&!c.loading&&(c.loading=!0,function(e){return p.apply(this,arguments)}(c).then(function(e){var t=e[c.tileIndex],r=document.querySelector(".vjs-thumbnail-holder img");r&&t.uri&&(r.src=t.uri),c.loading=!1,c.src=t.uri}))}}function b(e){return g.apply(this,arguments)}function g(){return(g=e(t.mark(function e(n){var u,o,l,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u={},n.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),n=a(r,2),o=n[0]*n[1],l=e.duration,c=0;c<o;c++){var p,d=Math.round((t*o+c)*l);u[d]=s(s({},e),{},{duration:e.duration,tileIndex:c,loading:!1,style:(p={left:"-60px",height:"85px",width:"130px"},i(p,"left","-60px"),i(p,"border","1px solid transparent"),i(p,"borderRadius","4px"),p)})}}),o=Object.keys(u).map(Number).sort(function(e,t){return e-t}),null==(l=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||l.addEventListener("mousemove",r(function(e){return f(e,u,o)},500)),null==(c=document.querySelector(".vjs-progress-control.vjs-control"))||c.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",r(function(e){return f(e,u,o)},500))}),e.abrupt("return",u);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var v=function(){var r=e(t.mark(function e(r,n){var i,u,o,s,l,c,p,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(r+n);case 2:return i=e.sent,e.next=5,i.text();case 5:u=e.sent,o=u.split("\n").map(function(e){return e.trim()}),s=[],l=null,c=0;case 10:if(!(c<(null==o?void 0:o.length))){e.next=27;break}if(!(p=o[c]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},d=p.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),r=a(t,2),n=r[0],i=r[1];n&&i&&(l[n.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!p.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(p.includes("jpg")||p.includes("png")||p.includes("jpeg"))&&(l.uri=p.includes("http")?p:r+p,s.push(l),l=null);case 24:c++,e.next=10;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}},e)}));return function(e,t){return r.apply(this,arguments)}}();function h(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function x(e,t){return y.apply(this,arguments)}function y(){return(y=e(t.mark(function e(r,i){var o,s,c,p,d,m,f,b,g,v,x,y,E,j,N,A,T,O,I,S,M,P,R,$,B,D,L,U,C,X,q,_,F,W,z,G,H,J,K,Q,V,Y,Z,ee,te,re,ne,ie,ae,ue,oe,se,le,ce,pe,de,me,fe;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=i,o=n(i),s=r.split("/"),c=s.findIndex(function(e){return"dash"===e.toLowerCase()}),p=h(-1!==c?s.slice(0,c+1).join("/"):new URL(r).origin),e.prev=5,e.next=8,fetch(r);case 8:return b=e.sent,e.next=11,b.text();case 11:g=e.sent,v=new DOMParser,x=v.parseFromString(g,"application/xml"),y=(null==o?void 0:o.duration())||(null===(d=u())||void 0===d||null===(m=d.video)||void 0===m?void 0:m.runtime),E=(null==x||null===(f=x.querySelector("MPD > BaseURL"))||void 0===f?void 0:f.textContent)||p+"/",j=x.getElementsByTagName("AdaptationSet"),N=0;case 18:if(!(N<j.length)){e.next=72;break}if(("image"!==(A=j[N]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(O=A.getElementsByTagName("SegmentTemplate")[0],I=null===(T=O.getElementsByTagName("SegmentTimeline"))||void 0===T?void 0:T[0],!O||!I){e.next=48;break}if(P=I.getElementsByTagName("S"),R=parseInt(null===(S=P[0])||void 0===S?void 0:S.getAttribute("t")),$=parseInt(null===(M=P[0])||void 0===M?void 0:M.getAttribute("d")),B=A.getElementsByTagName("Representation")[0],D=B.getElementsByTagName("EssentialProperty")[0],L=D.getAttribute("value"),U=null==L?void 0:L.split("x"),C=a(U,2),X=C[0],q=C[1],!O){e.next=46;break}if(O.getAttribute("media"),_=O.getAttribute("timescale"),F=(_?$/_:$)/(X*q),W=B.getAttribute("id"),z=Math.round(y/F),G=Math.ceil(z/(X*q)),H=O.getAttribute("media"),parseInt(O.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(J=[],N=0;N<G;N++)Q="/"==(K=H)[0]?new URL(p).origin:p+"/",J.push({duration:F,layout:L,uri:Q+K.replace("$Time$",R+N*$).replace("$RepresentationID$",W)});return e.abrupt("return",J);case 46:e.next=69;break;case 48:if(V=A.getElementsByTagName("Representation")[0],Y=V.getElementsByTagName("EssentialProperty")[0],Z=Y.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=a(ee,2),re=te[0],ne=te[1],!O){e.next=69;break}if(O.getAttribute("media"),ie=O.getAttribute("duration"),ae=O.getAttribute("timescale"),ue=(ae?ie/ae:ie)/(re*ne),oe=V.getAttribute("id"),se=Math.round(y/ue),le=Math.ceil(se/(re*ne)),ce=O.getAttribute("media"),pe=parseInt(O.getAttribute("startNumber"))||0,!isNaN(parseInt(le))){e.next=65;break}return e.abrupt("return");case 65:for(de=[],me=w(ce),N=0;N<le;N++)fe=me?k(me,N+pe):ce,de.push({duration:ue,layout:Z,uri:E+fe.replace("$Number$",N+pe).replace("$RepresentationID$",oe)});return e.abrupt("return",de);case 69:N++,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 w(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function k(e,t){var r=e.match(/%0(\d+)d/);if(!r)return e;var n=parseInt(r[1],10),i=String(t).padStart(n,"0");return e.replace(/\$Number%0\d+d\$/,i)}function E(e){return j.apply(this,arguments)}function j(){return(j=e(t.mark(function e(r){var i,a,u,o,s,l,c,p,m,f,g,h,y,w,k;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n(r),l=s.currentSource(),c=l.src,c=null!==(i=c)&&void 0!==i&&i.includes("blob")?null==s||null===(a=s.getSource)||void 0===a?void 0:a.call(s):c,null===(u=c)||void 0===u||!u.includes("m3u8")){e.next=19;break}return e.next=6,d(c,r);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return m=(null==p?void 0:p[0])||null,f=m.uri,g=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,v(g,f);case 12:return h=e.sent,e.next=15,b(h);case 15:y=e.sent,s.thumbnails(y);case 17:e.next=28;break;case 19:if(null===(o=c)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,x(c,r);case 22:if(!((null==(w=e.sent)?void 0:w.length)>0)){e.next=28;break}return e.next=26,b(w);case 26:k=e.sent,s.thumbnails(k);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}export{E as i};
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export default VLPlayerCore;
|
|
2
|
+
declare function VLPlayerCore(): {
|
|
3
|
+
loadVideoInstantly: (playerId: any, src: any, cancelTimeout: any) => Promise<any>;
|
|
4
|
+
onTimeUpdate: (playerId: any, cb: any) => void;
|
|
5
|
+
getVideoDuration: (playerId: any) => any;
|
|
6
|
+
onVideoEnded: (playerId: any, cb: any) => void;
|
|
7
|
+
init: (config: any) => Promise<any>;
|
|
8
|
+
getRenditions: (playerId?: string) => any[];
|
|
9
|
+
skip: (playerId?: string, time?: number) => void;
|
|
10
|
+
getPlayer: (playerId?: string) => any;
|
|
11
|
+
play: (playerId?: string) => void;
|
|
12
|
+
pause: (playerId?: string) => void;
|
|
13
|
+
detectBrowser: () => "IE" | "Opera" | "Chrome" | "Safari" | "Firefox" | "Unknown";
|
|
14
|
+
rewind: (playerId?: string, time?: number) => void;
|
|
15
|
+
loadVideo: (playerId: any, src: string) => void;
|
|
16
|
+
seekToTimeStamp: (playerId: any, time: any, cb: any) => void;
|
|
17
|
+
isPlayerInitialised: (playerId?: string) => boolean;
|
|
18
|
+
load: (playerId: any, videoId: any, token_deprecated: any) => Promise<any>;
|
|
19
|
+
authenticateLC: (playerId: any, params: any, load_asset?: boolean) => Promise<any>;
|
|
20
|
+
dispose: (playerId: any) => void;
|
|
21
|
+
enableCaptions: (playerId: any, trackId: any) => void;
|
|
22
|
+
disableCaptions: (playerId: any, trackId: any) => void;
|
|
23
|
+
getCaptions: (playerId: any) => any;
|
|
24
|
+
playSelectedResolution: (playerId: any, obj: any, auto: any) => void;
|
|
25
|
+
getSource: (res: any, playerId: any) => {
|
|
26
|
+
src: any;
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
setVolume: (playerId: any, volume: any, cb: any) => void;
|
|
30
|
+
getVolume: (playerId: any) => string;
|
|
31
|
+
disableControls: (playerId: any) => void;
|
|
32
|
+
setPlaybackSpeed: (playerId: any, speed: any) => string;
|
|
33
|
+
getEntitlementData: (id: any, token: any, url: any, locationData: any) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
34
|
+
getSsaiEvents: typeof getSsaiEvents;
|
|
35
|
+
playerEvents: typeof playerEvents;
|
|
36
|
+
onReplay: (playerId: any, cb: any) => void;
|
|
37
|
+
};
|
|
38
|
+
import { getSsaiEvents } from "./helpers/ssaiEventHandler";
|
|
39
|
+
import { playerEvents } from "./core/util";
|