@viewlift/player-backup 1.0.130-backup → 1.0.131-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-19ac2fbc.js → autoNextVideo-f75fb111.js} +1 -1
- package/cjs/{beacon-ca6bdec3.js → beacon-3472d9ab.js} +1 -1
- package/cjs/bundle.css +31 -27
- package/cjs/{caption-settings-6205c237.js → caption-settings-2b80dac2.js} +1 -1
- package/cjs/{features-6572482d.js → features-76f751d7.js} +1 -1
- package/cjs/{index-c5962ac8.js → index-61264ed0.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{multicamv2-6a90540f.js → multicamv2-5ab27b09.js} +1 -1
- package/cjs/{multicamv2-76d8530b.js → multicamv2-7a86b517.js} +1 -1
- package/cjs/{multicamv2-685f96f0.js → multicamv2-9304a5b3.js} +1 -1
- package/cjs/{nextEpisodeButton-19833648.js → nextEpisodeButton-fdf9263d.js} +1 -1
- package/cjs/{playlist-549b3b50.js → playlist-19950019.js} +1 -1
- package/cjs/{renditions-d4a3642f.js → renditions-8e58b1fd.js} +1 -1
- package/cjs/{resolution-4eae5e79.js → resolution-747ff7c8.js} +1 -1
- package/cjs/{series-de6875c5.js → series-0d5fa945.js} +1 -1
- package/cjs/{series-v2-3fc7104f.js → series-v2-67d3f7ce.js} +1 -1
- package/cjs/{series-v2-8b6f8385.js → series-v2-d6a2e270.js} +1 -1
- package/cjs/{settings-icon-7099e038.js → settings-icon-23d9d227.js} +1 -1
- package/cjs/{skin-76e6c431.js → skin-386b6ca2.js} +1 -1
- package/cjs/{skin-df960279.js → skin-396027ea.js} +1 -1
- package/cjs/{skin-c66e9b42.js → skin-55d72243.js} +1 -1
- package/cjs/{skin-bca424d1.js → skin-65b1f1b0.js} +1 -1
- package/cjs/{skin-b71fc9f4.js → skin-72a1ccea.js} +1 -1
- package/cjs/{skin-737b99ce.js → skin-a3188aa9.js} +1 -1
- package/cjs/{skin-a13cedfc.js → skin-dd7cb2ee.js} +1 -1
- package/cjs/{util-06c5f98b.js → util-c6824425.js} +1 -1
- package/cjs/{videoSelector-186cabf3.js → videoSelector-d1fc09ec.js} +1 -1
- package/cjs/{videoSelector-b3c204d8.js → videoSelector-f2b1fbef.js} +1 -1
- package/esm/{autoNextVideo-355201d8.js → autoNextVideo-743a7782.js} +1 -1
- package/esm/{beacon-37a5aa2a.js → beacon-9d84d686.js} +1 -1
- package/esm/bundle.css +31 -27
- package/esm/{caption-settings-6aa826ce.js → caption-settings-e83b6814.js} +1 -1
- package/esm/{features-8d37589f.js → features-5f7a39e0.js} +1 -1
- package/esm/{index-5d1bfb67.js → index-d9dda287.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{multicamv2-d006cffa.js → multicamv2-1fb5149a.js} +1 -1
- package/esm/{multicamv2-2d2b4a01.js → multicamv2-3d6e8051.js} +1 -1
- package/esm/{multicamv2-540e4a9e.js → multicamv2-b844a4f6.js} +1 -1
- package/esm/{nextEpisodeButton-e990f8b8.js → nextEpisodeButton-89ebffbb.js} +1 -1
- package/esm/{playlist-a9ce0c79.js → playlist-06f7f6a3.js} +1 -1
- package/esm/{renditions-5556ca50.js → renditions-f77c7c46.js} +1 -1
- package/esm/{resolution-b1192d49.js → resolution-d7ed7790.js} +1 -1
- package/esm/{series-5e8c84d7.js → series-12881a0f.js} +1 -1
- package/esm/{series-v2-dbd5d5ec.js → series-v2-a2a3c240.js} +1 -1
- package/esm/{series-v2-b0e9deee.js → series-v2-e01126da.js} +1 -1
- package/esm/{settings-icon-4b9689a4.js → settings-icon-bb726185.js} +1 -1
- package/esm/{skin-93f9a9a0.js → skin-0a0c271b.js} +1 -1
- package/esm/{skin-ac467e80.js → skin-7f6a85cb.js} +1 -1
- package/esm/{skin-ae708803.js → skin-82885153.js} +1 -1
- package/esm/{skin-fbc45594.js → skin-b06174f6.js} +1 -1
- package/esm/{skin-3d7d2afb.js → skin-b95b5c90.js} +1 -1
- package/esm/{skin-1eaa2c91.js → skin-c966c9cd.js} +1 -1
- package/esm/{skin-8b598f71.js → skin-e84d46c6.js} +1 -1
- package/esm/{util-3cb40c3d.js → util-e0a6cf62.js} +1 -1
- package/esm/videoSelector-a666f272.js +1 -0
- package/esm/{videoSelector-45e8433f.js → videoSelector-e4bd4ee1.js} +1 -1
- package/package.json +1 -1
- package/esm/videoSelector-dd04ee8b.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=require("./beacon-
|
|
1
|
+
"use strict";var e,t=require("./beacon-3472d9ab.js"),i=require("./util-c6824425.js"),n=0,o=0,u=function e(i,n,u,c){o=i,i>u.length-1||(t.setVideoIdx(o+1),t.load(n,u[i].id).then((function(e){t.highlightVideo(o),o++,d(e)})).catch((function(i){d(i),setTimeout((function(){t.highlightVideo(o),o++,e(o,n,u)}),5e3)})))},d=function(t){e&&e(t)};exports.autoPlayNext=function(c){clearTimeout(n);var h=null==c?void 0:c.content;e=null==c?void 0:c.cb;var l=c.playerId;i.onVideoEnded(l,(function(){var e=t.getPlayer(l);0!==(null==e?void 0:e.currentTime())&&((o=t.getVideoIdx())>h.length-1||(t.setVideoIdx(o+1),t.load(l,h[o].id).then((function(e){t.highlightVideo(o),t.setCurrentVideo(e.response),o++,d(e)})).catch((function(e){d(e),t.highlightVideo(o),o++,n=setTimeout((function(){t.isPaused(l)&&u(o,l,h)}),5e3)}))))}))},exports.switchToNext=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("video.js"),r=require("js-cookie"),a=require("ua-parser-js"),l=require("@babel/runtime/helpers/toConsumableArray"),d={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"};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)}function c(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 v(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?c(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var m={name:"@viewlift/player8",version:"1.0.110",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","video.js":"^8.21.1","videojs-contrib-ads":"^7.5.2","videojs-contrib-eme":"^5.5.1","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=m.version;var p=function(e,t){var n,o,r,a;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:_(),params:v({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":m.version},withCredentials:!0})},f=function(e,t){var n,o,r,a;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:O()+d.getLinearChannelDetails,params:v(v(v(v(v({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===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t}})},w=function(){var e=t(n.mark((function e(t,o){var r,a;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return a={siteOwner:null==t?void 0:t.siteOwner,userId:null==t?void 0:t.userId,videoId:null==t?void 0:t.videoId,watchedPercentage:null==t?void 0:t.watchedPercentage,watchedTime:null==t?void 0:t.watchedTime},e.abrupt("return",i({url:y(),method:"POST",headers:{Authorization:r,"x-api-key":t.xApiKey},params:{version:"v2"},data:JSON.stringify(a),withCredentials:!0}));case 8:if("v2"!=o){e.next=10;break}return e.abrupt("return",i({url:b(),method:"POST",headers:{Authorization:r},data:v({},t),params:v({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),g=function(e,t){var n,o,r=(null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(t.split(".")[1])),u=(null==d?void 0:d.site)||null;return i({method:"GET",url:h(e),params:{site:u},headers:{Authorization:t,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey},timeout:15e3})}if("v2"==r){var s,c;JSON.parse(atob(t.split(".")[1]));var v=window.contentType;return i({method:"GET",url:T(e,v),headers:{Authorization:t,"x-api-key":null===(s=window)||void 0===s||null===(c=s.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},I=function(e){return O()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV2,"/").concat(e)},E=function(){return O()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV1)},h=function(e){return O()+"".concat(null==d?void 0:d.getVideoInfoV1,"/").concat(e)},T=function(e,t){return O()+"".concat(null==d?void 0:d.getVideoInfoV2,"/").concat(t,"/").concat(e)},y=function(){return O()+"".concat(null==d?void 0:d.saveWatchHistoryV1)},b=function(){return O()+"".concat(null==d?void 0:d.saveWatchHistoryV2)},_=function(){var e,t,n,i,o=O()+"".concat(null==d?void 0:d.getVideoDetails);return null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.overrideEntitlementBaseUrl?(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":o},O=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==d?void 0:d.apiBaseUrl)},D=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},F=null;function x(){return{set:function(e){e&&(F=e)},get:function(){return F}}}var S,P,V,C,A,L,R=function(){var e=t(n.mark((function e(){var t,o,r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=x().get(),o=O(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/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,N=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"))||!D(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&&x().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)}}(),k=function(e){P=e},B=function(){return P},M=function(){return S},j=function(e){console.log("set",e),V=e},H=function(e){if(C){var t=C.get(e);j(t+1)}},U=(L=0,{set:function(e){e>=0&&(L=e)},get:function(){return L}}),z=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)}}},G=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var q=function(){var e,t;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(t=e.userAgentData)||void 0===t?void 0:t.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},Y=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)};function J(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 K(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?J(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):J(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window._deviceInfo=a(navigator.userAgent);var X=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},Q=function(e){var t=Z(e,"video.tags",[]),n=Z(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},Z=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},$=function(){var e,t,n,i,o,a,l,d,u,s,c,v,m,p,f,w,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",I=arguments.length>1?arguments[1]:void 0,E=arguments.length>2?arguments[2]:void 0,h=(null==E?void 0:E.contentType)||"video",T=null==E||null===(e=E[h])||void 0===e?void 0:e.metadata,y=Ie(I);if(!g.includes("VIEWLIFT_"))return g;var b=window.getComputedStyle(document.getElementById(I),null),_=Math.trunc(b.getPropertyValue("height").slice(0,-2)),O=Math.trunc(b.getPropertyValue("width").slice(0,-2)),D="linearchannel"===h?null==E||null===(t=E.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(i=n.find((function(e){return(null==e?void 0:e.id)===(null==E?void 0:E.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:Z(E,"video.gist.id",""),F=K(K({},ne(T)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE: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===(a=window)||void 0===a?void 0:a.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Z(E,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Z(E,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Z(E,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==y||null===(l=y.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==y||null===(d=y.options_)||void 0===d?void 0:d.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:Q(E),VIEWLIFT_MEDIA_ID:D,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Z(E,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:D,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+Z(E,"video.gist.permalink","")),VIEWLIFT_CONSENT:r.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Z(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(c=s.site)||void 0===c?void 0:c.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:Z(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(p=m.site)||void 0===p?void 0:p.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Z(E,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Z(E,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:D,VIEWLIFT_CONTENT_TITLE:Z(E,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:Z(E,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Z(E,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:te(),VIEWLIFT_SEASON_NUMBER:ee(),VIEWLIFT_CONTENT_TAGS:Q(E)},null===(f=window)||void 0===f||null===(w=f.customData)||void 0===w?void 0:w.macros);for(var x in F){var S=new RegExp(x,"g");g=g.replace(S,F[x])}return g},ee=function(){var e=U.get();return e>=0?e+1:1},te=function(){var e,t,n,i=M(),o=B(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=U.get(),l=null==i||null===(t=i[a])||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 l>=0?l+1:1},ne=function(e){var t,n,i,o,r,a,l={},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===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return u||s?(Y()?u?l=K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(l=K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?l=K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(l=K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?l=K(K({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}):s&&(l=K(K({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||""})),l=Y()?K(K({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):K(K({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=K(K({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}),l=Y()?K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),l},ie=function(e,t){var n,i,o,r,a,l,d,u,s,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",w=null==e||null===(n=e[f])||void 0===n?void 0:n.drmEnabled,g=null==e||null===(i=e[f])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,I=null==e||null===(r=e[f])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,E=(null==e||null===(l=e[f])||void 0===l||null===(d=l.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[f])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var h=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=I&&I.hls)return re(I);if(w){var T=ae(g,t);return T.src=$(T.src,t,e),T}if("Safari"!==q()&&h)return oe(g);if(E){var y=re(g);return y.src=$(y.src,t,e),y}if(null!=g&&g.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(g);return b.src=$(b.src,t,e),b}return null},oe=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},re=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},ae=function(e,t){var n=e.fairPlay,i=e.widevine,r=e.playReady,a=q();if(Ie(t),"Safari"===a){var l=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};console.log("🔐 Requesting FairPlay Certificate...",i),o.xhr(i,(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,i,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,(function(e,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return le(t),l}var d={src:i.url,type:"application/dash+xml"};return le(t),d.keySystems={"com.widevine.alpha":{url:i.licenseUrl,licenseHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},d};var le=function(e){var t=Ie(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==q()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},de=function(e){var t=Ie(e);t.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,t.removeRemoteTextTrack(e)}))},ue=function(e,t){var n=Ie(e);n.remoteTextTracks().tracks_.map((function(e){n.removeRemoteTextTrack(e)})),t.map((function(e){n.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},se=!1,ce=function(e,t,n){var i=$(t,e,n),o=Ie(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,r=Ie(e);if(null!==r.el_){se=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),se&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var l=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&l.hasAttribute("controls")&&l.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),r.one(d,(function(){u&&r.ima.initializeAdDisplayContainer()}));var s=(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;r.one("ads-ad-started",(function(){s&&s({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){s&&s({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){s&&s({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i)}},ve=["live","carousel","V2","defaultV2","multiplayer","minimalist","VL_ONE"],me=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");return null==t?void 0:t.querySelector("svg")},pe="",fe=function(e,t){var n;if(t){var i=document.getElementById(e),o=null===(n=window.getComputedStyle(i,null))||void 0===n?void 0:n.height;t.style.height!==o&&(t.style.height="".concat(o))}};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 ge=function(e){return!!o.getPlayer("".concat(e))},Ie=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},Ee=function(){var e=t(n.mark((function e(t,i){var o,r,a,l=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=l.length>2&&void 0!==l[2]&&l[2],e.next=3,N();case 3:return r=e.sent,a=Ie(t),e.abrupt("return",new Promise((function(e,n){f(i,r).then((function(n){var r=null==n?void 0:n.data;window.sid=Fe(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ie(r,t);k(r),l&&o?(ye(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,o){var r,a,l,d,u,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:return d=e.sent,(M()||null)&&H(i),u=0,s=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(a=window)&&void 0!==a&&null!==(l=a.watchHistory)&&void 0!==l&&l.enable&&g(i,d).then((function(e){var t,n,i,o,r,a;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)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,s=(null==e||null===(a=e.data)||void 0===a?void 0:a.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){p(i,d).then((function(i){var o,r,a,l,d,c,v,m,p,f,w=null==i?void 0:i.data,g=(null==w||null===(o=w.video)||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;k(i.data);var I=(null==w||null===(a=w.ads)||void 0===a||null===(l=a.preRoll)||void 0===l||null===(d=l.adTags)||void 0===d||null===(c=d.web)||void 0===c?void 0:c.active)&&(null==w||null===(v=w.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(p=m.adTags)||void 0===p||null===(f=p.web)||void 0===f?void 0:f.url);I&&ce(t,I,w);var E=ie(w,t);if(E){var h,T,y,b,_,O,D,F,x,S,P,V,C,A,L=(null==w||null===(h=w.video)||void 0===h||null===(T=h.gist)||void 0===T?void 0:T.videoImageUrl)||(null==w||null===(y=w.video)||void 0===y||null===(b=y.gist)||void 0===b||null===(_=b.imageGist)||void 0===_?void 0:_.r16x9),R=Ie(t);if(R.poster(L),ye(t,E),R.on("loadstart",(function(){g&&e({status:!0,msg:"Video Loaded",response:w})})),R.on("loadeddata",(function(){G(),e({status:!0,msg:"Video Loaded",response:w})})),R.one("play",(function(){u&&s<95&&setTimeout((function(){R.currentTime(u)}),0)})),R.one("error",(function(){var e;n({status:!1,msg:(null==R||null===(e=R.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==w||null===(O=w.video)||void 0===O||null===(D=O.contentDetails)||void 0===D||null===(F=D.closedCaptions)||void 0===F?void 0:F.length)>0||(null==w||null===(x=w.video)||void 0===x||null===(S=x.closedCaptions)||void 0===S?void 0:S.length)>0)P=((null==w||null===(V=w.video)||void 0===V||null===(C=V.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==w||null===(A=w.video)||void 0===A?void 0:A.closedCaptions)).filter((function(e){return"VTT"===e.format})),ue(t,P);else de(t)}else z(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 9:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}(),Te=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()},ye=function(e,t){var n=Ie(e);n&&n.src(t)},be=function(t,n,i,o){var r,a,l,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);ge(n)&&z(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}))};function _e(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 Oe(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var De=function(){var e,t,n,i,o,r,a,l=B();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.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==l?void 0:l.channelId)})))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==l||null===(o=l.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)};function Fe(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function xe(){var e=window.sessionStorage.getItem("uid");return e||(e=Fe(),window.sessionStorage.setItem("uid",e),e)}function Se(){return Pe.apply(this,arguments)}function Pe(){return(Pe=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,N();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)}window.initialise=function(e){window.sid=Fe(),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());s(r?"FAILED_TO_START":"DROPPED_STREAM",Oe({pfm:window.platform,uid:xe(),vid:De(),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){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),s("PLAY",Oe({pfm:window.platform,uid:xe(),vid:De(),videoPosition:Math.floor(e.currentTime())},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:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},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=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))s("BUFFERING",Oe({pfm:window.platform,uid:xe(),vid:De(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return l}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",Oe({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:xe(),vid:De()},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,a;s("AD_REQUEST",Oe({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:xe(),vid:De(),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",Oe({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:xe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:De()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.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)&&(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),a=i.end(o);if(Ve(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var Ve=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var o,r,a,l,d,u,s,c,v,m,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Oe,e.t1=Oe,e.t2=Oe({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=xe(),e.t5=De(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,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:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,Se();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,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:"",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===(l=window)||void 0===l||null===(d=l.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),m=[e.t31],e.next=37,N();case 37:p=e.sent,i({url:(null===(s=window)||void 0===s||null===(c=s.customData)||void 0===c||null===(v=c.beacon)||void 0===v?void 0:v.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),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}}},exports.addCaptions=ue,exports.authenticateLC=Ee,exports.clearError=G,exports.closeOpenDrawers=function(){var e=l(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var t,n;null==e||null===(t=e.childNodes)||void 0===t||null===(n=t[0])||void 0===n||n.click()}))},exports.createIconMarkup=function(e){return me(e)},exports.createIdxMapping=function(e){C=new Map,e.map((function(e,t){C.set(e.id,t)}))},exports.detectBrowser=q,exports.detectOrientationChange=function(e,t){var n,i=function(){return function(e,t){var n=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",i=document.getElementById(e);if(i&&pe!==n){var o=window.getComputedStyle(i,null).getPropertyValue("height");t&&(t.style.height="".concat(o)),pe=n}}(e,t)};window._orientationChangeHandler=i;window.addEventListener("resize",(function(){clearTimeout(n),n=setTimeout((function(){i()}),100)}))},exports.disableCaptions=function(e,t){for(var n=Ie(e).textTracks(),i=0;i<n.length;i++){var o=n[i];"subtitles"!==o.kind&&"captions"!==o.kind||o.id!==t||(o.mode="hidden")}},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=Ie(e);if(Te(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.enableCaptions=function(e,t){var n,i,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.style)||void 0===o||o.setProperty("display","flex"));for(var r=Ie(e).textTracks(),a=0;a<r.length;a++){var l=r[a];"subtitles"!==l.kind&&"captions"!==l.kind||l.id!=t||(l.mode="showing")}},exports.getCaptions=function(e){var t,n=Ie(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},exports.getCurrentSeries=M,exports.getCurrentVideo=B,exports.getEntitlementData=function(e,t,n){return i({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getLinearChannelDetails=f,exports.getPlayer=Ie,exports.getSeriesDetails=function(e,t){var n,o,r=JSON.parse(atob(t.split(".")[1])),a=(null==r?void 0:r.site)||null;return r&&r.countryCode,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:O()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=function(e){var t,n;if("v1"==((null===(t=window)||void 0===t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1"))return i({method:"GET",url:E(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token},timeout:15e3});var o=e.videoId;return i({method:"GET",url:I(o),headers:{Authorization:e.token},timeout:15e3})},exports.getSeriesWatchMap=function(){return A},exports.getSource=ie,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.getVideoDetails=p,exports.getVideoIdx=function(){return V},exports.getVideoInfo=g,exports.handleDrawerResizing=function(e,t){var n,i=Ie(e),o=Ie(e).el(),r=new ResizeObserver((function(){var i;null!==(i=t.classList)&&void 0!==i&&i.contains("hidden")||(n&&clearTimeout(n),n=setTimeout((function(){fe(e,t)}),200))}));r.observe(o),i.on("dispose",(function(){r.disconnect()})),i.on("fullscreenchange",(function(){setTimeout((function(){fe(e,t)}),50)}))},exports.handleError=z,exports.highlightVideo=function(e){var t=l(document.querySelectorAll("[video-idx]"));console.log(t),t.map((function(t){var n=t.parentNode,i=t.getAttribute("video-idx");n.style.background=i==e?"gray":"none"}))},exports.impolicy16x9=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},exports.initialiseAdvertisement=ce,exports.initiateErrorHandling=be,exports.inititateBeacon=function(e){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=Ie(e);window.initialise(t),window.firstFrame(t),t.on("loadedmetadata",(function(){window.endFirstFrame(t)}))}},exports.isMobile=Y,exports.isNotAValidSkin=function(e){return!ve.includes(e)},exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=ge,exports.isTokenExpired=D,exports.load=he,exports.loadVideo=ye,exports.loadVideoInstantly=function(e,t,n){var i=Ie(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.parseHtmlString=function(e){var t=(new DOMParser).parseFromString(e,"text/html");return null==t?void 0:t.querySelector("body")},exports.parseSvgString=me,exports.pause=function(e){o(e).pause()},exports.play=function(e){o(e).play()},exports.refreshTokenManager=x,exports.removeCaptions=de,exports.rewind=function(e,t){var n=o(e),i=n.currentTime(),r=i<=t?0:i-t;n.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)},exports.saveWatchHistory=w,exports.seasonIdxManager=U,exports.setCurrentSeries=function(e){S=e},exports.setCurrentVideo=k,exports.setSeriesWatchMap=function(e){A=e},exports.setUpdatedElHeight=fe,exports.setVideoIdx=j,exports.setVideoIdxById=H,exports.skip=function(e,t){var n=o(e),i=n.currentTime()+t;n.currentTime(i)},exports.token_authentication_enabled=function(e){var t=!0,n=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return n&&!i&&(t=!1),t};
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("video.js"),r=require("js-cookie"),a=require("ua-parser-js"),l=require("@babel/runtime/helpers/toConsumableArray"),d={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"};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)}function c(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 v(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?c(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var m={name:"@viewlift/player8",version:"1.0.110",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","video.js":"^8.21.1","videojs-contrib-ads":"^7.5.2","videojs-contrib-eme":"^5.5.1","videojs-contrib-quality-menu":"^1.0.3"}};window.vl_player_version=m.version;var p=function(e,t){var n,o,r,a;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:_(),params:v({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":m.version},withCredentials:!0})},f=function(e,t){var n,o,r,a;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:O()+d.getLinearChannelDetails,params:v(v(v(v(v({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===(a=r.customData)||void 0===a?void 0:a.entitlement),method:"GET",headers:{Authorization:t}})},w=function(){var e=t(n.mark((function e(t,o){var r,a;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return a={siteOwner:null==t?void 0:t.siteOwner,userId:null==t?void 0:t.userId,videoId:null==t?void 0:t.videoId,watchedPercentage:null==t?void 0:t.watchedPercentage,watchedTime:null==t?void 0:t.watchedTime},e.abrupt("return",i({url:y(),method:"POST",headers:{Authorization:r,"x-api-key":t.xApiKey},params:{version:"v2"},data:JSON.stringify(a),withCredentials:!0}));case 8:if("v2"!=o){e.next=10;break}return e.abrupt("return",i({url:b(),method:"POST",headers:{Authorization:r},data:v({},t),params:v({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),g=function(e,t){var n,o,r=(null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(t.split(".")[1])),u=(null==d?void 0:d.site)||null;return i({method:"GET",url:E(e),params:{site:u},headers:{Authorization:t,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey},timeout:15e3})}if("v2"==r){var s,c;JSON.parse(atob(t.split(".")[1]));var v=window.contentType;return i({method:"GET",url:T(e,v),headers:{Authorization:t,"x-api-key":null===(s=window)||void 0===s||null===(c=s.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},I=function(e){return O()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV2,"/").concat(e)},h=function(){return O()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV1)},E=function(e){return O()+"".concat(null==d?void 0:d.getVideoInfoV1,"/").concat(e)},T=function(e,t){return O()+"".concat(null==d?void 0:d.getVideoInfoV2,"/").concat(t,"/").concat(e)},y=function(){return O()+"".concat(null==d?void 0:d.saveWatchHistoryV1)},b=function(){return O()+"".concat(null==d?void 0:d.saveWatchHistoryV2)},_=function(){var e,t,n,i,o=O()+"".concat(null==d?void 0:d.getVideoDetails);return null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.overrideEntitlementBaseUrl?(null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":o},O=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==d?void 0:d.apiBaseUrl)},D=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},x=null;function F(){return{set:function(e){e&&(x=e)},get:function(){return x}}}var S,P,V,A,C,L,R=function(){var e=t(n.mark((function e(){var t,o,r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=F().get(),o=O(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/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,N=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"))||!D(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&&F().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)}}(),k=function(e){P=e},B=function(){return P},M=function(){return S},j=function(e){console.log("set",e),V=e},H=function(e){if(A){var t=A.get(e);j(t+1)}},U=(L=0,{set:function(e){e>=0&&(L=e)},get:function(){return L}}),z=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)}}},G=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var q=function(){var e,t;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(t=e.userAgentData)||void 0===t?void 0:t.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"},Y=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)};function J(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 K(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?J(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):J(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window._deviceInfo=a(navigator.userAgent);var X=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},Q=function(e){var t=Z(e,"video.tags",[]),n=Z(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},Z=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},$=function(){var e,t,n,i,o,a,l,d,u,s,c,v,m,p,f,w,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",I=arguments.length>1?arguments[1]:void 0,h=arguments.length>2?arguments[2]:void 0,E=(null==h?void 0:h.contentType)||"video",T=null==h||null===(e=h[E])||void 0===e?void 0:e.metadata,y=Ie(I);if(!g.includes("VIEWLIFT_"))return g;var b=window.getComputedStyle(document.getElementById(I),null),_=Math.trunc(b.getPropertyValue("height").slice(0,-2)),O=Math.trunc(b.getPropertyValue("width").slice(0,-2)),D="linearchannel"===E?null==h||null===(t=h.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(i=n.find((function(e){return(null==e?void 0:e.id)===(null==h?void 0:h.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:Z(h,"video.gist.id",""),x=K(K({},ne(T)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE: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===(a=window)||void 0===a?void 0:a.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:encodeURIComponent(encodeURIComponent(navigator.userAgent)),VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:Z(h,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:Z(h,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:Z(h,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==y||null===(l=y.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==y||null===(d=y.options_)||void 0===d?void 0:d.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_DEVICETYPE:"WEB_BROWSER",VIEWLIFT_IDTYPE:"WEB_BROWSER",VIEWLIFT_KEYWORDS:Q(h),VIEWLIFT_MEDIA_ID:D,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(Z(h,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:D,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+Z(h,"video.gist.permalink","")),VIEWLIFT_CONSENT:r.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:Z(null===(u=window)||void 0===u||null===(s=u.app_data)||void 0===s||null===(c=s.site)||void 0===c?void 0:c.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:Z(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(p=m.site)||void 0===p?void 0:p.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*Z(h,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:Z(h,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:D,VIEWLIFT_CONTENT_TITLE:Z(h,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:Z(h,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:Z(h,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:te(),VIEWLIFT_SEASON_NUMBER:ee(),VIEWLIFT_CONTENT_TAGS:Q(h)},null===(f=window)||void 0===f||null===(w=f.customData)||void 0===w?void 0:w.macros);for(var F in x){var S=new RegExp(F,"g");g=g.replace(S,x[F])}return g},ee=function(){var e=U.get();return e>=0?e+1:1},te=function(){var e,t,n,i=M(),o=B(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=U.get(),l=null==i||null===(t=i[a])||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 l>=0?l+1:1},ne=function(e){var t,n,i,o,r,a,l={},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===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return u||s?(Y()?u?l=K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(l=K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?l=K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(l=K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?l=K(K({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}):s&&(l=K(K({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||""})),l=Y()?K(K({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):K(K({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=K(K({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}),l=Y()?K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):K(K({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),l},ie=function(e,t){var n,i,o,r,a,l,d,u,s,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",w=null==e||null===(n=e[f])||void 0===n?void 0:n.drmEnabled,g=null==e||null===(i=e[f])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,I=null==e||null===(r=e[f])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,h=(null==e||null===(l=e[f])||void 0===l||null===(d=l.streamingInfo)||void 0===d||null===(u=d.videoAssets)||void 0===u?void 0:u.hls)||!1;null==e||null===(s=e[f])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var E=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=I&&I.hls)return re(I);if(w){var T=ae(g,t);return T.src=$(T.src,t,e),T}if("Safari"!==q()&&E)return oe(g);if(h){var y=re(g);return y.src=$(y.src,t,e),y}if(null!=g&&g.mpeg){var b=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(g);return b.src=$(b.src,t,e),b}return null},oe=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},re=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},ae=function(e,t){var n=e.fairPlay,i=e.widevine,r=e.playReady,a=q();if(Ie(t),"Safari"===a){var l=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};console.log("🔐 Requesting FairPlay Certificate...",i),o.xhr(i,(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,i,r){var a={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(a,(function(e,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return le(t),l}var d={src:i.url,type:"application/dash+xml"};return le(t),d.keySystems={"com.widevine.alpha":{url:i.licenseUrl,licenseHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}},d};var le=function(e){var t=Ie(e);if("function"==typeof t.eme)try{t.eme(),"Safari"==q()&&t.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},de=function(e){var t=Ie(e);t.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,t.removeRemoteTextTrack(e)}))},ue=function(e,t){var n=Ie(e);n.remoteTextTracks().tracks_.map((function(e){n.removeRemoteTextTrack(e)})),t.map((function(e){n.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},se=!1,ce=function(e,t,n){var i=$(t,e,n),o=Ie(e);if(t&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,t){var n,i,o,r=Ie(e);if(null!==r.el_){se=!0;var a={id:e,adTagUrl:"".concat(t),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),se&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var l=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&l.hasAttribute("controls")&&l.removeAttribute("controls");var d="click",u=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(u=!0,d="touchend"),r.one(d,(function(){u&&r.ima.initializeAdDisplayContainer()}));var s=(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;r.one("ads-ad-started",(function(){s&&s({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){s&&s({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){s&&s({status:"ERROR",msg:"Advertisement Error"})}))}}(e,i)}},ve=["live","carousel","V2","defaultV2","multiplayer","minimalist","VL_ONE"],me=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");return null==t?void 0:t.querySelector("svg")},pe="",fe=function(e,t){var n;if(t){var i=document.getElementById(e),o=null===(n=window.getComputedStyle(i,null))||void 0===n?void 0:n.height;t.style.height!==o&&(t.style.height="".concat(o))}};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 ge=function(e){return!!o.getPlayer("".concat(e))},Ie=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},he=function(){var e=t(n.mark((function e(t,i){var o,r,a,l=arguments;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=l.length>2&&void 0!==l[2]&&l[2],e.next=3,N();case 3:return r=e.sent,a=Ie(t),e.abrupt("return",new Promise((function(e,n){f(i,r).then((function(n){var r=null==n?void 0:n.data;window.sid=xe(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=ie(r,t);k(r),l&&o?(ye(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)}}(),Ee=function(){var e=t(n.mark((function e(t,i,o){var r,a,l,d,u,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:return d=e.sent,(M()||null)&&H(i),u=0,s=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(a=window)&&void 0!==a&&null!==(l=a.watchHistory)&&void 0!==l&&l.enable&&g(i,d).then((function(e){var t,n,i,o,r,a;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)),u=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,s=(null==e||null===(a=e.data)||void 0===a?void 0:a.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){p(i,d).then((function(i){var o,r,a,l,d,c,v,m,p,f,w=null==i?void 0:i.data,g=(null==w||null===(o=w.video)||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;k(i.data);var I=(null==w||null===(a=w.ads)||void 0===a||null===(l=a.preRoll)||void 0===l||null===(d=l.adTags)||void 0===d||null===(c=d.web)||void 0===c?void 0:c.active)&&(null==w||null===(v=w.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(p=m.adTags)||void 0===p||null===(f=p.web)||void 0===f?void 0:f.url);I&&ce(t,I,w);var h=ie(w,t);if(h){var E,T,y,b,_,O,D,x,F,S,P,V,A,C,L=(null==w||null===(E=w.video)||void 0===E||null===(T=E.gist)||void 0===T?void 0:T.videoImageUrl)||(null==w||null===(y=w.video)||void 0===y||null===(b=y.gist)||void 0===b||null===(_=b.imageGist)||void 0===_?void 0:_.r16x9),R=Ie(t);if(R.poster(L),ye(t,h),R.on("loadstart",(function(){g&&e({status:!0,msg:"Video Loaded",response:w})})),R.on("loadeddata",(function(){G(),e({status:!0,msg:"Video Loaded",response:w})})),R.one("play",(function(){u&&s<95&&setTimeout((function(){R.currentTime(u)}),0)})),R.one("error",(function(){var e;n({status:!1,msg:(null==R||null===(e=R.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==w||null===(O=w.video)||void 0===O||null===(D=O.contentDetails)||void 0===D||null===(x=D.closedCaptions)||void 0===x?void 0:x.length)>0||(null==w||null===(F=w.video)||void 0===F||null===(S=F.closedCaptions)||void 0===S?void 0:S.length)>0)P=((null==w||null===(V=w.video)||void 0===V||null===(A=V.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null==w||null===(C=w.video)||void 0===C?void 0:C.closedCaptions)).filter((function(e){return"VTT"===e.format})),ue(t,P);else de(t)}else z(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 9:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}(),Te=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()},ye=function(e,t){var n=Ie(e);n&&n.src(t)},be=function(t,n,i,o){var r,a,l,d,u,s,c=null==t||null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);ge(n)&&z(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}))};function _e(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 Oe(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var De=function(){var e,t,n,i,o,r,a,l=B();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.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==l?void 0:l.channelId)})))||void 0===n||null===(i=n.content)||void 0===i?void 0:i.id:(null==l||null===(o=l.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id)||(null==l||null===(a=l.video)||void 0===a?void 0:a.id)};function xe(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function Fe(){var e=window.sessionStorage.getItem("uid");return e||(e=xe(),window.sessionStorage.setItem("uid",e),e)}function Se(){return Pe.apply(this,arguments)}function Pe(){return(Pe=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,N();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)}window.initialise=function(e){window.sid=xe(),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());s(r?"FAILED_TO_START":"DROPPED_STREAM",Oe({pfm:window.platform,uid:Fe(),vid:De(),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){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),s("PLAY",Oe({pfm:window.platform,uid:Fe(),vid:De(),videoPosition:Math.floor(e.currentTime())},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:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},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=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))s("BUFFERING",Oe({pfm:window.platform,uid:Fe(),vid:De(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return l}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",Oe({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Fe(),vid:De()},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,a;s("AD_REQUEST",Oe({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Fe(),vid:De(),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",Oe({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:Fe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:De()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.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)&&(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),a=i.end(o);if(Ve(t,r,a)){var l=Math.round(n-a);if(isFinite(l))return l}}}))()};var Ve=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var o,r,a,l,d,u,s,c,v,m,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Oe,e.t1=Oe,e.t2=Oe({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(a=r.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=Fe(),e.t5=De(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,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:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,Se();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,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:"",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===(l=window)||void 0===l||null===(d=l.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),m=[e.t31],e.next=37,N();case 37:p=e.sent,i({url:(null===(s=window)||void 0===s||null===(c=s.customData)||void 0===c||null===(v=c.beacon)||void 0===v?void 0:v.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),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}}},exports.addCaptions=ue,exports.authenticateLC=he,exports.clearError=G,exports.closeOpenDrawers=function(){var e=l(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var t,n;null==e||null===(t=e.childNodes)||void 0===t||null===(n=t[0])||void 0===n||n.click()}))},exports.createIconMarkup=function(e){return me(e)},exports.createIdxMapping=function(e){A=new Map,e.map((function(e,t){A.set(e.id,t)}))},exports.detectBrowser=q,exports.detectOrientationChange=function(e,t){var n,i=function(){return function(e,t){var n=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",i=document.getElementById(e);if(i&&pe!==n){var o=window.getComputedStyle(i,null).getPropertyValue("height");t&&(t.style.height="".concat(o)),pe=n}}(e,t)};window._orientationChangeHandler=i;window.addEventListener("resize",(function(){clearTimeout(n),n=setTimeout((function(){i()}),100)}))},exports.disableCaptions=function(e,t){for(var n=Ie(e).textTracks(),i=0;i<n.length;i++){var o=n[i];"subtitles"!==o.kind&&"captions"!==o.kind||o.id!==t||(o.mode="hidden")}},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=Ie(e);if(Te(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.enableCaptions=function(e,t){var n,i,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.style)||void 0===o||o.setProperty("display","flex"));for(var r=Ie(e).textTracks(),a=0;a<r.length;a++){var l=r[a];"subtitles"!==l.kind&&"captions"!==l.kind||l.id!=t||(l.mode="showing")}},exports.getCaptions=function(e){var t,n=Ie(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},exports.getCurrentSeries=M,exports.getCurrentVideo=B,exports.getEntitlementData=function(e,t,n){return i({url:n,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:t},withCredentials:!0})},exports.getLinearChannelDetails=f,exports.getPlayer=Ie,exports.getSeriesDetails=function(e,t){var n,o,r=JSON.parse(atob(t.split(".")[1])),a=(null==r?void 0:r.site)||null;return r&&r.countryCode,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:O()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=function(e){var t,n;if("v1"==((null===(t=window)||void 0===t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1"))return i({method:"GET",url:h(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token},timeout:15e3});var o=e.videoId;return i({method:"GET",url:I(o),headers:{Authorization:e.token},timeout:15e3})},exports.getSeriesWatchMap=function(){return C},exports.getSource=ie,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.getVideoDetails=p,exports.getVideoIdx=function(){return V},exports.getVideoInfo=g,exports.handleDrawerResizing=function(e,t){var n,i=Ie(e),o=Ie(e).el(),r=new ResizeObserver((function(){var i;null!==(i=t.classList)&&void 0!==i&&i.contains("hidden")||(n&&clearTimeout(n),n=setTimeout((function(){fe(e,t)}),200))}));r.observe(o),i.on("dispose",(function(){r.disconnect()})),i.on("fullscreenchange",(function(){setTimeout((function(){fe(e,t)}),50)}))},exports.handleError=z,exports.highlightVideo=function(e){var t=l(document.querySelectorAll("[video-idx]"));console.log(t),t.map((function(t){var n=t.parentNode,i=t.getAttribute("video-idx");n.style.background=i==e?"gray":"none"}))},exports.highlightVideo_DEFAULTV2_TEMP=function(e){l(document.querySelectorAll("[video-idx]")).map((function(t){var n=t.getAttribute("video-idx");t.style.border=n==e?"2px solid white":"none"}))},exports.impolicy16x9=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},exports.initialiseAdvertisement=ce,exports.initiateErrorHandling=be,exports.inititateBeacon=function(e){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var t=Ie(e);window.initialise(t),window.firstFrame(t),t.on("loadedmetadata",(function(){window.endFirstFrame(t)}))}},exports.isMobile=Y,exports.isNotAValidSkin=function(e){return!ve.includes(e)},exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=ge,exports.isTokenExpired=D,exports.load=Ee,exports.loadVideo=ye,exports.loadVideoInstantly=function(e,t,n){var i=Ie(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.parseHtmlString=function(e){var t=(new DOMParser).parseFromString(e,"text/html");return null==t?void 0:t.querySelector("body")},exports.parseSvgString=me,exports.pause=function(e){o(e).pause()},exports.play=function(e){o(e).play()},exports.refreshTokenManager=F,exports.removeCaptions=de,exports.rewind=function(e,t){var n=o(e),i=n.currentTime(),r=i<=t?0:i-t;n.currentTime(r)},exports.runGtag=function(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)},exports.saveWatchHistory=w,exports.seasonIdxManager=U,exports.setCurrentSeries=function(e){S=e},exports.setCurrentVideo=k,exports.setSeriesWatchMap=function(e){C=e},exports.setUpdatedElHeight=fe,exports.setVideoIdx=j,exports.setVideoIdxById=H,exports.skip=function(e,t){var n=o(e),i=n.currentTime()+t;n.currentTime(i)},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/bundle.css
CHANGED
|
@@ -115,6 +115,34 @@
|
|
|
115
115
|
top: 4px;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
/* Big play */
|
|
119
|
+
.video-js.skin_vlone.vjs-paused .vjs-big-play-button {
|
|
120
|
+
width: 90px;
|
|
121
|
+
height: 90px;
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: center;
|
|
124
|
+
align-items: center;
|
|
125
|
+
border: none;
|
|
126
|
+
position: absolute;
|
|
127
|
+
top: 0;
|
|
128
|
+
left: 0;
|
|
129
|
+
right: 0;
|
|
130
|
+
bottom: 0;
|
|
131
|
+
margin: auto;
|
|
132
|
+
font-size: 6em;
|
|
133
|
+
line-height: 1.3em;
|
|
134
|
+
transform: none !important;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@media(max-width:600px){
|
|
139
|
+
.video-js.skin_vlone button.vjs-big-play-button {
|
|
140
|
+
width: 50px !important;
|
|
141
|
+
height: 50px !important;
|
|
142
|
+
font-size: 2.1rem !important;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
118
146
|
|
|
119
147
|
|
|
120
148
|
.video-js.vjs-quality-menu {
|
|
@@ -217,7 +245,6 @@
|
|
|
217
245
|
|
|
218
246
|
|
|
219
247
|
|
|
220
|
-
|
|
221
248
|
.video-js .multicamera-parent.default{
|
|
222
249
|
height: 345px;
|
|
223
250
|
position: absolute;
|
|
@@ -299,6 +326,7 @@
|
|
|
299
326
|
|
|
300
327
|
|
|
301
328
|
|
|
329
|
+
|
|
302
330
|
/* nextep */
|
|
303
331
|
.next-ep-preview{
|
|
304
332
|
position: absolute;
|
|
@@ -414,35 +442,11 @@
|
|
|
414
442
|
outline: none;
|
|
415
443
|
}
|
|
416
444
|
|
|
417
|
-
.video-js
|
|
418
|
-
|
|
419
|
-
height: 90px;
|
|
420
|
-
display: flex;
|
|
421
|
-
justify-content: center;
|
|
422
|
-
align-items: center;
|
|
423
|
-
border: none;
|
|
424
|
-
position: absolute;
|
|
425
|
-
top: 0;
|
|
426
|
-
left: 0;
|
|
427
|
-
right: 0;
|
|
428
|
-
bottom: 0;
|
|
429
|
-
margin: auto;
|
|
430
|
-
font-size: 6em;
|
|
431
|
-
line-height: 1.3em;
|
|
432
|
-
transform: none !important;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
@media(max-width:600px){
|
|
437
|
-
button.vjs-big-play-button {
|
|
438
|
-
width: 50px !important;
|
|
439
|
-
height: 50px !important;
|
|
440
|
-
font-size: 2.1rem !important;
|
|
441
|
-
}
|
|
445
|
+
.video-js .vjs-loading-spinner{
|
|
446
|
+
margin: none !important;
|
|
442
447
|
}
|
|
443
448
|
|
|
444
449
|
|
|
445
|
-
|
|
446
450
|
/* ADs */
|
|
447
451
|
.ima-ad-container {
|
|
448
452
|
top: 0em;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),r=require("./icons-0ea2e662.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator");var c=require("./beacon-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),r=require("./icons-0ea2e662.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator");var c=require("./beacon-3472d9ab.js");function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var s=i.getComponent("Component"),d=function(){n(m,s);var d,p,u=(d=m,p=l(),function(){var e,t=o(d);if(p){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function m(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,m),(i=u.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important"),i}return t(m,[{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"caption-selection vjs-control vjs-button"});e.style.position="unset";var t=i.dom.createEl("div",{className:"caption-selector-icon",innerHTML:"".concat(r.CaptionsSvgV2())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./caption-settings-34ca0188.js")})).then((function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=c.getCaptions(this.playerId);null==t||t.map((function(t){return c.disableCaptions(e.playerId,t.id)}));var n=this.el(),a=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var t;null!==(t=a.classList)&&void 0!==t&&t.contains("hidden")?(c.closeOpenDrawers(),a.classList.remove("hidden"),n.classList.add("open"),a.style.right="0px",c.setUpdatedElHeight(e.playerId,a)):(a.classList.add("hidden"),n.classList.remove("open"),a.style.right="-350px")};var o=document.getElementById(this.playerId);if(o){var r=window.getComputedStyle(o,null).getPropertyValue("height");a.style.height="".concat(r),i.dom.appendContent(n,a),o.style.overflow="hidden",this.addFunctionality(a),c.detectOrientationChange(this.playerId,a)}}},{key:"addFunctionality",value:function(e){var t=this.el(),n=i.dom.createEl("div",{className:"caption-selector-head"}),a=i.dom.createEl("div",{className:"caption-selector-cross-icon",innerHTML:"".concat(r.crossIconSvg())});a.onclick=function(){e.classList.add("hidden"),t.classList.remove("open"),e.style.right="-350px"};var o=i.dom.createEl("div",{className:"caption-selector-title",innerHTML:"Captions"}),l=i.dom.createEl("div",{className:"caption-selector-content"}),s=i.dom.createEl("div",{className:"caption-container"}),d=this.createLanguageContanier();i.dom.appendContent(s,d),i.dom.appendContent(n,a),i.dom.appendContent(n,o),i.dom.appendContent(e,n),i.dom.appendContent(e,l),i.dom.appendContent(l,s),c.handleDrawerResizing(this.playerId,e)}},{key:"createLanguageContanier",value:function(){var e=this,t=i.dom.createEl("div",{className:"caption-language-container"}),n=i.dom.createEl("div",{className:"caption-language-container-title",innerHTML:"Language"});i.dom.appendContent(t,n);var a=document.createElement("label");a.setAttribute("for","radio-off"),a.className="caption-language-holder";var o=document.createElement("div");o.className="caption",o.innerHTML="Off";var r=i.dom.createEl("input",{className:"radio - off",id:"radio-off",name:"language-radio",checked:"true"});r.setAttribute("type","radio"),r.onchange=function(t){var n,a,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important")),c.getCaptions(e.playerId).map((function(t){return c.disableCaptions(e.playerId,t.id)}))},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var l=c.getCaptions(this.playerId),s=function(n){var a,o=document.createElement("label");o.className="caption-language-holder",o.setAttribute("for","language-radio-".concat(n));var r=document.createElement("div");r.className="caption - ".concat(n),r.textContent=null==l||null===(a=l[n])||void 0===a?void 0:a.label;var s=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});s.onchange=function(t){c.enableCaptions(e.playerId,l[n].id)},s.setAttribute("type","radio"),i.dom.appendContent(o,s),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},d=0;d<l.length;d++)s(d);return t}},{key:"createFontSizeContainer",value:function(){var e=i.dom.createEl("div",{className:"caption-font-container"}),t=i.dom.createEl("div",{className:"caption-font-container-title",innerHTML:"Font Size"});i.dom.appendContent(e,t);for(var n=[{size:14},{size:18},{size:24}],a=0;a<n.length;a++){var o,r=document.createElement("label");r.className="caption-font-holder",r.setAttribute("for","font".concat(a));var c=document.createElement("div");c.className="fontsize - ".concat(a),c.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var l=i.dom.createEl("input",{className:"radio - ".concat(a),id:"font".concat(a),name:"font-size-radio",size:"".concat(n[a].size),checked:"".concat(a==n.length-1)});l.setAttribute("type","radio"),l.onchange=function(e){var t=e.target.size;if(document.getElementById("caption-size")){document.getElementById("caption-size").textContent=".vjs-text-track-cue{font-size:".concat(t,"px !important}")}else{var n=document.createElement("style");n.textContent=".vjs-text-track-cue{font-size:".concat(t,"px !important}"),n.id="caption-size",document.head.append(n)}},i.dom.appendContent(r,l),i.dom.appendContent(r,c),i.dom.appendContent(e,r)}return e}}]),m}();exports.default=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./beacon-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./beacon-3472d9ab.js"),s=require("./renditions-8e58b1fd.js"),d=require("./localisation-56e0a999.js");function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?c(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(e){var t=p();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then((function(){return require("./caption-settings-2b80dac2.js")})).then((function(r){var n,o,l,s,d=r.default,c=a.getPlayer(e);i.registerComponent("captionSelector",d),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),c&&c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addDBClickFullScreen=function(e){var t=a.getPlayer(e).el(),r=0,n=a.getPlayer(e);n.addChild("fullscreenToggle");var o=function(){var e,r=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];r&&r.click()};n.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;n.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),n=e-r;if(n<300&&n>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}r=e})),window._multiplayer_dbTapHandler=o},exports.addMulticamSelector=function(e,t){Promise.resolve().then((function(){return require("./multicamv2-9304a5b3.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},exports.addMulticamSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then((function(){return require("./multicamv2-5ab27b09.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then((function(){return require("./nextEpisodeButton-fdf9263d.js")})).then((function(n){var o=n.default,l=a.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)}))},exports.addOutputtingOverlay=function(e,t){var r=a.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then((function(){return require("./playlist-19950019.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},exports.addResolutionModule=function(e,t,r){Promise.resolve().then((function(){return require("./resolution-747ff7c8.js")})).then((function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a.getPlayer(e),d=s.getRenditions(e);(null==d?void 0:d.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:d},l.controlBar.children().length-4))}))},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=h(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-rewind-button");var d=a.parseSvgString(l);return o.append(d),n}return r(s,[{key:"handleClick",value:function(){a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then((function(){return require("./series-0d5fa945.js")})).then((function(n){var o=n.seriesModule,l=a.getPlayer(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var s=document.querySelectorAll(".season-title-sdk"),d=function(e){s[e].addEventListener("click",(function(){t[e]&&n.handleSeasonChange(t[e],e,l,r)}))},c=0;c<s.length;c++)d(c)}))},exports.addSeriesSelectorV2=function(e,t){Promise.resolve().then((function(){return require("./series-v2-d6a2e270.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",u({playerId:e},t),o.controlBar.children().length-3)}))},exports.addSeriesSelectorV2_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then((function(){return require("./series-v2-67d3f7ce.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("seriesV2",n),o.getChild("controlBar").addChild("seriesV2",u({playerId:e},t),o.controlBar.children().length-3)}))},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then((function(){return require("./settings-icon-23d9d227.js")})).then((function(r){var n,o,l,s,d=r.default,c=a.getPlayer(e);i.registerComponent("settingsSelector",d),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),c&&c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=h(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-skip-button");var d=a.parseSvgString(l);return o.append(d),n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=h(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=d.getLocalisation("slowMoText")||"Slow Mo",n}return r(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},exports.addVideoSelector=function(e,t){Promise.resolve().then((function(){return require("./videoSelector-d1fc09ec.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},exports.addVideoSelector_DEFAULTV2_TEMP=function(e,t){Promise.resolve().then((function(){return require("./videoSelector-f2b1fbef.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./beacon-ca6bdec3.js"),o=require("./autoNextVideo-19ac2fbc.js"),a=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/slicedToArray"),p=[],v=function(e,t){var n=l.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=l.getVideoIdx();o.switchToNext(i,e,p)}};function m(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 f(e){return h.apply(this,arguments)}function h(){return(h=s(c.mark((function e(t){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),l=d(i,2),o=l[0],a=l[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var l=i.width/a,u=i.height/o,s=0;s<o;s++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=l,d.height=u,d.getContext("2d").drawImage(i,c*l,s*u,l,u,0,0,l,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return x.apply(this,arguments)}function x(){return(x=s(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",m(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function y(e){return b.apply(this,arguments)}function b(){return(b=s(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return f(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n=e.duration;r[n*t]={src:e.uri,style:{left:"-60px",height:"85px",width:"130px"}}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}e={0:{src:"example-thumbnail.png"}},t=function e(){var t,n,r,i,l;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[r])i.hasOwnProperty(l)&&("object"===a(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);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 l,o,a,u,s,c,d,p;o=t({},e,i),u=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=u.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),l.appendChild(a),a.src=o[0].src,a.className="vjs-thumbnail",t(a.style,o[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),c=u.duration(),u.on("durationchange",(function(e){c=u.duration()})),u.on("loadedmetadata",(function(e){c=u.duration()})),(s=u.controlBar.progressControl).el().appendChild(l),d=function(e){var i,u,d,p,v,m,f,h,g,x;for(u in d=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=r(s.el()).getBoundingClientRect()).width||x.right)+g,m=e.pageX,e.changedTouches&&(m=e.changedTouches[0].pageX),p=m||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,p-=r(s.el()).getBoundingClientRect().left+g,i=Math.floor((p-s.el().offsetLeft)/s.width()*c),o)i>u&&(d=Math.max(d,u));(v=o[d]).src&&a.src!=v.src&&(a.src=v.src),v.style&&a.style!=v.style&&t(a.style,v.style),p+(h=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}(a,v.width||o[0].width)/2)>f?p-=p+h-f:p<h&&(p=h),l.style.left=p+"px"},s.on("mousemove",d),s.on("touchmove",d),p=function(e){l.style.left="-1000px"},s.on("mouseout",p),s.on("touchcancel",p),s.on("touchend",p),u.on("userinactive",p)}));var w=function(){var e=s(c.mark((function e(t,n){var r,i,l,o;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:return i=e.sent,l=i.split("\n"),o=[],l.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&l[n-1].includes("#EXT-X-TILES")&&(l[n-1]=l[n-1].split(","),r.uri=t+e,l[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=d(t,2),i=n[0],l=n[1];i=i.toLowerCase(),r[i]=l}))})),o.push(r))})),e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function E(e){return C.apply(this,arguments)}function C(){return(C=s(c.mark((function e(t){var n,r,i,o,a,u,s,d,p,v,m,f,h,g,x,y,b,w,E,C,N,k;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return o=e.sent,e.next=7,o.text();case 7:a=e.sent,u=new DOMParser,s=u.parseFromString(a,"application/xml"),d=null===(r=l.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i?void 0:i.runtime,p=s.getElementsByTagName("AdaptationSet"),v=0;case 13:if(!(v<p.length)){e.next=34;break}if("image"!==(m=p[v]).getAttribute("contentType")||"image/png"!==m.getAttribute("mimeType")){e.next=31;break}if(f=m.getElementsByTagName("SegmentTemplate")[0],h=m.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],x=g.getAttribute("value"),!f){e.next=31;break}for(f.getAttribute("media"),y=f.getAttribute("duration"),b=f.getAttribute("timescale"),w=y/b,E=Math.round(d/w),C=Math.ceil(E/9),N=f.getAttribute("media"),k=[],v=0;v<C;v++)k.push({duration:w,layout:x,uri:n+"/"+N.replace("$Number$",v)});return e.abrupt("return",k);case 31:v++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).apply(this,arguments)}function N(){return(N=s(c.mark((function e(t){var n,r,i,o,a,u,s,d,p,v,m,f,h,x,b,C,N,k,T,A,B;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=l.getPlayer(t),r=n.currentSource(),null==(i=r.src)||!i.includes("m3u8")){e.next=18;break}return e.next=5,g(i);case 5:if(!((null==(o=e.sent)?void 0:o.length)>0)){e.next=16;break}return b=(null==o?void 0:o[0])||null,C=b.uri,N=(null==n||null===(a=n.tech())||void 0===a||null===(u=a.vhs)||void 0===u||null===(s=u.playlists)||void 0===s||null===(d=s.master)||void 0===d||null===(p=d.uri)||void 0===p?void 0:p.substring(0,null==n||null===(v=n.tech())||void 0===v||null===(m=v.vhs)||void 0===m||null===(f=m.playlists)||void 0===f||null===(h=f.master)||void 0===h||null===(x=h.uri)||void 0===x?void 0:x.lastIndexOf("/")))+"/",e.next=11,w(N,C);case 11:return k=e.sent,e.next=14,y(k);case 14:T=e.sent,n.thumbnails(T);case 16:e.next=27;break;case 18:if(null==i||!i.includes("mpd")){e.next=27;break}return e.next=21,E(i);case 21:if(!((null==(A=e.sent)?void 0:A.length)>0)){e.next=27;break}return e.next=25,y(A);case 25:B=e.sent,n.thumbnails(B);case 27: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;p=[];var o=l.getCurrentSeries();null==o||o.map((function(e){var t;return(t=p).push.apply(t,i(e.episodes))})),null==t||null===(r=t.series)||void 0===r||r.cb}else{var a,u;p=null==t||null===(a=t.relatedVideos)||void 0===a?void 0:a.content,null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var s=l.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&&l.getVideoIdx()<=(null===(t=p)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var c,d=p.filter((function(e,t){return t==l.getVideoIdx()}));if((null==d?void 0:d.length)>0)if(null!==(c=document.getElementsByClassName("next-ep-preview"))&&void 0!==c&&c[0]){var m,f,h,g,x,y,b,w,E,C,N,k;(null===(m=document.getElementsByClassName("next-ep-preview"))||void 0===m?void 0:m[0]).style.visibility="hidden";var T=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],A=null===(h=document.getElementsByClassName("next-ep-img"))||void 0===h?void 0:h[0],B=null===(g=document.getElementsByClassName("next-ep-content"))||void 0===g?void 0:g[0],I=null===(x=d[0])||void 0===x?void 0:x.title;(null===(y=I)||void 0===y?void 0:y.length)>60&&(I=I.substr(0,60)+"..."),T.textContent="".concat(I),A.src=(null===(b=d[0])||void 0===b||null===(w=b.gist)||void 0===w||null===(E=w.imageGist)||void 0===E?void 0:E.r16x9)||(null==d||null===(C=d[0])||void 0===C?void 0:C.img)||(null===(N=window)||void 0===N||null===(k=N.customData)||void 0===k?void 0:k.fallbackImage),B.onclick=function(){return v(e)}}else{var M,P,O,S,L,X,q,j,R=document.createElement("div");R.className="next-ep-preview",R.style.visibility="hidden",document.getElementById(e).append(R);var V=document.createElement("div");V.className="next-ep-header",V.textContent="Next up";var D=null===(M=d[0])||void 0===M?void 0:M.title,F=document.createElement("img");F.className="next-ep-img",F.src=(null===(P=d[0])||void 0===P||null===(O=P.gist)||void 0===O||null===(S=O.imageGist)||void 0===S?void 0:S.r16x9)||(null==d||null===(L=d[0])||void 0===L?void 0:L.img)||(null===(X=window)||void 0===X||null===(q=X.customData)||void 0===q?void 0:q.fallbackImage);var G=document.createElement("div");G.className="next-ep-title",(null===(j=D)||void 0===j?void 0:j.length)>60&&(D=D.substr(0,60)+"..."),G.textContent="".concat(D);var U=document.createElement("div");U.className="next-ep-content",U.append(F),U.append(G),U.onclick=function(){return v(e)},R.append(V),R.append(U)}},exports.initiateTrickplay=function(e){return N.apply(this,arguments)};
|
|
1
|
+
"use strict";var e,t,n,r,i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./beacon-3472d9ab.js"),o=require("./autoNextVideo-f75fb111.js"),a=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/slicedToArray"),p=[],v=function(e,t){var n=l.getPlayer(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=l.getVideoIdx();o.switchToNext(i,e,p)}};function m(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 f(e){return h.apply(this,arguments)}function h(){return(h=s(c.mark((function e(t){return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),l=d(i,2),o=l[0],a=l[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var l=i.width/a,u=i.height/o,s=0;s<o;s++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=l,d.height=u,d.getContext("2d").drawImage(i,c*l,s*u,l,u,0,0,l,u);var p=d.toDataURL("image/png");r.push({uri:p,duration:t.duration})}e(r)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return x.apply(this,arguments)}function x(){return(x=s(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",m(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function y(e){return b.apply(this,arguments)}function b(){return(b=s(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return f(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n=e.duration;r[n*t]={src:e.uri,style:{left:"-60px",height:"85px",width:"130px"}}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}e={0:{src:"example-thumbnail.png"}},t=function e(){var t,n,r,i,l;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[r])i.hasOwnProperty(l)&&("object"===a(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);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 l,o,a,u,s,c,d,p;o=t({},e,i),u=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=u.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(l=document.createElement("div")).className="vjs-thumbnail-holder",a=document.createElement("img"),l.appendChild(a),a.src=o[0].src,a.className="vjs-thumbnail",t(a.style,o[0].style),a.style.left||a.style.right||(a.onload=function(){a.style.left=-a.naturalWidth/2+"px"}),c=u.duration(),u.on("durationchange",(function(e){c=u.duration()})),u.on("loadedmetadata",(function(e){c=u.duration()})),(s=u.controlBar.progressControl).el().appendChild(l),d=function(e){var i,u,d,p,v,m,f,h,g,x;for(u in d=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=r(s.el()).getBoundingClientRect()).width||x.right)+g,m=e.pageX,e.changedTouches&&(m=e.changedTouches[0].pageX),p=m||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,p-=r(s.el()).getBoundingClientRect().left+g,i=Math.floor((p-s.el().offsetLeft)/s.width()*c),o)i>u&&(d=Math.max(d,u));(v=o[d]).src&&a.src!=v.src&&(a.src=v.src),v.style&&a.style!=v.style&&t(a.style,v.style),p+(h=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}(a,v.width||o[0].width)/2)>f?p-=p+h-f:p<h&&(p=h),l.style.left=p+"px"},s.on("mousemove",d),s.on("touchmove",d),p=function(e){l.style.left="-1000px"},s.on("mouseout",p),s.on("touchcancel",p),s.on("touchend",p),u.on("userinactive",p)}));var w=function(){var e=s(c.mark((function e(t,n){var r,i,l,o;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:return i=e.sent,l=i.split("\n"),o=[],l.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&l[n-1].includes("#EXT-X-TILES")&&(l[n-1]=l[n-1].split(","),r.uri=t+e,l[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=d(t,2),i=n[0],l=n[1];i=i.toLowerCase(),r[i]=l}))})),o.push(r))})),e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function E(e){return C.apply(this,arguments)}function C(){return(C=s(c.mark((function e(t){var n,r,i,o,a,u,s,d,p,v,m,f,h,g,x,y,b,w,E,C,N,k;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return o=e.sent,e.next=7,o.text();case 7:a=e.sent,u=new DOMParser,s=u.parseFromString(a,"application/xml"),d=null===(r=l.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i?void 0:i.runtime,p=s.getElementsByTagName("AdaptationSet"),v=0;case 13:if(!(v<p.length)){e.next=34;break}if("image"!==(m=p[v]).getAttribute("contentType")||"image/png"!==m.getAttribute("mimeType")){e.next=31;break}if(f=m.getElementsByTagName("SegmentTemplate")[0],h=m.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],x=g.getAttribute("value"),!f){e.next=31;break}for(f.getAttribute("media"),y=f.getAttribute("duration"),b=f.getAttribute("timescale"),w=y/b,E=Math.round(d/w),C=Math.ceil(E/9),N=f.getAttribute("media"),k=[],v=0;v<C;v++)k.push({duration:w,layout:x,uri:n+"/"+N.replace("$Number$",v)});return e.abrupt("return",k);case 31:v++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).apply(this,arguments)}function N(){return(N=s(c.mark((function e(t){var n,r,i,o,a,u,s,d,p,v,m,f,h,x,b,C,N,k,T,A,B;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=l.getPlayer(t),r=n.currentSource(),null==(i=r.src)||!i.includes("m3u8")){e.next=18;break}return e.next=5,g(i);case 5:if(!((null==(o=e.sent)?void 0:o.length)>0)){e.next=16;break}return b=(null==o?void 0:o[0])||null,C=b.uri,N=(null==n||null===(a=n.tech())||void 0===a||null===(u=a.vhs)||void 0===u||null===(s=u.playlists)||void 0===s||null===(d=s.master)||void 0===d||null===(p=d.uri)||void 0===p?void 0:p.substring(0,null==n||null===(v=n.tech())||void 0===v||null===(m=v.vhs)||void 0===m||null===(f=m.playlists)||void 0===f||null===(h=f.master)||void 0===h||null===(x=h.uri)||void 0===x?void 0:x.lastIndexOf("/")))+"/",e.next=11,w(N,C);case 11:return k=e.sent,e.next=14,y(k);case 14:T=e.sent,n.thumbnails(T);case 16:e.next=27;break;case 18:if(null==i||!i.includes("mpd")){e.next=27;break}return e.next=21,E(i);case 21:if(!((null==(A=e.sent)?void 0:A.length)>0)){e.next=27;break}return e.next=25,y(A);case 25:B=e.sent,n.thumbnails(B);case 27: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;p=[];var o=l.getCurrentSeries();null==o||o.map((function(e){var t;return(t=p).push.apply(t,i(e.episodes))})),null==t||null===(r=t.series)||void 0===r||r.cb}else{var a,u;p=null==t||null===(a=t.relatedVideos)||void 0===a?void 0:a.content,null==t||null===(u=t.relatedVideos)||void 0===u||u.cb}var s=l.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&&l.getVideoIdx()<=(null===(t=p)||void 0===t?void 0:t.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var c,d=p.filter((function(e,t){return t==l.getVideoIdx()}));if((null==d?void 0:d.length)>0)if(null!==(c=document.getElementsByClassName("next-ep-preview"))&&void 0!==c&&c[0]){var m,f,h,g,x,y,b,w,E,C,N,k;(null===(m=document.getElementsByClassName("next-ep-preview"))||void 0===m?void 0:m[0]).style.visibility="hidden";var T=null===(f=document.getElementsByClassName("next-ep-title"))||void 0===f?void 0:f[0],A=null===(h=document.getElementsByClassName("next-ep-img"))||void 0===h?void 0:h[0],B=null===(g=document.getElementsByClassName("next-ep-content"))||void 0===g?void 0:g[0],I=null===(x=d[0])||void 0===x?void 0:x.title;(null===(y=I)||void 0===y?void 0:y.length)>60&&(I=I.substr(0,60)+"..."),T.textContent="".concat(I),A.src=(null===(b=d[0])||void 0===b||null===(w=b.gist)||void 0===w||null===(E=w.imageGist)||void 0===E?void 0:E.r16x9)||(null==d||null===(C=d[0])||void 0===C?void 0:C.img)||(null===(N=window)||void 0===N||null===(k=N.customData)||void 0===k?void 0:k.fallbackImage),B.onclick=function(){return v(e)}}else{var M,P,O,S,L,X,q,j,R=document.createElement("div");R.className="next-ep-preview",R.style.visibility="hidden",document.getElementById(e).append(R);var V=document.createElement("div");V.className="next-ep-header",V.textContent="Next up";var D=null===(M=d[0])||void 0===M?void 0:M.title,F=document.createElement("img");F.className="next-ep-img",F.src=(null===(P=d[0])||void 0===P||null===(O=P.gist)||void 0===O||null===(S=O.imageGist)||void 0===S?void 0:S.r16x9)||(null==d||null===(L=d[0])||void 0===L?void 0:L.img)||(null===(X=window)||void 0===X||null===(q=X.customData)||void 0===q?void 0:q.fallbackImage);var G=document.createElement("div");G.className="next-ep-title",(null===(j=D)||void 0===j?void 0:j.length)>60&&(D=D.substr(0,60)+"..."),G.textContent="".concat(D);var U=document.createElement("div");U.className="next-ep-content",U.append(F),U.append(G),U.onclick=function(){return v(e)},R.append(V),R.append(U)}},exports.initiateTrickplay=function(e){return N.apply(this,arguments)};
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./beacon-ca6bdec3.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/regenerator"),i=require("video.js");require("videojs-contrib-quality-menu");var r=require("@babel/runtime/helpers/typeof"),l=require("./util-06c5f98b.js"),a=require("./renditions-d4a3642f.js"),s=require("./resolution-4eae5e79.js"),u=require("./localisation-56e0a999.js");require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var d,c,v=function(e){return new Promise((function(n,t){if(p(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)}}))},p=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},m=function(){var t=n(o.mark((function n(t){var r,l,a,s;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=e.getPlayer(null==t?void 0:t.playerId),console.log(t),null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=5,import("@silvermine/videojs-chromecast");case 5:return s=n.sent,n.prev=6,n.next=9,v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(6),console.log("Error",n.t0);case 14:return n.prev=14,s.default(i),n.finish(14);case 17:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}}),n,null,[[6,11,14,17]])})));return function(e){return t.apply(this,arguments)}}(),f=function(n,t){var o=e.getPlayer(n);o&&t&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(e){var t,o,r,l,a,s=this.el(),u=i.dom.getPointerPosition(s,e).x;i.getPlayer(n).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===(o=t.cast)||void 0===o||null===(r=o.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),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function h(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?g(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):g(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var y=[],w=0,b=null;function k(n,o,i){var r,l,a,s,u,v=arguments.length>3&&void 0!==arguments[3]&&arguments[3];c=(null==o||null===(r=o.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var p=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,m=Math.floor(n.currentTime()),f=Math.floor(n.duration()),g=null==o||null===(a=o.watchHistory)||void 0===a?void 0:a.xapiKey,y=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,k=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,O=Math.floor(n.currentTime()),I=v?100:Math.floor(m/f*100),T={};k?function(n,o,i){var r=o?"watchhistory-data-".concat(o):"watchhistory-data-guest-".concat(i),l=P(r),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,n){return h(h({},e),{},t({},n,u[n]))}),{}),v=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===d}));v<0?l.push(h(h({content:c},n),{},{addedDate:a,updateDate:a})):l[v]=h(h(h({},l[v]),n),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(T={completed:v,watchedTime:O,watchedPercentage:I},p,o.siteOwner):("v1"==c?T={videoId:d,watchedTime:O,watchedPercentage:I,siteOwner:o.siteOwner,userId:o.userId,xApiKey:g}:"v2"==c&&(T=h(h({videoId:d,watchedTime:O,watchedPercentage:I,doneWatching:v,profileId:p},b&&{seriesId:b}),y&&{originalObjectId:y})),e.saveWatchHistory(T,c).then((function(e){})).catch((function(e){}))),w=m+i}function P(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function O(e,n,t){var o=P(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 I=function(n,t,o){var i=e.getPlayer(n);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),o&&o({status:!0,msg:"Volume set to ".concat(t,"%")})}else o&&o({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else o({status:!1,msg:"Cannot find player with id: '".concat(n,"'")})},T=function(n){var t=e.getPlayer(n);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(n,"'")},j=!1,S=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)&&!j){var l=C(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),j=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function C(e,n,t){if(Array.isArray(e))return e.map((function(e){return C(e,n,t)}));if(null!==e&&"object"===r(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]=C(e[i],n,t)})),o}return e}function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function x(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?D(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):D(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var E=function(n,t,o,i){var r,l,a=i.res,s=i.sres,u=e.getPlayer(n),c=(null==a?void 0:a.contentType)||"video",v=(null==a||null===(r=a[c])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;e.setCurrentVideo(a),u&&(u.on("loadstart",(function(){v?o.resolve({status:!0,msg:"Video Loaded",response:a}):o.resolve(x({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a}))})),u.on("loadeddata",(function(){var o,i;(null==u||!u.muted())&&I(n,sessionStorage.getItem("volume")||"100");var r=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 l,s,c=x(x({},t),a);!function(n,t,o){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(b=null==t||null===(r=t.series)||void 0===r?void 0:r.id),y=[],w=0,d=o;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=e.getPlayer(n);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());y.includes(w)||(e==w?(y.push(e),k(s,t,a)):e>w&&(w=e+a))})),s.one("ended",(function(){k(s,t,a,!0)})))}(n,c,null==r||null===(l=r.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.id)}})),u.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];u.trigger("subtitlechanged",n)})),u.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,p=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,m=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"===p){var f,g=m.getMediaSession(),h=g.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}})),u.tech_.on("retryplaylist",(function(){v&&S(a,n)})),u.on("error",(function(){var t,i;(console.log("ERROR",u.error(),u.error().code),4===u.error().code&&v)?S(a,n):(e.handleError(n,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured",response:a}))})),u.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},d=s.t,c=s.p;d&&c<95&&setTimeout((function(){u.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),u.on("chromecastDisconnected",(function(){if(v){u.currentSource();for(var e=u.textTracks(),n=e.length-1;n>=0;n--)u.removeRemoteTextTrack(e[n])}})))},V=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-bca424d1.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-76e6c431.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-df960279.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-b71fc9f4.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-a13cedfc.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-737b99ce.js")})).then((function(t){t.initialiseSkin(e,n)}))};var R,q=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),v("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)}}(),A=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:q,loadEMELibrary:A}),B=function(n,t){var o=new Map;e.getSeriesWatchHistory({videoId:n,token:t}).then((function(n){n.data.map((function(e){o.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),e.setSeriesWatchMap(o)})).catch((function(e){return console.log(e)}))};function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?L(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):L(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var M=function(r,l,a,s){var u,d,c,v,p,g,h,y,w,b,k,P,O,I,T,j,S,C,D,x,R,q,H,B,L,M,N,U,z,F,J,W,G,K=l.res,X=void 0===K?null:K,Q=l.sres,Y=void 0===Q?null:Q;null===(u=window)||void 0===u||null===(d=u.cast)||void 0===d||null===(c=d.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(p=v.getInstance())||void 0===p||p.S;var Z=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],$=(null===(g=X)||void 0===g?void 0:g.contentType)||"video",ee=e.impolicy16x9(null===(h=X)||void 0===h||null===(y=h[$])||void 0===y||null===(w=y.gist)||void 0===w?void 0:w.videoImageUrl)||e.impolicy16x9(null===(b=X)||void 0===b||null===(k=b[$])||void 0===k||null===(P=k.gist)||void 0===P||null===(O=P.imageGist)||void 0===O?void 0:O.r16x9),ne=(null===(I=X)||void 0===I||null===(T=I[$])||void 0===T||null===(j=T.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,te=(null===(S=X)||void 0===S||null===(C=S[$])||void 0===C||null===(D=C.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!0,oe=(null===(x=X)||void 0===x||null===(R=x.ads)||void 0===R||null===(q=R.preRoll)||void 0===q||null===(H=q.adTags)||void 0===H||null===(B=H.web)||void 0===B?void 0:B.active)&&(null===(L=X)||void 0===L||null===(M=L.ads)||void 0===M||null===(N=M.preRoll)||void 0===N||null===(U=N.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=_(_({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ie=(G={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==a.skin,liveui:ne},t(G,"autoplay",null==a?void 0:a.autoplay),t(G,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!oe),t(G,"loop",(null==a?void 0:a.loop)||!1),t(G,"audioPosterMode",null==a?void 0:a.audioPosterMode),t(G,"html5",_(_({vhs:_(_({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==a||null===(F=a.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(G,"poster",ee),t(G,"techOrder",Z),t(G,"chromecast",{requestCustomDataFn:function(n){var t=e.getPlayer(r),o=((null==t?void 0:t.textTracksJson_)||t.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,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){m.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var g=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=g}var h=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=h;var y=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=y;var w=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=w;var b=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=b,m.subTitles=t,m.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,n,o)}}),G);if(!i.getPlayers()[r])var re=i(r,ie,function(){var t=n(o.mark((function n(){var t,l,u,d,c,v,p,g,h,y,w,b,k,P,O,I,T,j,S,C,D,x,R;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(re),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,m(a);case 5:if(te&&s.resolve(_({status:!0,msg:"Player Initialised"},Y?{seriesResponse:Y,response:X}:{response:X})),e.inititateBeacon(r),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),P=null===(t=X)||void 0===t||null===(l=t[$])||void 0===l?void 0:l.drmEnabled,O=null===(u=X)||void 0===u||null===(d=u[$])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,!P){n.next=13;break}return n.next=13,A();case 13:ne&&f(r,O),!oe||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(r,oe,X),I=e.getSource(X,r),console.log(I),null!=a&&a.nearestClusterUrl&&(I=e.getUpdatedClusterSource(I,a.nearestClusterUrl)),I?e.loadVideo(r,I):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),e.handleError(r,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=X)||void 0===p||null===(g=p[$])||void 0===g||null===(h=g.contentDetails)||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0||(null===(w=X)||void 0===w||null===(b=w[$])||void 0===b||null===(k=b.closedCaptions)||void 0===k?void 0:k.length)>0)&&(R=(null===(j=X)||void 0===j||null===(S=j[$])||void 0===S||null===(C=S.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(D=X)||void 0===D||null===(x=D[$])||void 0===x?void 0:x.closedCaptions),T=R.filter((function(e){return"VTT"===e.format})),e.addCaptions(r,T)),null!=a&&a.disableControls?e.disableControls(r):V(r,_(_(_({},a),ie),{},{liveVideo:te,isDvrEnabled:ne,res:X,sres:Y})),E(r,_(_(_({},a),ie),{},{liveVideo:te}),s,{res:X,sres:Y});case 22:case"end":return n.stop()}}),n)})));return function(){return t.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(t){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(o.mark((function n(i,r){var l,a,s,d,c,p,m,f,g,h,y,w,b,k,P,I,T,j,S,C,D,x,E,V,A,L,N,U,z,F;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.isPlayerInitialised(null==t?void 0:t.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(w=(null==t?void 0:t.videoSourceUrl)||!1,b=null==t?void 0:t.asat,k=(null==t||null===(l=t.epg)||void 0===l?void 0:l.enable)||!1,P=null==t?void 0:t.videoId,I=(null==t||null===(a=t.series)||void 0===a?void 0:a.enable)||!1,window.videoId=P,T=null==t?void 0:t.token,!e.token_authentication_enabled(t)){n.next=15;break}if(e.refreshTokenManager().set(null==t?void 0:t.refreshToken),T&&!e.isTokenExpired(T)){n.next=14;break}return r({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),n.abrupt("return");case 14:R=JSON.parse(atob(T.split(".")[1]));case 15:return window.siteId=null===(s=R)||void 0===s?void 0:s.siteId,window.siteName=null===(d=R)||void 0===d?void 0:d.site,t.isAnonymousUser=!(null===(c=R)||void 0===c||!c.anonymousId),t.siteOwner=(null===(p=R)||void 0===p?void 0:p.site)||null,t.userId=(null===(m=R)||void 0===m?void 0:m.userId)||null,window.sessionStorage.setItem("uid",null===(f=R)||void 0===f?void 0:f.userId),window.watchHistory=t.watchHistory||null,sessionStorage.setItem("vlp_token",T),j=null==t?void 0:t.playerId,S=t.chromecastReceiverId=null!=t&&t.series?null:null==t?void 0:t.chromecastReceiverId,t.chromecastReceiverId=S,C=null==t?void 0:t.airplay,D=null==t?void 0:t.apiBaseUrl,x=(null==t||null===(g=t.analytics)||void 0===g?void 0:g.gaId)||null,(E=null==t?void 0:t.errors)&&(window.customErrors=E),window.customData=null==t?void 0:t.customData,u.setLocalisation(null==t||null===(h=t.customData)||void 0===h?void 0:h.localisation),D&&(window.playerEntitlementUrl=D),null!=t&&t.skin&&!e.isNotAValidSkin(t.skin)||(t.skin="VL_ONE"),n.next=37,q();case 37:C&&"Safari"==e.detectBrowser()&&Promise.resolve().then((function(){return H})).then((function(e){e.importAirplay()})),x&&v("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then((function(){return e.runGtag(x)})).catch((function(e){})),(V=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(j)))&&V.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(L={directPlaybackUrl:w,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(A,T).then((function(e){M(j,{res:_(_({},e),L)},t,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,A)})):M(j,{res:L},t,{resolve:i,reject:r})):I?(U=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(U)),z=null==t||null===(N=t.series)||void 0===N?void 0:N.id,e.getSeriesDetails(z,T).then((function(n){var o,l,a,s=n.data,u=n.data.seasons;e.setCurrentSeries(u);var d=P||(null==u||null===(o=u[0])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);B(z,T),e.getVideoDetails(d,T).then((function(n){var o,l,a;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(l=o.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,e.setCurrentVideo(n.data),M(j,{res:null==n?void 0:n.data,sres:s},t,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}))})).catch((function(n){e.initiateErrorHandling(n,j,r)}))):k?(F=null==t?void 0:t.epg,e.getLinearChannelDetails(F,T).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==F?void 0:F.channelId,M(j,{res:n},t,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}))):e.getVideoDetails(P,T).then((function(n){var o,l,a,s;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(l=o.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,e.setCurrentVideo(null==n?void 0:n.data);var u,d=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(s=t.watchHistory)&&void 0!==s&&s.enable)if((null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,p,m=O((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",P,null==t?void 0:t.siteOwner);if(m&&m.length)t.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;d.contentType="video",M(j,{res:d},t,{resolve:i,reject:r})}else e.getVideoInfo(P,T).then((function(e){var n,o,l,a,s,u;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,t.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",M(j,{res:d},t,{resolve:i,reject:r})})).catch((function(e){var n,o,l,a;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(e)),M(j,{res:d},t,{resolve:i,reject:r})}));else M(j,{res:d},t,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}));case 42:case"end":return n.stop()}}),n)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:e.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:e.enableCaptions,disableCaptions:e.disableCaptions,getCaptions:e.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:I,getVolume:T,disableControls:e.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("./beacon-3472d9ab.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/regenerator"),i=require("video.js");require("videojs-contrib-quality-menu");var r=require("@babel/runtime/helpers/typeof"),l=require("./util-c6824425.js"),a=require("./renditions-8e58b1fd.js"),s=require("./resolution-747ff7c8.js"),u=require("./localisation-56e0a999.js");require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var d,c,v=function(e){return new Promise((function(n,t){if(p(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)}}))},p=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},m=function(){var t=n(o.mark((function n(t){var r,l,a,s;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=e.getPlayer(null==t?void 0:t.playerId),console.log(t),null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=5,import("@silvermine/videojs-chromecast");case 5:return s=n.sent,n.prev=6,n.next=9,v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(6),console.log("Error",n.t0);case 14:return n.prev=14,s.default(i),n.finish(14);case 17:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}}),n,null,[[6,11,14,17]])})));return function(e){return t.apply(this,arguments)}}(),f=function(n,t){var o=e.getPlayer(n);o&&t&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(e){var t,o,r,l,a,s=this.el(),u=i.dom.getPointerPosition(s,e).x;i.getPlayer(n).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===(o=t.cast)||void 0===o||null===(r=o.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),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function h(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?g(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):g(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var y=[],w=0,b=null;function k(n,o,i){var r,l,a,s,u,v=arguments.length>3&&void 0!==arguments[3]&&arguments[3];c=(null==o||null===(r=o.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var p=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,m=Math.floor(n.currentTime()),f=Math.floor(n.duration()),g=null==o||null===(a=o.watchHistory)||void 0===a?void 0:a.xapiKey,y=(null==o||null===(s=o.video)||void 0===s?void 0:s.originalObjectId)||null,k=(null==o||null===(u=o.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,O=Math.floor(n.currentTime()),I=v?100:Math.floor(m/f*100),T={};k?function(n,o,i){var r=o?"watchhistory-data-".concat(o):"watchhistory-data-guest-".concat(i),l=P(r),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,n){return h(h({},e),{},t({},n,u[n]))}),{}),v=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===d}));v<0?l.push(h(h({content:c},n),{},{addedDate:a,updateDate:a})):l[v]=h(h(h({},l[v]),n),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(T={completed:v,watchedTime:O,watchedPercentage:I},p,o.siteOwner):("v1"==c?T={videoId:d,watchedTime:O,watchedPercentage:I,siteOwner:o.siteOwner,userId:o.userId,xApiKey:g}:"v2"==c&&(T=h(h({videoId:d,watchedTime:O,watchedPercentage:I,doneWatching:v,profileId:p},b&&{seriesId:b}),y&&{originalObjectId:y})),e.saveWatchHistory(T,c).then((function(e){})).catch((function(e){}))),w=m+i}function P(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function O(e,n,t){var o=P(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 I=function(n,t,o){var i=e.getPlayer(n);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),o&&o({status:!0,msg:"Volume set to ".concat(t,"%")})}else o&&o({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else o({status:!1,msg:"Cannot find player with id: '".concat(n,"'")})},T=function(n){var t=e.getPlayer(n);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(n,"'")},j=!1,S=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)&&!j){var l=C(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),j=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function C(e,n,t){if(Array.isArray(e))return e.map((function(e){return C(e,n,t)}));if(null!==e&&"object"===r(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]=C(e[i],n,t)})),o}return e}function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function x(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?D(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):D(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var E=function(n,t,o,i){var r,l,a=i.res,s=i.sres,u=e.getPlayer(n),c=(null==a?void 0:a.contentType)||"video",v=(null==a||null===(r=a[c])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;e.setCurrentVideo(a),u&&(u.on("loadstart",(function(){v?o.resolve({status:!0,msg:"Video Loaded",response:a}):o.resolve(x({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a}))})),u.on("loadeddata",(function(){var o,i;(null==u||!u.muted())&&I(n,sessionStorage.getItem("volume")||"100");var r=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 l,s,c=x(x({},t),a);!function(n,t,o){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(b=null==t||null===(r=t.series)||void 0===r?void 0:r.id),y=[],w=0,d=o;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=e.getPlayer(n);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());y.includes(w)||(e==w?(y.push(e),k(s,t,a)):e>w&&(w=e+a))})),s.one("ended",(function(){k(s,t,a,!0)})))}(n,c,null==r||null===(l=r.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.id)}})),u.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];u.trigger("subtitlechanged",n)})),u.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,p=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,m=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"===p){var f,g=m.getMediaSession(),h=g.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}})),u.tech_.on("retryplaylist",(function(){v&&S(a,n)})),u.on("error",(function(){var t,i;(console.log("ERROR",u.error(),u.error().code),4===u.error().code&&v)?S(a,n):(e.handleError(n,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured",response:a}))})),u.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},d=s.t,c=s.p;d&&c<95&&setTimeout((function(){u.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),u.on("chromecastDisconnected",(function(){if(v){u.currentSource();for(var e=u.textTracks(),n=e.length-1;n>=0;n--)u.removeRemoteTextTrack(e[n])}})))},V=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-65b1f1b0.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-386b6ca2.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-396027ea.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-72a1ccea.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-dd7cb2ee.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-a3188aa9.js")})).then((function(t){t.initialiseSkin(e,n)}))};var R,q=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),v("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)}}(),A=function(){var e=n(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:q,loadEMELibrary:A}),B=function(n,t){var o=new Map;e.getSeriesWatchHistory({videoId:n,token:t}).then((function(n){n.data.map((function(e){o.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),e.setSeriesWatchMap(o)})).catch((function(e){return console.log(e)}))};function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?L(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):L(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}var M=function(r,l,a,s){var u,d,c,v,p,g,h,y,w,b,k,P,O,I,T,j,S,C,D,x,R,q,H,B,L,M,N,U,z,F,J,W,G,K=l.res,X=void 0===K?null:K,Q=l.sres,Y=void 0===Q?null:Q;null===(u=window)||void 0===u||null===(d=u.cast)||void 0===d||null===(c=d.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(p=v.getInstance())||void 0===p||p.S;var Z=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],$=(null===(g=X)||void 0===g?void 0:g.contentType)||"video",ee=e.impolicy16x9(null===(h=X)||void 0===h||null===(y=h[$])||void 0===y||null===(w=y.gist)||void 0===w?void 0:w.videoImageUrl)||e.impolicy16x9(null===(b=X)||void 0===b||null===(k=b[$])||void 0===k||null===(P=k.gist)||void 0===P||null===(O=P.imageGist)||void 0===O?void 0:O.r16x9),ne=(null===(I=X)||void 0===I||null===(T=I[$])||void 0===T||null===(j=T.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,te=(null===(S=X)||void 0===S||null===(C=S[$])||void 0===C||null===(D=C.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!0,oe=(null===(x=X)||void 0===x||null===(R=x.ads)||void 0===R||null===(q=R.preRoll)||void 0===q||null===(H=q.adTags)||void 0===H||null===(B=H.web)||void 0===B?void 0:B.active)&&(null===(L=X)||void 0===L||null===(M=L.ads)||void 0===M||null===(N=M.preRoll)||void 0===N||null===(U=N.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=_(_({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ie=(G={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==a.skin,liveui:ne},t(G,"autoplay",null==a?void 0:a.autoplay),t(G,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!oe),t(G,"loop",(null==a?void 0:a.loop)||!1),t(G,"audioPosterMode",null==a?void 0:a.audioPosterMode),t(G,"html5",_(_({vhs:_(_({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==a||null===(F=a.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(G,"poster",ee),t(G,"techOrder",Z),t(G,"chromecast",{requestCustomDataFn:function(n){var t=e.getPlayer(r),o=((null==t?void 0:t.textTracksJson_)||t.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,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){m.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var g=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=g}var h=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=h;var y=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=y;var w=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=w;var b=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=b,m.subTitles=t,m.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,n,o)}}),G);if(!i.getPlayers()[r])var re=i(r,ie,function(){var t=n(o.mark((function n(){var t,l,u,d,c,v,p,g,h,y,w,b,k,P,O,I,T,j,S,C,D,x,R;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(re),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,m(a);case 5:if(te&&s.resolve(_({status:!0,msg:"Player Initialised"},Y?{seriesResponse:Y,response:X}:{response:X})),e.inititateBeacon(r),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),P=null===(t=X)||void 0===t||null===(l=t[$])||void 0===l?void 0:l.drmEnabled,O=null===(u=X)||void 0===u||null===(d=u[$])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,!P){n.next=13;break}return n.next=13,A();case 13:ne&&f(r,O),!oe||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(r,oe,X),I=e.getSource(X,r),console.log(I),null!=a&&a.nearestClusterUrl&&(I=e.getUpdatedClusterSource(I,a.nearestClusterUrl)),I?e.loadVideo(r,I):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),e.handleError(r,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=X)||void 0===p||null===(g=p[$])||void 0===g||null===(h=g.contentDetails)||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0||(null===(w=X)||void 0===w||null===(b=w[$])||void 0===b||null===(k=b.closedCaptions)||void 0===k?void 0:k.length)>0)&&(R=(null===(j=X)||void 0===j||null===(S=j[$])||void 0===S||null===(C=S.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(D=X)||void 0===D||null===(x=D[$])||void 0===x?void 0:x.closedCaptions),T=R.filter((function(e){return"VTT"===e.format})),e.addCaptions(r,T)),null!=a&&a.disableControls?e.disableControls(r):V(r,_(_(_({},a),ie),{},{liveVideo:te,isDvrEnabled:ne,res:X,sres:Y})),E(r,_(_(_({},a),ie),{},{liveVideo:te}),s,{res:X,sres:Y});case 22:case"end":return n.stop()}}),n)})));return function(){return t.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(t){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=n(o.mark((function n(i,r){var l,a,s,d,c,p,m,f,g,h,y,w,b,k,P,I,T,j,S,C,D,x,E,V,A,L,N,U,z,F;return o.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.isPlayerInitialised(null==t?void 0:t.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(w=(null==t?void 0:t.videoSourceUrl)||!1,b=null==t?void 0:t.asat,k=(null==t||null===(l=t.epg)||void 0===l?void 0:l.enable)||!1,P=null==t?void 0:t.videoId,I=(null==t||null===(a=t.series)||void 0===a?void 0:a.enable)||!1,window.videoId=P,T=null==t?void 0:t.token,!e.token_authentication_enabled(t)){n.next=15;break}if(e.refreshTokenManager().set(null==t?void 0:t.refreshToken),T&&!e.isTokenExpired(T)){n.next=14;break}return r({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),n.abrupt("return");case 14:R=JSON.parse(atob(T.split(".")[1]));case 15:return window.siteId=null===(s=R)||void 0===s?void 0:s.siteId,window.siteName=null===(d=R)||void 0===d?void 0:d.site,t.isAnonymousUser=!(null===(c=R)||void 0===c||!c.anonymousId),t.siteOwner=(null===(p=R)||void 0===p?void 0:p.site)||null,t.userId=(null===(m=R)||void 0===m?void 0:m.userId)||null,window.sessionStorage.setItem("uid",null===(f=R)||void 0===f?void 0:f.userId),window.watchHistory=t.watchHistory||null,sessionStorage.setItem("vlp_token",T),j=null==t?void 0:t.playerId,S=t.chromecastReceiverId=null!=t&&t.series?null:null==t?void 0:t.chromecastReceiverId,t.chromecastReceiverId=S,C=null==t?void 0:t.airplay,D=null==t?void 0:t.apiBaseUrl,x=(null==t||null===(g=t.analytics)||void 0===g?void 0:g.gaId)||null,(E=null==t?void 0:t.errors)&&(window.customErrors=E),window.customData=null==t?void 0:t.customData,u.setLocalisation(null==t||null===(h=t.customData)||void 0===h?void 0:h.localisation),D&&(window.playerEntitlementUrl=D),null!=t&&t.skin&&!e.isNotAValidSkin(t.skin)||(t.skin="VL_ONE"),n.next=37,q();case 37:C&&"Safari"==e.detectBrowser()&&Promise.resolve().then((function(){return H})).then((function(e){e.importAirplay()})),x&&v("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then((function(){return e.runGtag(x)})).catch((function(e){})),(V=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(j)))&&V.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(L={directPlaybackUrl:w,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(A,T).then((function(e){M(j,{res:_(_({},e),L)},t,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,A)})):M(j,{res:L},t,{resolve:i,reject:r})):I?(U=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(U)),z=null==t||null===(N=t.series)||void 0===N?void 0:N.id,e.getSeriesDetails(z,T).then((function(n){var o,l,a,s=n.data,u=n.data.seasons;e.setCurrentSeries(u);var d=P||(null==u||null===(o=u[0])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);B(z,T),e.getVideoDetails(d,T).then((function(n){var o,l,a;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(l=o.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,e.setCurrentVideo(n.data),M(j,{res:null==n?void 0:n.data,sres:s},t,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}))})).catch((function(n){e.initiateErrorHandling(n,j,r)}))):k?(F=null==t?void 0:t.epg,e.getLinearChannelDetails(F,T).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==F?void 0:F.channelId,M(j,{res:n},t,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}))):e.getVideoDetails(P,T).then((function(n){var o,l,a,s;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(l=o.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,e.setCurrentVideo(null==n?void 0:n.data);var u,d=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(s=t.watchHistory)&&void 0!==s&&s.enable)if((null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,p,m=O((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",P,null==t?void 0:t.siteOwner);if(m&&m.length)t.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;d.contentType="video",M(j,{res:d},t,{resolve:i,reject:r})}else e.getVideoInfo(P,T).then((function(e){var n,o,l,a,s,u;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,t.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",M(j,{res:d},t,{resolve:i,reject:r})})).catch((function(e){var n,o,l,a;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(e)),M(j,{res:d},t,{resolve:i,reject:r})}));else M(j,{res:d},t,{resolve:i,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}));case 42:case"end":return n.stop()}}),n)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:e.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:e.enableCaptions,disableCaptions:e.disableCaptions,getCaptions:e.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:I,getVolume:T,disableControls:e.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
|