@viewlift/player-backup 2.0.76-smartTv → 2.0.77-smartTv
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-9af1923e.js → autoNextVideo-2f849ab7.js} +1 -1
- package/cjs/bundle.css +146 -146
- package/cjs/{features-26fa4edd.js → features-c643adf5.js} +1 -1
- package/cjs/{generic-7a2d3bab.js → generic-ffaf708b.js} +1 -1
- package/cjs/{index-04ae1d0e.js → index-0005d1eb.js} +1 -1
- package/cjs/{index-815625cd.js → index-e7695120.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-4163e6a7.js → multicamv2-68e10b06.js} +1 -1
- package/cjs/{multicamv2-2afa4732.js → multicamv2-8085606f.js} +1 -1
- package/cjs/{nextEpisodeButton-34c59253.js → nextEpisodeButton-0b70c200.js} +1 -1
- package/cjs/{playlist-05848259.js → playlist-a1e112cc.js} +1 -1
- package/cjs/{series-90d2ec17.js → series-a20f9669.js} +1 -1
- package/cjs/{series-v2-6730e5ea.js → series-v2-96c005f3.js} +1 -1
- package/cjs/{series-v2-7b4a20dc.js → series-v2-d0cac00f.js} +1 -1
- package/cjs/{skin-1cb4029f.js → skin-684adfe2.js} +1 -1
- package/cjs/{skin-88b59136.js → skin-93092645.js} +1 -1
- package/cjs/{skin-090b02d5.js → skin-c3c25fd0.js} +1 -1
- package/cjs/{skin-745aa443.js → skin-d7d6942e.js} +1 -1
- package/cjs/{skin-18b458d2.js → skin-e5bfcf99.js} +1 -1
- package/cjs/{skin-b95158cf.js → skin-f40d0e53.js} +1 -1
- package/cjs/{skin-714e8f54.js → skin-f5a6dbe4.js} +1 -1
- package/cjs/{videoSelector-12a8583d.js → videoSelector-25018936.js} +1 -1
- package/cjs/{videoSelector-bd7a4a4f.js → videoSelector-5718dcf0.js} +1 -1
- package/esm/{autoNextVideo-1796d1ca.js → autoNextVideo-05a87fc9.js} +1 -1
- package/esm/bundle.css +146 -146
- package/esm/{features-446510f2.js → features-86ccd943.js} +1 -1
- package/esm/{generic-04b35f2c.js → generic-86e80064.js} +1 -1
- package/esm/{index-fee17e49.js → index-0d7a65a3.js} +1 -1
- package/esm/{index-b2dbf999.js → index-18b210e2.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-c13490c4.js → multicamv2-82e81188.js} +1 -1
- package/esm/{multicamv2-ebb3298c.js → multicamv2-9734e317.js} +1 -1
- package/esm/{nextEpisodeButton-27b11d27.js → nextEpisodeButton-85ae81cc.js} +1 -1
- package/esm/{playlist-0ace00a9.js → playlist-9e54e84c.js} +1 -1
- package/esm/{series-1a566674.js → series-8a5c2064.js} +1 -1
- package/esm/{series-v2-71a1316d.js → series-v2-a37e317d.js} +1 -1
- package/esm/{series-v2-ae0f0c7e.js → series-v2-ad1e785d.js} +1 -1
- package/esm/{skin-721fed16.js → skin-001c84e0.js} +1 -1
- package/esm/{skin-0357be96.js → skin-1faa4378.js} +1 -1
- package/esm/{skin-894d19f7.js → skin-81ef1dd1.js} +1 -1
- package/esm/{skin-2aa99132.js → skin-828480b2.js} +1 -1
- package/esm/{skin-5ca4991a.js → skin-adc8af16.js} +1 -1
- package/esm/{skin-14afd332.js → skin-ccbdcc94.js} +1 -1
- package/esm/{skin-0a167a1f.js → skin-cd062e64.js} +1 -1
- package/esm/{videoSelector-979b6425.js → videoSelector-a075c0d8.js} +1 -1
- package/esm/{videoSelector-cb761ab6.js → videoSelector-f6df1107.js} +1 -1
- package/package.json +1 -1
- package/cjs/autoNextVideo-b2664dca.js +0 -1
- package/cjs/autoNextVideo-fbb2830a.js +0 -1
- package/cjs/caption-settings-5944a544.js +0 -1
- package/cjs/captions-3c7ca3a7.js +0 -1
- package/cjs/features-4324250b.js +0 -1
- package/cjs/features-f648eeb3.js +0 -1
- package/cjs/generic-bbce09c9.js +0 -1
- package/cjs/generic-d56b38ac.js +0 -1
- package/cjs/index-510967ea.js +0 -1
- package/cjs/index-7a1f4fa3.js +0 -1
- package/cjs/index-865afc31.js +0 -1
- package/cjs/index-d65ff026.js +0 -1
- package/cjs/multicamv2-408075e5.js +0 -1
- package/cjs/multicamv2-69bba9cd.js +0 -1
- package/cjs/multicamv2-874c4b47.js +0 -1
- package/cjs/multicamv2-96ae1bef.js +0 -1
- package/cjs/nextEpisodeButton-571ddebc.js +0 -1
- package/cjs/nextEpisodeButton-bb9ea809.js +0 -1
- package/cjs/playlist-2a9d8c3a.js +0 -1
- package/cjs/playlist-35747adf.js +0 -1
- package/cjs/renditions-26c6d0df.js +0 -1
- package/cjs/resolution-5a0df2be.js +0 -1
- package/cjs/series-23a6b96c.js +0 -1
- package/cjs/series-e6194b86.js +0 -1
- package/cjs/series-v2-656980f1.js +0 -1
- package/cjs/series-v2-a128042a.js +0 -1
- package/cjs/series-v2-bcc237c0.js +0 -1
- package/cjs/series-v2-d636d25a.js +0 -1
- package/cjs/settings-icon-12add1fe.js +0 -1
- package/cjs/skin-2fa52c29.js +0 -1
- package/cjs/skin-3397dca5.js +0 -1
- package/cjs/skin-3d9d4689.js +0 -1
- package/cjs/skin-46b10fd3.js +0 -1
- package/cjs/skin-61950a20.js +0 -1
- package/cjs/skin-6aa6777f.js +0 -1
- package/cjs/skin-6db027fa.js +0 -1
- package/cjs/skin-95e27a9f.js +0 -1
- package/cjs/skin-9cff4263.js +0 -1
- package/cjs/skin-b5651b5b.js +0 -1
- package/cjs/skin-c76e657d.js +0 -1
- package/cjs/skin-d1d871d1.js +0 -1
- package/cjs/skin-d7a1e096.js +0 -1
- package/cjs/skin-e495e69f.js +0 -1
- package/cjs/skin-edc7bca4.js +0 -1
- package/cjs/util-c1962d91.js +0 -1
- package/cjs/videoSelector-3bdcd5ef.js +0 -1
- package/cjs/videoSelector-4fb88c9f.js +0 -1
- package/cjs/videoSelector-e0dbb3af.js +0 -1
- package/cjs/videoSelector-f32fc4b5.js +0 -1
- package/cjs/videojs-dash5.es-3cd3423d.js +0 -1
- package/esm/autoNextVideo-5202ca61.js +0 -1
- package/esm/autoNextVideo-b7900abb.js +0 -1
- package/esm/caption-settings-adcfbf9d.js +0 -1
- package/esm/captions-7996e045.js +0 -1
- package/esm/features-58699d4f.js +0 -1
- package/esm/features-92168e2d.js +0 -1
- package/esm/generic-49e2739e.js +0 -1
- package/esm/generic-fe8a5419.js +0 -1
- package/esm/index-01fc14f1.js +0 -1
- package/esm/index-24d08aa6.js +0 -1
- package/esm/index-2e330a8a.js +0 -1
- package/esm/index-d7c8b33b.js +0 -1
- package/esm/multicamv2-0a7e85a7.js +0 -1
- package/esm/multicamv2-8354e88e.js +0 -1
- package/esm/multicamv2-99d2d9f1.js +0 -1
- package/esm/multicamv2-f35637be.js +0 -1
- package/esm/nextEpisodeButton-2917270e.js +0 -1
- package/esm/nextEpisodeButton-6a78af06.js +0 -1
- package/esm/playlist-005ec05f.js +0 -1
- package/esm/playlist-e4aff030.js +0 -1
- package/esm/renditions-65794079.js +0 -1
- package/esm/resolution-ed00f17a.js +0 -1
- package/esm/series-6b8b01fd.js +0 -1
- package/esm/series-f895bf2d.js +0 -1
- package/esm/series-v2-2505dab5.js +0 -1
- package/esm/series-v2-55b5e1d5.js +0 -1
- package/esm/series-v2-66a7a336.js +0 -1
- package/esm/series-v2-f3cc2a59.js +0 -1
- package/esm/settings-icon-c670ad25.js +0 -1
- package/esm/skin-1c962a23.js +0 -1
- package/esm/skin-5ccd687d.js +0 -1
- package/esm/skin-65a9c014.js +0 -1
- package/esm/skin-672ee3ee.js +0 -1
- package/esm/skin-8b8f108b.js +0 -1
- package/esm/skin-8e2c5488.js +0 -1
- package/esm/skin-97ea34f3.js +0 -1
- package/esm/skin-9d7f6024.js +0 -1
- package/esm/skin-a0bc6679.js +0 -1
- package/esm/skin-b3625cf2.js +0 -1
- package/esm/skin-c5fd99ed.js +0 -1
- package/esm/skin-c7bbb999.js +0 -1
- package/esm/skin-d85cc01e.js +0 -1
- package/esm/skin-e1abdefd.js +0 -1
- package/esm/skin-e372d8cc.js +0 -1
- package/esm/util-389babb5.js +0 -1
- package/esm/videoSelector-1e8bafc5.js +0 -1
- package/esm/videoSelector-409920c1.js +0 -1
- package/esm/videoSelector-986c7677.js +0 -1
- package/esm/videoSelector-fd351fa1.js +0 -1
- package/esm/videojs-dash5.es-17cb6067.js +0 -1
package/cjs/generic-bbce09c9.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("axios"),r=require("./skin-f87e1c22.js"),l=require("./browser-38ff3331.js"),a=require("js-cookie"),d=require("ua-parser-js"),u=require("./captions-e4d4dc7d.js");function s(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){s("event",e,t)}var v={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"};function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function p(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?m(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):m(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var f={name:"@viewlift/player-backup",version:"2.0.76-smartTv",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=f.version;var g,I=function(e,t){var n,i,r,l,a,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":y.get()+"".concat(null==v?void 0:v.getVideoDetails),params:p({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":f.version},withCredentials:!0})},w=function(e,t){var n,i,r,l;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):o({url:y.get()+v.getLinearChannelDetails,params:p(p(p(p(p({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId}),(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId}),(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle}),(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType}),null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},E=function(){var e=t(n.mark(function e(t){var i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:return i=e.sent,e.abrupt("return",o({url:y.get()+"".concat(null==v?void 0:v.saveWatchHistoryV2),method:"POST",headers:{Authorization:i},data:p({},t),params:p({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),T=function(e,t){var n,i,r=window.contentType;return o({method:"GET",url:y.get()+"".concat(null==v?void 0:v.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(i=n.watchHistory)||void 0===i?void 0:i.xApiKey},timeout:15e3})},h=function(e){var t=e.videoId;return o({method:"GET",url:y.get()+"".concat(null==v?void 0:v.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},y=(g=null==v?void 0:v.apiBaseUrl,{set:function(e){e&&(g=e)},get:function(){return g}}),_=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},b=null;function D(){return{set:function(e){e&&(b=e)},get:function(){return b}}}var F,O,P,S,L,V,R=function(){var e=t(n.mark(function e(){var t,i,r;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=D().get(),i=y.get(),e.prev=2,e.next=5,o({method:"GET",url:"".concat(i,"/identity/refresh/").concat(t)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return e.apply(this,arguments)}}(),W=null,x=function(){var e=t(n.mark(function e(){var t;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!_(t)){e.next=6;break}return W||(W=R().then(function(e){var n,i,o=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&D().set(r),o||t}).catch(function(e){return console.error("Error fetching refresh token",e),t}).finally(function(){W=null})),e.abrupt("return",W);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),C=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},A=function(e){O=e},N=function(){return O},B=function(){return F},M=function(e){P=e},j=function(e){if(S){var t=S.get(e);M(t+1)}},U=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}});function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function H(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?k(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var G=0,z=function(){var e,t,n,i,o,r,l,a=N();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function Y(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function q(){var e=window.sessionStorage.getItem("uid");return e||(e=Y(),window.sessionStorage.setItem("uid",e),e)}function X(){return J.apply(this,arguments)}function J(){return(J=t(n.mark(function e(){var t,i;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function K(e){return e?String(e):""}window.initialise=function(e){window.sid=Y(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,c(r?"FAILED_TO_START":"DROPPED_STREAM",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),c("PLAY",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":z(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&G<4)G++,c("BUFFERING",H({pfm:window.platform,uid:q(),vid:z(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",H({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),vid:z()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;c("AD_REQUEST",H({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),vid:z(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",H({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:q(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:z()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(G=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Q(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Q=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark(function e(t){var i,r,l,a,d,u,s,c,m,p,f,g,I,w,E,T,h,_,b,D;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:return T=e.sent,h=C(T),_=null==h?void 0:h.site,b=null==h?void 0:h.siteId,e.t0=H,e.t1=H,e.t2=H({aid:_,cid:b,pfm:window.platform},null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params),e.t3={},e.t4=q(),e.t5=z(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=null!==(a=t.videoPosition)&&void 0!==a?a:null,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:null,e.t17=!0===t.isAdEvent?K(t.adPosition):"",e.next=26,X();case 26:e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=null!==(d=t.ttFirstFrame)&&void 0!==d?d:null,e.t23=null!==(u=t.bitrate)&&void 0!==u?u:null,e.t24=null!==(s=t.resHeight)&&void 0!==s?s:null,e.t25=null!==(c=t.resWidth)&&void 0!==c?c:null,e.t26=null!==(m=t.bufferHealth)&&void 0!==m?m:null,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:null,resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(p=window)||void 0===p||null===(f=p.customData)||void 0===f||null===(g=f.beacon)||void 0===g?void 0:g.params,e.t31=(0,e.t0)(e.t29,e.t30),D=[e.t31],o({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(E=w.beacon)||void 0===E?void 0:E.url)||y.get()+v.getBeaconUrl,method:"post",headers:{Authorization:T},contentType:"application/x-www-form-urlencoded",dataType:"text",data:D}).catch(function(e){console.error(e)});case 42:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var Z=function(){var e=U.get();return e>=0?e+1:1},$=function(){var e,t,n,i=B(),o=N(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=U.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function te(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ee(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ee(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}window._deviceInfo=d.UAParser(navigator.userAgent);var ne=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},ie=function(e){var t=oe(e,"video.tags",[]),n=oe(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},oe=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},re=function(){var e,t,n,i,o,l,d,u,s,c,v,m,p,f,g,I,w,E,T,h,y,_=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,D=arguments.length>2?arguments[2]:void 0,F=(null==D?void 0:D.siteName)||"",O=(null==D?void 0:D.contentType)||"video",P=(null==D||null===(e=D[O])||void 0===e?void 0:e.metadata)||(null==D||null===(t=D[O])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),S=r.getPlayer(b);if(!_.includes("VIEWLIFT_"))return _;var L,V=window.getComputedStyle(document.getElementById(b),null),R=Math.trunc(V.getPropertyValue("height").slice(0,-2)),W=Math.trunc(V.getPropertyValue("width").slice(0,-2)),x="linearchannel"===O?null==D||null===(i=D.linearchannel)||void 0===i||null===(o=i.channels)||void 0===o||null===(l=o.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===l||null===(d=l.content)||void 0===d?void 0:d.id:oe(D,"video.gist.id",""),C="linearchannel"===O?null==D||null===(u=D.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==D?void 0:D.channelId)}))||void 0===c?void 0:c.title:oe(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(L=window)||void 0===L||L.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=te(te({},le(P)),{},{VIEWLIFT_WIDTH:W,VIEWLIFT_HEIGHT:R,VIEWLIFT_SIZE:ne(W,R),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:oe(D,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==S||null===(m=S.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==S||null===(p=S.options_)||void 0===p?void 0:p.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==F?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:ie(D),VIEWLIFT_MEDIA_ID:x,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(oe(D,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:x,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+oe(D,"video.gist.permalink","")),VIEWLIFT_CONSENT:a.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:oe(null===(f=window)||void 0===f||null===(g=f.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==F?"":oe(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:oe(D,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:x,VIEWLIFT_CONTENT_TITLE:C,VIEWLIFT_CONTENT_SERIES_TITLE:oe(D,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:oe(D,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:$(),VIEWLIFT_SEASON_NUMBER:Z(),VIEWLIFT_CONTENT_TAGS:ie(D),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.macros);for(var M in B){var j=new RegExp(M,"g");_=_.replace(j,B[M])}return _},le=function(e){var t,n,i,o,r,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ae(u);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(l.isMobile()?c?u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=l.isMobile()?te(te({},u),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):te(te({},u),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=te(te({},u),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=l.isMobile()?te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):te(te({},u),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=te(te({},u),{},{VIEWLIFT_AFID:s.get("afid")})},ae=function(e){var t,n,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(u||s)&&(s?(a=te(te({},a),{},{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=te(te({},a),{},{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):te(te({},a),{},{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},de=function(e){var t=null;try{var n,i,o,r,l,a,d,u,s,c,v,m,p,f,g,I,w,E,T,h,y,_,b,D,F,O,P,S,L;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(y=h.samsung_tv)||void 0===y?void 0:y.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var V,R,W,x;t=null==e||null===(V=e.ads)||void 0===V||null===(R=V.preRoll)||void 0===R||null===(W=R.adTags)||void 0===W||null===(x=W.lg_tv)||void 0===x?void 0:x.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(p=m.vizioTv)&&void 0!==p&&p.active){var C,A,N,B;t=null==e||null===(C=e.ads)||void 0===C||null===(A=C.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(f=e.ads)&&void 0!==f&&null!==(g=f.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,j,U,k;t=null==e||null===(M=e.ads)||void 0===M||null===(j=M.preRoll)||void 0===j||null===(U=j.adTags)||void 0===U||null===(k=U.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(_=e.ads)||void 0===_||null===(b=_.preRoll)||void 0===b||null===(D=b.adTags)||void 0===D||null===(F=D.web)||void 0===F?void 0:F.active)&&(null==e||null===(O=e.ads)||void 0===O||null===(P=O.preRoll)||void 0===P||null===(S=P.adTags)||void 0===S||null===(L=S.web)||void 0===L?void 0:L.url)}catch(e){}return t},ue=function(e,t){var n,i,o,r,a,d,u,s,c,v,m,p,f,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(p=m.streamingInfo)||void 0===p||null===(f=p.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return ce(E);if(I){var y=ve(w,t);return y.src=re(y.src,t,e),y}if("Safari"!==l.detectBrowser()&&h)return se(w);if(T){var _=ce(w);return _.src=re(_.src,t,e),_}if(null!=w&&w.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return b.src=re(b.src,t,e),b}return null},se=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},ce=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},ve=function(e,t){var n=e.fairPlayCmaf||e.fairPlay,o=e.widevine,a=e.playReady,d=l.detectBrowser();if(r.getPlayer(t),"Safari"===d){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};i.xhr(o,function(e,t,i){console.log(e),e&&n(e),n(null,new Uint8Array(i))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,n,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};i.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(n);return me(t),u}var s,c={src:o.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(me(t),c.keySystems={"com.widevine.alpha":{url:o.licenseUrl,licenseHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:o.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":o.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var me=function(e){var t=r.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==l.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},pe=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},fe=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ge=!1,Ie=function(e,t,n){var i=re(t,e,n),o=r.getPlayer(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,l=r.getPlayer(e);if(null!==l.el_){ge=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ge&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.ads)||void 0===o?void 0:o.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}};function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var Ee=function(e){return!!i.getPlayer("".concat(e))},Te=function(){var e=t(n.mark(function e(t,i){var o,l,a,d=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=d.length>2&&void 0!==d[2]&&d[2],e.next=3,x();case 3:return l=e.sent,a=r.getPlayer(t),e.abrupt("return",new Promise(function(e,n){w(i,l).then(function(n){var r=null==n?void 0:n.data;window.sid=Y(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ue(r,t);A(r),l&&o?(_e(t,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:r})})):e({status:!0,msg:"Feed authenticated",response:r})}).catch(function(e){n({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),he=function(){var e=t(n.mark(function e(t,i){var o,l,a,d,s,c,v=arguments;return n.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,x();case 4:d=e.sent;case 5:return(B()||null)&&j(i),s=0,c=0,null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&T(i,d).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,n){I(i,d).then(function(i){var o,l,a=null==i?void 0:i.data,d=(null==a||null===(o=a.video)||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;A(i.data);var v=de(a);v&&Ie(t,v,a);var m=ue(a,t);if(m){var p,f,g,I,w,E,T,h,y,_,b,D,F,O,P=(null==a||null===(p=a.video)||void 0===p||null===(f=p.gist)||void 0===f?void 0:f.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),S=r.getPlayer(t);if(S.poster(P),_e(t,m),S.on("loadstart",function(){d&&e({status:!0,msg:"Video Loaded",response:a})}),S.on("loadeddata",function(){fe(),e({status:!0,msg:"Video Loaded",response:a})}),S.one("play",function(){s&&c<95&&setTimeout(function(){S.currentTime(s)},0)}),S.one("error",function(){var e;n({status:!1,msg:(null==S||null===(e=S.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(y=a.video)||void 0===y||null===(_=y.closedCaptions)||void 0===_?void 0:_.length)>0)b=((null==a||null===(D=a.video)||void 0===D||null===(F=D.contentDetails)||void 0===F?void 0:F.closedCaptions)||(null==a||null===(O=a.video)||void 0===O?void 0:O.closedCaptions)).filter(function(e){return"VTT"===e.format}),u.addCaptions(t,b);else u.removeCaptions(t)}else pe(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){be(e,t,n,i)})}));case 11:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),ye=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},_e=function(e,t){var n=r.getPlayer(e);n&&n.src(t)},be=function(t,n,i,o){var r,l,a,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==t||null===(a=t.response)||void 0===a||null===(d=a.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);Ee(n)&&pe(n,(null===(u=window)||void 0===u?void 0:u.customErrors)&&(null===(s=window)||void 0===s?void 0:s.customErrors[c])||"".concat(v)),i&&i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?we(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):we(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({status:!1,response:t,msg:"".concat(v)},o&&{videoId:o}))};exports.authenticateLC=Te,exports.baseUrlManager=y,exports.clearError=fe,exports.createIdxMapping=function(e){S=new Map,e.map(function(e,t){S.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;h({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=r.getPlayer(e);if(ye(),r.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=de,exports.getCurrentSeries=B,exports.getCurrentVideo=N,exports.getDecodedToken=C,exports.getEntitlementData=function(e,t,n,i){return o({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==i?void 0:i.latitude,longitude:null==i?void 0:i.longitude},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getEpisodeNumber=$,exports.getLinearChannelDetails=w,exports.getSeasonNumber=Z,exports.getSeriesDetails=function(e,t){var n,i,r=C(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):o({url:y.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=h,exports.getSeriesWatchMap=function(){return L},exports.getSource=ue,exports.getToken=x,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=q,exports.getVideoDetails=I,exports.getVideoIdx=function(){return P},exports.getVideoInfo=T,exports.handleError=pe,exports.initialiseAdvertisement=Ie,exports.initiateErrorHandling=be,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=r.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return i(e).paused()},exports.isPlayerInitialised=Ee,exports.isTokenExpired=_,exports.load=he,exports.loadVideo=_e,exports.loadVideoInstantly=function(e,t,n){var i=r.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){i(e).pause()},exports.play=function(e){i(e).play()},exports.refreshTokenManager=D,exports.replaceMacros=re,exports.rewind=function(e,t){var n=i(e),o=n.currentTime(),r=o<=t?0:o-t;n.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],s("js",new Date),s("config",e)},exports.saveWatchHistory=E,exports.seasonIdxManager=U,exports.setCurrentSeries=function(e){F=e},exports.setCurrentVideo=A,exports.setVideoIdx=M,exports.setVideoIdxById=j,exports.skip=function(e,t){var n=i(e),o=n.currentTime()+t;n.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
package/cjs/generic-d56b38ac.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),n=require("video.js"),i=require("axios"),o=require("./skin-3397dca5.js"),r=require("./browser-38ff3331.js"),l=require("js-cookie"),a=require("ua-parser-js"),d=require("./captions-3c7ca3a7.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function s(e,t){u("event",e,t)}var c={apiBaseUrl:"https://prod-api.viewlift.com",getVideoDetails:"/entitlement/video/status",getSeriesDetails:"/entitlement/series/status",saveWatchHistoryV1:"/user/userId/history/video",saveWatchHistoryV2:"/v2/user/history",getVideoInfoV1:"/user/info/video",getVideoInfoV2:"/v2/user/info",getSeriesWatchHistoryV1:"/user/userId/history/video",getSeriesWatchHistoryV2:"/v2/user/history/series",getLinearChannelDetails:"/v3/entitlement/linearchannel",getBeaconUrl:"/analytics/player-beacon"},v={name:"@viewlift/player-backup",version:"2.0.75-smartTv",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.3.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3",ima:"npm:videojs-ima@2.2.0","js-cookie":"^3.0.5","ua-parser-js":"^2.0.3","video.js":"8.22.0","videojs-contrib-ads":"7.5.2","videojs-contrib-eme":"5.5.1","videojs-mux":"^4.21.7","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=v.version;var m,f=function(e,t){var n,o,r,l,a,d,u,s;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:null!==(a=window)&&void 0!==a&&null!==(d=a.customData)&&void 0!==d&&d.overrideEntitlementBaseUrl?(null===(u=window)||void 0===u||null===(s=u.customData)||void 0===s?void 0:s.overrideEntitlementBaseUrl)+"/video/status":E.get()+"".concat(null==c?void 0:c.getVideoDetails),params:Object.assign({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":v.version},withCredentials:!0})},p=function(e,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementResponse})}):i({url:E.get()+c.getLinearChannelDetails,params:Object.assign({id:null==e?void 0:e.id,deviceType:"web_browser",contentConsumption:"web"},(null==e?void 0:e.channelId)&&{channelId:null==e?void 0:e.channelId},(null==e?void 0:e.programId)&&{programId:null==e?void 0:e.programId},(null==e?void 0:e.programTitle)&&{programTitle:null==e?void 0:e.programTitle},(null==e?void 0:e.programSubType)&&{programSubType:null==e?void 0:e.programSubType},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,hdcp:"HDCP-1.4",sl:"SW_SECURE_CRYPTO"}})},g=function(){var n=e(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return o=e.sent,e.abrupt("return",i({url:E.get()+"".concat(null==c?void 0:c.saveWatchHistoryV2),method:"POST",headers:{Authorization:o},data:Object.assign({},n),params:Object.assign({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 4:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),I=function(e,t){var n,o,r=window.contentType;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getVideoInfoV2,"/").concat(r,"/").concat(e),headers:{Authorization:t,"x-api-key":null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.xApiKey},timeout:15e3})},w=function(e){var t=e.videoId;return i({method:"GET",url:E.get()+"".concat(null==c?void 0:c.getSeriesWatchHistoryV2,"/").concat(t),headers:{Authorization:e.token},timeout:15e3})},E=(m=null==c?void 0:c.apiBaseUrl,{set:function(e){e&&(m=e)},get:function(){return m}}),T=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},h=null;function _(){return{set:function(e){e&&(h=e)},get:function(){return h}}}var y,b,F,D,L,V,R=function(){var n=e(t.mark(function e(){var n,o,r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=_().get(),o=E.get(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(){return n.apply(this,arguments)}}(),S=null,W=function(){var n=e(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!T(n)){e.next=6;break}return S||(S=R().then(function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&_().set(r),o||n}).catch(function(e){return console.error("Error fetching refresh token",e),n}).finally(function(){S=null})),e.abrupt("return",S);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e)}));return function(){return n.apply(this,arguments)}}(),O=function(e){if(e&&"string"==typeof e)return JSON.parse(atob(e.split(".")[1]))},x=function(e){b=e},C=function(){return b},P=function(){return y},A=function(e){F=e},N=function(e){if(D){var t=D.get(e);A(t+1)}},B=(V=0,{set:function(e){e>=0&&(V=e)},get:function(){return V}}),M=0,U=function(){var e,t,n,i,o,r,l,a=C();return"linearchannel"==((null==a?void 0:a.contentType)||"video")?null==a||null===(e=a.linearchannel)||void 0===e||null===(t=e.channels)||void 0===t||null===(n=t.find(function(e){return(null==e?void 0:e.id)===(null==a?void 0:a.channelId)}))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==a||null===(o=a.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==a||null===(l=a.video)||void 0===l?void 0:l.id)||(null==a?void 0:a.id)};function j(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function k(){var e=window.sessionStorage.getItem("uid");return e||(e=j(),window.sessionStorage.setItem("uid",e),e)}function H(){return G.apply(this,arguments)}function G(){return(G=e(t.mark(function e(){var n,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function z(e){return e?String(e):""}window.initialise=function(e){window.sid=j(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",function(){var n,i,o,r=Math.floor(e.currentTime());clearInterval(window.bufferingTimer),window.buffering=null,window.handleBufferTimer=null,s(r?"FAILED_TO_START":"DROPPED_STREAM",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})},window.firstFrame=function(e,t){e.one("play",tryCatch(function(){var n,i,o;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval(function(){window.ttFirstFrame=window.handleBufferTimer?window.handleBufferTimer(window.ttFirstFrame,e):null},100),s("PLAY",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1}),t&&t("started_video_playback",{"Video ID":U(),watchTime:Math.floor(e.currentTime())})}))},window.buffering=function(e){e.on("waiting",tryCatch(function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval(function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=window.handleBufferTimer?window.handleBufferTimer(window.totalBufferTime,e):null:clearInterval(window.bufferingTimer)},100))}))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting")&&M<4)M++,s("BUFFERING",Object.assign({pfm:window.platform,uid:k(),vid:U(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,s("FIRST_FRAME",Object.assign({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})})},window.ads=function(e){e.on("adsready",function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,function(){var t,n,i,o,r,l;s("AD_REQUEST",Object.assign({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),vid:U(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),s("AD_IMPRESSION",Object.assign({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:k(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:U()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})}),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,function(){window.ttFirstFrame=0}),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,function(){window.ttFirstFrame=0})})},window.ping=function(e){var t=[];e.on("timeupdate",function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(M=0,t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))})},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch(function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(Y(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}})()};var Y=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var n=e(t.mark(function e(n){var o,r,l,a,d,u,s,v,m,f,p,g,I,w,T,h,_,y,b,F;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return h=e.sent,_=O(h),y=null==_?void 0:_.site,b=null==_?void 0:_.siteId,e.t0=Object,e.t1={aid:y,cid:b,pfm:window.platform},e.t2=null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params,e.t3=k(),e.t4=U(),e.t5=n.url||document.location.href,e.t6=n.ref||document.referrer,e.t7=n.eventName,e.t8=null!==(a=n.videoPosition)&&void 0!==a?a:null,e.t9=window.environment,e.t10=n.dp1||"",e.t11=n.dp2||"",e.t12=n.dp3||"",e.t13=n.dp4||"",e.t14=n.dp5||"",e.t15=!0===n.isAdEvent?n.videoPosition:null,e.t16=!0===n.isAdEvent?z(n.adPosition):"",e.next=25,H();case 25:e.t17=e.sent,e.t18=n.playerType||"native",e.t19=n.mediaType||"VIDEO",e.t20=window.sid,e.t21=null!==(d=n.ttFirstFrame)&&void 0!==d?d:null,e.t22=null!==(u=n.bitrate)&&void 0!==u?u:null,e.t23=null!==(s=n.resHeight)&&void 0!==s?s:null,e.t24=null!==(v=n.resWidth)&&void 0!==v?v:null,e.t25=null!==(m=n.bufferHealth)&&void 0!==m?m:null,e.t26={uid:e.t3,vid:e.t4,url:e.t5,ref:e.t6,pa:e.t7,vpos:e.t8,environment:e.t9,dp1:e.t10,dp2:e.t11,dp3:e.t12,dp4:e.t13,dp5:e.t14,apos:e.t15,apod:e.t16,profid:e.t17,player:e.t18,media_type:e.t19,stream_id:e.t20,embedurl:"",ttfirstframe:e.t21,bitrate:e.t22,connectionspeed:null,resolutionheight:e.t23,resolutionwidth:e.t24,bufferhealth:e.t25},e.t27=(null==n?void 0:n.duration)&&{duration:n.duration},e.t28=null===(f=window)||void 0===f||null===(p=f.customData)||void 0===p||null===(g=p.beacon)||void 0===g?void 0:g.params,e.t29=e.t0.assign.call(e.t0,e.t1,e.t2,e.t26,e.t27,e.t28),F=[e.t29],i({url:(null===(I=window)||void 0===I||null===(w=I.customData)||void 0===w||null===(T=w.beacon)||void 0===T?void 0:T.url)||E.get()+c.getBeaconUrl,method:"post",headers:{Authorization:h},contentType:"application/x-www-form-urlencoded",dataType:"text",data:F}).catch(function(e){console.error(e)});case 40:case"end":return e.stop()}},e)}));return function(e){return n.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var q=function(){var e=B.get();return e>=0?e+1:1},X=function(){var e,t,n,i=P(),o=C(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,l=B.get(),a=null==i||null===(t=i[l])||void 0===t||null===(n=t.episodes)||void 0===n?void 0:n.findIndex(function(e){return(null==e?void 0:e.id)===r});return a>=0?a+1:1};window._deviceInfo=a.UAParser(navigator.userAgent);var J=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},K=function(e){var t=Q(e,"video.tags",[]),n=Q(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map(function(e){return e.title}).join(","):n},Q=function(e,t,n){for(var i=0,o=(t=t.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[t[i]]}return e||n},Z=function(){var e,t,n,i,r,a,d,u,s,c,v,m,f,p,g,I,w,E,T,h,_,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=arguments.length>1?arguments[1]:void 0,F=arguments.length>2?arguments[2]:void 0,D=(null==F?void 0:F.siteName)||"",L=(null==F?void 0:F.contentType)||"video",V=(null==F||null===(e=F[L])||void 0===e?void 0:e.metadata)||(null==F||null===(t=F[L])||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.metadata),R=o.getPlayer(b);if(!y.includes("VIEWLIFT_"))return y;var S,W=window.getComputedStyle(document.getElementById(b),null),O=Math.trunc(W.getPropertyValue("height").slice(0,-2)),x=Math.trunc(W.getPropertyValue("width").slice(0,-2)),C="linearchannel"===L?null==F||null===(i=F.linearchannel)||void 0===i||null===(r=i.channels)||void 0===r||null===(a=r.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===a||null===(d=a.content)||void 0===d?void 0:d.id:Q(F,"video.gist.id",""),P="linearchannel"===L?null==F||null===(u=F.linearchannel)||void 0===u||null===(s=u.channels)||void 0===s||null===(c=s.find(function(e){return(null==e?void 0:e.id)===(null==F?void 0:F.channelId)}))||void 0===c?void 0:c.title:Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),A=null,N=null;"function"==typeof window.__gpp&&(null===(S=window)||void 0===S||S.__gpp("ping",function(e){A=null==e?void 0:e.gppString,N=null==e?void 0:e.sectionList[0]}));var B=Object.assign({},$(V),{VIEWLIFT_WIDTH:x,VIEWLIFT_HEIGHT:O,VIEWLIFT_SIZE:J(x,O),VIEWLIFT_DOMAIN:window.location.hostname,VIEWLIFT_URL:window.location.href,VIEWLIFT_ENCODED_URL:encodeURIComponent(window.location.href),VIEWLIFT_DOUBLE_ENCODED_URL:encodeURIComponent(encodeURIComponent(window.location.href)),VIEWLIFT_CACHEBUSTER:"3708662946268",VIEWLIFT_TIMESTAMP:Date.now().toString().substring(0,10),VIEWLIFT_TIMESTAMP_MS:Date.now().toString(),VIEWLIFT_IP:(null===(v=window)||void 0===v?void 0:v.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Q(F,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==R||null===(m=R.options_)||void 0===m?void 0:m.autoplay)||1,VIEWLIFT_MUTE:(null==R||null===(f=R.options_)||void 0===f?void 0:f.autoplay)||0,VIEWLIFT_DEVICE_ID:"spinco"==D?"":localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"dpid",VIEWLIFT_KEYWORDS:K(F),VIEWLIFT_MEDIA_ID:C,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Q(F,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:C,VIEWLIFT_VIDEO_URL:encodeURI(window.location.origin+Q(F,"video.gist.permalink","")),VIEWLIFT_CONSENT:l.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Q(null===(p=window)||void 0===p||null===(g=p.app_data)||void 0===g||null===(I=g.site)||void 0===I?void 0:I.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR_CONSENT:"",VIEWLIFT_GDPR:"spinco"==D?"":Q(null===(w=window)||void 0===w||null===(E=w.app_data)||void 0===E||null===(T=E.site)||void 0===T?void 0:T.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Q(F,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:C,VIEWLIFT_CONTENT_TITLE:P,VIEWLIFT_CONTENT_SERIES_TITLE:Q(F,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Q(F,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:X(),VIEWLIFT_SEASON_NUMBER:q(),VIEWLIFT_CONTENT_TAGS:K(F),VIEWLIFT_GPP_SID:N||"VIEWLIFT_GPP_SID",VIEWLIFT_GPP:A||"VIEWLIFT_GPP",VIEWLIFT_APP_ID:"",VIEWLIFT_APP_STORE_URL:""},null===(h=window)||void 0===h||null===(_=h.customData)||void 0===_?void 0:_.macros);for(var M in B){var U=new RegExp(M,"g");y=y.replace(U,B[M])}return y},$=function(e){var t,n,i,o,l,a,d;if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV)return ee(u);var u={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){s.set(e.name,e.value)}));var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.subscription)||void 0===o?void 0:o.SVOD)||!1,v=(null===(l=window)||void 0===l||null===(a=l.customData)||void 0===a||null===(d=a.subscription)||void 0===d?void 0:d.TVE)||!1;return c||v?(r.isMobile()?c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):c?u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),c?u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}):v&&(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.tve")||s.get("sfid.web.tve")||""})),u=r.isMobile()?Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_PROF:s.get("prof.web")||""})):(u=Object.assign({},u,{VIEWLIFT_SFID:s.get("sfid.dtc")||s.get("sfid.web.dtc")||""}),u=r.isMobile()?Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):Object.assign({},u,{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),u=Object.assign({},u,{VIEWLIFT_AFID:s.get("afid")})},ee=function(e){var t,n,i,o,r,l,a={},d=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map(function(e){d.set(e.name,e.value)}));var u=(null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.subscription)||void 0===i?void 0:i.SVOD)||!1,s=(null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return(u||s)&&(s?(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.tve")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.tve")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.tve")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.tve")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.tve")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.tve")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""})):(a=Object.assign({},a,{VIEWLIFT_SFID:d.get("sfid.dtc")}),a="lgTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.lgtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.lgtv")||""}):"vizioTv"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.viziotv.dtc")||"",VIEWLIFT_PROF:d.get("prof.viziotv")||""}):"xfinityX1"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xfinity.dtc")||"",VIEWLIFT_PROF:d.get("prof.xfinity")||""}):"xbox"==window.customData.device?Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.xbox.dtc")||"",VIEWLIFT_PROF:d.get("prof.xbox")||""}):Object.assign({},a,{VIEWLIFT_CSID:d.get("csid.samsungtv.dtc")||"",VIEWLIFT_PROF:d.get("prof.samsungtv")||""}))),a},te=function(e){var t=null;try{var n,i,o,r,l,a,d,u,s,c,v,m,f,p,g,I,w,E,T,h,_,y,b,F,D,L,V,R,S;if(null!==(n=window)&&void 0!==n&&n.customData.isSmartTV){if("samsungTv"==window.customData.device&&null!=e&&null!==(i=e.ads)&&void 0!==i&&null!==(o=i.preRoll)&&void 0!==o&&null!==(r=o.adTags)&&void 0!==r&&null!==(l=r.samsung_tv)&&void 0!==l&&l.active)t=null==e||null===(E=e.ads)||void 0===E||null===(T=E.preRoll)||void 0===T||null===(h=T.adTags)||void 0===h||null===(_=h.samsung_tv)||void 0===_?void 0:_.url;else if("lgTv"==window.customData.device&&null!=e&&null!==(a=e.ads)&&void 0!==a&&null!==(d=a.preRoll)&&void 0!==d&&null!==(u=d.adTags)&&void 0!==u&&null!==(s=u.lg_tv)&&void 0!==s&&s.active){var W,O,x,C;t=null==e||null===(W=e.ads)||void 0===W||null===(O=W.preRoll)||void 0===O||null===(x=O.adTags)||void 0===x||null===(C=x.lg_tv)||void 0===C?void 0:C.url}else if("vizioTv"==window.customData.device&&null!=e&&null!==(c=e.ads)&&void 0!==c&&null!==(v=c.preRoll)&&void 0!==v&&null!==(m=v.adTags)&&void 0!==m&&null!==(f=m.vizioTv)&&void 0!==f&&f.active){var P,A,N,B;t=null==e||null===(P=e.ads)||void 0===P||null===(A=P.preRoll)||void 0===A||null===(N=A.adTags)||void 0===N||null===(B=N.vizioTv)||void 0===B?void 0:B.url}else if("xbox"==window.customData.device&&null!=e&&null!==(p=e.ads)&&void 0!==p&&null!==(g=p.preRoll)&&void 0!==g&&null!==(I=g.adTags)&&void 0!==I&&null!==(w=I.xbox)&&void 0!==w&&w.active){var M,U,j,k;t=null==e||null===(M=e.ads)||void 0===M||null===(U=M.preRoll)||void 0===U||null===(j=U.adTags)||void 0===j||null===(k=j.xbox)||void 0===k?void 0:k.url}}else t=(null==e||null===(y=e.ads)||void 0===y||null===(b=y.preRoll)||void 0===b||null===(F=b.adTags)||void 0===F||null===(D=F.web)||void 0===D?void 0:D.active)&&(null==e||null===(L=e.ads)||void 0===L||null===(V=L.preRoll)||void 0===V||null===(R=V.adTags)||void 0===R||null===(S=R.web)||void 0===S?void 0:S.url)}catch(e){}return t},ne=function(e,t){var n,i,o,l,a,d,u,s,c,v,m,f,p,g=(null==e?void 0:e.contentType)||"video",I=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,w=null==e||null===(i=e[g])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(l=e[g])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.audioAssets,T=(null==e||null===(d=e[g])||void 0===d||null===(u=d.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(c=e[g])||void 0===c||null===(v=c.liveDetails)||void 0===v||v.isDvrEnabled;var h=(null==e||null===(m=e[g])||void 0===m||null===(f=m.streamingInfo)||void 0===f||null===(p=f.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return oe(E);if(I){var _=re(w,t);return _.src=Z(_.src,t,e),_}if("Safari"!==r.detectBrowser()&&h)return ie(w);if(T){var y=oe(w);return y.src=Z(y.src,t,e),y}if(null!=w&&w.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(w);return b.src=Z(b.src,t,e),b}return null},ie=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},oe=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},re=function(e,t){var i=e.fairPlayCmaf||e.fairPlay,l=e.widevine,a=e.playReady,d=r.detectBrowser();if(o.getPlayer(t),"Safari"===d){var u=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,i){var o={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};n.xhr(o,function(e,t,n){console.log(e),e&&i(e),i(null,new Uint8Array(n))})},getContentId:function(e,t){if(t){var n=t.indexOf("\0")+1;return t.slice(n)}},getLicense:function(t,i,o,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:o,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};n.xhr(l,function(e,t,n){console.log(e),e&&r(e),r(null,n)})}}}}}(i);return le(t),u}var s,c={src:l.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(le(t),c.keySystems={"com.widevine.alpha":{url:l.licenseUrl,licenseHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:a.licenseUrl,licenseHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}):(c.keySystemOptions=[],c.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:l.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":l.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:a.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":a.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),c};var le=function(e){var t=o.getPlayer(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==r.detectBrowser()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},ae=function(e,t){if(Promise.resolve().then(function(){return require("./error-26d5a3c3.js")}).then(function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)}),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var i=document.getElementById(e);if(i){var o=document.createElement("div");o.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),o.appendChild(r),i.append(o)}}},de=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var ue=!1,se=function(e,t,n){var i=Z(t,e,n),r=o.getPlayer(e);if(t&&window.google){if("function"!=typeof r.ima)return;r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),function(e,t){var n,i,r,l=o.getPlayer(e);if(null!==l.el_){ue=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};l.ima.initializeAdDisplayContainer&&l.ima.initializeAdDisplayContainer(),ue&&null!==l.el_&&("function"==typeof l.ima?l.ima(a):setTimeout(function(){l.ima.setContentWithAdTag(null,t,!0),l.ima.requestAds()},1e3));var d=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&d.hasAttribute("controls")&&d.removeAttribute("controls");var u="click",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,u="touchend"),l.one(u,function(){s&&l.ima.initializeAdDisplayContainer()});var c=(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.adEventHandler)||null;l.one("ads-ad-started",function(){c&&c({status:"STARTED",msg:"Advertisement Started"})}),l.one("ads-manager",function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})})}),l.on("adserror",function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})})}}(e,i)}},ce=function(e){return!!n.getPlayer("".concat(e))},ve=function(){var n=e(t.mark(function e(n,i){var r,l,a,d=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=d.length>2&&void 0!==d[2]&&d[2],e.next=3,W();case 3:return l=e.sent,a=o.getPlayer(n),e.abrupt("return",new Promise(function(e,t){p(i,l).then(function(t){var o=null==t?void 0:t.data;window.sid=j(),o.contentType="linearchannel",o.channelId=null==i?void 0:i.channelId;var l=ne(o,n);x(o),l&&r?(pe(n,l),a.on("loadstart",function(){e({status:!0,msg:"Feed authenticated and loaded",response:o})})):e({status:!0,msg:"Feed authenticated",response:o})}).catch(function(e){t({status:!1,msg:"Cannot load feed",response:e})})}));case 6:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),me=function(){var n=e(t.mark(function e(n,i){var r,l,a,u,s,c,v=arguments;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=v.length>2&&void 0!==v[2]?v[2]:null){e.next=5;break}return e.next=4,W();case 4:u=e.sent;case 5:return(P()||null)&&N(i),s=0,c=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&I(i,u).then(function(e){var t,n,i,o,r,l;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,c=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedPercentage)||null}).catch(function(e){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))}),e.abrupt("return",new Promise(function(e,t){f(i,u).then(function(i){var r,l,a=null==i?void 0:i.data,u=(null==a||null===(r=a.video)||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;x(i.data);var v=te(a);v&&se(n,v,a);var m=ne(a,n);if(m){var f,p,g,I,w,E,T,h,_,y,b,F,D,L,V=(null==a||null===(f=a.video)||void 0===f||null===(p=f.gist)||void 0===p?void 0:p.videoImageUrl)||(null==a||null===(g=a.video)||void 0===g||null===(I=g.gist)||void 0===I||null===(w=I.imageGist)||void 0===w?void 0:w.r16x9),R=o.getPlayer(n);if(R.poster(V),pe(n,m),R.on("loadstart",function(){u&&e({status:!0,msg:"Video Loaded",response:a})}),R.on("loadeddata",function(){de(),e({status:!0,msg:"Video Loaded",response:a})}),R.one("play",function(){s&&c<95&&setTimeout(function(){R.currentTime(s)},0)}),R.one("error",function(){var e;t({status:!1,msg:(null==R||null===(e=R.error())||void 0===e?void 0:e.message)||"Some error occured"})}),(null==a||null===(E=a.video)||void 0===E||null===(T=E.contentDetails)||void 0===T||null===(h=T.closedCaptions)||void 0===h?void 0:h.length)>0||(null==a||null===(_=a.video)||void 0===_||null===(y=_.closedCaptions)||void 0===y?void 0:y.length)>0)b=((null==a||null===(F=a.video)||void 0===F||null===(D=F.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null==a||null===(L=a.video)||void 0===L?void 0:L.closedCaptions)).filter(function(e){return"VTT"===e.format}),d.addCaptions(n,b);else d.removeCaptions(n)}else ae(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")}).catch(function(e){ge(e,n,t,i)})}));case 11:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}(),fe=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},pe=function(e,t){var n=o.getPlayer(e);n&&n.src(t)},ge=function(e,t,n,i){var o,r,l,a,d,u,s=null==e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,c=(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.errorMessage)||(null==e?void 0:e.message);ce(t)&&ae(t,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[s])||"".concat(c)),n&&n(Object.assign({status:!1,response:e,msg:"".concat(c)},i&&{videoId:i}))};exports.authenticateLC=ve,exports.baseUrlManager=E,exports.clearError=de,exports.createIdxMapping=function(e){D=new Map,e.map(function(e,t){D.set(e.id,t)})},exports.createSeriesWatchMap=function(e,t){var n=new Map;w({videoId:e,token:t}).then(function(e){e.data.map(function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})}),L=n}).catch(function(e){return console.log(e)})},exports.disableControls=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var i=t.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=t.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")},exports.dispose=function(e){var t=o.getPlayer(e);if(fe(),o.clearEventListeners(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.getAdsURL=te,exports.getCurrentSeries=P,exports.getCurrentVideo=C,exports.getDecodedToken=O,exports.getEntitlementData=function(e,t,n,o){return i({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web",latitude:null==o?void 0:o.latitude,longitude:null==o?void 0:o.longitude},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getEpisodeNumber=X,exports.getLinearChannelDetails=p,exports.getSeasonNumber=q,exports.getSeriesDetails=function(e,t){var n,o,r=O(t),l=(null==r?void 0:r.site)||null;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.seriesData?new Promise(function(e,t){var n,i;return e({data:null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.seriesData})}):i({url:E.get()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=w,exports.getSeriesWatchMap=function(){return L},exports.getSource=ne,exports.getToken=W,exports.getUpdatedClusterSource=function(e,t){var n=e.src,i=e.type;if(!n||"string"!=typeof n||!n.includes(".com"))return{src:n,type:i};t=t.replace(/\/$/,"");var o=n.split(".com")[1]||"";return{src:o?"".concat(t).concat(o):n,type:i}},exports.getUserId=k,exports.getVideoDetails=f,exports.getVideoIdx=function(){return F},exports.getVideoInfo=I,exports.handleError=ae,exports.initialiseAdvertisement=se,exports.initiateErrorHandling=ge,exports.inititateBeacon=function(e,t){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=o.getPlayer(e);window.initialise(n,t),window.firstFrame(n,t),n.on("loadedmetadata",function(){window.endFirstFrame(n)})}},exports.isPaused=function(e){return n(e).paused()},exports.isPlayerInitialised=ce,exports.isTokenExpired=T,exports.load=me,exports.loadVideo=pe,exports.loadVideoInstantly=function(e,t,n){var i=o.getPlayer(e);return i.src(t),new Promise(function(e,t){var o=0;i.one("loadedmetadata",function(){clearTimeout(o),e({status:!0,msg:"video loaded"})}),i.one("loadstart",function(e){o=setTimeout(function(){t("FAILED: Took too long to load")},n)})})},exports.pause=function(e){n(e).pause()},exports.play=function(e){n(e).play()},exports.refreshTokenManager=_,exports.replaceMacros=Z,exports.rewind=function(e,t){var i=n(e),o=i.currentTime(),r=o<=t?0:o-t;i.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)},exports.saveWatchHistory=g,exports.seasonIdxManager=B,exports.setCurrentSeries=function(e){y=e},exports.setCurrentVideo=x,exports.setVideoIdx=A,exports.setVideoIdxById=N,exports.skip=function(e,t){var i=n(e),o=i.currentTime()+t;i.currentTime(o)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
package/cjs/index-510967ea.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e,t,n,r,i=require("./skin-3397dca5.js"),a=require("./generic-d56b38ac.js"),l=require("./autoNextVideo-b2664dca.js"),o=require("@babel/runtime/helpers/typeof"),u=require("video.js"),s=require("@babel/runtime/helpers/asyncToGenerator"),c=require("@babel/runtime/regenerator"),d=require("@babel/runtime/helpers/defineProperty"),p=require("@babel/runtime/helpers/slicedToArray"),v=[],m=function(e,t){var n=i.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var o=a.getVideoIdx();l.switchToNext(o,e,v)}};e={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},t=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===o(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},r=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},u.registerPlugin("thumbnails",function(i){var a,l,o,u,s,c,d,p,v,m;if(u=t({},e,i),c=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=c.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(o=document.createElement("div")).className="vjs-thumbnail-holder",s=document.createElement("img"),o.appendChild(s),s.src=u[0].src,s.className="vjs-thumbnail",t(s.style,u[0].style),s.style.left||s.style.right||(s.onload=function(){s.style.left=-s.naturalWidth/2+"px"}),p=c.duration(),c.on("durationchange",function(e){p=c.duration()}),c.on("loadedmetadata",function(e){p=c.duration()}),(d=c.controlBar.progressControl).el().appendChild(o),v=function(e){var i,a,l,c,v,m,f,g,h,b;for(a in l=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((b=r(d.el()).getBoundingClientRect()).width||b.right)+h,m=e.pageX,e.changedTouches&&(m=e.changedTouches[0].pageX),c=m||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c-=r(d.el()).getBoundingClientRect().left+h,i=Math.floor((c-d.el().offsetLeft)/d.width()*p),u)i>a&&(l=Math.max(l,a));(v=u[l]).src&&s.src!=v.src&&(s.src=v.src),v.style&&s.style!=v.style&&t(s.style,v.style),c+(g=function(e,t){var r;return t?parseFloat(t):"auto"!==(r=n(e)("clip"))&&"inherit"!==r&&4===(r=r.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(r[1])-parseFloat(r[3]):0}(s,v.width||u[0].width)/2)>f?c-=c+g-f:c<g&&(c=g),o.style.left=c+"px"},null!==(a=window)&&void 0!==a&&null!==(l=a.customData)&&void 0!==l&&l.isSmartTV){var f=function(){var e,t,n=0,r=(null===(e=d.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;r<65?r=5:r>=c.el().offsetWidth-180?r=c.el().offsetWidth-240:r-=58;var i=c.currentTime();for(t in u)i>t&&(n=Math.max(n,t));var a=u[n];a.uri&&""!=a.uri&&s.src!=a.uri?(s.src=a.uri,o.style.left=r+"px",s.style.opacity="1"):(o.style.left="-1000px",s.style.opacity="0")},g=null;d.el_.children[0].onfocus=function(){f(),g=setInterval(function(){f()},250)},d.el_.children[0].addEventListener("blur",function(){try{o.style.left="-1000px",s.style.opacity="0",g&&(clearInterval(g),g=null)}catch(e){}})}else d.on("mousemove",v),d.on("touchmove",v);function h(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",h),m()}d.on("pointerdown",function(e){document.addEventListener("pointermove",v),document.addEventListener("pointerup",h)}),m=function(e){o.style.left="-1000px"},d.on("mouseout",m),d.on("touchcancel",m),d.on("touchend",m),c.on("userinactive",m)});var f="my-player";function g(e){var t=e.split("\n"),n=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))}),n.push(r)}}),n}function h(){return(h=s(c.mark(function e(t){var n,r,i,a,l,o,u,s,d,v,m,f,g,h,b,y,x,w,A,E,N,k,T,I;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),l=p(a,2),o=l[0],u=l[1],s=i.width/u,d=i.height/o,v=[],m=0;m<o;m++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=d,g.getContext("2d").drawImage(i,f*s,m*d,s,d,0,0,s,d),h=g.toDataURL("image/png"),v.push({uri:h,duration:t.duration}),t._tiles=v;return e.abrupt("return",v);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=p(b,2),x=y[0],w=y[1],A=[],E=0;E<x*w;E++)A.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(T=k.appcmsMain)||void 0===T||null===(I=T.images)||void 0===I?void 0:I.placeholderCover,duration:t.duration});return e.abrupt("return",A);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function b(e,t){return y.apply(this,arguments)}function y(){return(y=s(c.mark(function e(t,n){var r,i;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",g(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function x(e,t,n){var r=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),a=i.getPlayer(f);if(r&&a){var l=r.getBoundingClientRect(),o=(e.clientX-l.left)/l.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var l=Math.floor((i+a)/2),o=t[l];if(o===e)return o;o<e?i=l+1:a=l-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(o*a.duration()),n),s=t[u];s&&!s.loading&&(s.loading=!0,function(e){return h.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function w(e){return A.apply(this,arguments)}function A(){return(A=s(c.mark(function e(t){var n,r,a,l;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),i=p(r,2),a=i[0]*i[1],l=e.duration,o=0;o<a;o++){var u,s=Math.round((t*a+o)*l);n[s]=Object.assign({},e,{duration:e.duration,tileIndex:o,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},d(u,"left","-60px"),d(u,"border","1px solid transparent"),d(u,"borderRadius","4px"),u)})}}),r=Object.keys(n).map(Number).sort(function(e,t){return e-t}),null==(a=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||a.addEventListener("mousemove",i.throttle(function(e){return x(e,n,r)},500)),null==(l=document.querySelector(".vjs-progress-control.vjs-control"))||l.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",i.throttle(function(e){return x(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var E=function(){var e=s(c.mark(function e(t,n){var r,i,a,l,o,u,s,d;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),l=[],o=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(s=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}o={resolution:null,duration:null,uri:null,layout:null},d=s.split(":")[1]||"",d.split(",").forEach(function(e){var t=e.split("="),n=p(t,2),r=n[0],i=n[1];r&&i&&(o[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(o.uri=s.includes("http")?s:t+s,l.push(o),o=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",l);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function N(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function k(e,t){return T.apply(this,arguments)}function T(){return(T=s(c.mark(function e(t,n){var r,l,o,u,s,d,v,m,g,h,b,y,x,w,A,E,k,T,L,B,j,M,S,P,R,q,O,$,X,D,V,_,F,U,W,G,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,le,oe,ue,se,ce,de,pe,ve,me;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f=n,r=i.getPlayer(n),l=t.split("/"),o=l.findIndex(function(e){return"dash"===e.toLowerCase()}),u=N(-1!==o?l.slice(0,o+1).join("/"):new URL(t).origin),e.prev=5,e.next=8,fetch(t);case 8:return m=e.sent,e.next=11,m.text();case 11:g=e.sent,h=new DOMParser,b=h.parseFromString(g,"application/xml"),y=(null==r?void 0:r.duration())||(null===(s=a.getCurrentVideo())||void 0===s||null===(d=s.video)||void 0===d?void 0:d.runtime),x=(null==b||null===(v=b.querySelector("MPD > BaseURL"))||void 0===v?void 0:v.textContent)||u+"/",w=b.getElementsByTagName("AdaptationSet"),A=0;case 18:if(!(A<w.length)){e.next=72;break}if(("image"!==(E=w[A]).getAttribute("contentType")||"image/png"!==E.getAttribute("mimeType"))&&"image/jpeg"!==E.getAttribute("mimeType")){e.next=69;break}if(T=E.getElementsByTagName("SegmentTemplate")[0],L=null===(k=T.getElementsByTagName("SegmentTimeline"))||void 0===k?void 0:k[0],!T||!L){e.next=48;break}if(M=L.getElementsByTagName("S"),S=parseInt(null===(B=M[0])||void 0===B?void 0:B.getAttribute("t")),P=parseInt(null===(j=M[0])||void 0===j?void 0:j.getAttribute("d")),R=E.getElementsByTagName("Representation")[0],q=R.getElementsByTagName("EssentialProperty")[0],O=q.getAttribute("value"),$=null==O?void 0:O.split("x"),X=p($,2),D=X[0],V=X[1],!T){e.next=46;break}if(T.getAttribute("media"),_=T.getAttribute("timescale"),F=(_?P/_:P)/(D*V),U=R.getAttribute("id"),W=Math.round(y/F),G=Math.ceil(W/(D*V)),z=T.getAttribute("media"),parseInt(T.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],A=0;A<G;A++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:F,layout:O,uri:Y+Q.replace("$Time$",S+A*P).replace("$RepresentationID$",U)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=E.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=p(ee,2),ne=te[0],re=te[1],!T){e.next=69;break}if(T.getAttribute("media"),ie=T.getAttribute("duration"),ae=T.getAttribute("timescale"),le=(ae?ie/ae:ie)/(ne*re),oe=J.getAttribute("id"),ue=Math.round(y/le),se=Math.ceil(ue/(ne*re)),ce=T.getAttribute("media"),de=parseInt(T.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],ve=I(ce),A=0;A<se;A++)me=ve?C(ve,A+de):ce,pe.push({duration:le,layout:Z,uri:x+me.replace("$Number$",A+de).replace("$RepresentationID$",oe)});return e.abrupt("return",pe);case 69:A++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function I(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function C(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function L(){return(L=s(c.mark(function e(t){var n,r,a,l,o,u,s,d,p,v,m,f,g,h,y,x;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=i.getPlayer(t),s=u.currentSource(),d=s.src,d=null!==(n=d)&&void 0!==n&&n.includes("blob")?null===(r=window)||void 0===r||null===(a=r.player)||void 0===a?void 0:a.getSource():d,null===(l=d)||void 0===l||!l.includes("m3u8")){e.next=19;break}return e.next=6,b(d,t);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return v=(null==p?void 0:p[0])||null,m=v.uri,f=d.substring(0,d.lastIndexOf("/"))+"/",e.next=12,E(f,m);case 12:return g=e.sent,e.next=15,w(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(o=d)||void 0===o||!o.includes("mpd")){e.next=28;break}return e.next=22,k(d,t);case 22:if(!((null==(y=e.sent)?void 0:y.length)>0)){e.next=28;break}return e.next=26,w(y);case 26:x=e.sent,u.thumbnails(x);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}exports.addNextEpPreview=function(e,t){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r;v=[];var l=a.getCurrentSeries();null==l||l.map(function(e){var t;return(t=v).push.apply(t,e.episodes)}),null==t||null===(r=t.series)||void 0===r||r.cb}else{var o,u;v=(null==t||null===(o=t.relatedVideos)||void 0===o?void 0:o.content)||[],null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var s=i.getPlayer(e);s.on("timeupdate",function(){var e,t,n=Math.floor(s.currentTime()),r=s.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&a.getVideoIdx()<=(null===(t=v)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")});var c,d=v.filter(function(e,t){return t==a.getVideoIdx()});if((null==d?void 0:d.length)>0)if(null!==(c=document.getElementsByClassName("next-ep-preview"))&&void 0!==c&&c[0]){var p,f,g,h,b,y,x,w,A,E,N,k;(null===(p=document.getElementsByClassName("next-ep-preview"))||void 0===p?void 0:p[0]).style.visibility="hidden";var T=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],I=null===(g=document.getElementsByClassName("next-ep-img"))||void 0===g?void 0:g[0],C=null===(h=document.getElementsByClassName("next-ep-content"))||void 0===h?void 0:h[0],L=null===(b=d[0])||void 0===b?void 0:b.title;(null===(y=L)||void 0===y?void 0:y.length)>60&&(L=L.substr(0,60)+"..."),T.textContent="".concat(L),I.src=(null===(x=d[0])||void 0===x||null===(w=x.gist)||void 0===w||null===(A=w.imageGist)||void 0===A?void 0:A.r16x9)||(null==d||null===(E=d[0])||void 0===E?void 0:E.img)||(null===(N=window)||void 0===N||null===(k=N.customData)||void 0===k?void 0:k.fallbackImage),C.onclick=function(){return m(e)}}else{var B,j,M,S,P,R,q,O,$=document.createElement("div");$.className="next-ep-preview",$.style.visibility="hidden",document.getElementById(e).append($);var X=document.createElement("div");X.className="next-ep-header",X.textContent="Next up";var D=null===(B=d[0])||void 0===B?void 0:B.title,V=document.createElement("img");V.className="next-ep-img",V.src=(null===(j=d[0])||void 0===j||null===(M=j.gist)||void 0===M||null===(S=M.imageGist)||void 0===S?void 0:S.r16x9)||(null==d||null===(P=d[0])||void 0===P?void 0:P.img)||(null===(R=window)||void 0===R||null===(q=R.customData)||void 0===q?void 0:q.fallbackImage);var _=document.createElement("div");_.className="next-ep-title",(null===(O=D)||void 0===O?void 0:O.length)>60&&(D=D.substr(0,60)+"..."),_.textContent="".concat(D);var F=document.createElement("div");F.className="next-ep-content",F.append(V),F.append(_),F.onclick=function(){return m(e)},$.append(X),$.append(F)}},exports.addTVProviderImage=function(e,t){var n=i.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var a=document.createElement("div");a.className="tvProviderImage";var l=document.createElement("img");l.src="".concat(r),l.alt="Provider Image",a.append(l),n.el().appendChild(a),n.on("useractive",function(){a.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||a.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?a.style.top="3.2rem":a.style.top="1rem"})}},exports.initiateTrickplay=function(e){return L.apply(this,arguments)};
|
package/cjs/index-7a1f4fa3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-7a2d3bab.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("./util-47af43d1.js"),l=require("./captions-e4d4dc7d.js"),a=require("./skin-f87e1c22.js"),s=require("./renditions-268ef2ed.js"),u=require("./resolution-467dbbb0.js"),c=require("./browser-38ff3331.js"),d=require("./localisation-56e0a999.js"),v=require("@babel/runtime/helpers/typeof"),f=require("@babel/runtime/helpers/toConsumableArray"),p=require("@babel/runtime/helpers/slicedToArray"),m=function(e){return new Promise(function(n,t){if(y(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}})},y=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(e){var n,t=a.getPlayer(e);return(null==t||null===(n=t.audioTracks())||void 0===n?void 0:n.tracks_)||[]||[]},h=function(e,n){for(var t=a.getPlayer(e).audioTracks().tracks_||[],r=0;r<t.length;r++){var o=t[r];o.id==n?o.enabled=!0:o.enabled=!1}},b=function(e,n,t){var r=a.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var o=parseFloat(n)/100;r.volume(o),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},w=function(e){var n=a.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},k=function(){var e=t(r.mark(function e(n){var t,i,l,s,u;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=a.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(o),e.finish(13);case 16:(u=o.getTech("chromecast"))&&!u.prototype.seeking&&(u.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==i||i.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==c.detectBrowser()?null==i||i.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),S=function(e,n){var t=a.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,r,i,l,a,s=this.el(),u=o.dom.getPointerPosition(s,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*u,v.seek()}})};var O=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),m("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),j=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),P=function(){var e=t(r.mark(function e(){var n;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(o),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),T=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-8606834d.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),I=function(){var e=t(r.mark(function e(){return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-6a129893.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),E=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(o)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(o)})},loadAdsLibrary:O,loadEMELibrary:j,loadMuxPlugin:P,loadDvrSeekbar:T,loadContribDash:I});function D(e){return C.apply(this,arguments)}function C(){return(C=t(r.mark(function e(n){var t;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,O();case 3:t&&"Safari"==c.detectBrowser()&&Promise.resolve().then(function(){return E}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function x(e,n){return A.apply(this,arguments)}function A(){return(A=t(r.mark(function e(n,t){var o,i,l,a,s,u,d,v,f,p;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d=(null==t?void 0:t.contentType)||"video",v=null==t||null===(o=t[d])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[d])||void 0===i||null===(l=i.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==t||null===(a=t[d])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(u=s.videoAssets)||void 0===u?void 0:u.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==c.detectBrowser()?j():"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?I():j():"Safari"!=c.detectBrowser()&&f?I():null,k(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}},e,null,[[5,10]])}))).apply(this,arguments)}function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var R=new Set,V=null,M=function(n,t,r){var o,i,l,a,s,u,c,d={},v=(null==n?void 0:n.contentType)||"video";d["c3.cm.id"]=(null===(o=n[v])||void 0===o?void 0:o.id)||"Null",d["c3.cm.contentType"]=W(n),d[null==r||null===(i=r.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==n||!n.linearchannel),d[null==r||null===(l=r.Constants)||void 0===l?void 0:l.STREAM_URL]=t.currentSrc(),d[null==r||null===(a=r.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),d["c3.cm.categoryType"]=H(n),d["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),d.DRMEnabled=(null===(s=n[v])||void 0===s?void 0:s.drmEnabled)||"None",d.DAIStream=null!==(u=n[v])&&void 0!==u&&null!==(c=u.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[r.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=q(n),d["c3.cm.genreList"]=B(n),d["c3.cm.genre"]=_(n),d["c3.cm.channel"]=U(n);var f=K(e.getCurrentSeries(),n);return d=N(N({},d),f)},_=function(e){var n,t,r,o=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[o])||void 0===n||null===(t=n.gist)||void 0===t||null===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},B=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},U=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"VOD":(null==e||null===(n=e[r])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},H=function(e){return(null==e?void 0:e.contentType)||"null"},q=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",o=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return o?"YES":"NO"},F=function(e,n){var t,r,o=(n||{}).epg;if(o&&null!=o&&o.enable&&null!=o&&o.programTitle)return o.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},W=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var G,K=function(n,t){var r,o,i,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),c=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(o=r.series)||void 0===o?void 0:o.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(i=n[u-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},z=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},J=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Q=function(){var n=t(r.mark(function n(t,o){var i,l,s,u,c,d,v,f,p,m;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,s=i.paymentHandler,u=i.tveProvider,c=i.enable,d=i.appName,v=(o||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(f=a.getPlayer(t),"function"==typeof(p=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,p("getConvivaObject");case 10:if(m=n.sent){n.next=13;break}return n.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=z(t.keySystem);p("contentInfo",{DRMEnabled:r})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var n,t;V&&V!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),R.clear(),V=f.currentSrc();var r=J(f.currentType()),i=e.getCurrentVideo(),l=M(i,f,m);l[null==m||null===(n=m.Constants)||void 0===n?void 0:n.PLAYER_NAME]=d||"WEB",l[null==m||null===(t=m.Constants)||void 0===t?void 0:t.ASSET_NAME]=F(i,o),l.authToken=v||"NULL",l.streamType=r,l.D2CType=s||"NONE",l.subscriberType=u||(s?"D2C":"FREE"),l["c3.cm.affiliate"]=u||"NULL",p("contentInfo",l)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),f.on("play",function(){R.has(f.currentSrc())||(R.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){R.has(f.currentSrc())&&R.delete(f.currentSrc()),p("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==R||R.clear(),p("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}(),X=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-b95158cf.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-e495e69f.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-6aa6777f.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-9cff4263.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-c76e657d.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-d7a1e096.js")}).then(function(t){t.initialiseSkin(e,n)}):"VL_SmartTV"==t&&Promise.resolve().then(function(){return require("./skin-714e8f54.js")}).then(function(t){t.initialiseSkin(e,n)})};function Y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Z=[],ee=0,ne=null;function te(t,r,o){var i,l,a,s,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==r||null===(i=r.watchHistory)||void 0===i||i.apiVersion;var d=null==r||null===(l=r.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==r||null===(a=r.watchHistory)||void 0===a||a.xapiKey;var p=(null==r||null===(s=r.video)||void 0===s?void 0:s.originalObjectId)||null,m=(null==r||null===(u=r.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,y=Math.floor(t.currentTime()),g=c?100:Math.floor(v/f*100),h={};m?function(t,r,o){var i=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(o),l=re(i),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,t){return $($({},e),{},n({},t,u[t]))},{}),d=l.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===G});d<0?l.push($($({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=$($($({},l[d]),t),{},{updateDate:a});localStorage.setItem("".concat(i),JSON.stringify(l))}(h={completed:c,watchedTime:y,watchedPercentage:g},d,r.siteOwner):(h=$($({videoId:G,watchedTime:y,watchedPercentage:g,doneWatching:c,profileId:d},ne&&{seriesId:ne}),p&&{originalObjectId:p}),e.saveWatchHistory(h).then(function(e){}).catch(function(e){})),ee=v+o}function re(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function oe(e,n,t){var r=re(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return r&&Array.isArray(r)&&(o=r.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),o}var ie=!1,le=function(n,t){var r,o,i=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[i])||void 0===r||null===(o=r.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!ie){var l=ae(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ie=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function ae(e,n,t){if(Array.isArray(e))return e.map(function(e){return ae(e,n,t)});if(null!==e&&"object"===v(e)){var r={};return Object.keys(e).forEach(function(o){o===n&&void 0!==e[t]?r[o]=e[t]:o===t&&void 0!==e[n]?r[o]=e[n]:r[o]=ae(e[o],n,t)}),r}return e}function se(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 ue(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)?ue(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,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,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function ue(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ve=function(n,t,r,o){var i,s,u,d,f=o.res,p=o.sres,m=a.getPlayer(n),y=(null==f?void 0:f.contentType)||"video",g=(null==f?void 0:f[y].drmEnabled)||!1,h=(null==f||null===(i=f[y])||void 0===i||null===(s=i.streamingInfo)||void 0===s?void 0:s.isLiveStream)||!1,w=(null==f||null===(u=f[y])||void 0===u||null===(d=u.liveDetails)||void 0===d?void 0:d.isDvrEnabled)||!1;e.setCurrentVideo(f),m&&(m.on("loadstart",function(){h?r.resolve({status:!0,msg:"Video Loaded",response:f}):r.resolve(de({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:f}:{response:f}))}),m.on("loadeddata",function(){var r,o,i,s=l.getCaptions(n);if(null==s||s.map(function(e){return l.disableCaptions(n,e.id)}),w&&"Safari"===c.detectBrowser())try{var u;null==m||null===(u=m.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&b(n,sessionStorage.getItem("volume")||"100");var d=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var v,p,y=de(de({},t),f);!function(e,n,t){var r,o,i;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(ne=null==n||null===(o=n.series)||void 0===o?void 0:o.id),Z=[],ee=0,G=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,s=a.getPlayer(e);s&&(s.on("timeupdate",function(){var e=Math.floor(s.currentTime());Z.includes(ee)||(e==ee?(Z.push(e),te(s,n,l)):e>ee&&(ee=e+l))}),s.one("ended",function(){te(s,n,l,!0)}))}(n,y,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(i=t.analytics)&&void 0!==i&&i.muxKey&&null!=m&&m.mux){var g,h,k,S,O,j,P=(null===(g=e.getCurrentVideo())||void 0===g?void 0:g.video)||(null==f?void 0:f.video),T=null==P?void 0:P.gist,I={env_key:null==t||null===(h=t.analytics)||void 0===h?void 0:h.muxKey,player_name:"vl-web-player",player_version:null===(k=window)||void 0===k?void 0:k.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==P||null===(S=P.series)||void 0===S?void 0:S.title,video_stream_type:null!=P&&null!==(O=P.streamingInfo)&&void 0!==O&&O.isLiveStream?"live":"video",viewer_user_id:null==t||null===(j=t.analytics)||void 0===j?void 0:j.userId};m.mux({debug:!1,data:I})}}),m.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,r,o,i,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(i=o.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,y=p.getMediaSession(),g=y.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}}),m.tech_.on("retryplaylist",function(){h&&le(f,n)}),m.on("error",function(){var t,o;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?le(f,n):(e.handleError(n,(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==m||null===(o=m.error())||void 0===o?void 0:o.message)||"Some error occured",response:f}))}),m.one("play",function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r,o,i,l=null===(r=e.getCurrentVideo())||void 0===r||null===(o=r.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout(function(){m.currentTime(u)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(h){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if("object"==v(m.dash)){var t,r,o,i=null==m||null===(t=m.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),l=null==i?void 0:i.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=se(n);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(l&&(null==s?void 0:s.id)=="dash-audio-".concat(l.index)){s.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var u,d=se(n);try{for(d.s();!(u=d.n()).done;){var f,p,y,h=u.value;("Chrome"==c.detectBrowser()||"Edge"==c.detectBrowser()&&(null!==(f=navigator)&&void 0!==f&&null!==(p=f.userAgent)&&void 0!==p&&p.includes("Macintosh")||!g))&&null!=h&&null!==(y=h.label)&&void 0!==y&&y.includes("5.1")?m.audioTracks().removeTrack(h):"main"==h.kind?h.enabled=!0:h.enabled=!1}}catch(e){d.e(e)}finally{d.f()}}}))};var fe,pe=(fe=!0,{enable:function(){fe=!0},disable:function(){fe=!1},get enabled(){return fe}});function me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?me(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ge(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 he(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)?he(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,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,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function he(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var be,we=(be="",{set:function(e){e&&(be=e)},get:function(){return be}});function ke(e,n){return Se.apply(this,arguments)}function Se(){return(Se=t(r.mark(function n(t,o){var i,l,s,u,c,d,v,f,m,y,g,h,b,w;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a.getPlayer(t),i=e.getSource(o,t),l=i.src,s=l.replace("/dash/","/session/").replace("master","session"),s=e.replaceMacros(s,t,o),u=Oe(s),c=p(u,2),d=c[0],v=c[1],s=new URL(s.split("?")[0]),Object.keys(v).length>0&&Object.entries(v).forEach(function(e){var n=p(e,2),t=n[0],r=n[1];s.searchParams.set(t,r)}),n.prev=8,n.next=11,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:ye({},d)})});case 11:return f=n.sent,n.next=14,f.json();case 14:return m=n.sent,y="https://"+new URL(s).hostname,g=m.trackingUrl,h=m.manifestUrl,b=y+g,w=y+h,we.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),i.src=w,n.abrupt("return",i);case 26:return n.prev=26,n.t0=n.catch(8),n.abrupt("return",i);case 29:case"end":return n.stop()}},n,null,[[8,26]])}))).apply(this,arguments)}function Oe(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var r,o=ge(t.split("&"));try{for(o.s();!(r=o.n()).done;){var i=r.value.split("="),l=p(i,2),a=l[0],s=l[1];n[decodeURIComponent(a)]=decodeURIComponent(s||"")}}catch(e){o.e(e)}finally{o.f()}for(var u={},c={},d=0,v=Object.entries(n);d<v.length;d++){var f=p(v[d],2),m=f[0],y=f[1];if(m.startsWith("ads."))u[m.replace(/^ads\./,"")]=y;else c[m]=y}return[u,c]}function je(){return je=t(r.mark(function e(n,o){var i,l,s,u,c,d;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d=function(e,t,r,o,i){var l=a.getPlayer(n);if(!l.seeking()){t.startTimeInSeconds,t.durationInSeconds,Math.floor(l.currentTime());var s,d=ge(r);try{for(d.s();!(s=d.n()).done;){var v,f,p,m=s.value,y=m.eventType,g=m.beaconUrls,h=m.startTimeInSeconds,b=m.startTime,w=m.durationInSeconds,k=h||0,S=g,O=(null===(v=window)||void 0===v||null===(f=v.customData)||void 0===f||null===(p=f.ads)||void 0===p?void 0:p.adEventHandler)||null,j="".concat(k,"_").concat(y),P=u.get("pod-".concat(i))||[];if(console.warn(e,k,"map:",y,"condition1:",e>=k,"map:",u),e>=k&&!P.includes(j)){P.push(j),u.set("pod-".concat(i),P);try{c(y,t,S,l)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,t)}if("function"==typeof O)try{var T;O({adsData:{eventType:y,startTimeInSeconds:h,startTime:b,durationInSeconds:w,ad:null==t||null===(T=t.ads)||void 0===T?void 0:T[o],adIndex:o}})}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){d.e(e)}finally{d.f()}}},c=function(e,n,t,r){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),null==t||t.forEach(function(e){fetch(e,{mode:"no-cors"}).catch(function(n){console.warn("Beacon failed:",e,n)})})},s=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},i=we.get(),a.getPlayer(n).one("loadeddata",function(){i&&l(i)}),l=function(){var e=t(r.mark(function e(t){var o,i,l,u,c,v,p,m,y,g,h,b,w,k,S,O,j,P,T,I,E,D,C;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return T=function(e){document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",T),0===e.button&&j()},P=function(e){},j=function(){var e,n=y.currentTime(),t=null,r=ge(m);try{for(r.s();!(e=r.n()).done;){var o=e.value,i=o.startTimeInSeconds,l=o.durationInSeconds,a=o.ads,s=Math.floor(i+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>i)&&!b.has(i)||n>=i&&n<=s)&&(t=i,b.set(i,!0))}}catch(e){r.e(e)}finally{r.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){y.currentTime(t+.4)},100))},e.next=5,fetch(t);case 5:return c=e.sent,e.next=8,c.json();case 8:v=e.sent,p=v.avails,m=[],y=a.getPlayer(n),g=y.controlBar.progressControl,h=g.seekBar.el(),p.map(function(e){var n,t;m.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:(null==e||null===(n=e.adBreakTrackingEvents)||void 0===n||null===(t=n.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===t?void 0:t[0])||[]})}),m.forEach(function(e){var n=e.markerPositionInSeconds,t=e.ads,r=y.duration();if(!(n>r||Array.isArray(t)&&0==(null==t?void 0:t.length))){var o=n/r*100,i=document.createElement("div");i.className="vjs-seekbar-marker",i.style.left="".concat(o,"%"),i.style.position="absolute",i.style.top="0",i.style.bottom="0",i.style.width="2px",i.style.backgroundColor="#fecc09",i.style.left="".concat(o,"%"),i.style.pointerEvents="none",h.appendChild(i)}}),b=new Map,w=-1,k=(null===(o=document)||void 0===o||null===(i=o.getElementsByClassName("tvProviderImage"))||void 0===i?void 0:i[0])||null,S=(null==y||null===(l=y.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,O=(null==y||null===(u=y.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,j(),y.on("timeupdate",a.throttle(function(){var e=y.currentTime();if(e!==w){w=e;for(var n=!1,t=function(){var t=m[r],o=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,a=o+i;if(e>=o-2.5&&e<=a+2.5){e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&b.set(o,!0),pe.disable(),k&&k.classList.add("vjs-hidden"),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),O&&(O.el().style.pointerEvents="none",O.el().classList.add("vjs-hidden")),g.el().style.visibility="hidden";for(var u=e-o,c=0,v=0,p=0;p<l.length;p++){var y,h=null==l||null===(y=l[p])||void 0===y?void 0:y.durationInSeconds;if(u<c+h){v=p;break}c+=h}var w=l[v],j=u-c,P=Math.max(0,(null==w?void 0:w.durationInSeconds)-j),T=Math.round(P);I.style.display="block",C.textContent="".concat(v+1," of ").concat(l.length," • ").concat(s(T));var E=[];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)});E.push.apply(E,f(n))}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&E.push(null==t?void 0:t.podSlotImpressionBeacon),d(e,t,E,v,r),"break"}},r=0;r<m.length;r++){if("break"===t())break}n||(I.style.display="none",g.el().style.visibility="visible",S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),O&&(O.el().style.pointerEvents="auto",O.el().classList.remove("vjs-hidden")),k&&k.classList.remove("vjs-hidden"),pe.enable())}},1e3)),g.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",P),document.addEventListener("pointerup",T))}),(I=document.createElement("div")).className="ssai-ad-container",(E=document.createElement("div")).className="sponsored-adbox",(D=document.createElement("div")).className="sponsored-text",D.textContent="Sponsored Ad",E.append(D),(C=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",I.append(E),I.append(C),y.el().appendChild(I);case 40:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),u=new Map;case 9:case"end":return e.stop()}},e)})),je.apply(this,arguments)}function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ie=function(i,s,u,d){var v,f,p,m,y,g,h,b,w,k,O,j,P,T,I,E,D,C,A,L,N,R,V,M,_,B,U=s.res,H=void 0===U?null:U,q=s.sres,F=void 0===q?null:q,W=null!=u&&u.chromecastReceiverId?["chromecast","html5"]:["html5"],G=(null===(v=H)||void 0===v?void 0:v.contentType)||"video",K=a.impolicy16x9(null===(f=H)||void 0===f||null===(p=f[G])||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.videoImageUrl)||a.impolicy16x9(null===(y=H)||void 0===y||null===(g=y[G])||void 0===g||null===(h=g.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),z=(null===(w=H)||void 0===w||null===(k=w[G])||void 0===k||null===(O=k.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,J=(null===(j=H)||void 0===j||null===(P=j[G])||void 0===P||null===(T=P.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,Y=e.getAdsURL(H);H=Te(Te({},H),{},{audioAssetSource:null==u?void 0:u.audioAssetSource});var $="MEDIA_TAILOR"==(null===(I=window)||void 0===I||null===(E=I.app_data)||void 0===E||null===(D=E.appcmsMain)||void 0===D||null===(C=D.adsConfig)||void 0===C?void 0:C.vodAdSticherProvider)||!1,Z=(null==u?void 0:u.latency)||6,ee=(_={enableSmoothSeeking:!0,controls:0!=(null==u?void 0:u.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==u?void 0:u.muted)||!1,autoplay:(null==u?void 0:u.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==u.skin,liveui:z},n(_,"autoplay",null==u?void 0:u.autoplay),n(_,"normalizeAutoplay",(null==u?void 0:u.autoplay)&&!Y),n(_,"loop",(null==u?void 0:u.loop)||!1),n(_,"audioPosterMode",null==u?void 0:u.audioPosterMode),n(_,"html5",Te(Te({dash:Te(Te(Te({},!o.browser.IS_SAFARI&&{useTTML:!0}),(null==u?void 0:u.debugConfig)&&(null==u||null===(A=u.debugConfig)||void 0===A?void 0:A.enable)&&{debug:!0,logLevel:null!=u&&null!==(L=u.debugConfig)&&void 0!==L&&L.logLevel?null==u||null===(N=u.debugConfig)||void 0===N?void 0:N.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:Z},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Te({},"IE"==c.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Te(Te({liveRangeSafeTimeDelta:Z,useDevicePixelRatio:!0,experimentalLLHLS:(null==u?void 0:u.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==u||null===(R=u.customData)||void 0===R?void 0:R.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),debug:!0,nativeTextTracks:"Safari"==c.detectBrowser()},0==(null==u||null===(V=u.customData)||void 0===V?void 0:V.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==u||null===(M=u.customData)||void 0===M?void 0:M.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(_,"poster",K),n(_,"techOrder",W),n(_,"chromecast",{requestCustomDataFn:function(e){var n=a.getPlayer(i),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind});return function(e,n,t){var r,o,i,l,a,s,u,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,y,g,h,b,w,k,S;p.isDrmEnabled=!0;var O=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,j=(null==O?void 0:O.url)||(null==n||null===(y=n.keySystemOptions)||void 0===y||null===(g=y[0])||void 0===g||null===(h=g.options)||void 0===h?void 0:h.serverURL);p.licenseUrl=j;var P=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=P}var T=(null==e||null===(r=e[f])||void 0===r||null===(o=r.gist)||void 0===o?void 0:o.contentType)||"VIDEO";p.contentType=T;var I=null==e||null===(i=e[f])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;p.duration=I;var E=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=E;var D=null==e||null===(u=e[f])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=D,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(H,e,t)},modifyLoadRequestFn:function(e){var n,t,r,o,l,s=a.getPlayer(i),u=(null==s?void 0:s.currentSource())||{};!(null===(n=H)||void 0===n||null===(t=n[G])||void 0===t||null===(r=t.streamingInfo)||void 0===r||null===(o=r.videoAssets)||void 0===o?void 0:o.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),_);if(!o.getPlayers()[i]){null!==(B=window)&&void 0!==B&&B.customData.isSmartTV&&(ee.spatialNavigation={enabled:!0,horizontalSeek:!0}),o.log.level("debug");var ne=o(i,ee,function(){var n=t(r.mark(function n(){var t,a,s,c,v,f,p,m,y,g,h,b,w,k,O,j,P,T,I,E,D;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ne),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,x(u,H);case 5:if(null!==(t=window)&&void 0!==t&&t.customData.isSmartTV&&ne.spatialNavigation.start(),w=null===(a=H)||void 0===a||null===(s=a[G])||void 0===s||null===(c=s.liveDetails)||void 0===c?void 0:c.startOverTime,J&&d.resolve(Te({status:!0,msg:"Player Initialised"},F?{seriesResponse:F,response:H}:{response:H})),e.inititateBeacon(i,null==u?void 0:u.analyticsCb),Q(i,u),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),z&&S(i,w),!Y||null!=u&&null!==(v=u.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(i,Y,H),k=e.getSource(H,i),console.log(k),null!=u&&u.nearestClusterUrl&&(k=e.getUpdatedClusterSource(k,u.nearestClusterUrl)),!$){n.next=20;break}return n.next=19,ke(i,H);case 19:k=n.sent;case 20:k?e.loadVideo(i,k):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:H}),e.handleError(i,"Incompatible / Missing Source")),((null===(f=H)||void 0===f||null===(p=f[G])||void 0===p||null===(m=p.contentDetails)||void 0===m||null===(y=m.closedCaptions)||void 0===y?void 0:y.length)>0||(null===(g=H)||void 0===g||null===(h=g[G])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(D=(null===(j=H)||void 0===j||null===(P=j[G])||void 0===P||null===(T=P.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null===(I=H)||void 0===I||null===(E=I[G])||void 0===E?void 0:E.closedCaptions),O=D.filter(function(e){return"VTT"===e.format}),l.addCaptions(i,O)),null!=u&&u.disableControls?e.disableControls(i):X(i,Te(Te(Te({},u),ee),{},{liveVideo:J,isDvrEnabled:z,res:H,sres:F})),ve(i,Te(Te(Te({},u),ee),{},{liveVideo:J}),d,{res:H,sres:F});case 24:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}},Ee={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function De(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var xe,Ae=function(e,n){var t=n.resolve,r=n.reject,o=null==e?void 0:e.playerId,i=Le(e);Ie(o,{res:i},e,{resolve:t,reject:r})},Le=function(n){var t,r,o=null==n?void 0:n.streamingInfo,i=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,l=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.isDrmEnabled)||null,a=null==n?void 0:n.token,s=e.getDecodedToken(a),u=null==s?void 0:s.site;return Ce(Ce({id:null==Ee?void 0:Ee[u]},!l&&{directPlaybackUrl:null==i?void 0:i.url}),{},{video:{drmEnabled:l,streamingInfo:{videoAssets:{widevine:null==i?void 0:i.widevine,fairPlay:null==i?void 0:i.fairPlay,playReady:null==i?void 0:i.playReady}},liveDetails:{isDvrEnabled:null==o?void 0:o.isDvrEnabled}}})};function Ne(e,n){return Re.apply(this,arguments)}function Re(){return(Re=t(r.mark(function n(t,o){var i,l,a,s,u,c;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=o.resolve,l=o.reject,a=null==t?void 0:t.videoId,s=null==t?void 0:t.playerId,u=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:c=n.sent,e.getVideoDetails(a,c).then(function(n){var r,o,d,v;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(o=r.video)||void 0===o||null===(d=o.gist)||void 0===d?void 0:d.contentType,e.setCurrentVideo(null==n?void 0:n.data);var f,p=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(v=t.watchHistory)&&void 0!==v&&v.enable&&!u)if((null===(f=t.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,y,g,h=oe((null===(m=t.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==t?void 0:t.siteOwner);if(h&&h.length)t.watchHistoryResumeTime=(null===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Ie(s,{res:p},t,{resolve:i,reject:l})}else e.getVideoInfo(a,c).then(function(e){var n,r,o,i,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,r,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(o=r.watchHistory)||void 0===o||o.cb(e))}).finally(function(){Ie(s,{res:p},t,{resolve:i,reject:l})});else Ie(s,{res:p},t,{resolve:i,reject:l})}).catch(function(n){e.initiateErrorHandling(n,s,l,a)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ve(e,n){return Me.apply(this,arguments)}function Me(){return(Me=t(r.mark(function n(t,o){var i,l,a,s,u;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=o.resolve,l=o.reject,n.next=3,e.getToken();case 3:a=n.sent,s=null==t?void 0:t.playerId,u=null==t?void 0:t.epg,e.getLinearChannelDetails(u,a).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,Ie(s,{res:n},t,{resolve:i,reject:l})}).catch(function(n){e.initiateErrorHandling(n,s,l,videoId)});case 7:case"end":return n.stop()}},n)}))).apply(this,arguments)}function _e(e,n){return Be.apply(this,arguments)}function Be(){return(Be=t(r.mark(function n(t,o){var i,l,a,s,u,c,d;return r.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=o.resolve,a=o.reject,n.next=3,e.getToken();case 3:s=n.sent,u=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(c)),d=null==t||null===(i=t.series)||void 0===i?void 0:i.id,e.getSeriesDetails(d,s).then(function(n){var r,o,i,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var f=videoId||(null==v||null===(r=v[0])||void 0===r||null===(o=r.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);e.createSeriesWatchMap(d,s),e.getVideoDetails(f,s).then(function(n){var r,o,i;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(o=r.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,e.setCurrentVideo(n.data),Ie(u,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,u,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,u,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function He(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:i.onTimeUpdate,getVideoDuration:i.getVideoDuration,getVideoCurrentTime:i.getVideoCurrentTime,onVideoEnded:i.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=t(r.mark(function t(o,i){var l,s,u,c,v,f,p,y,g,h,b,w,k,S,O,j,P,T,I,E,C,x,A;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(b=(null==n?void 0:n.videoSourceUrl)||!1,w=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,S=null==n?void 0:n.videoId,O=(null==n||null===(s=n.series)||void 0===s?void 0:s.enable)||!1,j=(null==n?void 0:n.streamingInfo)||!1,window.videoId=S,P=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",P),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),P&&!e.isTokenExpired(P)){t.next=16;break}return i({status:!1,msg:"".concat(P?"Token is expired !":"Missing Authorization Token"),response:{token:P}}),t.abrupt("return");case 16:xe=JSON.parse(atob(P.split(".")[1]));case 17:return n.isAnonymousUser=!(null===(u=xe)||void 0===u||!u.anonymousId),n.siteOwner=(null===(c=xe)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=xe)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=xe)||void 0===f?void 0:f.userId),window.watchHistory=n.watchHistory||null,T=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(p=n.series)&&void 0!==p&&p.enable?null:null==n?void 0:n.chromecastReceiverId,I=(null==n||null===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(E=null==n?void 0:n.errors)&&(window.customErrors=E),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(g=n.customData)||void 0===g?void 0:g.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!a.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=33,D(n);case 33:I&&m("https://www.googletagmanager.com/gtag/js?id=".concat(I)).then(function(){return e.runGtag(I)}).catch(function(e){}),(C=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(T)))&&C.addEventListener("contextmenu",function(e){return e.preventDefault()}),b?(A={directPlaybackUrl:b,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},w?e.getVideoDetails(x,P).then(function(e){var t=(null==e?void 0:e.data)||{};Ie(T,{res:He(He({},t),A)},n,{resolve:o,reject:i})}).catch(function(n){e.initiateErrorHandling(n,T,i,x)}):Ie(T,{res:A},n,{resolve:o,reject:i})):j?Ae(n,{resolve:o,reject:i}):O?_e(n,{resolve:o,reject:i}):k?Ve(n,{resolve:o,reject:i}):Ne(n,{resolve:o,reject:i});case 37:case"end":return t.stop()}},t)}));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:s.getRenditions,skip:e.skip,getPlayer:a.getPlayer,play:e.play,pause:e.pause,isPaused:e.isPaused,detectBrowser:c.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:i.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,getAudioTracks:g,enableAudioTrack:h,playSelectedResolution:u.playSelectedResolution,getSource:e.getSource,setVolume:b,getVolume:w,disableControls:e.disableControls,setPlaybackSpeed:i.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}},exports.initialiseKeyboardEvents=function(n,t){var r,o,i,l=a.getPlayer(n),s=null==l||null===(r=l.controlBar)||void 0===r||null===(o=r.playToggle)||void 0===o?void 0:o.el_,u=document.getElementsByTagName("video")[0];null===(i=document)||void 0===i||i.addEventListener("keydown",function(r){var o;if(pe.enabled&&"input"!=r.target.localName){var i=r.key,a=!0===t.liveVideo||!0===t.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(i)&&(r.preventDefault(),null==u||u.focus()),i){case" ":null==s||s.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":a&&!1===t.liveui||e.rewind(n,10);break;case"ArrowRight":a||e.skip(n,10)}}},!0)},exports.setupAdvertisementMarkers=function(e,n){return je.apply(this,arguments)};
|
package/cjs/index-865afc31.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-d56b38ac.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("./util-c1962d91.js"),r=require("./captions-3c7ca3a7.js"),l=require("./skin-3397dca5.js"),a=require("./renditions-26c6d0df.js"),s=require("./resolution-5a0df2be.js"),u=require("./browser-38ff3331.js"),d=require("./localisation-56e0a999.js"),c=require("@babel/runtime/helpers/defineProperty"),v=require("@babel/runtime/helpers/typeof"),f=require("@babel/runtime/helpers/slicedToArray"),p=function(e){return new Promise(function(n,t){if(m(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}})},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(e){var n,t=l.getPlayer(e);return(null==t||null===(n=t.audioTracks())||void 0===n?void 0:n.tracks_)||[]||[]},h=function(e,n){for(var t=l.getPlayer(e).audioTracks().tracks_||[],o=0;o<t.length;o++){var i=t[o];i.id==n?i.enabled=!0:i.enabled=!1}},y=function(e,n,t){var o=l.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var n=l.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var e=n(t.mark(function e(n){var i,r,a,s,d;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=l.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,p("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(o),e.finish(13);case 16:(d=o.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(a=window)&&void 0!==a&&a.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.airplay&&"Safari"==u.detectBrowser()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}},e,null,[[5,10,13,16]])}));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t=l.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,i,r,l,a,s=this.el(),u=o.dom.getPointerPosition(s,n).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(r=i.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*u,v.seek()}})};var S=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),p("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){}).catch(function(e){return console.log(e)})]);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),T=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),I=function(){var e=n(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(o),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),E=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./index-8606834d.js")});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}},e,null,[[0,5]])}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=n(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then(function(){return require("./videojs-dash5.es-3cd3423d.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),x=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){p("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(o)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(o)})},loadAdsLibrary:S,loadEMELibrary:T,loadMuxPlugin:I,loadDvrSeekbar:E,loadContribDash:C});function P(e){return j.apply(this,arguments)}function j(){return(j=n(t.mark(function e(n){var o;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=(null==n?void 0:n.airplay)||!1,e.next=3,S();case 3:o&&"Safari"==u.detectBrowser()&&Promise.resolve().then(function(){return x}).then(function(e){e.importAirplay()});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function A(e,n){return D.apply(this,arguments)}function D(){return(D=n(t.mark(function e(n,o){var i,r,l,a,s,d,c,v,f,p;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=(null==o?void 0:o.contentType)||"video",v=null==o||null===(i=o[c])||void 0===i?void 0:i.drmEnabled,null==o||null===(r=o[c])||void 0===r||null===(l=r.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==o||null===(a=o[c])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==u.detectBrowser()?T():"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?C():T():"Safari"!=u.detectBrowser()&&f?C():null,w(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}},e,null,[[5,10]])}))).apply(this,arguments)}var L=new Set,N=null,R=function(n,t,o){var i,r,l,a,s,u,d,c={},v=(null==n?void 0:n.contentType)||"video";c["c3.cm.id"]=(null===(i=n[v])||void 0===i?void 0:i.id)||"Null",c["c3.cm.contentType"]=H(n),c[null==o||null===(r=o.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==n||!n.linearchannel),c[null==o||null===(l=o.Constants)||void 0===l?void 0:l.STREAM_URL]=t.currentSrc(),c[null==o||null===(a=o.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),c["c3.cm.categoryType"]=_(n),c["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),c.DRMEnabled=(null===(s=n[v])||void 0===s?void 0:s.drmEnabled)||"None",c.DAIStream=null!==(u=n[v])&&void 0!==u&&null!==(d=u.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",c[o.Constants.DEFAULT_RESOURCE]="AKAMAI",c["c3.cm.brand"]="NULL",c.CDVREnabled=B(n),c["c3.cm.genreList"]=V(n),c["c3.cm.genre"]=O(n),c["c3.cm.channel"]=M(n);var f=F(e.getCurrentSeries(),n);return c=Object.assign({},c,f)},O=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},V=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map(function(e){return null==e?void 0:e.title}).join(", ")||"Null"},M=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},_=function(e){return(null==e?void 0:e.contentType)||"null"},B=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},U=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},H=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var q,F=function(n,t){var o,i,r,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),d=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(o=t.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(r=n[u-1])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",s},W=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},G=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},K=function(){var o=n(t.mark(function n(o,i){var r,a,s,u,d,c,v,f,p,m;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(r=(null==i?void 0:i.convivaConfig)||{},a=r.trackConvivaPlayerEvent,s=r.paymentHandler,u=r.tveProvider,d=r.enable,c=r.appName,v=(i||{}).token,d){n.next=4;break}return n.abrupt("return");case 4:if(f=l.getPlayer(o),"function"==typeof(p=a)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,p("getConvivaObject");case 10:if(m=n.sent){n.next=13;break}return n.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=W(t.keySystem);p("contentInfo",{DRMEnabled:o})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var n,t;N&&N!==f.currentSrc()&&p("playbackEnded"),p("setPlayer",f),L.clear(),N=f.currentSrc();var o=G(f.currentType()),r=e.getCurrentVideo(),l=R(r,f,m);l[null==m||null===(n=m.Constants)||void 0===n?void 0:n.PLAYER_NAME]=c||"WEB",l[null==m||null===(t=m.Constants)||void 0===t?void 0:t.ASSET_NAME]=U(r,i),l.authToken=v||"NULL",l.streamType=o,l.D2CType=s||"NONE",l.subscriberType=u||(s?"D2C":"FREE"),l["c3.cm.affiliate"]=u||"NULL",p("contentInfo",l)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),f.on("play",function(){L.has(f.currentSrc())||(L.add(f.currentSrc()),p("playbackStarted",null))}),f.on("ended",function(){L.has(f.currentSrc())&&L.delete(f.currentSrc()),p("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==L||L.clear(),p("playbackEnded")});case 20:case"end":return n.stop()}},n)}));return function(e,n){return o.apply(this,arguments)}}(),z=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-b5651b5b.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-6db027fa.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-2fa52c29.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-61950a20.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-d1d871d1.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-edc7bca4.js")}).then(function(t){t.initialiseSkin(e,n)}):"VL_SmartTV"==t&&Promise.resolve().then(function(){return require("./skin-95e27a9f.js")}).then(function(t){t.initialiseSkin(e,n)})},J=[],Q=0,X=null;function Y(n,t,o){var i,r,l,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(n.currentTime()),f=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var p=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,m=(null==t||null===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,g=Math.floor(n.currentTime()),h=u?100:Math.floor(v/f*100),y={};m?function(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=$(i),l=(new Date).getTime(),a=e.getCurrentVideo(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return Object.assign({},e,c({},n,s[n]))},{}),d=r.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===q});d<0?r.push(Object.assign({content:u},n,{addedDate:l,updateDate:l})):r[d]=Object.assign({},r[d],n,{updateDate:l});localStorage.setItem("".concat(i),JSON.stringify(r))}(y={completed:u,watchedTime:g,watchedPercentage:h},d,t.siteOwner):(y=Object.assign({videoId:q,watchedTime:g,watchedPercentage:h,doneWatching:u,profileId:d},X&&{seriesId:X},p&&{originalObjectId:p}),e.saveWatchHistory(y).then(function(e){}).catch(function(e){})),Q=v+o}function $(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Z(e,n,t){var o=$(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var ee=!1,ne=function(n,t){var o,i,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[r])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ee){var l=te(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ee=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function te(e,n,t){if(Array.isArray(e))return e.map(function(e){return te(e,n,t)});if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=te(e[i],n,t)}),o}return e}function oe(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 ie(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)?ie(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 ie(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 re=function(n,t,o,i){var a,s,d,c,f=i.res,p=i.sres,m=l.getPlayer(n),g=(null==f?void 0:f.contentType)||"video",h=(null==f?void 0:f[g].drmEnabled)||!1,b=(null==f||null===(a=f[g])||void 0===a||null===(s=a.streamingInfo)||void 0===s?void 0:s.isLiveStream)||!1,w=(null==f||null===(d=f[g])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.isDvrEnabled)||!1;e.setCurrentVideo(f),m&&(m.on("loadstart",function(){b?o.resolve({status:!0,msg:"Video Loaded",response:f}):o.resolve(Object.assign({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:f}:{response:f}))}),m.on("loadeddata",function(){var o,i,a,s=r.getCaptions(n);if(null==s||s.map(function(e){return r.disableCaptions(n,e.id)}),w&&"Safari"===u.detectBrowser())try{var d;null==m||null===(d=m.liveTracker)||void 0===d||d.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&y(n,sessionStorage.getItem("volume")||"100");var c=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,g=Object.assign({},t,f);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(X=null==n||null===(i=n.series)||void 0===i?void 0:i.id),J=[],Q=0,q=t;var a=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,s=l.getPlayer(e);s&&(s.on("timeupdate",function(){var e=Math.floor(s.currentTime());J.includes(Q)||(e==Q?(J.push(e),Y(s,n,a)):e>Q&&(Q=e+a))}),s.one("ended",function(){Y(s,n,a,!0)}))}(n,g,null==c||null===(v=c.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(a=t.analytics)&&void 0!==a&&a.muxKey&&null!=m&&m.mux){var h,b,k,S,T,I,E=(null===(h=e.getCurrentVideo())||void 0===h?void 0:h.video)||(null==f?void 0:f.video),C=null==E?void 0:E.gist,x={env_key:null==t||null===(b=t.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(k=window)||void 0===k?void 0:k.vl_player_version,video_id:null==C?void 0:C.id,video_title:null==C?void 0:C.title,video_series:null==E||null===(S=E.series)||void 0===S?void 0:S.title,video_stream_type:null!=E&&null!==(T=E.streamingInfo)&&void 0!==T&&T.isLiveStream?"live":"video",viewer_user_id:null==t||null===(I=t.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:x})}}),m.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,i,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var m,g=p.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}}),m.tech_.on("retryplaylist",function(){b&&ne(f,n)}),m.on("error",function(){var t,i;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&b)?ne(f,n):(e.handleError(n,(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==m||null===(i=m.error())||void 0===i?void 0:i.message)||"Some error occured",response:f}))}),m.one("play",function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var o,i,r,l=null===(o=e.getCurrentVideo())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,d=s.p;u&&d<95&&setTimeout(function(){m.currentTime(u)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(b){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if("object"==v(m.dash)){var t,o,i,r=null==m||null===(t=m.dash)||void 0===t||null===(o=t.mediaPlayer)||void 0===o?void 0:o.getTracksFor("audio"),l=null==r?void 0:r.find(function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")}),a=oe(n);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(l&&(null==s?void 0:s.id)=="dash-audio-".concat(l.index)){s.enabled=!0;break}}}catch(e){a.e(e)}finally{a.f()}}else{var d,c=oe(n);try{for(c.s();!(d=c.n()).done;){var f,p,g,y=d.value;("Chrome"==u.detectBrowser()||"Edge"==u.detectBrowser()&&(null!==(f=navigator)&&void 0!==f&&null!==(p=f.userAgent)&&void 0!==p&&p.includes("Macintosh")||!h))&&null!=y&&null!==(g=y.label)&&void 0!==g&&g.includes("5.1")?m.audioTracks().removeTrack(y):"main"==y.kind?y.enabled=!0:y.enabled=!1}}catch(e){c.e(e)}finally{c.f()}}}))};var le,ae=(le=!0,{enable:function(){le=!0},disable:function(){le=!1},get enabled(){return le}});function se(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 ue(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)?ue(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 ue(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 de,ce=(de="",{set:function(e){e&&(de=e)},get:function(){return de}});function ve(e,n){return fe.apply(this,arguments)}function fe(){return(fe=n(t.mark(function n(o,i){var r,a,s,u,d,c,v,p,m,g,h,y,b,w;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l.getPlayer(o),r=e.getSource(i,o),a=r.src,s=a.replace("/dash/","/session/").replace("master","session"),s=e.replaceMacros(s,o,i),u=pe(s),d=f(u,2),c=d[0],v=d[1],s=new URL(s.split("?")[0]),Object.keys(v).length>0&&Object.entries(v).forEach(function(e){var n=f(e,2),t=n[0],o=n[1];s.searchParams.set(t,o)}),n.prev=8,n.next=11,fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:Object.assign({},c)})});case 11:return p=n.sent,n.next=14,p.json();case 14:return m=n.sent,g="https://"+new URL(s).hostname,h=m.trackingUrl,y=m.manifestUrl,b=g+h,w=g+y,ce.set(b),console.log("%c TRACKING URL","background: #bdf369; color: #000",b),r.src=w,n.abrupt("return",r);case 26:return n.prev=26,n.t0=n.catch(8),n.abrupt("return",r);case 29:case"end":return n.stop()}},n,null,[[8,26]])}))).apply(this,arguments)}function pe(e){var n={},t=e.split("?")[1];if(!t)return[{},{}];var o,i=se(t.split("&"));try{for(i.s();!(o=i.n()).done;){var r=o.value.split("="),l=f(r,2),a=l[0],s=l[1];n[decodeURIComponent(a)]=decodeURIComponent(s||"")}}catch(e){i.e(e)}finally{i.f()}for(var u={},d={},c=0,v=Object.entries(n);c<v.length;c++){var p=f(v[c],2),m=p[0],g=p[1];if(m.startsWith("ads."))u[m.replace(/^ads\./,"")]=g;else d[m]=g}return[u,d]}function me(){return me=n(t.mark(function e(o,i){var r,a,s,u,d,c;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:c=function(e,n,t,i,r){var a=l.getPlayer(o);if(!a.seeking()){n.startTimeInSeconds,n.durationInSeconds,Math.floor(a.currentTime());var s,c=se(t);try{for(c.s();!(s=c.n()).done;){var v,f,p,m=s.value,g=m.eventType,h=m.beaconUrls,y=m.startTimeInSeconds,b=m.startTime,w=m.durationInSeconds,k=y||0,S=h,T=(null===(v=window)||void 0===v||null===(f=v.customData)||void 0===f||null===(p=f.ads)||void 0===p?void 0:p.adEventHandler)||null,I="".concat(k,"_").concat(g),E=u.get("pod-".concat(r))||[];if(console.warn(e,k,"map:",g,"condition1:",e>=k,"map:",u),e>=k&&!E.includes(I)){E.push(I),u.set("pod-".concat(r),E);try{d(g,n,S,a)}catch(e){console.error("Error when calling triggerAdBeacon:",e,g,n)}if("function"==typeof T)try{var C;T({adsData:{eventType:g,startTimeInSeconds:y,startTime:b,durationInSeconds:w,ad:null==n||null===(C=n.ads)||void 0===C?void 0:C[i],adIndex:i}})}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){c.e(e)}finally{c.f()}}},d=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)})})},s=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},r=ce.get(),l.getPlayer(o).one("loadeddata",function(){r&&a(r)}),a=function(){var e=n(t.mark(function e(n){var i,r,a,u,d,v,f,p,m,g,h,y,b,w,k,S,T,I,E,C,x,P,j;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return E=function(e){document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",E),0===e.button&&T()},I=function(e){},T=function(){var e,n=m.currentTime(),t=null,o=se(p);try{for(o.s();!(e=o.n()).done;){var i=e.value,r=i.startTimeInSeconds,l=i.durationInSeconds,a=i.ads,s=Math.floor(r+l);(Array.isArray(a)&&(null==a?void 0:a.length)>0&&(n>s||n>r)&&!y.has(r)||n>=r&&n<=s)&&(t=r,y.set(r,!0))}}catch(e){o.e(e)}finally{o.f()}null!==t&&(console.log("Seeking back to ad pod:",t),setTimeout(function(){m.currentTime(t+.4)},100))},e.next=5,fetch(n);case 5:return d=e.sent,e.next=8,d.json();case 8:v=e.sent,f=v.avails,p=[],m=l.getPlayer(o),g=m.controlBar.progressControl,h=g.seekBar.el(),f.map(function(e){var n,t;p.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:(null==e||null===(n=e.adBreakTrackingEvents)||void 0===n||null===(t=n.filter(function(e){return"breakStart"==(null==e?void 0:e.eventType)}))||void 0===t?void 0:t[0])||[]})}),p.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",h.appendChild(r)}}),y=new Map,b=-1,w=(null===(i=document)||void 0===i||null===(r=i.getElementsByClassName("tvProviderImage"))||void 0===r?void 0:r[0])||null,k=(null==m||null===(a=m.controlBar)||void 0===a?void 0:a.getChild("videoSelector"))||null,S=(null==m||null===(u=m.controlBar)||void 0===u?void 0:u.getChild("seriesV2"))||null,T(),m.on("timeupdate",l.throttle(function(){var e=m.currentTime();if(e!==b){b=e;for(var n=!1,t=function(){var t=p[o],i=t.startTimeInSeconds,r=t.durationInSeconds,l=t.ads,a=i+r;if(e>=i-2.5&&e<=a+2.5){e<=a&&Array.isArray(l)&&(null==l?void 0:l.length)>0&&(n=!0),e>a&&y.set(i,!0),ae.disable(),w&&w.classList.add("vjs-hidden"),k&&(k.el().style.pointerEvents="none",k.el().classList.add("vjs-hidden")),S&&(S.el().style.pointerEvents="none",S.el().classList.add("vjs-hidden")),g.el().style.visibility="hidden";for(var u=e-i,d=0,v=0,f=0;f<l.length;f++){var m,h=null==l||null===(m=l[f])||void 0===m?void 0:m.durationInSeconds;if(u<d+h){v=f;break}d+=h}var b=l[v],T=u-d,I=Math.max(0,(null==b?void 0:b.durationInSeconds)-T),E=Math.round(I);C.style.display="block",j.textContent="".concat(v+1," of ").concat(l.length," • ").concat(s(E));var x=[];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)});x.push.apply(x,n)}),Array.isArray(l)&&0==(null==l?void 0:l.length)&&x.push(null==t?void 0:t.podSlotImpressionBeacon),c(e,t,x,v,o),"break"}},o=0;o<p.length;o++){if("break"===t())break}n||(C.style.display="none",g.el().style.visibility="visible",k&&(k.el().style.pointerEvents="auto",k.el().classList.remove("vjs-hidden")),S&&(S.el().style.pointerEvents="auto",S.el().classList.remove("vjs-hidden")),w&&w.classList.remove("vjs-hidden"),ae.enable())}},1e3)),g.el().addEventListener("pointerdown",function(e){0===e.button&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",E))}),(C=document.createElement("div")).className="ssai-ad-container",(x=document.createElement("div")).className="sponsored-adbox",(P=document.createElement("div")).className="sponsored-text",P.textContent="Sponsored Ad",x.append(P),(j=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",C.append(x),C.append(j),m.el().appendChild(C);case 40:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}(),u=new Map;case 9:case"end":return e.stop()}},e)})),me.apply(this,arguments)}var ge,he=function(i,a,s,d){var v,f,p,m,g,h,y,b,w,S,T,I,E,C,x,P,j,D,L,N,R,O,V,M,_,B,U=a.res,H=void 0===U?null:U,q=a.sres,F=void 0===q?null:q,W=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],G=(null===(v=H)||void 0===v?void 0:v.contentType)||"video",J=l.impolicy16x9(null===(f=H)||void 0===f||null===(p=f[G])||void 0===p||null===(m=p.gist)||void 0===m?void 0:m.videoImageUrl)||l.impolicy16x9(null===(g=H)||void 0===g||null===(h=g[G])||void 0===h||null===(y=h.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),Q=(null===(w=H)||void 0===w||null===(S=w[G])||void 0===S||null===(T=S.liveDetails)||void 0===T?void 0:T.isDvrEnabled)||!1,X=(null===(I=H)||void 0===I||null===(E=I[G])||void 0===E||null===(C=E.streamingInfo)||void 0===C?void 0:C.isLiveStream)||!1,Y=e.getAdsURL(H);H=Object.assign({},H,{audioAssetSource:null==s?void 0:s.audioAssetSource});var $="MEDIA_TAILOR"==(null===(x=window)||void 0===x||null===(P=x.app_data)||void 0===P||null===(j=P.appcmsMain)||void 0===j||null===(D=j.adsConfig)||void 0===D?void 0:D.vodAdSticherProvider)||!1,Z=(null==s?void 0:s.latency)||6,ee=(_={enableSmoothSeeking:!0,controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==s.skin,liveui:Q},c(_,"autoplay",null==s?void 0:s.autoplay),c(_,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!Y),c(_,"loop",(null==s?void 0:s.loop)||!1),c(_,"audioPosterMode",null==s?void 0:s.audioPosterMode),c(_,"html5",Object.assign({dash:Object.assign({},!o.browser.IS_SAFARI&&{useTTML:!0},(null==s?void 0:s.debugConfig)&&(null==s||null===(L=s.debugConfig)||void 0===L?void 0:L.enable)&&{debug:!0,logLevel:null!=s&&null!==(N=s.debugConfig)&&void 0!==N&&N.logLevel?null==s||null===(R=s.debugConfig)||void 0===R?void 0:R.logLevel:"DEBUG"},{updateSettings:{streaming:{delay:{liveDelay:Z},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:Object.assign({},"IE"==u.detectBrowser()&&{enableStallFix:!0,stallSeek:1}),abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Object.assign({liveRangeSafeTimeDelta:Z,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==s||null===(O=s.customData)||void 0===O?void 0:O.overrideNative)&&{overrideNative:!0},{enableLowInitialPlaylist:!0}),debug:!0,nativeTextTracks:"Safari"==u.detectBrowser()},0==(null==s||null===(V=s.customData)||void 0===V?void 0:V.nativeAudioTracks)&&{nativeAudioTracks:!1},0==(null==s||null===(M=s.customData)||void 0===M?void 0:M.nativeVideoTracks)&&{nativeVideoTracks:!1})),c(_,"poster",J),c(_,"techOrder",W),c(_,"chromecast",{requestCustomDataFn:function(e){var n=l.getPlayer(i),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind});return function(e,n,t){var o,i,r,l,a,s,u,d,c,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,g,h,y,b,w,k,S;p.isDrmEnabled=!0;var T=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,I=(null==T?void 0:T.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);p.licenseUrl=I;var E=(null==T?void 0:T.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);p.licenseToken=E}var C=(null==e||null===(o=e[f])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=C;var x=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;p.duration=x;var P=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=P;var j=null==e||null===(u=e[f])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=j,p.subTitles=t,p.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(H,e,t)},modifyLoadRequestFn:function(e){var n,t,o,r,a,s=l.getPlayer(i),u=(null==s?void 0:s.currentSource())||{};!(null===(n=H)||void 0===n||null===(t=n[G])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(a=u.src)&&void 0!==a&&a.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),_);if(!o.getPlayers()[i]){null!==(B=window)&&void 0!==B&&B.customData.isSmartTV&&(ee.spatialNavigation={enabled:!0,horizontalSeek:!0}),o.log.level("debug");var ne=o(i,ee,function(){var l=n(t.mark(function n(){var l,a,u,c,v,f,p,m,g,h,y,b,w,S,T,I,E,C,x,P,j;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(ne),console.log(o.VERSION),console.log(o.getPlugins()),n.next=5,A(s,H);case 5:if(null!==(l=window)&&void 0!==l&&l.customData.isSmartTV&&ne.spatialNavigation.start(),w=null===(a=H)||void 0===a||null===(u=a[G])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,X&&d.resolve(Object.assign({status:!0,msg:"Player Initialised"},F?{seriesResponse:F,response:H}:{response:H})),e.inititateBeacon(i,null==s?void 0:s.analyticsCb),K(i,s),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),Q&&k(i,w),!Y||null!=s&&null!==(v=s.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(i,Y,H),S=e.getSource(H,i),console.log(S),null!=s&&s.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,s.nearestClusterUrl)),!$){n.next=20;break}return n.next=19,ve(i,H);case 19:S=n.sent;case 20:S?e.loadVideo(i,S):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:H}),e.handleError(i,"Incompatible / Missing Source")),((null===(f=H)||void 0===f||null===(p=f[G])||void 0===p||null===(m=p.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=H)||void 0===h||null===(y=h[G])||void 0===y||null===(b=y.closedCaptions)||void 0===b?void 0:b.length)>0)&&(j=(null===(I=H)||void 0===I||null===(E=I[G])||void 0===E||null===(C=E.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(x=H)||void 0===x||null===(P=x[G])||void 0===P?void 0:P.closedCaptions),T=j.filter(function(e){return"VTT"===e.format}),r.addCaptions(i,T)),null!=s&&s.disableControls?e.disableControls(i):z(i,Object.assign({},s,ee,{liveVideo:X,isDvrEnabled:Q,res:H,sres:F})),re(i,Object.assign({},s,ee,{liveVideo:X}),d,{res:H,sres:F});case 24:case"end":return n.stop()}},n)}));return function(){return l.apply(this,arguments)}}())}},ye={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"},be=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=we(e);he(i,{res:r},e,{resolve:t,reject:o})},we=function(n){var t,o,i=null==n?void 0:n.streamingInfo,r=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,l=(null==n||null===(o=n.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,a=null==n?void 0:n.token,s=e.getDecodedToken(a),u=null==s?void 0:s.site;return Object.assign({id:null==ye?void 0:ye[u]},!l&&{directPlaybackUrl:null==r?void 0:r.url},{video:{drmEnabled:l,streamingInfo:{videoAssets:{widevine:null==r?void 0:r.widevine,fairPlay:null==r?void 0:r.fairPlay,playReady:null==r?void 0:r.playReady}},liveDetails:{isDvrEnabled:null==i?void 0:i.isDvrEnabled}}})};function ke(e,n){return Se.apply(this,arguments)}function Se(){return(Se=n(t.mark(function n(o,i){var r,l,a,s,u,d;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=i.resolve,l=i.reject,a=null==o?void 0:o.videoId,s=null==o?void 0:o.playerId,u=!(null==o||!o.anonymousId),n.next=6,e.getToken();case 6:d=n.sent,e.getVideoDetails(a,d).then(function(n){var t,i,c,v;window.contentType=null==n||null===(t=n.data)||void 0===t||null===(i=t.video)||void 0===i||null===(c=i.gist)||void 0===c?void 0:c.contentType,e.setCurrentVideo(null==n?void 0:n.data);var f,p=null==n?void 0:n.data;if(null!=o&&o.watchHistory&&null!=o&&null!==(v=o.watchHistory)&&void 0!==v&&v.enable&&!u)if((null===(f=o.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,g,h,y=Z((null===(m=o.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==o?void 0:o.siteOwner);if(y&&y.length)o.watchHistoryResumeTime=(null===(g=y[0])||void 0===g?void 0:g.watchedTime)||null,o.watchedPercentage=(null===(h=y[0])||void 0===h?void 0:h.watchedPercentage)||null;p.contentType="video",he(s,{res:p},o,{resolve:r,reject:l})}else e.getVideoInfo(a,d).then(function(e){var n,t,i,r,l,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),o.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,o.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){he(s,{res:p},o,{resolve:r,reject:l})});else he(s,{res:p},o,{resolve:r,reject:l})}).catch(function(n){e.initiateErrorHandling(n,s,l,a)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Te(e,n){return Ie.apply(this,arguments)}function Ie(){return(Ie=n(t.mark(function n(o,i){var r,l,a,s,u;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=i.resolve,l=i.reject,n.next=3,e.getToken();case 3:a=n.sent,s=null==o?void 0:o.playerId,u=null==o?void 0:o.epg,e.getLinearChannelDetails(u,a).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,he(s,{res:n},o,{resolve:r,reject:l})}).catch(function(n){e.initiateErrorHandling(n,s,l,videoId)});case 7:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ee(e,n){return Ce.apply(this,arguments)}function Ce(){return(Ce=n(t.mark(function n(o,i){var r,l,a,s,u,d,c;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:s=n.sent,u=null==o?void 0:o.playerId,d=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(d)),c=null==o||null===(r=o.series)||void 0===r?void 0:r.id,e.getSeriesDetails(c,s).then(function(n){var t,i,r,d=n.data,v=n.data.seasons;e.setCurrentSeries(v);var f=videoId||(null==v||null===(t=v[0])||void 0===t||null===(i=t.episodes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.id);e.createSeriesWatchMap(c,s),e.getVideoDetails(f,s).then(function(n){var t,i,r;window.contentType=null==n||null===(t=n.data)||void 0===t||null===(i=t.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.contentType,e.setCurrentVideo(n.data),he(u,{res:null==n?void 0:n.data,sres:d},o,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,u,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,u,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:i.onTimeUpdate,getVideoDuration:i.getVideoDuration,getVideoCurrentTime:i.getVideoCurrentTime,onVideoEnded:i.onVideoEnded,init:function(o){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(t.mark(function n(i,r){var a,s,u,c,v,f,m,g,h,y,b,w,k,S,T,I,E,C,x,j,A,D,L;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.isPlayerInitialised(null==o?void 0:o.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(b=(null==o?void 0:o.videoSourceUrl)||!1,w=null==o?void 0:o.asat,k=(null==o||null===(a=o.epg)||void 0===a?void 0:a.enable)||!1,S=null==o?void 0:o.videoId,T=(null==o||null===(s=o.series)||void 0===s?void 0:s.enable)||!1,I=(null==o?void 0:o.streamingInfo)||!1,window.videoId=S,E=null==o?void 0:o.token,!e.token_authentication_enabled(o)){n.next=17;break}if(sessionStorage.setItem("vlp_token",E),e.refreshTokenManager().set(null==o?void 0:o.refreshToken),E&&!e.isTokenExpired(E)){n.next=16;break}return r({status:!1,msg:"".concat(E?"Token is expired !":"Missing Authorization Token"),response:{token:E}}),n.abrupt("return");case 16:ge=JSON.parse(atob(E.split(".")[1]));case 17:return o.isAnonymousUser=!(null===(u=ge)||void 0===u||!u.anonymousId),o.siteOwner=(null===(c=ge)||void 0===c?void 0:c.site)||null,o.userId=(null===(v=ge)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=ge)||void 0===f?void 0:f.userId),window.watchHistory=o.watchHistory||null,C=null==o?void 0:o.playerId,o.chromecastReceiverId=null!=o&&null!==(m=o.series)&&void 0!==m&&m.enable?null:null==o?void 0:o.chromecastReceiverId,x=(null==o||null===(g=o.analytics)||void 0===g?void 0:g.gaId)||null,(j=null==o?void 0:o.errors)&&(window.customErrors=j),window.customData=null==o?void 0:o.customData,d.setLocalisation(null==o||null===(h=o.customData)||void 0===h?void 0:h.localisation),e.baseUrlManager.set(o.apiBaseUrl),null!=o&&o.skin&&!l.isNotAValidSkin(o.skin)||(o.skin="VL_ONE"),n.next=33,P(o);case 33:x&&p("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then(function(){return e.runGtag(x)}).catch(function(e){}),(A=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(C)))&&A.addEventListener("contextmenu",function(e){return e.preventDefault()}),b?(L={directPlaybackUrl:b,id:D="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},w?e.getVideoDetails(D,E).then(function(e){var n=(null==e?void 0:e.data)||{};he(C,{res:Object.assign({},n,L)},o,{resolve:i,reject:r})}).catch(function(n){e.initiateErrorHandling(n,C,r,D)}):he(C,{res:L},o,{resolve:i,reject:r})):I?be(o,{resolve:i,reject:r}):T?Ee(o,{resolve:i,reject:r}):k?Te(o,{resolve:i,reject:r}):ke(o,{resolve:i,reject:r});case 37:case"end":return n.stop()}},n)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:l.getPlayer,play:e.play,pause:e.pause,isPaused:e.isPaused,detectBrowser:u.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:i.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:r.enableCaptions,disableCaptions:r.disableCaptions,getCaptions:r.getCaptions,getAudioTracks:g,enableAudioTrack:h,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:b,disableControls:e.disableControls,setPlaybackSpeed:i.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}},exports.initialiseKeyboardEvents=function(n,t){var o,i,r,a=l.getPlayer(n),s=null==a||null===(o=a.controlBar)||void 0===o||null===(i=o.playToggle)||void 0===i?void 0:i.el_,u=document.getElementsByTagName("video")[0];null===(r=document)||void 0===r||r.addEventListener("keydown",function(o){var i;if(ae.enabled&&"input"!=o.target.localName){var r=o.key,l=!0===t.liveVideo||!0===t.liveui;switch([" ","m","M","f","F","ArrowLeft","ArrowRight"].includes(r)&&(o.preventDefault(),null==u||u.focus()),r){case" ":null==s||s.click();break;case"m":case"M":a.muted(!a.muted());break;case"f":case"F":null===(i=document.querySelector(".vjs-fullscreen-control"))||void 0===i||i.click();break;case"ArrowLeft":l&&!1===t.liveui||e.rewind(n,10);break;case"ArrowRight":l||e.skip(n,10)}}},!0)},exports.setupAdvertisementMarkers=function(e,n){return me.apply(this,arguments)};
|
package/cjs/index-d65ff026.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),a=require("./skin-f87e1c22.js"),o=require("./generic-bbce09c9.js"),l=require("./autoNextVideo-fbb2830a.js"),u=require("@babel/runtime/helpers/typeof"),s=require("video.js"),c=require("@babel/runtime/helpers/asyncToGenerator"),d=require("@babel/runtime/regenerator"),p=require("@babel/runtime/helpers/defineProperty"),v=require("@babel/runtime/helpers/slicedToArray"),m=[],f=function(e,t){var n=a.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=o.getVideoIdx();l.switchToNext(i,e,m)}};function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}e={0:{src:"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"loading"}},t=function e(){var t,n,r,i,a;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(a in i=t[r])i.hasOwnProperty(a)&&("object"===u(i[a])?n[a]=e(n[a],i[a]):n[a]=i[a]);return n},n=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},r=function e(t){return"HTML"!==t.nodeName&&"static"===n(t)("position")?e(t.offsetParent):t},s.registerPlugin("thumbnails",function(i){var a,o,l,u,s,c,d,p,v,m;if(u=t({},e,i),c=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=c.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",s=document.createElement("img"),l.appendChild(s),s.src=u[0].src,s.className="vjs-thumbnail",t(s.style,u[0].style),s.style.left||s.style.right||(s.onload=function(){s.style.left=-s.naturalWidth/2+"px"}),p=c.duration(),c.on("durationchange",function(e){p=c.duration()}),c.on("loadedmetadata",function(e){p=c.duration()}),(d=c.controlBar.progressControl).el().appendChild(l),v=function(e){var i,a,o,c,v,m,f,g,h,b;for(a in o=0,h=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((b=r(d.el()).getBoundingClientRect()).width||b.right)+h,m=e.pageX,e.changedTouches&&(m=e.changedTouches[0].pageX),c=m||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,c-=r(d.el()).getBoundingClientRect().left+h,i=Math.floor((c-d.el().offsetLeft)/d.width()*p),u)i>a&&(o=Math.max(o,a));(v=u[o]).src&&s.src!=v.src&&(s.src=v.src),v.style&&s.style!=v.style&&t(s.style,v.style),c+(g=function(e,t){var r;return t?parseFloat(t):"auto"!==(r=n(e)("clip"))&&"inherit"!==r&&4===(r=r.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(r[1])-parseFloat(r[3]):0}(s,v.width||u[0].width)/2)>f?c-=c+g-f:c<g&&(c=g),l.style.left=c+"px"},null!==(a=window)&&void 0!==a&&null!==(o=a.customData)&&void 0!==o&&o.isSmartTV){var f=function(){var e,t,n=0,r=(null===(e=d.el_.children[0].children[2])||void 0===e?void 0:e.offsetWidth)||5;r<65?r=5:r>=c.el().offsetWidth-180?r=c.el().offsetWidth-240:r-=58;var i=c.currentTime();for(t in u)i>t&&(n=Math.max(n,t));var a=u[n];a.uri&&""!=a.uri&&s.src!=a.uri?(s.src=a.uri,l.style.left=r+"px",s.style.opacity="1"):(l.style.left="-1000px",s.style.opacity="0")},g=null;d.el_.children[0].onfocus=function(){f(),g=setInterval(function(){f()},250)},d.el_.children[0].addEventListener("blur",function(){try{l.style.left="-1000px",s.style.opacity="0",g&&(clearInterval(g),g=null)}catch(e){}})}else d.on("mousemove",v),d.on("touchmove",v);function h(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",h),m()}d.on("pointerdown",function(e){document.addEventListener("pointermove",v),document.addEventListener("pointerup",h)}),m=function(e){l.style.left="-1000px"},d.on("mouseout",m),d.on("touchcancel",m),d.on("touchend",m),c.on("userinactive",m)});var b="my-player";function y(e){var t=e.split("\n"),n=[];return t.forEach(function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach(function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))}),n.push(r)}}),n}function x(){return(x=c(d.mark(function e(t){var n,r,i,a,o,l,u,s,c,p,m,f,g,h,b,y,x,w,E,A,N,k,j,T;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t._tiles){e.next=2;break}return e.abrupt("return",t._tiles);case 2:return e.prev=2,e.next=5,fetch(t.uri,{mode:"cors"});case 5:return n=e.sent,e.next=8,n.blob();case 8:return r=e.sent,e.next=11,createImageBitmap(r);case 11:for(i=e.sent,a=t.layout.split("x").map(Number),o=v(a,2),l=o[0],u=o[1],s=i.width/u,c=i.height/l,p=[],m=0;m<l;m++)for(f=0;f<u;f++)(g=document.createElement("canvas")).width=s,g.height=c,g.getContext("2d").drawImage(i,f*s,m*c,s,c,0,0,s,c),h=g.toDataURL("image/png"),p.push({uri:h,duration:t.duration}),t._tiles=p;return e.abrupt("return",p);case 20:for(e.prev=20,e.t0=e.catch(2),b=t.layout.split("x").map(Number),y=v(b,2),x=y[0],w=y[1],E=[],A=0;A<x*w;A++)E.push({uri:null===(N=window)||void 0===N||null===(k=N.app_data)||void 0===k||null===(j=k.appcmsMain)||void 0===j||null===(T=j.images)||void 0===T?void 0:T.placeholderCover,duration:t.duration});return e.abrupt("return",E);case 26:case"end":return e.stop()}},e,null,[[2,20]])}))).apply(this,arguments)}function w(e,t){return E.apply(this,arguments)}function E(){return(E=c(d.mark(function e(t,n){var r,i;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return b=n,e.prev=1,e.next=4,fetch(t);case 4:return r=e.sent,e.next=7,r.text();case 7:return i=e.sent,e.abrupt("return",y(i));case 11:e.prev=11,e.t0=e.catch(1),console.error("Error fetching the M3U8 manifest:",e.t0);case 14:case"end":return e.stop()}},e,null,[[1,11]])}))).apply(this,arguments)}function A(e,t,n){var r=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"),i=a.getPlayer(b);if(r&&i){var o=r.getBoundingClientRect(),l=(e.clientX-o.left)/o.width,u=function(e,t){var n,r;if(!t||0===t.length)return null;var i=0,a=t.length-1;for(;i<=a;){var o=Math.floor((i+a)/2),l=t[o];if(l===e)return l;l<e?i=o+1:a=o-1}var u=null!==(n=t[i])&&void 0!==n?n:1/0,s=null!==(r=t[a])&&void 0!==r?r:-1/0;return Math.abs(u-e)<Math.abs(s-e)?u:s}(Math.round(l*i.duration()),n),s=t[u];s&&!s.loading&&(s.loading=!0,function(e){return x.apply(this,arguments)}(s).then(function(e){var t=e[s.tileIndex],n=document.querySelector(".vjs-thumbnail-holder img");n&&t.uri&&(n.src=t.uri),s.loading=!1,s.src=t.uri}))}}function N(e){return k.apply(this,arguments)}function k(){return(k=c(d.mark(function e(t){var n,r,i,o;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={},t.forEach(function(e,t){for(var r=e.layout.split("x").map(Number),i=v(r,2),a=i[0]*i[1],o=e.duration,l=0;l<a;l++){var u,s=Math.round((t*a+l)*o);n[s]=h(h({},e),{},{duration:e.duration,tileIndex:l,loading:!1,style:(u={left:"-60px",height:"85px",width:"130px"},p(u,"left","-60px"),p(u,"border","1px solid transparent"),p(u,"borderRadius","4px"),u)})}}),r=Object.keys(n).map(Number).sort(function(e,t){return e-t}),null==(i=document.querySelector(".vjs-progress-holder.vjs-slider.vjs-slider-horizontal"))||i.addEventListener("mousemove",a.throttle(function(e){return A(e,n,r)},500)),null==(o=document.querySelector(".vjs-progress-control.vjs-control"))||o.addEventListener("pointerdown",function(e){document.addEventListener("pointermove",a.throttle(function(e){return A(e,n,r)},500))}),e.abrupt("return",n);case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var j=function(){var e=c(d.mark(function e(t,n){var r,i,a,o,l,u,s,c;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:i=e.sent,a=i.split("\n").map(function(e){return e.trim()}),o=[],l=null,u=0;case 10:if(!(u<(null==a?void 0:a.length))){e.next=27;break}if(!(s=a[u]).startsWith("#EXT-X-TILES")){e.next=19;break}l={resolution:null,duration:null,uri:null,layout:null},c=s.split(":")[1]||"",c.split(",").forEach(function(e){var t=e.split("="),n=v(t,2),r=n[0],i=n[1];r&&i&&(l[r.trim().toLowerCase()]=i.trim())}),e.next=24;break;case 19:if(!s.startsWith("#EXTINF")){e.next=23;break}return e.abrupt("continue",24);case 23:(s.includes("jpg")||s.includes("png")||s.includes("jpeg"))&&(l.uri=s.includes("http")?s:t+s,o.push(l),l=null);case 24:u++,e.next=10;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();function T(e){return e.replace(/AdSegmentFilter\/markers=\(.+?\)\//,"")}function C(e,t){return I.apply(this,arguments)}function I(){return(I=c(d.mark(function e(t,n){var r,i,l,u,s,c,p,m,f,g,h,y,x,w,E,A,N,k,j,C,I,L,B,S,M,R,q,D,$,X,V,_,F,U,W,G,z,H,Q,Y,J,K,Z,ee,te,ne,re,ie,ae,oe,le,ue,se,ce,de,pe,ve,me;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return b=n,r=a.getPlayer(n),i=t.split("/"),l=i.findIndex(function(e){return"dash"===e.toLowerCase()}),u=T(-1!==l?i.slice(0,l+1).join("/"):new URL(t).origin),e.prev=5,e.next=8,fetch(t);case 8:return m=e.sent,e.next=11,m.text();case 11:f=e.sent,g=new DOMParser,h=g.parseFromString(f,"application/xml"),y=(null==r?void 0:r.duration())||(null===(s=o.getCurrentVideo())||void 0===s||null===(c=s.video)||void 0===c?void 0:c.runtime),x=(null==h||null===(p=h.querySelector("MPD > BaseURL"))||void 0===p?void 0:p.textContent)||u+"/",w=h.getElementsByTagName("AdaptationSet"),E=0;case 18:if(!(E<w.length)){e.next=72;break}if(("image"!==(A=w[E]).getAttribute("contentType")||"image/png"!==A.getAttribute("mimeType"))&&"image/jpeg"!==A.getAttribute("mimeType")){e.next=69;break}if(k=A.getElementsByTagName("SegmentTemplate")[0],j=null===(N=k.getElementsByTagName("SegmentTimeline"))||void 0===N?void 0:N[0],!k||!j){e.next=48;break}if(L=j.getElementsByTagName("S"),B=parseInt(null===(C=L[0])||void 0===C?void 0:C.getAttribute("t")),S=parseInt(null===(I=L[0])||void 0===I?void 0:I.getAttribute("d")),M=A.getElementsByTagName("Representation")[0],R=M.getElementsByTagName("EssentialProperty")[0],q=R.getAttribute("value"),D=null==q?void 0:q.split("x"),$=v(D,2),X=$[0],V=$[1],!k){e.next=46;break}if(k.getAttribute("media"),_=k.getAttribute("timescale"),F=(_?S/_:S)/(X*V),U=M.getAttribute("id"),W=Math.round(y/F),G=Math.ceil(W/(X*V)),z=k.getAttribute("media"),parseInt(k.getAttribute("startNumber")),!isNaN(parseInt(G))){e.next=43;break}return e.abrupt("return");case 43:for(H=[],E=0;E<G;E++)Y="/"==(Q=z)[0]?new URL(u).origin:u+"/",H.push({duration:F,layout:q,uri:Y+Q.replace("$Time$",B+E*S).replace("$RepresentationID$",U)});return e.abrupt("return",H);case 46:e.next=69;break;case 48:if(J=A.getElementsByTagName("Representation")[0],K=J.getElementsByTagName("EssentialProperty")[0],Z=K.getAttribute("value"),ee=null==Z?void 0:Z.split("x"),te=v(ee,2),ne=te[0],re=te[1],!k){e.next=69;break}if(k.getAttribute("media"),ie=k.getAttribute("duration"),ae=k.getAttribute("timescale"),oe=(ae?ie/ae:ie)/(ne*re),le=J.getAttribute("id"),ue=Math.round(y/oe),se=Math.ceil(ue/(ne*re)),ce=k.getAttribute("media"),de=parseInt(k.getAttribute("startNumber"))||0,!isNaN(parseInt(se))){e.next=65;break}return e.abrupt("return");case 65:for(pe=[],ve=P(ce),E=0;E<se;E++)me=ve?O(ve,E+de):ce,pe.push({duration:oe,layout:Z,uri:x+me.replace("$Number$",E+de).replace("$RepresentationID$",le)});return e.abrupt("return",pe);case 69:E++,e.next=18;break;case 72:return console.log("No trickplay segment found."),e.abrupt("return",null);case 76:e.prev=76,e.t0=e.catch(5),console.error("Error fetching or parsing MPD:",e.t0);case 79:case"end":return e.stop()}},e,null,[[5,76]])}))).apply(this,arguments)}function P(e){var t=e.match(/Thumbnail_\$Number%0\d+d\$\.\w+/);return t?t[0]:null}function O(e,t){var n=e.match(/%0(\d+)d/);if(!n)return e;var r=parseInt(n[1],10),i=String(t).padStart(r,"0");return e.replace(/\$Number%0\d+d\$/,i)}function L(){return(L=c(d.mark(function e(t){var n,r,i,o,l,u,s,c,p,v,m,f,g,h,b,y;return d.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(u=a.getPlayer(t),s=u.currentSource(),c=s.src,c=null!==(n=c)&&void 0!==n&&n.includes("blob")?null===(r=window)||void 0===r||null===(i=r.player)||void 0===i?void 0:i.getSource():c,null===(o=c)||void 0===o||!o.includes("m3u8")){e.next=19;break}return e.next=6,w(c,t);case 6:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=17;break}return v=(null==p?void 0:p[0])||null,m=v.uri,f=c.substring(0,c.lastIndexOf("/"))+"/",e.next=12,j(f,m);case 12:return g=e.sent,e.next=15,N(g);case 15:h=e.sent,u.thumbnails(h);case 17:e.next=28;break;case 19:if(null===(l=c)||void 0===l||!l.includes("mpd")){e.next=28;break}return e.next=22,C(c,t);case 22:if(!((null==(b=e.sent)?void 0:b.length)>0)){e.next=28;break}return e.next=26,N(b);case 26:y=e.sent,u.thumbnails(y);case 28:case"end":return e.stop()}},e)}))).apply(this,arguments)}exports.addNextEpPreview=function(e,t){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r;m=[];var l=o.getCurrentSeries();null==l||l.map(function(e){var t;return(t=m).push.apply(t,i(e.episodes))}),null==t||null===(r=t.series)||void 0===r||r.cb}else{var u,s;m=(null==t||null===(u=t.relatedVideos)||void 0===u?void 0:u.content)||[],null==t||null===(s=t.relatedVideos)||void 0===s||s.cb}var c=a.getPlayer(e);c.on("timeupdate",function(){var e,t,n=Math.floor(c.currentTime()),r=c.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-n<=10&&o.getVideoIdx()<=(null===(t=m)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")});var d,p=m.filter(function(e,t){return t==o.getVideoIdx()});if((null==p?void 0:p.length)>0)if(null!==(d=document.getElementsByClassName("next-ep-preview"))&&void 0!==d&&d[0]){var v,g,h,b,y,x,w,E,A,N,k,j;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var T=null===(g=document.getElementsByClassName("next-ep-title"))||void 0===g?void 0:g[0],C=null===(h=document.getElementsByClassName("next-ep-img"))||void 0===h?void 0:h[0],I=null===(b=document.getElementsByClassName("next-ep-content"))||void 0===b?void 0:b[0],P=null===(y=p[0])||void 0===y?void 0:y.title;(null===(x=P)||void 0===x?void 0:x.length)>60&&(P=P.substr(0,60)+"..."),T.textContent="".concat(P),C.src=(null===(w=p[0])||void 0===w||null===(E=w.gist)||void 0===E||null===(A=E.imageGist)||void 0===A?void 0:A.r16x9)||(null==p||null===(N=p[0])||void 0===N?void 0:N.img)||(null===(k=window)||void 0===k||null===(j=k.customData)||void 0===j?void 0:j.fallbackImage),I.onclick=function(){return f(e)}}else{var O,L,B,S,M,R,q,D,$=document.createElement("div");$.className="next-ep-preview",$.style.visibility="hidden",document.getElementById(e).append($);var X=document.createElement("div");X.className="next-ep-header",X.textContent="Next up";var V=null===(O=p[0])||void 0===O?void 0:O.title,_=document.createElement("img");_.className="next-ep-img",_.src=(null===(L=p[0])||void 0===L||null===(B=L.gist)||void 0===B||null===(S=B.imageGist)||void 0===S?void 0:S.r16x9)||(null==p||null===(M=p[0])||void 0===M?void 0:M.img)||(null===(R=window)||void 0===R||null===(q=R.customData)||void 0===q?void 0:q.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(D=V)||void 0===D?void 0:D.length)>60&&(V=V.substr(0,60)+"..."),F.textContent="".concat(V);var U=document.createElement("div");U.className="next-ep-content",U.append(_),U.append(F),U.onclick=function(){return f(e)},$.append(X),$.append(U)}},exports.addTVProviderImage=function(e,t){var n=a.getPlayer(e),r=null==t?void 0:t.tvProviderLogoUrl;if(r){var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(r),o.alt="Provider Image",i.append(o),n.el().appendChild(i),n.on("useractive",function(){i.classList.remove("vjs-fade")}),n.on("userinactive",function(){n.paused()||i.classList.add("vjs-fade")}),n.on("fullscreenchange",function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"})}},exports.initiateTrickplay=function(e){return L.apply(this,arguments)};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),n=require("@babel/runtime/helpers/inherits"),s=require("video.js"),o=require("./icons-0ea2e662.js"),i=require("./generic-d56b38ac.js"),l=require("./skin-3397dca5.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./browser-38ff3331.js"),require("js-cookie"),require("ua-parser-js"),require("./captions-3c7ca3a7.js");var d=s.getComponent("Component"),u=function(){function u(t){var n,s,o,i,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,u),s=this,i=[t,l],o=a(o=u),(n=r(s,c()?Reflect.construct(o,i||[],a(s).constructor):o.apply(s,i))).playerId=l.playerId,n.seriesData=l.sres,n.streams=l.streams,n.currentVideoData=l.res,n.initialiseStructure(),n.loadCSS(),n}return n(u,d),t(u,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(o.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then(function(){return require("./multicamv2-1efdbdb9.js")}).then(function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)})}},{key:"initialiseStructure",value:function(){var e=this,t=this.el(),r=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=r.classList)&&void 0!==a&&a.contains("hidden")?(l.closeOpenDrawers(),r.classList.remove("hidden"),t.classList.add("open"),l.setUpdatedElHeight(e.playerId,r)):(r.classList.add("hidden"),t.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var n=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);r.style.height="".concat(n,"px"),a.style.overflow="hidden",s.dom.appendContent(t,r),this.addFunctionality(r)}}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=s.dom.createEl("div",{className:"stream-selector-head"}),n=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(o.crossIconSvg())});n.onclick=function(){e.classList.add("hidden"),r.classList.remove("open")};for(var c=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),d=s.dom.createEl("div",{className:"stream-selector-content"}),u=s.dom.createEl("div",{className:"stream-tray"}),m=function(e){var r,a,n,l=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(o.SelectedStream())});0==e&&(l.classList.add("selected"),l.style.border="2px solid #D2393B"),l.onclick=function(){for(var r=s.dom.$$(".stream"),a=0;a<r.length;a++)r[a].style.border="none",r[a].classList.remove("selected");l.classList.add("selected"),l.style.border="2px solid #D2393B",i.load(t.playerId,t.streams[e].id).then(function(e){i.play(t.playerId),console.log(e)}).catch(function(e){console.log(e)})},l.style.backgroundImage="url(".concat(t.streams[e].img,")");var c=document.createElement("img");c.className="stream-thumbnail-image",c.src="".concat((null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img)||(null===(a=window)||void 0===a||null===(n=a.customData)||void 0===n?void 0:n.fallbackImage)),l.append(c),s.dom.appendContent(u,l),s.dom.appendContent(d,u)},p=0;p<this.streams.length;p++)m(p);s.dom.appendContent(a,n),s.dom.appendContent(a,c),s.dom.appendContent(e,a),s.dom.appendContent(e,d),l.handleDrawerResizing(this.playerId,e)}}])}();exports.default=u;
|