@viewlift/player-backup 1.0.129-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.
Files changed (64) hide show
  1. package/cjs/{autoNextVideo-19ac2fbc.js → autoNextVideo-f75fb111.js} +1 -1
  2. package/cjs/{beacon-ca6bdec3.js → beacon-3472d9ab.js} +1 -1
  3. package/cjs/bundle.css +34 -27
  4. package/cjs/{caption-settings-6205c237.js → caption-settings-2b80dac2.js} +1 -1
  5. package/cjs/features-76f751d7.js +1 -0
  6. package/cjs/{index-c5962ac8.js → index-61264ed0.js} +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/multicamv2-5ab27b09.js +1 -0
  9. package/cjs/multicamv2-7a86b517.js +1 -0
  10. package/cjs/{multicamv2-685f96f0.js → multicamv2-9304a5b3.js} +1 -1
  11. package/cjs/{nextEpisodeButton-19833648.js → nextEpisodeButton-fdf9263d.js} +1 -1
  12. package/cjs/{playlist-9e6e42a9.js → playlist-19950019.js} +1 -1
  13. package/cjs/{renditions-d4a3642f.js → renditions-8e58b1fd.js} +1 -1
  14. package/cjs/{resolution-4eae5e79.js → resolution-747ff7c8.js} +1 -1
  15. package/cjs/{series-b9ff6f6e.js → series-0d5fa945.js} +1 -1
  16. package/cjs/series-v2-67d3f7ce.js +1 -0
  17. package/cjs/{series-v2-8b6f8385.js → series-v2-d6a2e270.js} +1 -1
  18. package/cjs/series-v2-fd7485a5.js +1 -0
  19. package/cjs/{settings-icon-7099e038.js → settings-icon-23d9d227.js} +1 -1
  20. package/cjs/{skin-76e6c431.js → skin-386b6ca2.js} +1 -1
  21. package/cjs/{skin-6b59b752.js → skin-396027ea.js} +1 -1
  22. package/cjs/{skin-c66e9b42.js → skin-55d72243.js} +1 -1
  23. package/cjs/{skin-58829249.js → skin-65b1f1b0.js} +1 -1
  24. package/cjs/{skin-f1c386aa.js → skin-72a1ccea.js} +1 -1
  25. package/cjs/{skin-2839ab53.js → skin-a3188aa9.js} +1 -1
  26. package/cjs/{skin-a13cedfc.js → skin-dd7cb2ee.js} +1 -1
  27. package/cjs/{util-06c5f98b.js → util-c6824425.js} +1 -1
  28. package/cjs/{videoSelector-186cabf3.js → videoSelector-d1fc09ec.js} +1 -1
  29. package/cjs/videoSelector-f2b1fbef.js +1 -0
  30. package/cjs/videoSelector-fcdf11eb.js +1 -0
  31. package/esm/{autoNextVideo-355201d8.js → autoNextVideo-743a7782.js} +1 -1
  32. package/esm/{beacon-37a5aa2a.js → beacon-9d84d686.js} +1 -1
  33. package/esm/bundle.css +34 -27
  34. package/esm/{caption-settings-6aa826ce.js → caption-settings-e83b6814.js} +1 -1
  35. package/esm/features-5f7a39e0.js +1 -0
  36. package/esm/{index-5d1bfb67.js → index-d9dda287.js} +1 -1
  37. package/esm/index.js +1 -1
  38. package/esm/multicamv2-1fb5149a.js +1 -0
  39. package/esm/{multicamv2-2d2b4a01.js → multicamv2-3d6e8051.js} +1 -1
  40. package/esm/multicamv2-b844a4f6.js +1 -0
  41. package/esm/{nextEpisodeButton-e990f8b8.js → nextEpisodeButton-89ebffbb.js} +1 -1
  42. package/esm/{playlist-a9ce0c79.js → playlist-06f7f6a3.js} +1 -1
  43. package/esm/{renditions-5556ca50.js → renditions-f77c7c46.js} +1 -1
  44. package/esm/{resolution-b1192d49.js → resolution-d7ed7790.js} +1 -1
  45. package/esm/{series-5e8c84d7.js → series-12881a0f.js} +1 -1
  46. package/esm/series-v2-4cdbf9b1.js +1 -0
  47. package/esm/{series-v2-1bcf61b1.js → series-v2-a2a3c240.js} +1 -1
  48. package/esm/series-v2-e01126da.js +1 -0
  49. package/esm/{settings-icon-d476eb7c.js → settings-icon-bb726185.js} +1 -1
  50. package/esm/{skin-2f09c77e.js → skin-0a0c271b.js} +1 -1
  51. package/esm/{skin-2d9f6387.js → skin-7f6a85cb.js} +1 -1
  52. package/esm/{skin-705779f4.js → skin-82885153.js} +1 -1
  53. package/esm/{skin-fbc45594.js → skin-b06174f6.js} +1 -1
  54. package/esm/skin-b95b5c90.js +1 -0
  55. package/esm/{skin-1eaa2c91.js → skin-c966c9cd.js} +1 -1
  56. package/esm/{skin-2b40be0d.js → skin-e84d46c6.js} +1 -1
  57. package/esm/{util-3cb40c3d.js → util-e0a6cf62.js} +1 -1
  58. package/esm/videoSelector-8e258d45.js +1 -0
  59. package/esm/videoSelector-a666f272.js +1 -0
  60. package/esm/{videoSelector-45e8433f.js → videoSelector-e4bd4ee1.js} +1 -1
  61. package/package.json +1 -1
  62. package/cjs/features-eb660010.js +0 -1
  63. package/esm/features-ef70c938.js +0 -1
  64. package/esm/skin-b9042825.js +0 -1
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"axios";import o from"video.js";import r from"js-cookie";import a from"ua-parser-js";import l from"@babel/runtime/helpers/toConsumableArray";var 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,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function s(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)}function c(e,n){u("event",e,n)}function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function m(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var f={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=f.version;var p=function(e,n){var t,o,r,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):i({url:F(),params:m({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:n,"Sdk-Version":f.version},withCredentials:!0})},w=function(e,n){var t,o,r,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):i({url:S()+d.getLinearChannelDetails,params:m(m(m(m(m({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:n}})},g=function(e,n){var t,o,r=JSON.parse(atob(n.split(".")[1])),a=(null==r?void 0:r.site)||null;return r&&r.countryCode,null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})})):i({url:S()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},E=function(){var e=n(t.mark((function e(n,o){var r,a;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return a={siteOwner:null==n?void 0:n.siteOwner,userId:null==n?void 0:n.userId,videoId:null==n?void 0:n.videoId,watchedPercentage:null==n?void 0:n.watchedPercentage,watchedTime:null==n?void 0:n.watchedTime},e.abrupt("return",i({url:O(),method:"POST",headers:{Authorization:r,"x-api-key":n.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:D(),method:"POST",headers:{Authorization:r},data:m({},n),params:m({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),I=function(e,n){var t,o,r=(null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(n.split(".")[1])),u=(null==d?void 0:d.site)||null;return i({method:"GET",url:b(e),params:{site:u},headers:{Authorization:n,"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(n.split(".")[1]));var v=window.contentType;return i({method:"GET",url:_(e,v),headers:{Authorization:n,"x-api-key":null===(s=window)||void 0===s||null===(c=s.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},h=function(e){var n,t;if("v1"==((null===(n=window)||void 0===n||null===(t=n.watchHistory)||void 0===t?void 0:t.apiVersion)||"v1"))return i({method:"GET",url:y(),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:T(o),headers:{Authorization:e.token},timeout:15e3})},T=function(e){return S()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV2,"/").concat(e)},y=function(){return S()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV1)},b=function(e){return S()+"".concat(null==d?void 0:d.getVideoInfoV1,"/").concat(e)},_=function(e,n){return S()+"".concat(null==d?void 0:d.getVideoInfoV2,"/").concat(n,"/").concat(e)},O=function(){return S()+"".concat(null==d?void 0:d.saveWatchHistoryV1)},D=function(){return S()+"".concat(null==d?void 0:d.saveWatchHistoryV2)},F=function(){var e,n,t,i,o=S()+"".concat(null==d?void 0:d.getVideoDetails);return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":o},S=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==d?void 0:d.apiBaseUrl)},P=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},A=null;function L(){return{set:function(e){e&&(A=e)},get:function(){return A}}}var V,R,C,W,N,k,B=function(){var e=n(t.mark((function e(){var n,o,r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=L().get(),o=S(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),x=null,j=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!P(n)){e.next=6;break}return x||(x=B().then((function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&L().set(r),o||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){x=null}))),e.abrupt("return",x);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},U=function(e,n,t){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:n},withCredentials:!0})},H=function(e){R=e},z=function(){return R},G=function(e){V=e},Y=function(){return V},q=function(){return C},J=function(e){console.log("set",e),C=e},K=function(e){N=e},X=function(){return N},Q=function(e){W=new Map,e.map((function(e,n){W.set(e.id,n)}))},Z=function(e){if(W){var n=W.get(e);J(n+1)}},$=(k=0,{set:function(e){e>=0&&(k=e)},get:function(){return k}}),ee=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var 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(n),o.appendChild(r),i.append(o)}}},ne=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var te=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.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"},ie=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)};function oe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function re(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):oe(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}window._deviceInfo=a(navigator.userAgent);var ae=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},le=function(e){var n=de(e,"video.tags",[]),t=de(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},de=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},ue=function(){var e,n,t,i,o,a,l,d,u,s,c,v,m,f,p,w,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",E=arguments.length>1?arguments[1]:void 0,I=arguments.length>2?arguments[2]:void 0,h=(null==I?void 0:I.contentType)||"video",T=null==I||null===(e=I[h])||void 0===e?void 0:e.metadata,y=Ge(E);if(!g.includes("VIEWLIFT_"))return g;var b=window.getComputedStyle(document.getElementById(E),null),_=Math.trunc(b.getPropertyValue("height").slice(0,-2)),O=Math.trunc(b.getPropertyValue("width").slice(0,-2)),D="linearchannel"===h?null==I||null===(n=I.linearchannel)||void 0===n||null===(t=n.channels)||void 0===t||null===(i=t.find((function(e){return(null==e?void 0:e.id)===(null==I?void 0:I.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:de(I,"video.gist.id",""),F=re(re({},ve(T)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE:ae(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:de(I,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:de(I,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:de(I,"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:le(I),VIEWLIFT_MEDIA_ID:D,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(de(I,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:D,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+de(I,"video.gist.permalink","")),VIEWLIFT_CONSENT:r.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:de(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:de(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(f=m.site)||void 0===f?void 0:f.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*de(I,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:de(I,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:D,VIEWLIFT_CONTENT_TITLE:de(I,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:de(I,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:de(I,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ce(),VIEWLIFT_SEASON_NUMBER:se(),VIEWLIFT_CONTENT_TAGS:le(I)},null===(p=window)||void 0===p||null===(w=p.customData)||void 0===w?void 0:w.macros);for(var S in F){var P=new RegExp(S,"g");g=g.replace(P,F[S])}return g},se=function(){var e=$.get();return e>=0?e+1:1},ce=function(){var e,n,t,i=Y(),o=z(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=$.get(),l=null==i||null===(n=i[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1},ve=function(e){var n,t,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===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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?(ie()?u?l=re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(l=re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?l=re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(l=re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?l=re(re({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}):s&&(l=re(re({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||""})),l=ie()?re(re({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):re(re({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=re(re({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}),l=ie()?re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),l},me=function(e,n){var t,i,o,r,a,l,d,u,s,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",w=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(i=e[p])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[p])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,I=(null==e||null===(l=e[p])||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[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var h=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return pe(E);if(w){var T=we(g,n);return T.src=ue(T.src,n,e),T}if("Safari"!==te()&&h)return fe(g);if(I){var y=pe(g);return y.src=ue(y.src,n,e),y}if(null!=g&&g.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return b.src=ue(b.src,n,e),b}return null},fe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},pe=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},we=function(e,n){var t=e.fairPlay,i=e.widevine,r=e.playReady,a=te();if(Ge(n),"Safari"===a){var l=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};console.log("🔐 Requesting FairPlay Certificate...",i),o.xhr(i,(function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,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,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(t);return ge(n),l}var d={src:i.url,type:"application/dash+xml"};return ge(n),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 ge=function(e){var n=Ge(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==te()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Ee=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},Ie=function(e,n){var t,i,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(t=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===t||null===(i=t[0])||void 0===i||null===(o=i.style)||void 0===o||o.setProperty("display","flex"));for(var r=Ge(e).textTracks(),a=0;a<r.length;a++){var l=r[a];"subtitles"!==l.kind&&"captions"!==l.kind||l.id!=n||(l.mode="showing")}},he=function(e,n){for(var t=Ge(e).textTracks(),i=0;i<t.length;i++){var o=t[i];"subtitles"!==o.kind&&"captions"!==o.kind||o.id!==n||(o.mode="hidden")}},Te=function(e){var n,t=Ge(e);return(null==t||null===(n=t.textTracks())||void 0===n?void 0:n.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},ye=function(e){var n=Ge(e);n.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,n.removeRemoteTextTrack(e)}))},be=function(e,n){var t=Ge(e);t.remoteTextTracks().tracks_.map((function(e){t.removeRemoteTextTrack(e)})),n.map((function(e){t.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},_e=!1,Oe=function(e,n,t){var i=ue(n,e,t),o=Ge(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i,o,r=Ge(e);if(null!==r.el_){_e=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),_e&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,n,!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===(t=window)||void 0===t||null===(i=t.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)}},De=["live","carousel","V2","defaultV2","multiplayer","minimalist","VL_ONE"],Fe=function(e){return!De.includes(e)},Se=function(e){var n=(new DOMParser).parseFromString(e,"text/html");return null==n?void 0:n.querySelector("body")},Pe=function(e){var n=(new DOMParser).parseFromString(e,"image/svg+xml");return null==n?void 0:n.querySelector("svg")},Ae=function(e){return Pe(e)},Le=function(e){var n=l(document.querySelectorAll("[video-idx]"));console.log(n),n.map((function(n){var t=n.parentNode,i=n.getAttribute("video-idx");t.style.background=i==e?"gray":"none"}))},Ve=function(){var e=l(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var n,t;null==e||null===(n=e.childNodes)||void 0===n||null===(t=n[0])||void 0===t||t.click()}))},Re=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},Ce="",We=function(e,n){var t,i=function(){return function(e,n){var t=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",i=document.getElementById(e);if(i&&Ce!==t){var o=window.getComputedStyle(i,null).getPropertyValue("height");n&&(n.style.height="".concat(o)),Ce=t}}(e,n)};window._orientationChangeHandler=i;window.addEventListener("resize",(function(){clearTimeout(t),t=setTimeout((function(){i()}),100)}))},Ne=function(e,n){var t,i=Ge(e),o=Ge(e).el(),r=new ResizeObserver((function(){var i;null!==(i=n.classList)&&void 0!==i&&i.contains("hidden")||(t&&clearTimeout(t),t=setTimeout((function(){ke(e,n)}),200))}));r.observe(o),i.on("dispose",(function(){r.disconnect()})),i.on("fullscreenchange",(function(){setTimeout((function(){ke(e,n)}),50)}))},ke=function(e,n){var t;if(n){var i=document.getElementById(e),o=null===(t=window.getComputedStyle(i,null))||void 0===t?void 0:t.height;n.style.height!==o&&(n.style.height="".concat(o))}};function Be(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var xe=function(e){o(e).play()},je=function(e){o(e).pause()},Me=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},Ue=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},He=function(e){return!!o.getPlayer("".concat(e))},ze=function(e){return o(e).paused()},Ge=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},Ye=function(){var e=n(t.mark((function e(n,i){var o,r,a,l=arguments;return t.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,j();case 3:return r=e.sent,a=Ge(n),e.abrupt("return",new Promise((function(e,t){w(i,r).then((function(t){var r=null==t?void 0:t.data;window.sid=on(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=me(r,n);H(r),l&&o?(Qe(n,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){t({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),qe=function(){var e=n(t.mark((function e(n,i,o){var r,a,l,d,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return d=e.sent,(Y()||null)&&Z(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&&I(i,d).then((function(e){var n,t,i,o,r,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.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 n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,t){p(i,d).then((function(i){var o,r,a,l,d,c,v,m,f,p,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;H(i.data);var E=(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===(f=m.adTags)||void 0===f||null===(p=f.web)||void 0===p?void 0:p.url);E&&Oe(n,E,w);var I=me(w,n);if(I){var h,T,y,b,_,O,D,F,S,P,A,L,V,R,C=(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),W=Ge(n);if(W.poster(C),Qe(n,I),W.on("loadstart",(function(){g&&e({status:!0,msg:"Video Loaded",response:w})})),W.on("loadeddata",(function(){ne(),e({status:!0,msg:"Video Loaded",response:w})})),W.one("play",(function(){u&&s<95&&setTimeout((function(){W.currentTime(u)}),0)})),W.one("error",(function(){var e;t({status:!1,msg:(null==W||null===(e=W.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===(S=w.video)||void 0===S||null===(P=S.closedCaptions)||void 0===P?void 0:P.length)>0)A=((null==w||null===(L=w.video)||void 0===L||null===(V=L.contentDetails)||void 0===V?void 0:V.closedCaptions)||(null==w||null===(R=w.video)||void 0===R?void 0:R.closedCaptions)).filter((function(e){return"VTT"===e.format})),be(n,A);else ye(n)}else ee(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){Ze(e,n,t,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),Je=function(e,n,t){var i=Ge(e);return i.src(n),new Promise((function(e,n){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Ke=function(e){var n=Ge(e);if(Xe(),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,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Xe=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()},Qe=function(e,n){var t=Ge(e);t&&t.src(n)},Ze=function(n,t,i,o){var r,a,l,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);He(t)&&ee(t,(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(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Be(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},o&&{videoId:o}))},$e=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};function en(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function nn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?en(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):en(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var tn=function(){var e,n,t,i,o,r,a,l=z();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===t||null===(i=t.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 on(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function rn(){var e=window.sessionStorage.getItem("uid");return e||(e=on(),window.sessionStorage.setItem("uid",e),e)}function an(){return ln.apply(this,arguments)}function ln(){return(ln=n(t.mark((function e(){var n,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.initialise=function(e){window.sid=on(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var t,i,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",nn({pfm:window.platform,uid:rn(),vid:tn(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var n,t,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",nn({pfm:window.platform,uid:rn(),vid:tn(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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 n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting"))c("BUFFERING",nn({pfm:window.platform,uid:rn(),vid:tn(),videoPosition:n.el_&&Math.floor(n.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:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",nn({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:rn(),vid:tn()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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 n,t,i,o,r,a;c("AD_REQUEST",nn({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:rn(),vid:tn(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",nn({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:rn(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:tn()},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 n=[];e.on("timeupdate",(function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(dn(n,r,a)){var l=Math.round(t-a);if(isFinite(l))return l}}}))()};var dn=function(e,n,t){return e>=n&&e<=t};function un(e){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=Ge(e);window.initialise(n),window.firstFrame(n),n.on("loadedmetadata",(function(){window.endFirstFrame(n)}))}}window.fireEvent=function(){var e=n(t.mark((function e(n){var o,r,a,l,d,u,s,c,v,m,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=nn,e.t1=nn,e.t2=nn({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=rn(),e.t5=tn(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=n.videoPosition,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:"",e.t17=!0===n.isAdEvent?(t=n.adPosition)?String(t):"":"",e.next=20,an();case 20:return e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=n.ttFirstFrame,e.t23=n.bitrate,e.t24=n.resHeight,e.t25=n.resWidth,e.t26=n.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==n?void 0:n.duration)&&{duration:n.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,j();case 37:f=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:f},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var t}),e)})));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};export{Ve as $,p as A,I as B,Ze as C,Fe as D,M as E,L as F,P as G,Re as H,Oe as I,Ee as J,be as K,un as L,s as M,g as N,w as O,$ as P,G as Q,Pe as R,Ae as S,ie as T,q as U,Y as V,J as W,Le as X,ze as Y,ye as Z,Se as _,z as a,ke as a0,We as a1,Ne as a2,Q as a3,Z as a4,me as b,H as c,te as d,ne as e,X as f,Ge as g,ee as h,h as i,K as j,Je as k,Qe as l,Me as m,je as n,He as o,xe as p,qe as q,Ue as r,E as s,Ye as t,Ke as u,Ie as v,he as w,Te as x,$e as y,U as z};
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import i from"axios";import o from"video.js";import r from"js-cookie";import a from"ua-parser-js";import l from"@babel/runtime/helpers/toConsumableArray";var 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,n;null===(e=window)||void 0===e||null===(n=e.dataLayer)||void 0===n||n.push(arguments)}function s(e){window.dataLayer=window.dataLayer||[],u("js",new Date),u("config",e)}function c(e,n){u("event",e,n)}function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function m(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var f={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=f.version;var p=function(e,n){var t,o,r,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):i({url:F(),params:m({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:n,"Sdk-Version":f.version},withCredentials:!0})},w=function(e,n){var t,o,r,a;return null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementResponse})})):i({url:S()+d.getLinearChannelDetails,params:m(m(m(m(m({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:n}})},g=function(e,n){var t,o,r=JSON.parse(atob(n.split(".")[1])),a=(null==r?void 0:r.site)||null;return r&&r.countryCode,null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,n){var t,i;return e({data:null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.seriesData})})):i({url:S()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},E=function(){var e=n(t.mark((function e(n,o){var r,a;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return a={siteOwner:null==n?void 0:n.siteOwner,userId:null==n?void 0:n.userId,videoId:null==n?void 0:n.videoId,watchedPercentage:null==n?void 0:n.watchedPercentage,watchedTime:null==n?void 0:n.watchedTime},e.abrupt("return",i({url:O(),method:"POST",headers:{Authorization:r,"x-api-key":n.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:D(),method:"POST",headers:{Authorization:r},data:m({},n),params:m({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),I=function(e,n){var t,o,r=(null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(n.split(".")[1])),u=(null==d?void 0:d.site)||null;return i({method:"GET",url:b(e),params:{site:u},headers:{Authorization:n,"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(n.split(".")[1]));var v=window.contentType;return i({method:"GET",url:_(e,v),headers:{Authorization:n,"x-api-key":null===(s=window)||void 0===s||null===(c=s.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},h=function(e){var n,t;if("v1"==((null===(n=window)||void 0===n||null===(t=n.watchHistory)||void 0===t?void 0:t.apiVersion)||"v1"))return i({method:"GET",url:y(),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:T(o),headers:{Authorization:e.token},timeout:15e3})},T=function(e){return S()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV2,"/").concat(e)},y=function(){return S()+"".concat(null==d?void 0:d.getSeriesWatchHistoryV1)},b=function(e){return S()+"".concat(null==d?void 0:d.getVideoInfoV1,"/").concat(e)},_=function(e,n){return S()+"".concat(null==d?void 0:d.getVideoInfoV2,"/").concat(n,"/").concat(e)},O=function(){return S()+"".concat(null==d?void 0:d.saveWatchHistoryV1)},D=function(){return S()+"".concat(null==d?void 0:d.saveWatchHistoryV2)},F=function(){var e,n,t,i,o=S()+"".concat(null==d?void 0:d.getVideoDetails);return null!==(e=window)&&void 0!==e&&null!==(n=e.customData)&&void 0!==n&&n.overrideEntitlementBaseUrl?(null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.overrideEntitlementBaseUrl)+"/video/status":o},S=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==d?void 0:d.apiBaseUrl)},P=function(e){var n=JSON.parse(atob(null==e?void 0:e.split(".")[1])),t=null==n?void 0:n.exp;if(new Date(1e3*t).getTime()<(new Date).getTime())return!0},A=null;function L(){return{set:function(e){e&&(A=e)},get:function(){return A}}}var V,R,C,W,N,k,B=function(){var e=n(t.mark((function e(){var n,o,r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=L().get(),o=S(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(n)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),x=null,j=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=sessionStorage.getItem("vlp_token"))||!P(n)){e.next=6;break}return x||(x=B().then((function(e){var t,i,o=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(i=e.data)||void 0===i?void 0:i.refreshToken;return o&&sessionStorage.setItem("vlp_token",o),r&&L().set(r),o||n})).catch((function(e){return console.error("Error fetching refresh token",e),n})).finally((function(){x=null}))),e.abrupt("return",x);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(e){var n=!0,t=null==e?void 0:e.videoSourceUrl,i=null==e?void 0:e.asat;return t&&!i&&(n=!1),n},U=function(e,n,t){return i({url:t,params:{id:e,deviceType:"web_browser",contentConsumption:"web"},method:"GET",headers:{Authorization:n},withCredentials:!0})},H=function(e){R=e},z=function(){return R},G=function(e){V=e},Y=function(){return V},q=function(){return C},J=function(e){console.log("set",e),C=e},K=function(e){N=e},X=function(){return N},Q=function(e){W=new Map,e.map((function(e,n){W.set(e.id,n)}))},Z=function(e){if(W){var n=W.get(e);J(n+1)}},$=(k=0,{set:function(e){e>=0&&(k=e)},get:function(){return k}}),ee=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var 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(n),o.appendChild(r),i.append(o)}}},ne=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var te=function(){var e,n;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(n=e.userAgentData)||void 0===n?void 0:n.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"},ie=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)};function oe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function re(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):oe(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}window._deviceInfo=a(navigator.userAgent);var ae=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},le=function(e){var n=de(e,"video.tags",[]),t=de(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},de=function(e,n,t){for(var i=0,o=(n=n.split(".")).length;i<o;i++){var r;e=null===(r=e)||void 0===r?void 0:r[n[i]]}return e||t},ue=function(){var e,n,t,i,o,a,l,d,u,s,c,v,m,f,p,w,g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",E=arguments.length>1?arguments[1]:void 0,I=arguments.length>2?arguments[2]:void 0,h=(null==I?void 0:I.contentType)||"video",T=null==I||null===(e=I[h])||void 0===e?void 0:e.metadata,y=Ye(E);if(!g.includes("VIEWLIFT_"))return g;var b=window.getComputedStyle(document.getElementById(E),null),_=Math.trunc(b.getPropertyValue("height").slice(0,-2)),O=Math.trunc(b.getPropertyValue("width").slice(0,-2)),D="linearchannel"===h?null==I||null===(n=I.linearchannel)||void 0===n||null===(t=n.channels)||void 0===t||null===(i=t.find((function(e){return(null==e?void 0:e.id)===(null==I?void 0:I.channelId)})))||void 0===i||null===(o=i.content)||void 0===o?void 0:o.id:de(I,"video.gist.id",""),F=re(re({},ve(T)),{},{VIEWLIFT_WIDTH:O,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE:ae(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:de(I,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:de(I,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:de(I,"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:le(I),VIEWLIFT_MEDIA_ID:D,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(de(I,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:D,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+de(I,"video.gist.permalink","")),VIEWLIFT_CONSENT:r.get("cc")||"VIEWLIFT_CONSENT",VIEWLIFT_COPPA:de(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:de(null===(v=window)||void 0===v||null===(m=v.app_data)||void 0===m||null===(f=m.site)||void 0===f?void 0:f.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*de(I,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:de(I,"video.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:D,VIEWLIFT_CONTENT_TITLE:de(I,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:de(I,"video.series.gist.title","VIEWLIFT_CONTENT_SERIES_TITLE"),VIEWLIFT_CONTENT_GENRE:de(I,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER",VIEWLIFT_EPISODE_NUMBER:ce(),VIEWLIFT_SEASON_NUMBER:se(),VIEWLIFT_CONTENT_TAGS:le(I)},null===(p=window)||void 0===p||null===(w=p.customData)||void 0===w?void 0:w.macros);for(var S in F){var P=new RegExp(S,"g");g=g.replace(P,F[S])}return g},se=function(){var e=$.get();return e>=0?e+1:1},ce=function(){var e,n,t,i=Y(),o=z(),r=null==o||null===(e=o.video)||void 0===e?void 0:e.id,a=$.get(),l=null==i||null===(n=i[a])||void 0===n||null===(t=n.episodes)||void 0===t?void 0:t.findIndex((function(e){return(null==e?void 0:e.id)===r}));return l>=0?l+1:1},ve=function(e){var n,t,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===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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?(ie()?u?l=re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):s&&(l=re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):u?l=re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):s&&(l=re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),u?l=re(re({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}):s&&(l=re(re({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||""})),l=ie()?re(re({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):re(re({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=re(re({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}),l=ie()?re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):re(re({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),l},me=function(e,n){var t,i,o,r,a,l,d,u,s,c,v,m,f,p=(null==e?void 0:e.contentType)||"video",w=null==e||null===(t=e[p])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(i=e[p])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.videoAssets,E=null==e||null===(r=e[p])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,I=(null==e||null===(l=e[p])||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[p])||void 0===s||null===(c=s.liveDetails)||void 0===c||c.isDvrEnabled;var h=(null==e||null===(v=e[p])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(f=m.videoAssets)||void 0===f?void 0:f.dash)||!1;if(null!=e&&e.directPlaybackUrl)return{src:null==e?void 0:e.directPlaybackUrl,type:null};if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return pe(E);if(w){var T=we(g,n);return T.src=ue(T.src,n,e),T}if("Safari"!==te()&&h)return fe(g);if(I){var y=pe(g);return y.src=ue(y.src,n,e),y}if(null!=g&&g.mpeg){var b=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return b.src=ue(b.src,n,e),b}return null},fe=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},pe=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},we=function(e,n){var t=e.fairPlay,i=e.widevine,r=e.playReady,a=te();if(Ye(n),"Safari"===a){var l=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};console.log("🔐 Requesting FairPlay Certificate...",i),o.xhr(i,(function(e,n,i){console.log(e),e&&t(e),t(null,new Uint8Array(i))}))},getContentId:function(e,n){if(n){var t=n.indexOf("\0")+1;return n.slice(t)}},getLicense:function(n,t,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,n,t){console.log(e),e&&r(e),r(null,t)}))}}}}}(t);return ge(n),l}var d={src:i.url,type:"application/dash+xml"};return ge(n),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 ge=function(e){var n=Ye(e);if("function"==typeof n.eme)try{n.eme(),"Safari"==te()&&n.eme.initLegacyFairplay()}catch(e){console.log("EME ERROR :",e)}},Ee=function(e,n){var t=e.src,i=e.type;if(!t||"string"!=typeof t||!t.includes(".com"))return{src:t,type:i};n=n.replace(/\/$/,"");var o=t.split(".com")[1]||"";return{src:o?"".concat(n).concat(o):t,type:i}},Ie=function(e,n){var t,i,o;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(t=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===t||null===(i=t[0])||void 0===i||null===(o=i.style)||void 0===o||o.setProperty("display","flex"));for(var r=Ye(e).textTracks(),a=0;a<r.length;a++){var l=r[a];"subtitles"!==l.kind&&"captions"!==l.kind||l.id!=n||(l.mode="showing")}},he=function(e,n){for(var t=Ye(e).textTracks(),i=0;i<t.length;i++){var o=t[i];"subtitles"!==o.kind&&"captions"!==o.kind||o.id!==n||(o.mode="hidden")}},Te=function(e){var n,t=Ye(e);return(null==t||null===(n=t.textTracks())||void 0===n?void 0:n.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},ye=function(e){var n=Ye(e);n.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,n.removeRemoteTextTrack(e)}))},be=function(e,n){var t=Ye(e);t.remoteTextTracks().tracks_.map((function(e){t.removeRemoteTextTrack(e)})),n.map((function(e){t.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},_e=!1,Oe=function(e,n,t){var i=ue(n,e,t),o=Ye(e);if(n&&window.google){if("function"!=typeof o.ima)return;o.ima.initializeAdDisplayContainer&&o.ima.initializeAdDisplayContainer(),function(e,n){var t,i,o,r=Ye(e);if(null!==r.el_){_e=!0;var a={id:e,adTagUrl:"".concat(n),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),_e&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,n,!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===(t=window)||void 0===t||null===(i=t.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)}},De=["live","carousel","V2","defaultV2","multiplayer","minimalist","VL_ONE"],Fe=function(e){return!De.includes(e)},Se=function(e){var n=(new DOMParser).parseFromString(e,"text/html");return null==n?void 0:n.querySelector("body")},Pe=function(e){var n=(new DOMParser).parseFromString(e,"image/svg+xml");return null==n?void 0:n.querySelector("svg")},Ae=function(e){return Pe(e)},Le=function(e){var n=l(document.querySelectorAll("[video-idx]"));console.log(n),n.map((function(n){var t=n.parentNode,i=n.getAttribute("video-idx");t.style.background=i==e?"gray":"none"}))},Ve=function(e){l(document.querySelectorAll("[video-idx]")).map((function(n){var t=n.getAttribute("video-idx");n.style.border=t==e?"2px solid white":"none"}))},Re=function(){var e=l(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var n,t;null==e||null===(n=e.childNodes)||void 0===n||null===(t=n[0])||void 0===t||t.click()}))},Ce=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},We="",Ne=function(e,n){var t,i=function(){return function(e,n){var t=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape",i=document.getElementById(e);if(i&&We!==t){var o=window.getComputedStyle(i,null).getPropertyValue("height");n&&(n.style.height="".concat(o)),We=t}}(e,n)};window._orientationChangeHandler=i;window.addEventListener("resize",(function(){clearTimeout(t),t=setTimeout((function(){i()}),100)}))},ke=function(e,n){var t,i=Ye(e),o=Ye(e).el(),r=new ResizeObserver((function(){var i;null!==(i=n.classList)&&void 0!==i&&i.contains("hidden")||(t&&clearTimeout(t),t=setTimeout((function(){Be(e,n)}),200))}));r.observe(o),i.on("dispose",(function(){r.disconnect()})),i.on("fullscreenchange",(function(){setTimeout((function(){Be(e,n)}),50)}))},Be=function(e,n){var t;if(n){var i=document.getElementById(e),o=null===(t=window.getComputedStyle(i,null))||void 0===t?void 0:t.height;n.style.height!==o&&(n.style.height="".concat(o))}};function xe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}var je=function(e){o(e).play()},Me=function(e){o(e).pause()},Ue=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},He=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},ze=function(e){return!!o.getPlayer("".concat(e))},Ge=function(e){return o(e).paused()},Ye=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},qe=function(){var e=n(t.mark((function e(n,i){var o,r,a,l=arguments;return t.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,j();case 3:return r=e.sent,a=Ye(n),e.abrupt("return",new Promise((function(e,t){w(i,r).then((function(t){var r=null==t?void 0:t.data;window.sid=rn(),r.contentType="linearchannel",r.channelId=null==i?void 0:i.channelId;var l=me(r,n);H(r),l&&o?(Ze(n,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){t({status:!1,msg:"Cannot load feed",response:e})}))})));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Je=function(){var e=n(t.mark((function e(n,i,o){var r,a,l,d,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return d=e.sent,(Y()||null)&&Z(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&&I(i,d).then((function(e){var n,t,i,o,r,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.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 n,t,i,o;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(e))})),e.abrupt("return",new Promise((function(e,t){p(i,d).then((function(i){var o,r,a,l,d,c,v,m,f,p,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;H(i.data);var E=(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===(f=m.adTags)||void 0===f||null===(p=f.web)||void 0===p?void 0:p.url);E&&Oe(n,E,w);var I=me(w,n);if(I){var h,T,y,b,_,O,D,F,S,P,A,L,V,R,C=(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),W=Ye(n);if(W.poster(C),Ze(n,I),W.on("loadstart",(function(){g&&e({status:!0,msg:"Video Loaded",response:w})})),W.on("loadeddata",(function(){ne(),e({status:!0,msg:"Video Loaded",response:w})})),W.one("play",(function(){u&&s<95&&setTimeout((function(){W.currentTime(u)}),0)})),W.one("error",(function(){var e;t({status:!1,msg:(null==W||null===(e=W.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===(S=w.video)||void 0===S||null===(P=S.closedCaptions)||void 0===P?void 0:P.length)>0)A=((null==w||null===(L=w.video)||void 0===L||null===(V=L.contentDetails)||void 0===V?void 0:V.closedCaptions)||(null==w||null===(R=w.video)||void 0===R?void 0:R.closedCaptions)).filter((function(e){return"VTT"===e.format})),be(n,A);else ye(n)}else ee(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){$e(e,n,t,i)}))})));case 9:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),Ke=function(e,n,t){var i=Ye(e);return i.src(n),new Promise((function(e,n){var o=0;i.one("loadedmetadata",(function(){clearTimeout(o),e({status:!0,msg:"video loaded"})})),i.one("loadstart",(function(e){o=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Xe=function(e){var n=Ye(e);if(Qe(),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,n)n.dispose();else{var t=document.getElementById(e);t&&t.remove()}},Qe=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()},Ze=function(e,n){var t=Ye(e);t&&t.src(n)},$e=function(n,t,i,o){var r,a,l,d,u,s,c=null==n||null===(r=n.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==n||null===(l=n.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==n?void 0:n.message);ze(t)&&ee(t,(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(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):xe(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},o&&{videoId:o}))},en=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var i=n.getElementsByClassName("vjs-big-play-button")[0];i&&(i.style.display="none");var o=n.getElementsByClassName("vjs-fullscreen-control")[0];o&&(o.style.display="none")};function nn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function tn(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(i),!0).forEach((function(t){e(n,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):nn(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var on=function(){var e,n,t,i,o,r,a,l=z();return"linearchannel"==((null==l?void 0:l.contentType)||"video")?null==l||null===(e=l.linearchannel)||void 0===e||null===(n=e.channels)||void 0===n||null===(t=n.find((function(e){return(null==e?void 0:e.id)===(null==l?void 0:l.channelId)})))||void 0===t||null===(i=t.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 rn(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function an(){var e=window.sessionStorage.getItem("uid");return e||(e=rn(),window.sessionStorage.setItem("uid",e),e)}function ln(){return dn.apply(this,arguments)}function dn(){return(dn=n(t.mark((function e(){var n,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:if(!(n=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(n.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.initialise=function(e){window.sid=rn(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var n=Math.floor(e.currentTime());e.on("error",(function(){var t,i,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",tn({pfm:window.platform,uid:an(),vid:on(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:n===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var n,t,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",tn({pfm:window.platform,uid:an(),vid:on(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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 n,t;null!=e&&null!==(n=e.el_)&&void 0!==n&&null!==(t=n.className)&&void 0!==t&&t.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,n){var t,i;if(n.el_){var o,r,a,l=e+.1;if(+l.toFixed(2)%5==0&&null!=n&&null!==(t=n.el_)&&void 0!==t&&null!==(i=t.className)&&void 0!==i&&i.includes("vjs-waiting"))c("BUFFERING",tn({pfm:window.platform,uid:an(),vid:on(),videoPosition:n.el_&&Math.floor(n.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:n.el_&&Math.floor(n.currentTime()),isAdEvent:!1});return l}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var n,t,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",tn({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:an(),vid:on()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.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 n,t,i,o,r,a;c("AD_REQUEST",tn({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:an(),vid:on(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(i=t.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",tn({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:an(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:on()},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 n=[];e.on("timeupdate",(function(){var t=Math.floor(e.currentTime());t>=30&&t%30==0&&!n.includes(t)&&(n.push(t),fireEvent({eventName:"PING",videoPosition:t,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var n=e.currentTime(),t=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),a=i.end(o);if(un(n,r,a)){var l=Math.round(t-a);if(isFinite(l))return l}}}))()};var un=function(e,n,t){return e>=n&&e<=t};function sn(e){if("localhost"!==location.hostname&&"127.0.0.1"!==location.hostname){var n=Ye(e);window.initialise(n),window.firstFrame(n),n.on("loadedmetadata",(function(){window.endFirstFrame(n)}))}}window.fireEvent=function(){var e=n(t.mark((function e(n){var o,r,a,l,d,u,s,c,v,m,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=tn,e.t1=tn,e.t2=tn({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=an(),e.t5=on(),e.t6=n.url||document.location.href,e.t7=n.ref||document.referrer,e.t8=n.eventName,e.t9=n.videoPosition,e.t10=window.environment,e.t11=n.dp1||"",e.t12=n.dp2||"",e.t13=n.dp3||"",e.t14=n.dp4||"",e.t15=n.dp5||"",e.t16=!0===n.isAdEvent?n.videoPosition:"",e.t17=!0===n.isAdEvent?(t=n.adPosition)?String(t):"":"",e.next=20,ln();case 20:return e.t18=e.sent,e.t19=n.playerType||"native",e.t20=n.mediaType||"VIDEO",e.t21=window.sid,e.t22=n.ttFirstFrame,e.t23=n.bitrate,e.t24=n.resHeight,e.t25=n.resWidth,e.t26=n.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==n?void 0:n.duration)&&{duration:n.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,j();case 37:f=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:f},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var t}),e)})));return function(n){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};export{Re as $,p as A,I as B,$e as C,Fe as D,M as E,L as F,P as G,Ce as H,Oe as I,Ee as J,be as K,sn as L,s as M,g as N,w as O,$ as P,G as Q,Pe as R,Ae as S,ie as T,q as U,Y as V,J as W,Le as X,Ge as Y,ye as Z,Se as _,z as a,Be as a0,Ne as a1,ke as a2,Q as a3,Z as a4,Ve as a5,me as b,H as c,te as d,ne as e,X as f,Ye as g,ee as h,h as i,K as j,Ke as k,Ze as l,Ue as m,Me as n,ze as o,je as p,Je as q,He as r,E as s,qe as t,Xe as u,Ie as v,he as w,Te as x,en as y,U as z};
package/esm/bundle.css CHANGED
@@ -3,7 +3,6 @@
3
3
 
4
4
 
5
5
 
6
-
7
6
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
8
7
  height: 0.7em;
9
8
  position: absolute;
@@ -116,6 +115,35 @@
116
115
  top: 4px;
117
116
  }
118
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
+
146
+
119
147
 
120
148
  .video-js.vjs-quality-menu {
121
149
  display: block;
@@ -296,6 +324,9 @@
296
324
  }
297
325
 
298
326
 
327
+
328
+
329
+
299
330
  /* nextep */
300
331
  .next-ep-preview{
301
332
  position: absolute;
@@ -411,35 +442,11 @@
411
442
  outline: none;
412
443
  }
413
444
 
414
- .video-js.vjs-paused .vjs-big-play-button {
415
- width: 90px;
416
- height: 90px;
417
- display: flex;
418
- justify-content: center;
419
- align-items: center;
420
- border: none;
421
- position: absolute;
422
- top: 0;
423
- left: 0;
424
- right: 0;
425
- bottom: 0;
426
- margin: auto;
427
- font-size: 6em;
428
- line-height: 1.3em;
429
- transform: none !important;
430
- }
431
-
432
-
433
- @media(max-width:600px){
434
- button.vjs-big-play-button {
435
- width: 50px !important;
436
- height: 50px !important;
437
- font-size: 2.1rem !important;
438
- }
445
+ .video-js .vjs-loading-spinner{
446
+ margin: none !important;
439
447
  }
440
448
 
441
449
 
442
-
443
450
  /* ADs */
444
451
  .ima-ad-container {
445
452
  top: 0em;
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as r,f as c}from"./icons-79ad4d7d.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import{x as l,w as s,$ as d,a0 as p,a1 as m,a2 as u,v}from"./beacon-37a5aa2a.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var h=i.getComponent("Component"),y=function(){n(b,h);var y,g,C=(y=b,g=f(),function(){var e,t=o(y);if(g){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function b(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),(i=C.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(b,[{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())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./caption-settings-cb47408f.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=l(this.playerId);null==t||t.map((function(t){return s(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")?(d(),a.classList.remove("hidden"),n.classList.add("open"),a.style.right="0px",p(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),m(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(c())});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"}),r=i.dom.createEl("div",{className:"caption-selector-content"}),l=i.dom.createEl("div",{className:"caption-container"}),s=this.createLanguageContanier();i.dom.appendContent(l,s),i.dom.appendContent(n,a),i.dom.appendContent(n,o),i.dom.appendContent(e,n),i.dom.appendContent(e,r),i.dom.appendContent(r,l),u(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")),l(e.playerId).map((function(t){return s(e.playerId,t.id)}))},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var c=l(this.playerId),d=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==c||null===(a=c[n])||void 0===a?void 0:a.label;var l=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});l.onchange=function(t){v(e.playerId,c[n].id)},l.setAttribute("type","radio"),i.dom.appendContent(o,l),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},p=0;p<c.length;p++)d(p);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}}]),b}();export{y as default};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{C as r,f as c}from"./icons-79ad4d7d.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import{x as l,w as s,$ as d,a0 as p,a1 as m,a2 as u,v}from"./beacon-9d84d686.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var h=i.getComponent("Component"),y=function(){n(b,h);var y,g,C=(y=b,g=f(),function(){var e,t=o(y);if(g){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function b(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),(i=C.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(b,[{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())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./caption-settings-cb47408f.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=l(this.playerId);null==t||t.map((function(t){return s(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")?(d(),a.classList.remove("hidden"),n.classList.add("open"),a.style.right="0px",p(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),m(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(c())});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"}),r=i.dom.createEl("div",{className:"caption-selector-content"}),l=i.dom.createEl("div",{className:"caption-container"}),s=this.createLanguageContanier();i.dom.appendContent(l,s),i.dom.appendContent(n,a),i.dom.appendContent(n,o),i.dom.appendContent(e,n),i.dom.appendContent(e,r),i.dom.appendContent(r,l),u(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")),l(e.playerId).map((function(t){return s(e.playerId,t.id)}))},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var c=l(this.playerId),d=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==c||null===(a=c[n])||void 0===a?void 0:a.label;var l=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});l.onchange=function(t){v(e.playerId,c[n].id)},l.setAttribute("type","radio"),i.dom.appendContent(o,l),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},p=0;p<c.length;p++)d(p);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}}]),b}();export{y as default};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/classCallCheck";import n from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import i from"video.js";import{g as a,R as s,r as c,m as d}from"./beacon-9d84d686.js";import{g as u}from"./renditions-f77c7c46.js";import{g as p}from"./localisation-0bf399a1.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(e){var t=v();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}var g=function(e){var o=function(e){r(i,e);var o=f(i);function i(e,n){var r;t(this,i);var l=(r=o.call(this,e,n)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=p("slowMoText")||"Slow Mo",r}return n(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)},C=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-rewind-button");var c=s(l);return o.append(c),r}return n(a,[{key:"handleClick",value:function(){c(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},y=function(e,o,l){var a=function(o){r(a,o);var i=f(a);function a(e,n){var r;t(this,a);var o=(r=i.call(this,e,n)).el_;o.classList.add("vjs-skip-button");var c=s(l);return o.append(c),r}return n(a,[{key:"handleClick",value:function(){d(e,10)}}]),a}(i.getComponent("Button"));i.registerComponent("MyButton",a),i(e).getChild("controlBar").addChild("myButton",{},1)},B=function(e,t,n){import("./resolution-d7ed7790.js").then((function(r){var o=r.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a(e),s=u(e);(null==s?void 0:s.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:n,renditions:s},l.controlBar.children().length-4))}))},b=function(e,t,n){import("./nextEpisodeButton-89ebffbb.js").then((function(r){var o=r.default,l=a(n);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:n,sres:e,res:t},l.controlBar.children().length-5)}))},j=function(e,t,n){import("./series-12881a0f.js").then((function(r){var o=r.seriesModule,l=a(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"),c=function(e){s[e].addEventListener("click",(function(){t[e]&&r.handleSeasonChange(t[e],e,l,n)}))},d=0;d<s.length;d++)c(d)}))},k=function(e,t){import("./videoSelector-e4bd4ee1.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},S=function(e,t){import("./caption-settings-e83b6814.js").then((function(n){var r,o,l,s,c=n.default,d=a(e);i.registerComponent("captionSelector",c),null===(r=document)||void 0===r||null===(o=r.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(),d&&d.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},E=function(e,t){import("./settings-icon-bb726185.js").then((function(n){var r,o,l,s,c=n.default,d=a(e);i.registerComponent("settingsSelector",c),null===(r=document)||void 0===r||null===(o=r.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(),d&&d.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},d.controlBar.children().length-3)}))},O=function(e,t){import("./playlist-06f7f6a3.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("playlistSelector",r),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},I=function(e,t){import("./series-v2-a2a3c240.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},w=function(e,t){import("./multicamv2-3d6e8051.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},M=function(e,t){var n=a(e).el(),r=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});n.append(r)},P=function(e){var t=a(e).el(),n=0,r=a(e);r.addChild("fullscreenToggle");var o=function(){var e,n=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];n&&n.click()};r.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;r.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),r=e-n;if(r<300&&r>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}n=e})),window._multiplayer_dbTapHandler=o},L=function(e,t){import("./videoSelector-a666f272.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("videoSelector",r),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))},N=function(e,t){import("./series-v2-e01126da.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("seriesV2",r),o.getChild("controlBar").addChild("seriesV2",h({playerId:e},t),o.controlBar.children().length-3)}))},R=function(e,t){import("./multicamv2-b844a4f6.js").then((function(n){var r=n.default,o=a(e);i.registerComponent("streamSelector",r),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))};export{B as a,j as b,b as c,y as d,C as e,E as f,S as g,M as h,g as i,L as j,R as k,O as l,N as m,P as n,k as o,I as p,w as q};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,U as n,V as r,a as i}from"./beacon-37a5aa2a.js";import{s as o}from"./autoNextVideo-355201d8.js";import l from"@babel/runtime/helpers/typeof";import a from"video.js";import u from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import c from"@babel/runtime/helpers/slicedToArray";var d,p,m,v,f=[],h=function(i,o){var l;if(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable){var a;f=[];var u=r();null==u||u.map((function(t){var n;return(n=f).push.apply(n,e(t.episodes))})),null==o||null===(a=o.series)||void 0===a||a.cb}else{var s,c;f=null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content,null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(i);d.on("timeupdate",(function(){var e,t,r=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=f)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var p,m=f.filter((function(e,t){return t==n()}));if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,h,x,y,b,w,E,C,N,k,T,A;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var B=null===(h=document.getElementsByClassName("next-ep-title"))||void 0===h?void 0:h[0],M=null===(x=document.getElementsByClassName("next-ep-img"))||void 0===x?void 0:x[0],I=null===(y=document.getElementsByClassName("next-ep-content"))||void 0===y?void 0:y[0],O=null===(b=m[0])||void 0===b?void 0:b.title;(null===(w=O)||void 0===w?void 0:w.length)>60&&(O=O.substr(0,60)+"..."),B.textContent="".concat(O),M.src=(null===(E=m[0])||void 0===E||null===(C=E.gist)||void 0===C||null===(N=C.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(T=window)||void 0===T||null===(A=T.customData)||void 0===A?void 0:A.fallbackImage),I.onclick=function(){return g(i)}}else{var L,S,X,P,j,R,D,F,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(i).append(U);var G=document.createElement("div");G.className="next-ep-header",G.textContent="Next up";var V=null===(L=m[0])||void 0===L?void 0:L.title,W=document.createElement("img");W.className="next-ep-img",W.src=(null===(S=m[0])||void 0===S||null===(X=S.gist)||void 0===X||null===(P=X.imageGist)||void 0===P?void 0:P.r16x9)||(null==m||null===(j=m[0])||void 0===j?void 0:j.img)||(null===(R=window)||void 0===R||null===(D=R.customData)||void 0===D?void 0:D.fallbackImage);var $=document.createElement("div");$.className="next-ep-title",(null===(F=V)||void 0===F?void 0:F.length)>60&&(V=V.substr(0,60)+"..."),$.textContent="".concat(V);var H=document.createElement("div");H.className="next-ep-content",H.append(W),H.append($),H.onclick=function(){return g(i)},U.append(G),U.append(H)}},g=function(e,r){var i=t(e),l=Math.floor(i.currentTime());if(Math.floor(i.duration())!=l){i.pause(e);var a=n();o(a,e,f)}};function x(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 y(e){return b.apply(this,arguments)}function b(){return(b=u(s.mark((function e(t){return s.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"),o=c(i,2),l=o[0],a=o[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 o=i.width/a,u=i.height/l,s=0;s<l;s++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,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 w(e){return E.apply(this,arguments)}function E(){return(E=u(s.mark((function e(t){var n,r;return s.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",x(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 C(e){return N.apply(this,arguments)}function N(){return(N=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return y(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)}d={0:{src:"example-thumbnail.png"}},p=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===l(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},m=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},v=function e(t){return"HTML"!==t.nodeName&&"static"===m(t)("position")?e(t.offsetParent):t},a.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,l,a,u;n=p({},d,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",p(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),l=i.duration(),i.on("durationchange",(function(e){l=i.duration()})),i.on("loadedmetadata",(function(e){l=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),a=function(e){var i,a,u,s,c,d,f,h,g,x;for(a in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=v(o.el()).getBoundingClientRect()).width||x.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=v(o.el()).getBoundingClientRect().left+g,i=Math.floor((s-o.el().offsetLeft)/o.width()*l),n)i>a&&(u=Math.max(u,a));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&p(r.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=m(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>f?s-=s+h-f:s<h&&(s=h),t.style.left=s+"px"},o.on("mousemove",a),o.on("touchmove",a),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var k=function(){var e=u(s.mark((function e(t,n){var r,i,o,l;return s.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,o=i.split("\n"),l=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=c(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),l.push(r))})),e.abrupt("return",l);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function T(e){return A.apply(this,arguments)}function A(){return(A=u(s.mark((function e(t){var n,r,o,l,a,u,c,d,p,m,v,f,h,g,x,y,b,w,E,C,N,k;return s.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 l=e.sent,e.next=7,l.text();case 7:a=e.sent,u=new DOMParser,c=u.parseFromString(a,"application/xml"),d=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,p=c.getElementsByTagName("AdaptationSet"),m=0;case 13:if(!(m<p.length)){e.next=34;break}if("image"!==(v=p[m]).getAttribute("contentType")||"image/png"!==v.getAttribute("mimeType")){e.next=31;break}if(f=v.getElementsByTagName("SegmentTemplate")[0],h=v.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=[],m=0;m<C;m++)k.push({duration:w,layout:x,uri:n+"/"+N.replace("$Number$",m)});return e.abrupt("return",k);case 31:m++,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 B(e){return M.apply(this,arguments)}function M(){return(M=u(s.mark((function e(n){var r,i,o,l,a,u,c,d,p,m,v,f,h,g,x,y,b,E,N,A,B;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t(n),i=r.currentSource(),null==(o=i.src)||!o.includes("m3u8")){e.next=18;break}return e.next=5,w(o);case 5:if(!((null==(l=e.sent)?void 0:l.length)>0)){e.next=16;break}return x=(null==l?void 0:l[0])||null,y=x.uri,b=(null==r||null===(a=r.tech())||void 0===a||null===(u=a.vhs)||void 0===u||null===(c=u.playlists)||void 0===c||null===(d=c.master)||void 0===d||null===(p=d.uri)||void 0===p?void 0:p.substring(0,null==r||null===(m=r.tech())||void 0===m||null===(v=m.vhs)||void 0===v||null===(f=v.playlists)||void 0===f||null===(h=f.master)||void 0===h||null===(g=h.uri)||void 0===g?void 0:g.lastIndexOf("/")))+"/",e.next=11,k(b,y);case 11:return E=e.sent,e.next=14,C(E);case 14:N=e.sent,r.thumbnails(N);case 16:e.next=27;break;case 18:if(null==o||!o.includes("mpd")){e.next=27;break}return e.next=21,T(o);case 21:if(!((null==(A=e.sent)?void 0:A.length)>0)){e.next=27;break}return e.next=25,C(A);case 25:B=e.sent,r.thumbnails(B);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}export{h as a,B as i};
1
+ import e from"@babel/runtime/helpers/toConsumableArray";import{g as t,U as n,V as r,a as i}from"./beacon-9d84d686.js";import{s as o}from"./autoNextVideo-743a7782.js";import l from"@babel/runtime/helpers/typeof";import a from"video.js";import u from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/regenerator";import c from"@babel/runtime/helpers/slicedToArray";var d,p,m,v,f=[],h=function(i,o){var l;if(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable){var a;f=[];var u=r();null==u||u.map((function(t){var n;return(n=f).push.apply(n,e(t.episodes))})),null==o||null===(a=o.series)||void 0===a||a.cb}else{var s,c;f=null==o||null===(s=o.relatedVideos)||void 0===s?void 0:s.content,null==o||null===(c=o.relatedVideos)||void 0===c||c.cb}var d=t(i);d.on("timeupdate",(function(){var e,t,r=Math.floor(d.currentTime()),i=d.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-r<=10&&n()<=(null===(t=f)||void 0===t?void 0:t.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var p,m=f.filter((function(e,t){return t==n()}));if((null==m?void 0:m.length)>0)if(null!==(p=document.getElementsByClassName("next-ep-preview"))&&void 0!==p&&p[0]){var v,h,x,y,b,w,E,C,N,k,T,A;(null===(v=document.getElementsByClassName("next-ep-preview"))||void 0===v?void 0:v[0]).style.visibility="hidden";var B=null===(h=document.getElementsByClassName("next-ep-title"))||void 0===h?void 0:h[0],M=null===(x=document.getElementsByClassName("next-ep-img"))||void 0===x?void 0:x[0],I=null===(y=document.getElementsByClassName("next-ep-content"))||void 0===y?void 0:y[0],O=null===(b=m[0])||void 0===b?void 0:b.title;(null===(w=O)||void 0===w?void 0:w.length)>60&&(O=O.substr(0,60)+"..."),B.textContent="".concat(O),M.src=(null===(E=m[0])||void 0===E||null===(C=E.gist)||void 0===C||null===(N=C.imageGist)||void 0===N?void 0:N.r16x9)||(null==m||null===(k=m[0])||void 0===k?void 0:k.img)||(null===(T=window)||void 0===T||null===(A=T.customData)||void 0===A?void 0:A.fallbackImage),I.onclick=function(){return g(i)}}else{var L,S,X,P,j,R,D,F,U=document.createElement("div");U.className="next-ep-preview",U.style.visibility="hidden",document.getElementById(i).append(U);var G=document.createElement("div");G.className="next-ep-header",G.textContent="Next up";var V=null===(L=m[0])||void 0===L?void 0:L.title,W=document.createElement("img");W.className="next-ep-img",W.src=(null===(S=m[0])||void 0===S||null===(X=S.gist)||void 0===X||null===(P=X.imageGist)||void 0===P?void 0:P.r16x9)||(null==m||null===(j=m[0])||void 0===j?void 0:j.img)||(null===(R=window)||void 0===R||null===(D=R.customData)||void 0===D?void 0:D.fallbackImage);var $=document.createElement("div");$.className="next-ep-title",(null===(F=V)||void 0===F?void 0:F.length)>60&&(V=V.substr(0,60)+"..."),$.textContent="".concat(V);var H=document.createElement("div");H.className="next-ep-content",H.append(W),H.append($),H.onclick=function(){return g(i)},U.append(G),U.append(H)}},g=function(e,r){var i=t(e),l=Math.floor(i.currentTime());if(Math.floor(i.duration())!=l){i.pause(e);var a=n();o(a,e,f)}};function x(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 y(e){return b.apply(this,arguments)}function b(){return(b=u(s.mark((function e(t){return s.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"),o=c(i,2),l=o[0],a=o[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 o=i.width/a,u=i.height/l,s=0;s<l;s++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=o,d.height=u,d.getContext("2d").drawImage(i,c*o,s*u,o,u,0,0,o,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 w(e){return E.apply(this,arguments)}function E(){return(E=u(s.mark((function e(t){var n,r;return s.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",x(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 C(e){return N.apply(this,arguments)}function N(){return(N=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return y(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)}d={0:{src:"example-thumbnail.png"}},p=function e(){var t,n,r,i,o;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(o in i=t[r])i.hasOwnProperty(o)&&("object"===l(i[o])?n[o]=e(n[o],i[o]):n[o]=i[o]);return n},m=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},v=function e(t){return"HTML"!==t.nodeName&&"static"===m(t)("position")?e(t.offsetParent):t},a.registerPlugin("thumbnails",(function(e){var t,n,r,i,o,l,a,u;n=p({},d,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",p(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),l=i.duration(),i.on("durationchange",(function(e){l=i.duration()})),i.on("loadedmetadata",(function(e){l=i.duration()})),(o=i.controlBar.progressControl).el().appendChild(t),a=function(e){var i,a,u,s,c,d,f,h,g,x;for(a in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,f=((x=v(o.el()).getBoundingClientRect()).width||x.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=v(o.el()).getBoundingClientRect().left+g,i=Math.floor((s-o.el().offsetLeft)/o.width()*l),n)i>a&&(u=Math.max(u,a));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&p(r.style,c.style),s+(h=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=m(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>f?s-=s+h-f:s<h&&(s=h),t.style.left=s+"px"},o.on("mousemove",a),o.on("touchmove",a),u=function(e){t.style.left="-1000px"},o.on("mouseout",u),o.on("touchcancel",u),o.on("touchend",u),i.on("userinactive",u)}));var k=function(){var e=u(s.mark((function e(t,n){var r,i,o,l;return s.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,o=i.split("\n"),l=[],o.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&o[n-1].includes("#EXT-X-TILES")&&(o[n-1]=o[n-1].split(","),r.uri=t+e,o[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=c(t,2),i=n[0],o=n[1];i=i.toLowerCase(),r[i]=o}))})),l.push(r))})),e.abrupt("return",l);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function T(e){return A.apply(this,arguments)}function A(){return(A=u(s.mark((function e(t){var n,r,o,l,a,u,c,d,p,m,v,f,h,g,x,y,b,w,E,C,N,k;return s.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 l=e.sent,e.next=7,l.text();case 7:a=e.sent,u=new DOMParser,c=u.parseFromString(a,"application/xml"),d=null===(r=i())||void 0===r||null===(o=r.video)||void 0===o?void 0:o.runtime,p=c.getElementsByTagName("AdaptationSet"),m=0;case 13:if(!(m<p.length)){e.next=34;break}if("image"!==(v=p[m]).getAttribute("contentType")||"image/png"!==v.getAttribute("mimeType")){e.next=31;break}if(f=v.getElementsByTagName("SegmentTemplate")[0],h=v.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=[],m=0;m<C;m++)k.push({duration:w,layout:x,uri:n+"/"+N.replace("$Number$",m)});return e.abrupt("return",k);case 31:m++,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 B(e){return M.apply(this,arguments)}function M(){return(M=u(s.mark((function e(n){var r,i,o,l,a,u,c,d,p,m,v,f,h,g,x,y,b,E,N,A,B;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t(n),i=r.currentSource(),null==(o=i.src)||!o.includes("m3u8")){e.next=18;break}return e.next=5,w(o);case 5:if(!((null==(l=e.sent)?void 0:l.length)>0)){e.next=16;break}return x=(null==l?void 0:l[0])||null,y=x.uri,b=(null==r||null===(a=r.tech())||void 0===a||null===(u=a.vhs)||void 0===u||null===(c=u.playlists)||void 0===c||null===(d=c.master)||void 0===d||null===(p=d.uri)||void 0===p?void 0:p.substring(0,null==r||null===(m=r.tech())||void 0===m||null===(v=m.vhs)||void 0===v||null===(f=v.playlists)||void 0===f||null===(h=f.master)||void 0===h||null===(g=h.uri)||void 0===g?void 0:g.lastIndexOf("/")))+"/",e.next=11,k(b,y);case 11:return E=e.sent,e.next=14,C(E);case 14:N=e.sent,r.thumbnails(N);case 16:e.next=27;break;case 18:if(null==o||!o.includes("mpd")){e.next=27;break}return e.next=21,T(o);case 21:if(!((null==(A=e.sent)?void 0:A.length)>0)){e.next=27;break}return e.next=25,C(A);case 25:B=e.sent,r.thumbnails(B);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}export{h as a,B as i};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import{d as e,g as n,s as t,a as o,b as i,l,c as r,e as a,h as s,f as u,i as d,j as c,k as v,m,p,n as f,r as h,o as w,q as g,t as y,u as b,v as k,w as O,x as I,y as j,z as T,A as P,B as S,C as D,D as C,E as x,F as R,G as E,H as A,I as V,J as H,K as B,L,M as N,N as _,O as M,P as U,Q as q}from"./beacon-37a5aa2a.js";import z from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/helpers/defineProperty";import J from"@babel/runtime/regenerator";import G from"video.js";import"videojs-contrib-quality-menu";import K from"@babel/runtime/helpers/typeof";import{o as Q,g as X,a as W,s as Y,b as Z}from"./util-3cb40c3d.js";import{g as $}from"./renditions-5556ca50.js";import{playSelectedResolution as ee}from"./resolution-b1192d49.js";import{s as ne}from"./localisation-0bf399a1.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var te,oe,ie=function(e){return new Promise((function(n,t){if(le(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)}}))},le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},re=function(){var t=z(J.mark((function t(o){var i,l,r,a;return J.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=n(null==o?void 0:o.playerId),console.log(o),null!=o&&null!==(i=o.series)&&void 0!==i&&i.enable||null==o||!o.chromecastReceiverId){t.next=21;break}return t.next=5,import("@silvermine/videojs-chromecast");case 5:return a=t.sent,t.prev=6,t.next=9,ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(6),console.log("Error",t.t0);case 14:return t.prev=14,a.default(G),t.finish(14);case 17:null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},t.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=o&&o.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return t.stop()}}),t,null,[[6,11,14,17]])})));return function(e){return t.apply(this,arguments)}}(),ae=function(e,t){var o=n(e);o&&t&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=G.dom.getPointerPosition(a,n).x;G.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function se(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 ue(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var de=[],ce=0,ve=null;function me(e,n,i){var l,r,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];oe=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.apiVersion)||"v1";var c=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(e.currentTime()),m=Math.floor(e.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,f=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,w=Math.floor(e.currentTime()),g=d?100:Math.floor(v/m*100),y={};h?function(e,n,t){var i=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),l=pe(i),r=(new Date).getTime(),a=o(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ue(ue({},e),{},F({},n,s[n]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===te}));d<0?l.push(ue(ue({content:u},e),{},{addedDate:r,updateDate:r})):l[d]=ue(ue(ue({},l[d]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(y={completed:d,watchedTime:w,watchedPercentage:g},c,n.siteOwner):("v1"==oe?y={videoId:te,watchedTime:w,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==oe&&(y=ue(ue({videoId:te,watchedTime:w,watchedPercentage:g,doneWatching:d,profileId:c},ve&&{seriesId:ve}),f&&{originalObjectId:f})),t(y,oe).then((function(e){})).catch((function(e){}))),ce=v+i}function pe(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function fe(e,n,t){var o=pe(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 he=function(e,t,o){var i=n(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var l=parseFloat(t)/100;i.volume(l),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(e,"'")})},we=function(e){var t=n(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ge=!1,ye=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!ge){var a=be(e,"videoAssets","secondaryVideoAssets"),s=i(a,n);return s&&l(n,s),ge=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function be(e,n,t){if(Array.isArray(e))return e.map((function(e){return be(e,n,t)}));if(null!==e&&"object"===K(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]=be(e[i],n,t)})),o}return e}function ke(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 Oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ke(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ke(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ie=function(e,t,i,l){var d,c,v=l.res,m=l.sres,p=n(e),f=(null==v?void 0:v.contentType)||"video",h=(null==v||null===(d=v[f])||void 0===d||null===(c=d.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;r(v),p&&(p.on("loadstart",(function(){h?i.resolve({status:!0,msg:"Video Loaded",response:v}):i.resolve(Oe({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:v}:{response:v}))})),p.on("loadeddata",(function(){var i,l;(null==p||!p.muted())&&he(e,sessionStorage.getItem("volume")||"100");var r=o();if(a(),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.saveOffline)){var s,u,d=Oe(Oe({},t),v);!function(e,t,o){var i,l,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(ve=null==t||null===(l=t.series)||void 0===l?void 0:l.id),de=[],ce=0,te=o;var a=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=n(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());de.includes(ce)||(e==ce?(de.push(e),me(s,t,a)):e>ce&&(ce=e+a))})),s.one("ended",(function(){me(s,t,a,!0)})))}(e,d,null==r||null===(s=r.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id)}})),p.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];p.trigger("subtitlechanged",n)})),p.on("subtitlechanged",(function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,h=p.getMediaSession(),w=h.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([w[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(f)}})),p.tech_.on("retryplaylist",(function(){h&&ye(v,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&h)?ye(v,e):(s(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:v}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,l,r=null===(n=o())||void 0===n||null===(i=n.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,a=u(),s=(null==a?void 0:a.get(r))||{t:0,p:0},d=s.t,c=s.p;d&&c<95&&setTimeout((function(){p.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),p.on("volumechange",(function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),p.on("chromecastDisconnected",(function(){if(h){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))},je=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-2b40be0d.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-2f09c77e.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-705779f4.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-2d9f6387.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-1eaa2c91.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-b9042825.js").then((function(t){t.initialiseSkin(e,n)}))};var Te,Pe=function(){var e=z(J.mark((function e(){return J.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ie("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:console.log(undefined);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=z(J.mark((function e(){return J.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){G.getPlugin("eme")||G.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),De=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(G)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(G)}))},loadAdsLibrary:Pe,loadEMELibrary:Se}),Ce=function(e,n){var t=new Map;d({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),c(t)})).catch((function(e){return console.log(e)}))};function xe(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 Re(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xe(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ee=function(e,t,o,r){var a,u,d,c,v,m,p,f,h,w,g,y,b,k,O,I,T,P,S,D,C,x,R,E,N,_,M,U,q,K,Q,X,W,Y=t.res,Z=void 0===Y?null:Y,$=t.sres,ee=void 0===$?null:$;null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(d=u.framework)||void 0===d||null===(c=d.CastContext)||void 0===c||null===(v=c.getInstance())||void 0===v||v.S;var ne=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=Z)||void 0===m?void 0:m.contentType)||"video",oe=A(null===(p=Z)||void 0===p||null===(f=p[te])||void 0===f||null===(h=f.gist)||void 0===h?void 0:h.videoImageUrl)||A(null===(w=Z)||void 0===w||null===(g=w[te])||void 0===g||null===(y=g.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),ie=(null===(k=Z)||void 0===k||null===(O=k[te])||void 0===O||null===(I=O.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,le=(null===(T=Z)||void 0===T||null===(P=T[te])||void 0===P||null===(S=P.streamingInfo)||void 0===S?void 0:S.isLiveStream)||!0,se=(null===(D=Z)||void 0===D||null===(C=D.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(R=x.adTags)||void 0===R||null===(E=R.web)||void 0===E?void 0:E.active)&&(null===(N=Z)||void 0===N||null===(_=N.ads)||void 0===_||null===(M=_.preRoll)||void 0===M||null===(U=M.adTags)||void 0===U||null===(q=U.web)||void 0===q?void 0:q.url);Z=Re(Re({},Z),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var ue=(W={controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==o.skin,liveui:ie},F(W,"autoplay",null==o?void 0:o.autoplay),F(W,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!se),F(W,"loop",(null==o?void 0:o.loop)||!1),F(W,"audioPosterMode",null==o?void 0:o.audioPosterMode),F(W,"html5",Re(Re({vhs:Re(Re({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==o||null===(K=o.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(X=o.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),F(W,"poster",oe),F(W,"techOrder",ne),F(W,"chromecast",{requestCustomDataFn:function(t){var o=n(e),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,l,r,a,s,u,d,c,v,m=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){p.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;p.licenseUrl=f;var h=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=h}var w=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=w;var g=null==e||null===(l=e[m])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=y;var b=null==e||null===(u=e[m])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=b,p.subTitles=t,p.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Z,t,i)}}),W);if(!G.getPlayers()[e])var de=G(e,ue,function(){var n=z(J.mark((function n(){var t,a,u,d,c,v,m,p,f,h,w,g,y,b,k,O,I,T,P,S,D,C,x;return J.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(de),console.log(G.VERSION),console.log(G.getPlugins()),n.next=5,re(o);case 5:if(le&&r.resolve(Re({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),L(e),/Android/i.test(navigator.userAgent)&&(G.options.vhs.overrideNative=!0),b=null===(t=Z)||void 0===t||null===(a=t[te])||void 0===a?void 0:a.drmEnabled,k=null===(u=Z)||void 0===u||null===(d=u[te])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,!b){n.next=13;break}return n.next=13,Se();case 13:ie&&ae(e,k),!se||null!=o&&null!==(v=o.customData)&&void 0!==v&&v.disableAds||V(e,se,Z),O=i(Z,e),console.log(O),null!=o&&o.nearestClusterUrl&&(O=H(O,o.nearestClusterUrl)),O?l(e,O):(r.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),s(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Z)||void 0===m||null===(p=m[te])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(h=f.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(w=Z)||void 0===w||null===(g=w[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(x=(null===(T=Z)||void 0===T||null===(P=T[te])||void 0===P||null===(S=P.contentDetails)||void 0===S?void 0:S.closedCaptions)||(null===(D=Z)||void 0===D||null===(C=D[te])||void 0===C?void 0:C.closedCaptions),I=x.filter((function(e){return"VTT"===e.format})),B(e,I)),null!=o&&o.disableControls?j(e):je(e,Re(Re(Re({},o),ue),{},{liveVideo:le,isDvrEnabled:ie,res:Z,sres:ee})),Ie(e,Re(Re(Re({},o),ue),{},{liveVideo:le}),r,{res:Z,sres:ee});case 22:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ae(){return{loadVideoInstantly:v,onTimeUpdate:Q,getVideoDuration:X,onVideoEnded:W,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var t=z(J.mark((function t(o,i){var l,a,s,u,d,c,v,m,p,f,h,g,y,b,k,O,I,j,T,A,V,H,B,L,z,F,G,K,Q,X;return J.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!w(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(g=(null==n?void 0:n.videoSourceUrl)||!1,y=null==n?void 0:n.asat,b=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,k=null==n?void 0:n.videoId,O=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=k,I=null==n?void 0:n.token,!x(n)){t.next=15;break}if(R().set(null==n?void 0:n.refreshToken),I&&!E(I)){t.next=14;break}return i({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}}),t.abrupt("return");case 14:Te=JSON.parse(atob(I.split(".")[1]));case 15:return window.siteId=null===(s=Te)||void 0===s?void 0:s.siteId,window.siteName=null===(u=Te)||void 0===u?void 0:u.site,n.isAnonymousUser=!(null===(d=Te)||void 0===d||!d.anonymousId),n.siteOwner=(null===(c=Te)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=Te)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=Te)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,sessionStorage.setItem("vlp_token",I),j=null==n?void 0:n.playerId,T=n.chromecastReceiverId=null!=n&&n.series?null:null==n?void 0:n.chromecastReceiverId,n.chromecastReceiverId=T,A=null==n?void 0:n.airplay,V=null==n?void 0:n.apiBaseUrl,H=(null==n||null===(p=n.analytics)||void 0===p?void 0:p.gaId)||null,(B=null==n?void 0:n.errors)&&(window.customErrors=B),window.customData=null==n?void 0:n.customData,ne(null==n||null===(f=n.customData)||void 0===f?void 0:f.localisation),V&&(window.playerEntitlementUrl=V),null!=n&&n.skin&&!C(n.skin)||(n.skin="VL_ONE"),t.next=37,Pe();case 37:A&&"Safari"==e()&&Promise.resolve().then((function(){return De})).then((function(e){e.importAirplay()})),H&&ie("https://www.googletagmanager.com/gtag/js?id=".concat(H)).then((function(){return N(H)})).catch((function(e){})),(L=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&L.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g?(F={directPlaybackUrl:g,id:z="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?P(z,I).then((function(e){Ee(j,{res:Re(Re({},e),F)},n,{resolve:o,reject:i})})).catch((function(e){D(e,j,i,z)})):Ee(j,{res:F},n,{resolve:o,reject:i})):O?(K=sessionStorage.getItem("season-idx")||0,U.set(parseInt(K)),Q=null==n||null===(G=n.series)||void 0===G?void 0:G.id,_(Q,I).then((function(e){var t,l,a,s=e.data,u=e.data.seasons;q(u);var d=k||(null==u||null===(t=u[0])||void 0===t||null===(l=t.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);Ce(Q,I),P(d,I).then((function(e){var t,l,a;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(l=t.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(e.data),Ee(j,{res:null==e?void 0:e.data,sres:s},n,{resolve:o,reject:i})})).catch((function(e){D(e,j,i,k)}))})).catch((function(e){D(e,j,i)}))):b?(X=null==n?void 0:n.epg,M(X,I).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==X?void 0:X.channelId,Ee(j,{res:t},n,{resolve:o,reject:i})})).catch((function(e){D(e,j,i,k)}))):P(k,I).then((function(e){var t,l,a,s;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(l=t.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(null==e?void 0:e.data);var u,d=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(s=n.watchHistory)&&void 0!==s&&s.enable)if((null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,m,p=fe((null===(c=n.watchHistory)||void 0===c?void 0:c.profileId)||"",k,null==n?void 0:n.siteOwner);if(p&&p.length)n.watchHistoryResumeTime=(null===(v=p[0])||void 0===v?void 0:v.watchedTime)||null,n.watchedPercentage=(null===(m=p[0])||void 0===m?void 0:m.watchedPercentage)||null;d.contentType="video",Ee(j,{res:d},n,{resolve:o,reject:i})}else S(k,I).then((function(e){var t,l,r,a,s,u;null!==(t=window)&&void 0!==t&&null!==(l=t.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,n.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",Ee(j,{res:d},n,{resolve:o,reject:i})})).catch((function(e){var t,l,r,a;null!==(t=window)&&void 0!==t&&null!==(l=t.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(e)),Ee(j,{res:d},n,{resolve:o,reject:i})}));else Ee(j,{res:d},n,{resolve:o,reject:i})})).catch((function(e){D(e,j,i,k)}));case 42:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},getRenditions:$,skip:m,getPlayer:n,play:p,pause:f,detectBrowser:e,rewind:h,loadVideo:l,seekToTimeStamp:Y,isPlayerInitialised:w,load:g,authenticateLC:y,dispose:b,enableCaptions:k,disableCaptions:O,getCaptions:I,playSelectedResolution:ee,getSource:i,setVolume:he,getVolume:we,disableControls:j,setPlaybackSpeed:Z,getEntitlementData:T}}export{Ae as default};
1
+ import"video.js/dist/video-js.min.css";import{d as e,g as n,s as t,a as o,b as i,l,c as r,e as a,h as s,f as u,i as d,j as c,k as v,m,p,n as f,r as h,o as w,q as g,t as y,u as b,v as k,w as O,x as I,y as j,z as T,A as P,B as S,C as D,D as C,E as x,F as R,G as E,H as A,I as V,J as H,K as B,L,M as N,N as _,O as M,P as U,Q as q}from"./beacon-9d84d686.js";import z from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/helpers/defineProperty";import J from"@babel/runtime/regenerator";import G from"video.js";import"videojs-contrib-quality-menu";import K from"@babel/runtime/helpers/typeof";import{o as Q,g as X,a as W,s as Y,b as Z}from"./util-e0a6cf62.js";import{g as $}from"./renditions-f77c7c46.js";import{playSelectedResolution as ee}from"./resolution-d7ed7790.js";import{s as ne}from"./localisation-0bf399a1.js";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";var te,oe,ie=function(e){return new Promise((function(n,t){if(le(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)}}))},le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},re=function(){var t=z(J.mark((function t(o){var i,l,r,a;return J.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=n(null==o?void 0:o.playerId),console.log(o),null!=o&&null!==(i=o.series)&&void 0!==i&&i.enable||null==o||!o.chromecastReceiverId){t.next=21;break}return t.next=5,import("@silvermine/videojs-chromecast");case 5:return a=t.sent,t.prev=6,t.next=9,ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(6),console.log("Error",t.t0);case 14:return t.prev=14,a.default(G),t.finish(14);case 17:null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},t.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=o&&o.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return t.stop()}}),t,null,[[6,11,14,17]])})));return function(e){return t.apply(this,arguments)}}(),ae=function(e,t){var o=n(e);o&&t&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=G.dom.getPointerPosition(a,n).x;G.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function se(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 ue(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var de=[],ce=0,ve=null;function me(e,n,i){var l,r,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];oe=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.apiVersion)||"v1";var c=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(e.currentTime()),m=Math.floor(e.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,f=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,w=Math.floor(e.currentTime()),g=d?100:Math.floor(v/m*100),y={};h?function(e,n,t){var i=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),l=pe(i),r=(new Date).getTime(),a=o(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ue(ue({},e),{},F({},n,s[n]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===te}));d<0?l.push(ue(ue({content:u},e),{},{addedDate:r,updateDate:r})):l[d]=ue(ue(ue({},l[d]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(y={completed:d,watchedTime:w,watchedPercentage:g},c,n.siteOwner):("v1"==oe?y={videoId:te,watchedTime:w,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==oe&&(y=ue(ue({videoId:te,watchedTime:w,watchedPercentage:g,doneWatching:d,profileId:c},ve&&{seriesId:ve}),f&&{originalObjectId:f})),t(y,oe).then((function(e){})).catch((function(e){}))),ce=v+i}function pe(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function fe(e,n,t){var o=pe(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 he=function(e,t,o){var i=n(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var l=parseFloat(t)/100;i.volume(l),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(e,"'")})},we=function(e){var t=n(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ge=!1,ye=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!ge){var a=be(e,"videoAssets","secondaryVideoAssets"),s=i(a,n);return s&&l(n,s),ge=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function be(e,n,t){if(Array.isArray(e))return e.map((function(e){return be(e,n,t)}));if(null!==e&&"object"===K(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]=be(e[i],n,t)})),o}return e}function ke(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 Oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ke(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ke(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ie=function(e,t,i,l){var d,c,v=l.res,m=l.sres,p=n(e),f=(null==v?void 0:v.contentType)||"video",h=(null==v||null===(d=v[f])||void 0===d||null===(c=d.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;r(v),p&&(p.on("loadstart",(function(){h?i.resolve({status:!0,msg:"Video Loaded",response:v}):i.resolve(Oe({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:v}:{response:v}))})),p.on("loadeddata",(function(){var i,l;(null==p||!p.muted())&&he(e,sessionStorage.getItem("volume")||"100");var r=o();if(a(),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.saveOffline)){var s,u,d=Oe(Oe({},t),v);!function(e,t,o){var i,l,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(ve=null==t||null===(l=t.series)||void 0===l?void 0:l.id),de=[],ce=0,te=o;var a=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=n(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());de.includes(ce)||(e==ce?(de.push(e),me(s,t,a)):e>ce&&(ce=e+a))})),s.one("ended",(function(){me(s,t,a,!0)})))}(e,d,null==r||null===(s=r.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id)}})),p.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];p.trigger("subtitlechanged",n)})),p.on("subtitlechanged",(function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,h=p.getMediaSession(),w=h.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([w[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(f)}})),p.tech_.on("retryplaylist",(function(){h&&ye(v,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&h)?ye(v,e):(s(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:v}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,l,r=null===(n=o())||void 0===n||null===(i=n.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,a=u(),s=(null==a?void 0:a.get(r))||{t:0,p:0},d=s.t,c=s.p;d&&c<95&&setTimeout((function(){p.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),p.on("volumechange",(function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),p.on("chromecastDisconnected",(function(){if(h){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))},je=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-e84d46c6.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-0a0c271b.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-82885153.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-7f6a85cb.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-c966c9cd.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-b95b5c90.js").then((function(t){t.initialiseSkin(e,n)}))};var Te,Pe=function(){var e=z(J.mark((function e(){return J.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),ie("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)}}(),Se=function(){var e=z(J.mark((function e(){return J.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){G.getPlugin("eme")||G.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),De=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(G)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(G)}))},loadAdsLibrary:Pe,loadEMELibrary:Se}),Ce=function(e,n){var t=new Map;d({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),c(t)})).catch((function(e){return console.log(e)}))};function xe(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 Re(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xe(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ee=function(e,t,o,r){var a,u,d,c,v,m,p,f,h,w,g,y,b,k,O,I,T,P,S,D,C,x,R,E,N,_,M,U,q,K,Q,X,W,Y=t.res,Z=void 0===Y?null:Y,$=t.sres,ee=void 0===$?null:$;null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(d=u.framework)||void 0===d||null===(c=d.CastContext)||void 0===c||null===(v=c.getInstance())||void 0===v||v.S;var ne=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=Z)||void 0===m?void 0:m.contentType)||"video",oe=A(null===(p=Z)||void 0===p||null===(f=p[te])||void 0===f||null===(h=f.gist)||void 0===h?void 0:h.videoImageUrl)||A(null===(w=Z)||void 0===w||null===(g=w[te])||void 0===g||null===(y=g.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),ie=(null===(k=Z)||void 0===k||null===(O=k[te])||void 0===O||null===(I=O.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,le=(null===(T=Z)||void 0===T||null===(P=T[te])||void 0===P||null===(S=P.streamingInfo)||void 0===S?void 0:S.isLiveStream)||!0,se=(null===(D=Z)||void 0===D||null===(C=D.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(R=x.adTags)||void 0===R||null===(E=R.web)||void 0===E?void 0:E.active)&&(null===(N=Z)||void 0===N||null===(_=N.ads)||void 0===_||null===(M=_.preRoll)||void 0===M||null===(U=M.adTags)||void 0===U||null===(q=U.web)||void 0===q?void 0:q.url);Z=Re(Re({},Z),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var ue=(W={controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==o.skin,liveui:ie},F(W,"autoplay",null==o?void 0:o.autoplay),F(W,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!se),F(W,"loop",(null==o?void 0:o.loop)||!1),F(W,"audioPosterMode",null==o?void 0:o.audioPosterMode),F(W,"html5",Re(Re({vhs:Re(Re({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==o||null===(K=o.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(X=o.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),F(W,"poster",oe),F(W,"techOrder",ne),F(W,"chromecast",{requestCustomDataFn:function(t){var o=n(e),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,l,r,a,s,u,d,c,v,m=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){p.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;p.licenseUrl=f;var h=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=h}var w=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=w;var g=null==e||null===(l=e[m])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=y;var b=null==e||null===(u=e[m])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=b,p.subTitles=t,p.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Z,t,i)}}),W);if(!G.getPlayers()[e])var de=G(e,ue,function(){var n=z(J.mark((function n(){var t,a,u,d,c,v,m,p,f,h,w,g,y,b,k,O,I,T,P,S,D,C,x;return J.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(de),console.log(G.VERSION),console.log(G.getPlugins()),n.next=5,re(o);case 5:if(le&&r.resolve(Re({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),L(e),/Android/i.test(navigator.userAgent)&&(G.options.vhs.overrideNative=!0),b=null===(t=Z)||void 0===t||null===(a=t[te])||void 0===a?void 0:a.drmEnabled,k=null===(u=Z)||void 0===u||null===(d=u[te])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,!b){n.next=13;break}return n.next=13,Se();case 13:ie&&ae(e,k),!se||null!=o&&null!==(v=o.customData)&&void 0!==v&&v.disableAds||V(e,se,Z),O=i(Z,e),console.log(O),null!=o&&o.nearestClusterUrl&&(O=H(O,o.nearestClusterUrl)),O?l(e,O):(r.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),s(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Z)||void 0===m||null===(p=m[te])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(h=f.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(w=Z)||void 0===w||null===(g=w[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(x=(null===(T=Z)||void 0===T||null===(P=T[te])||void 0===P||null===(S=P.contentDetails)||void 0===S?void 0:S.closedCaptions)||(null===(D=Z)||void 0===D||null===(C=D[te])||void 0===C?void 0:C.closedCaptions),I=x.filter((function(e){return"VTT"===e.format})),B(e,I)),null!=o&&o.disableControls?j(e):je(e,Re(Re(Re({},o),ue),{},{liveVideo:le,isDvrEnabled:ie,res:Z,sres:ee})),Ie(e,Re(Re(Re({},o),ue),{},{liveVideo:le}),r,{res:Z,sres:ee});case 22:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ae(){return{loadVideoInstantly:v,onTimeUpdate:Q,getVideoDuration:X,onVideoEnded:W,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var t=z(J.mark((function t(o,i){var l,a,s,u,d,c,v,m,p,f,h,g,y,b,k,O,I,j,T,A,V,H,B,L,z,F,G,K,Q,X;return J.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!w(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(g=(null==n?void 0:n.videoSourceUrl)||!1,y=null==n?void 0:n.asat,b=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,k=null==n?void 0:n.videoId,O=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=k,I=null==n?void 0:n.token,!x(n)){t.next=15;break}if(R().set(null==n?void 0:n.refreshToken),I&&!E(I)){t.next=14;break}return i({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}}),t.abrupt("return");case 14:Te=JSON.parse(atob(I.split(".")[1]));case 15:return window.siteId=null===(s=Te)||void 0===s?void 0:s.siteId,window.siteName=null===(u=Te)||void 0===u?void 0:u.site,n.isAnonymousUser=!(null===(d=Te)||void 0===d||!d.anonymousId),n.siteOwner=(null===(c=Te)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=Te)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=Te)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,sessionStorage.setItem("vlp_token",I),j=null==n?void 0:n.playerId,T=n.chromecastReceiverId=null!=n&&n.series?null:null==n?void 0:n.chromecastReceiverId,n.chromecastReceiverId=T,A=null==n?void 0:n.airplay,V=null==n?void 0:n.apiBaseUrl,H=(null==n||null===(p=n.analytics)||void 0===p?void 0:p.gaId)||null,(B=null==n?void 0:n.errors)&&(window.customErrors=B),window.customData=null==n?void 0:n.customData,ne(null==n||null===(f=n.customData)||void 0===f?void 0:f.localisation),V&&(window.playerEntitlementUrl=V),null!=n&&n.skin&&!C(n.skin)||(n.skin="VL_ONE"),t.next=37,Pe();case 37:A&&"Safari"==e()&&Promise.resolve().then((function(){return De})).then((function(e){e.importAirplay()})),H&&ie("https://www.googletagmanager.com/gtag/js?id=".concat(H)).then((function(){return N(H)})).catch((function(e){})),(L=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&L.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g?(F={directPlaybackUrl:g,id:z="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?P(z,I).then((function(e){Ee(j,{res:Re(Re({},e),F)},n,{resolve:o,reject:i})})).catch((function(e){D(e,j,i,z)})):Ee(j,{res:F},n,{resolve:o,reject:i})):O?(K=sessionStorage.getItem("season-idx")||0,U.set(parseInt(K)),Q=null==n||null===(G=n.series)||void 0===G?void 0:G.id,_(Q,I).then((function(e){var t,l,a,s=e.data,u=e.data.seasons;q(u);var d=k||(null==u||null===(t=u[0])||void 0===t||null===(l=t.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);Ce(Q,I),P(d,I).then((function(e){var t,l,a;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(l=t.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(e.data),Ee(j,{res:null==e?void 0:e.data,sres:s},n,{resolve:o,reject:i})})).catch((function(e){D(e,j,i,k)}))})).catch((function(e){D(e,j,i)}))):b?(X=null==n?void 0:n.epg,M(X,I).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==X?void 0:X.channelId,Ee(j,{res:t},n,{resolve:o,reject:i})})).catch((function(e){D(e,j,i,k)}))):P(k,I).then((function(e){var t,l,a,s;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(l=t.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(null==e?void 0:e.data);var u,d=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(s=n.watchHistory)&&void 0!==s&&s.enable)if((null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,m,p=fe((null===(c=n.watchHistory)||void 0===c?void 0:c.profileId)||"",k,null==n?void 0:n.siteOwner);if(p&&p.length)n.watchHistoryResumeTime=(null===(v=p[0])||void 0===v?void 0:v.watchedTime)||null,n.watchedPercentage=(null===(m=p[0])||void 0===m?void 0:m.watchedPercentage)||null;d.contentType="video",Ee(j,{res:d},n,{resolve:o,reject:i})}else S(k,I).then((function(e){var t,l,r,a,s,u;null!==(t=window)&&void 0!==t&&null!==(l=t.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,n.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",Ee(j,{res:d},n,{resolve:o,reject:i})})).catch((function(e){var t,l,r,a;null!==(t=window)&&void 0!==t&&null!==(l=t.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(e)),Ee(j,{res:d},n,{resolve:o,reject:i})}));else Ee(j,{res:d},n,{resolve:o,reject:i})})).catch((function(e){D(e,j,i,k)}));case 42:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},getRenditions:$,skip:m,getPlayer:n,play:p,pause:f,detectBrowser:e,rewind:h,loadVideo:l,seekToTimeStamp:Y,isPlayerInitialised:w,load:g,authenticateLC:y,dispose:b,enableCaptions:k,disableCaptions:O,getCaptions:I,playSelectedResolution:ee,getSource:i,setVolume:he,getVolume:we,disableControls:j,setPlaybackSpeed:Z,getEntitlementData:T}}export{Ae as default};
@@ -0,0 +1 @@
1
+ var n=".stream-selection {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.stream-selector-icon {\n cursor: pointer;\n}\n\n.stream-container {\n position: absolute;\n width: 350px;\n right: -350px;\n bottom: 0px;\n\n background: #00000080 !important;\n z-index: -1;\n transition: right 300ms ease-out;\n}\n\n.stream-container.hidden {\n visibility: hidden;\n}\n\n.stream-selection.open {\n background: rgba(255, 255, 255, 0.20) !important;\n}\n\n.stream-tray {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n}\n\n.stream-selector-head {\n display: flex;\n align-items: center;\n padding-top: 18px;\n padding-left: 20px;\n margin-bottom: 20px;\n}\n\n.stream-selector-title {\n font-size: 18px;\n font-weight: 600;\n margin-left: 25px;\n user-select: none;\n}\n\n.stream-selector-cross-icon {\n cursor: pointer;\n}\n\n.stream-selector-content {\n height: 74%;\n overflow: scroll;\n /* background: yellowgreen; */\n}\n\n.stream-selector-content::-webkit-scrollbar {\n display: none;\n}\n\n/* Hide scrollbar for IE, Edge and Firefox */\n.stream-selector-content {\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */\n}\n\n.stream-selector-content-video {\n height: 300px;\n margin-bottom: 30px;\n /* background: red; */\n}\n\n.stream {\n position: relative;\n height: 175px;\n width: 303px;\n background-repeat: no-repeat;\n background-size: contain;\n margin-bottom: 10px;\n}\n\n.stream>svg {\n display: none;\n}\n\n\n.stream.selected>svg {\n display: block;\n position: absolute;\n right: 0;\n top: -1px;\n}\n\n.parent {\n margin: 21px 52px 23px 34px;\n}\n\n.stream:hover {\n cursor: pointer;\n}\n\n.info {\n font-size: 15px;\n padding: 7px;\n}\n.stream-thumbnail-image{\n width: 100%;\n height: 100%;\n}\n\n@media (max-width:600px){\n .stream-selector-head{\n padding-top: 11px !important;\n padding-left: 8px !important;\n margin-bottom: 17px !important;\n }\n .stream-selector-cross-icon>svg{\n height: 12px;\n }\n .stream-selector-title{\n font-size: 14px;\n }\n .stream-selector-content{\n height: 52%;\n }\n .stream-container{\n width: 200px !important;\n }\n .stream{\n height: 89px !important;\n width: 167px !important;\n }\n .info {\n font-size: 9px !important;\n }\n .selected-stream{\n height: 18px;\n width: 20px;\n }\n .stream-selector-title{\n margin-left: 13px;\n }\n}";export{n as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import r from"video.js";import{h as s,f as l,i}from"./icons-79ad4d7d.js";import{$ as c,g as d,q as m,p as u}from"./beacon-37a5aa2a.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var h=r.getComponent("Component"),v=function(){a(b,h);var v,f,y=(v=b,f=p(),function(){var e,t=n(v);if(f){var a=n(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return o(this,e)});function b(t){var a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),(a=y.call(this,t,o)).playerId=o.playerId,a.seriesData=o.sres,a.streams=o.streams,a.currentVideoData=o.res,a.initialiseStructure(),a.loadCSS(),a}return t(b,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=r.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-93c81b27.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=r.dom.createEl("div",{className:"stream-container hidden"});r.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=t.classList)&&void 0!==a&&a.contains("hidden")?(c(),t.classList.remove("hidden"),e.classList.add("open")):(t.classList.add("hidden"),e.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var o=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px"),a.style.overflow="hidden",r.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),o=r.dom.createEl("div",{className:"stream-selector-head"}),n=r.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(l())});n.onclick=function(){e.classList.add("hidden"),a.classList.remove("open")};for(var s=r.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),c=r.dom.createEl("div",{className:"stream-selector-content"}),p=r.dom.createEl("div",{className:"stream-tray"}),h=function(e){var a,o,n,s=r.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i())});0==e&&(s.classList.add("selected"),s.style.border="2px solid #D2393B"),s.onclick=function(){for(var a=r.dom.$$(".stream"),o=0;o<a.length;o++)a[o].style.border="none",a[o].classList.remove("selected");s.classList.add("selected"),s.style.border="2px solid #D2393B",m(t.playerId,t.streams[e].id).then((function(e){u(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},s.style.backgroundImage="url(".concat(t.streams[e].img,")");var l=document.createElement("img");l.className="stream-thumbnail-image",l.src="".concat((null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img)||(null===(o=window)||void 0===o||null===(n=o.customData)||void 0===n?void 0:n.fallbackImage)),s.append(l),r.dom.appendContent(p,s),r.dom.appendContent(c,p)},v=0;v<this.streams.length;v++)h(v);r.dom.appendContent(o,n),r.dom.appendContent(o,s),r.dom.appendContent(e,o),r.dom.appendContent(e,c),d(this.playerId).on("fullscreenchange",(function(){var a=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(a,"px")}))}}]),b}();export{v as default};
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import r from"video.js";import{h as s,f as l,i}from"./icons-79ad4d7d.js";import{$ as c,g as d,q as m,p as u}from"./beacon-9d84d686.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var h=r.getComponent("Component"),v=function(){a(b,h);var v,f,y=(v=b,f=p(),function(){var e,t=n(v);if(f){var a=n(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return o(this,e)});function b(t){var a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,b),(a=y.call(this,t,o)).playerId=o.playerId,a.seriesData=o.sres,a.streams=o.streams,a.currentVideoData=o.res,a.initialiseStructure(),a.loadCSS(),a}return t(b,[{key:"createEl",value:function(){var e=r.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=r.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return r.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-93c81b27.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=r.dom.createEl("div",{className:"stream-container hidden"});r.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=t.classList)&&void 0!==a&&a.contains("hidden")?(c(),t.classList.remove("hidden"),e.classList.add("open")):(t.classList.add("hidden"),e.classList.remove("open"))};var a=document.getElementById(this.playerId);if(a){var o=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(o,"px"),a.style.overflow="hidden",r.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),o=r.dom.createEl("div",{className:"stream-selector-head"}),n=r.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(l())});n.onclick=function(){e.classList.add("hidden"),a.classList.remove("open")};for(var s=r.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),c=r.dom.createEl("div",{className:"stream-selector-content"}),p=r.dom.createEl("div",{className:"stream-tray"}),h=function(e){var a,o,n,s=r.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i())});0==e&&(s.classList.add("selected"),s.style.border="2px solid #D2393B"),s.onclick=function(){for(var a=r.dom.$$(".stream"),o=0;o<a.length;o++)a[o].style.border="none",a[o].classList.remove("selected");s.classList.add("selected"),s.style.border="2px solid #D2393B",m(t.playerId,t.streams[e].id).then((function(e){u(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},s.style.backgroundImage="url(".concat(t.streams[e].img,")");var l=document.createElement("img");l.className="stream-thumbnail-image",l.src="".concat((null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img)||(null===(o=window)||void 0===o||null===(n=o.customData)||void 0===n?void 0:n.fallbackImage)),s.append(l),r.dom.appendContent(p,s),r.dom.appendContent(c,p)},v=0;v<this.streams.length;v++)h(v);r.dom.appendContent(o,n),r.dom.appendContent(o,s),r.dom.appendContent(e,o),r.dom.appendContent(e,c),d(this.playerId).on("fullscreenchange",(function(){var a=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(a,"px")}))}}]),b}();export{v as default};
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import r from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import o from"video.js";import{h as s,f as l,i}from"./icons-79ad4d7d.js";import{$ as c,g as m,q as d,p}from"./beacon-9d84d686.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var h=o.getComponent("Component"),v=function(){a(g,h);var v,f,y=(v=g,f=u(),function(){var e,t=n(v);if(f){var a=n(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return r(this,e)});function g(t){var a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,g),(a=y.call(this,t,r)).playerId=r.playerId,a.seriesData=r.sres,a.streams=r.streams,a.currentVideoData=r.res,a.initialiseStructure(),a.loadCSS(),a}return t(g,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=o.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(s())});return o.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){import("./multicamv2-1fb5149a.js").then((function(e){var t=document.createElement("style");t.id="multicam-v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=o.dom.createEl("div",{className:"stream-container hidden"});o.dom.$(".stream-selector-icon",this.el()).onclick=function(){var a;null!==(a=t.classList)&&void 0!==a&&a.contains("hidden")?(c(),t.classList.remove("hidden"),e.classList.add("open"),t.style.right="0px"):(t.classList.add("hidden"),e.classList.remove("open"),t.style.right="-350px")};var a=document.getElementById(this.playerId);if(a){var r=window.getComputedStyle(a,null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(r,"px"),a.style.overflow="hidden",o.dom.appendContent(e,t),this.addFunctionality(t)}}},{key:"addFunctionality",value:function(e){var t=this,a=this.el(),r=o.dom.createEl("div",{className:"stream-selector-head"}),n=o.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(l())});n.onclick=function(){e.classList.add("hidden"),a.classList.remove("open"),e.style.right="-350px"};for(var s=o.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),c=o.dom.createEl("div",{className:"stream-selector-content"}),u=o.dom.createEl("div",{className:"stream-tray"}),h=function(e){var a,r=o.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(i())});0==e&&(r.classList.add("selected"),r.style.border="4px solid #D2393B"),r.onclick=function(){for(var a=o.dom.$$(".stream"),n=0;n<a.length;n++)a[n].style.border="none",a[n].classList.remove("selected");r.classList.add("selected"),r.style.border="4px solid #D2393B",d(t.playerId,t.streams[e].id).then((function(e){p(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},r.style.backgroundImage="url(".concat(t.streams[e].img,")");var n=document.createElement("img");n.className="stream-thumbnail-image",n.src="".concat(null==t||null===(a=t.streams[e])||void 0===a?void 0:a.img),n.alt="No Thumbnail Available",r.append(n),o.dom.appendContent(u,r),o.dom.appendContent(c,u)},v=0;v<this.streams.length;v++)h(v);o.dom.appendContent(r,n),o.dom.appendContent(r,s),o.dom.appendContent(e,r),o.dom.appendContent(e,c),m(this.playerId).on("fullscreenchange",(function(){var a=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(a,"px")}))}}]),g}();export{v as default};