@viewlift/player-backup 1.0.40-backup → 1.0.42-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 (55) hide show
  1. package/cjs/autoNextVideo-8656a841.js +1 -0
  2. package/cjs/bundle.css +1 -1
  3. package/cjs/{caption-settings-dfaf4210.js → caption-settings-4e762ac2.js} +1 -1
  4. package/cjs/{features-68987000.js → features-9f66c5b2.js} +1 -1
  5. package/cjs/generic-d74a3b68.js +1 -0
  6. package/cjs/index.js +1 -1
  7. package/cjs/{keyboardShortcuts-c7820be4.js → keyboardShortcuts-a0cc657a.js} +1 -1
  8. package/cjs/{multicam-48941ff4.js → multicam-01812a04.js} +1 -1
  9. package/cjs/{multicamv2-ef0afe2c.js → multicamv2-83cea567.js} +1 -1
  10. package/cjs/{mwebPotraitTray-b9abb359.js → mwebPotraitTray-54298fe5.js} +1 -1
  11. package/cjs/{nextEpisodeButton-2151d197.js → nextEpisodeButton-56cc8d79.js} +1 -1
  12. package/cjs/{playlist-f4448fe7.js → playlist-49e7ede9.js} +1 -1
  13. package/cjs/{renditions-de9cffcc.js → renditions-ebfdd2b2.js} +1 -1
  14. package/cjs/{resolution-732a1ac3.js → resolution-d4cdbcb0.js} +1 -1
  15. package/cjs/{series-8ebbeaa4.js → series-b4dff6d6.js} +1 -1
  16. package/cjs/{series-v2-cc4a9de1.js → series-v2-3ef3f191.js} +1 -1
  17. package/cjs/{settings-icon-9cc35050.js → settings-icon-77196a60.js} +1 -1
  18. package/cjs/{skin-add94a22.js → skin-1a498ca1.js} +1 -1
  19. package/cjs/{skin-1e9dde97.js → skin-8140cdce.js} +1 -1
  20. package/cjs/{skin-0b926fe7.js → skin-9d7c6286.js} +1 -1
  21. package/cjs/skin-bea1efcd.js +1 -0
  22. package/cjs/{skin-306aea45.js → skin-e0cd26ad.js} +1 -1
  23. package/cjs/{util-bb176db0.js → util-dc2b13ea.js} +1 -1
  24. package/cjs/{videoSelector-20432ba0.js → videoSelector-7845eb0c.js} +1 -1
  25. package/esm/autoNextVideo-11c92db9.js +1 -0
  26. package/esm/bundle.css +1 -1
  27. package/esm/{caption-settings-f5ed1d5b.js → caption-settings-627d7d48.js} +1 -1
  28. package/esm/{features-e749a4ec.js → features-5fde26e5.js} +1 -1
  29. package/esm/generic-a58c376a.js +1 -0
  30. package/esm/index.js +1 -1
  31. package/esm/{keyboardShortcuts-64550cec.js → keyboardShortcuts-f16f554b.js} +1 -1
  32. package/esm/{multicam-b7f0db4f.js → multicam-3a5e8f19.js} +1 -1
  33. package/esm/{multicamv2-d068a43b.js → multicamv2-66462362.js} +1 -1
  34. package/esm/{mwebPotraitTray-585105a1.js → mwebPotraitTray-24765550.js} +1 -1
  35. package/esm/{nextEpisodeButton-17fc582d.js → nextEpisodeButton-32cb18de.js} +1 -1
  36. package/esm/{playlist-e3c81e07.js → playlist-878f853b.js} +1 -1
  37. package/esm/{renditions-96da564c.js → renditions-bbab5489.js} +1 -1
  38. package/esm/{resolution-1dde23be.js → resolution-1ed5361a.js} +1 -1
  39. package/esm/{series-af61b2f7.js → series-a279df1f.js} +1 -1
  40. package/esm/{series-v2-9a813fa4.js → series-v2-621b2aba.js} +1 -1
  41. package/esm/{settings-icon-658d3ec4.js → settings-icon-fd63bf43.js} +1 -1
  42. package/esm/{skin-6ed63cfd.js → skin-146f75b8.js} +1 -1
  43. package/esm/skin-2cb09517.js +1 -0
  44. package/esm/{skin-64448263.js → skin-6b70508b.js} +1 -1
  45. package/esm/{skin-aa26e685.js → skin-8637dcb6.js} +1 -1
  46. package/esm/{skin-4ca0f112.js → skin-c2a25d33.js} +1 -1
  47. package/esm/{util-b003fd8d.js → util-e4f12146.js} +1 -1
  48. package/esm/{videoSelector-08ab2e92.js → videoSelector-b3c80717.js} +1 -1
  49. package/package.json +1 -1
  50. package/cjs/autoNextVideo-c08e5141.js +0 -1
  51. package/cjs/generic-d6489c83.js +0 -1
  52. package/cjs/skin-d475739f.js +0 -1
  53. package/esm/autoNextVideo-214dc46e.js +0 -1
  54. package/esm/generic-713f097f.js +0 -1
  55. package/esm/skin-320ff245.js +0 -1
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import o from"video.js";import i from"axios";import"js-cookie";import r from"ua-parser-js";import a from"@babel/runtime/helpers/toConsumableArray";var l={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 d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function s(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?d(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var u={name:"@viewlift/player-backup",version:"1.0.40-backup",main:"dist/bundle.cjs.js",amdName:"_playerCore",dependencies:{"@silvermine/videojs-airplay":"^1.2.0","@silvermine/videojs-chromecast":"^1.4.1",axios:"^1.2.3","js-cookie":"^3.0.5","video.js":"^7.20.3","videojs-contrib-ads":"^6.9.0","videojs-contrib-dash":"^5.1.1","videojs-contrib-eme":"^3.11.1","videojs-ima":"^2.1.0"}},c=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,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):i({url:_(),params:s({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":u.version},withCredentials:!0})},v=function(e,n){var t,o;return i({url:b()+l.getLinearChannelDetails,params:s(s(s(s(s({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===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:n}})},m=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,o;return e({data:null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o?void 0:o.seriesData})})):i({url:b()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:n}})},p=function(){var e=n(t.mark((function e(n,o){var r,a,l;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();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:y(),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=11;break}return l=s({doneWatching:null==n?void 0:n.doneWatching,videoId:null==n?void 0:n.videoId,watchedPercentage:null==n?void 0:n.watchedPercentage,watchedTime:null==n?void 0:n.watchedTime},(null==n?void 0:n.seriesId)&&{seriesId:n.seriesId}),e.abrupt("return",i({url:h(),method:"POST",headers:{Authorization:r},data:l,params:s({},(null==n?void 0:n.profileId)&&{profileId:null==n?void 0:n.profileId})}));case 11:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),f=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])),s=(null==d?void 0:d.site)||null;return i({method:"GET",url:w(e),params:{site:s},headers:{Authorization:n,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey}})}if("v2"==r){var u,c;JSON.parse(atob(n.split(".")[1]));var v=window.contentType;return i({method:"GET",url:T(e,v),headers:{Authorization:n,"x-api-key":null===(u=window)||void 0===u||null===(c=u.watchHistory)||void 0===c?void 0:c.xApiKey}})}},I=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:E(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token}});var o=e.videoId;return i({method:"GET",url:g(o),headers:{Authorization:e.token}})},g=function(e){return b()+"".concat(null==l?void 0:l.getSeriesWatchHistoryV2,"/").concat(e)},E=function(){return b()+"".concat(null==l?void 0:l.getSeriesWatchHistoryV1)},w=function(e){return b()+"".concat(null==l?void 0:l.getVideoInfoV1,"/").concat(e)},T=function(e,n){return b()+"".concat(null==l?void 0:l.getVideoInfoV2,"/").concat(n,"/").concat(e)},y=function(){return b()+"".concat(null==l?void 0:l.saveWatchHistoryV1)},h=function(){return b()+"".concat(null==l?void 0:l.saveWatchHistoryV2)},_=function(){return b()+"".concat(null==l?void 0:l.getVideoDetails)},b=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==l?void 0:l.apiBaseUrl)},O=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},D=null;function V(){return{set:function(e){e&&(D=e)},get:function(){return D}}}var L=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"))||!O(n)){e.next=5;break}return e.abrupt("return",S().then((function(e){var t,o,i=null==e||null===(t=e.data)||void 0===t?void 0:t.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&V().set(r),i||n})).catch((function(e){return console.log("Error fetching refresh token",e),n})));case 5:return e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=V().get(),n=b();return i({method:"GET",url:n+"/identity/refresh/".concat(e)})},C=function(e,n){if(import("./error-2395864b.js").then((function(e){var n=document.createElement("style");n.id="errorblock",n.append("".concat(e.default)),document.head.appendChild(n)})),document.getElementsByClassName("error-container")[0]){var t=document.getElementsByClassName("error-message")[0];t&&(t.innerHTML="".concat(n))}else{var o=document.getElementById(e),i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(n),i.appendChild(r),o.append(i)}},W=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var A=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"};function F(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 R(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?F(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):F(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}window._deviceInfo=r(navigator.userAgent);var k,P,N,x,j,B=function(e,n){return e&&n?"".concat(e,"x").concat(n):e>1024?"L":e>768?"M":"S"},U=function(e){var n=H(e,"video.tags",[]),t=H(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return n.length>0?n.map((function(e){return e.title})).join(","):t},H=function(e,n,t){for(var o=0,i=(n=n.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[n[o]]}return e||t},M=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},z=function(){var e,n,t,o,i,r,a,l,d,s,u,c,v=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",m=arguments.length>1?arguments[1]:void 0,p=arguments.length>2?arguments[2]:void 0,f=null==p||null===(e=p.video)||void 0===e?void 0:e.metadata,I=Se(m);if(!v.includes("VIEWLIFT_"))return v;var g=window.getComputedStyle(document.getElementById(m),null),E=Math.trunc(g.getPropertyValue("height").slice(0,-2)),w=Math.trunc(g.getPropertyValue("width").slice(0,-2)),T=H(p,"video.gist.id",""),y=R(R({},G(f)),{},{VIEWLIFT_WIDTH:w,VIEWLIFT_HEIGHT:E,VIEWLIFT_SIZE:B(w,E),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===(n=window)||void 0===n?void 0:n.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:navigator.userAgent,VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:H(p,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:H(p,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:H(p,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==I||null===(t=I.options_)||void 0===t?void 0:t.autoplay)||1,VIEWLIFT_MUTE:(null==I||null===(o=I.options_)||void 0===o?void 0:o.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:U(p),VIEWLIFT_MEDIA_ID:T,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(H(p,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:T,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+H(p,"video.gist.permalink","")),VIEWLIFT_COPPA:H(null===(i=window)||void 0===i||null===(r=i.app_data)||void 0===r||null===(a=r.site)||void 0===a?void 0:a.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:H(null===(l=window)||void 0===l||null===(d=l.app_data)||void 0===d||null===(s=d.site)||void 0===s?void 0:s.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*H(p,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:H(p,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:T,VIEWLIFT_CONTENT_TITLE:H(p,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:H(p,"video.series[0].gist.title",H(p,"seriesInfo.title","VIEWLIFT_CONTENT_SERIES_TITLE")),VIEWLIFT_CONTENT_EPISODE:H(p,"video.currentEpisode","VIEWLIFT_CONTENT_EPISODE"),VIEWLIFT_CONTENT_SEASON:H(p,"video.currentSeason","VIEWLIFT_CONTENT_SEASON"),VIEWLIFT_CONTENT_GENRE:H(p,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER"},null===(u=window)||void 0===u||null===(c=u.customData)||void 0===c?void 0:c.macros);for(var h in y){var _=new RegExp("\\b("+h+")\\b","g");v=v.replace(_,y[h])}return v},G=function(e){var n,t,o,i,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 s=(null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t||null===(o=t.subscription)||void 0===o?void 0:o.SVOD)||!1,u=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(a=r.subscription)||void 0===a?void 0:a.TVE)||!1;return s||u?(M()?s?l=R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):u&&(l=R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):s?l=R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):u&&(l=R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),s?l=R(R({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}):u&&(l=R(R({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||""})),l=M()?R(R({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):R(R({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=R(R({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}),l=M()?R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:d.get("prof.mweb")||""}):R(R({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||"",VIEWLIFT_PROF:d.get("prof.web")||""})),l},q=function(e,n){var t,o,i,r,a,l,d,s,u,c,v,m,p,f=(null==e?void 0:e.contentType)||"video",I=null==e||null===(t=e[f])||void 0===t?void 0:t.drmEnabled,g=null==e||null===(o=e[f])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,E=null==e||null===(r=e[f])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.audioAssets,w=(null==e||null===(l=e[f])||void 0===l||null===(d=l.streamingInfo)||void 0===d||null===(s=d.videoAssets)||void 0===s?void 0:s.hls)||!1;null==e||null===(u=e[f])||void 0===u||null===(c=u.liveDetails)||void 0===c||c.isDvrEnabled;var T=(null==e||null===(v=e[f])||void 0===v||null===(m=v.streamingInfo)||void 0===m||null===(p=m.videoAssets)||void 0===p?void 0:p.dash)||!1;if(null!=e&&e.audioAssetSource&&null!=E&&E.hls)return J(E);if(I){var y=X(g,n);return y.src=z(y.src,n,e),y}if("Safari"!==A()&&T)return Y(g);if(w){var h=J(g);return h.src=z(h.src,n,e),h}if(null!=g&&g.mpeg){var _=function(e){var n=null==e?void 0:e.mpeg;return{src:n[n.length-1].url,type:"video/mp4"}}(g);return _.src=z(_.src,n,e),_}return null},Y=function(e){var n=null==e?void 0:e.dash;return n?{src:n,type:"application/dash+xml"}:null},J=function(e){var n=null==e?void 0:e.hls;return n?{src:n,type:"application/x-mpegURL"}:null},X=function(e,n){var t=e.fairPlay,i=e.widevine,r=e.playReady,a=A(),l=Se(n);if("Safari"===a){var d=function(e){var n=e.url;return{src:n,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(n,t){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,(function(e,n,o){console.log(e),e&&t(e),t(null,new Uint8Array(o))}))},getContentId:function(e,n){if(n)return new TextDecoder("utf-16").decode(n.slice(16))},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);try{l.eme()}catch(e){console.log("EME ERROR :",e)}return d}var s,u={src:i.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(l.eme(),u.keySystems={"com.widevine.alpha":{url:i.licenseUrl,licenseHeaders:{"X-AxDRM-Message":i.licenseToken}},"com.microsoft.playready":{url:r.licenseUrl,licenseHeaders:{"X-AxDRM-Message":r.licenseToken}}}):(u.keySystemOptions=[],u.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:i.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),u.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),u};var K=function(e){P=e},Q=function(){return P},Z=function(e){k=e},$=function(){return k},ee=function(){return N},ne=function(e){N=e},te=function(e){j=e},oe=function(){return j},ie=function(e){x=new Map,e.map((function(e,n){x.set(e.id,n)}))},re=function(e){if(x){var n=x.get(e);ne(n+1)}},ae=function(e,n){for(var t=Se(e).textTracks(),o=0;o<t.length;o++){var i=t[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!=n||(i.mode="showing")}},le=function(e,n){for(var t=Se(e).textTracks(),o=0;o<t.length;o++){var i=t[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!==n||(i.mode="hidden")}},de=function(e){var n,t=Se(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})))||[]},se=function(e){var n=Se(e);n.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,n.removeRemoteTextTrack(e)}))},ue=function(e,n){var t=Se(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})}))},ce=!1,ve=function(e,n,t){var o=z(n,e,t),i=Se(e);n&&window.google&&(i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,n){var t,o,i,r=Se(e);if(null!==r.el_){ce=!0;var a={id:e,adTagUrl:"".concat(n,"&vid=").concat(window.videoId,"&url=").concat(window.location.href,"&correlator=").concat((new Date).getTime(),"&cust_params=sd%3D60000%26site%3D").concat(window.location.origin,"%26autostart%3D%26mute%3D%26user_agent%3D%26keyword%3D%26category%3D").concat(window.category,"%26vid%3D").concat(window.videoId),adLabel:"Your video will resume after this sponsor message"};r.ima.initializeAdDisplayContainer&&r.ima.initializeAdDisplayContainer(),ce&&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",s=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(s=!0,d="touchend"),r.one(d,(function(){s&&r.ima.initializeAdDisplayContainer()}));var u=(null===(t=window)||void 0===t||null===(o=t.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;r.one("ads-ad-started",(function(){u&&u({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){u&&u({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){u&&u({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o))},me=function(e){return"live"!==e&&"carousel"!==e&&"V2"!==e&&"defaultV2"!==e&&"multiplayer"!==e},pe=function(e){var n=(new DOMParser).parseFromString(e,"text/html");return null==n?void 0:n.querySelector("body")},fe=function(e){var n=(new DOMParser).parseFromString(e,"image/svg+xml");return null==n?void 0:n.querySelector("svg")},Ie=function(e){return fe(e)},ge=function(e){a(document.querySelectorAll("[video-idx]")).map((function(n){var t=n.getAttribute("video-idx");n.style.border=t==e?"2px solid white":"none"}))},Ee=function(){var e=a(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()}))},we=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},Te="",ye=function(e,n){var t,o=function(){return function(e,n){var t=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape";if(Te!==t){var o=window.getComputedStyle(document.getElementById(e),null).getPropertyValue("height");n&&(n.style.height="".concat(o)),Te=t}}(e,n)};window._orientationChangeHandler=o;window.addEventListener("resize",(function(){clearTimeout(t),t=setTimeout((function(){o()}),100)}))};function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var _e=function(e){o(e).play()},be=function(e){o(e).pause()},Oe=function(e,n){var t=o(e),i=t.currentTime()+n;t.currentTime(i)},De=function(e,n){var t=o(e),i=t.currentTime(),r=i<=n?0:i-n;t.currentTime(r)},Ve=function(e){return!!o.getPlayer("".concat(e))},Le=function(e){return o(e).paused()},Se=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},Ce=function(){var e=n(t.mark((function e(n,o,i){var r,a,l,d,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return d=e.sent,re(o),s=0,u=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(a=window)&&void 0!==a&&null!==(l=a.watchHistory)&&void 0!==l&&l.enable&&f(o,d).then((function(e){var n,t,o,i,r,a;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),s=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,u=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})),e.abrupt("return",new Promise((function(e,t){c(o,d).then((function(o){var i,r,a,l,d,c,v,m,p,f,I=null==o?void 0:o.data,g=(null==I||null===(i=I.video)||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;K(o.data);var E=(null==I||null===(a=I.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==I||null===(v=I.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(p=m.adTags)||void 0===p||null===(f=p.web)||void 0===f?void 0:f.url);E&&ve(n,E,I);var w=q(I,n);if(w){var T,y,h,_,b,O,D,V,L,S,A,F,R,k,P=(null==I||null===(T=I.video)||void 0===T||null===(y=T.gist)||void 0===y?void 0:y.videoImageUrl)||(null==I||null===(h=I.video)||void 0===h||null===(_=h.gist)||void 0===_||null===(b=_.imageGist)||void 0===b?void 0:b.r16x9),N=Se(n);if(N.poster(P),Re(n,w),N.on("loadstart",(function(){g&&e({status:!0,msg:"Video Loaded",response:I})})),N.on("loadeddata",(function(){W(),e({status:!0,msg:"Video Loaded",response:I})})),N.one("play",(function(){s&&u<95&&setTimeout((function(){N.currentTime(s)}),0)})),N.one("error",(function(){var e;t({status:!1,msg:(null==N||null===(e=N.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==I||null===(O=I.video)||void 0===O||null===(D=O.contentDetails)||void 0===D||null===(V=D.closedCaptions)||void 0===V?void 0:V.length)>0||(null==I||null===(L=I.video)||void 0===L||null===(S=L.closedCaptions)||void 0===S?void 0:S.length)>0)A=((null==I||null===(F=I.video)||void 0===F||null===(R=F.contentDetails)||void 0===R?void 0:R.closedCaptions)||(null==I||null===(k=I.video)||void 0===k?void 0:k.closedCaptions)).filter((function(e){return"VTT"===e.format})),ue(n,A);else se(n)}else C(n,"Incompatible Source, only hls,mp4,drm content is allowed"),t("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){ke(e,n,t,o)}))})));case 8:case"end":return e.stop()}}),e)})));return function(n,t,o){return e.apply(this,arguments)}}(),We=function(e,n,t){var o=Se(e);return o.src(n),new Promise((function(e,n){var i=0;o.one("loadedmetadata",(function(){clearTimeout(i),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){i=setTimeout((function(){n("FAILED: Took too long to load")}),t)}))}))},Ae=function(e){var n=Se(e);if(Fe(),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()}},Fe=function(){document.getElementById("carousel_homepage")&&document.getElementById("carousel_homepage").remove(),document.getElementById("dvr_skin")&&document.getElementById("dvr_skin").remove(),document.getElementById("nondvr_skin")&&document.getElementById("nondvr_skin").remove(),document.getElementById("multicam")&&document.getElementById("multicam").remove(),document.getElementById("errorblock")&&document.getElementById("errorblock").remove(),document.getElementById("def_skin")&&document.getElementById("def_skin").remove(),document.getElementById("video-selection")&&document.getElementById("video-selection").remove(),document.getElementById("multicam-v2")&&document.getElementById("multicam-v2").remove(),document.getElementById("default_v2")&&document.getElementById("default_v2").remove(),document.getElementById("video-captions")&&document.getElementById("video-captions").remove(),document.getElementById("playlist-selection")&&document.getElementById("playlist-selection").remove(),document.getElementById("multiplayer_css")&&document.getElementById("multiplayer_css").remove(),document.getElementById("chromett")&&document.getElementById("chromett").remove()},Re=function(e,n){Se(e).src(n)},ke=function(n,t,o,i){var r,a,l,d,s,u,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);Ve(t)&&C(t,(null===(s=window)||void 0===s?void 0:s.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),o&&o(function(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?he(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):he(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}({status:!1,response:n,msg:"".concat(v)},i&&{videoId:i}))},Pe=function(e){var n=document.getElementById(e),t=n.getElementsByClassName("vjs-control-bar")[0];t&&(t.style.visibility="hidden");var o=n.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=n.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{O as A,me as B,m as C,c as D,ke as E,v as F,f as G,we as H,ve as I,ue as J,Z as K,fe as L,Ie as M,$ as N,ee as O,ge as P,Le as Q,ne as R,pe as S,Ee as T,ye as U,ie as V,re as W,Se as a,Q as b,W as c,A as d,K as e,oe as f,L as g,C as h,I as i,te as j,Oe as k,We as l,be as m,Re as n,Ve as o,_e as p,Ce as q,De as r,p as s,Ae as t,ae as u,le as v,de as w,q as x,Pe as y,V as z};
@@ -1 +0,0 @@
1
- import{i as e,j as l,k as t,g as n,h as i,d as o,l as a,m as r,n as s,o as d}from"./features-e749a4ec.js";import{M as u,a as v,c as m,d as c}from"./icons-c2efba97.js";import{N as p,a as f,O as g,w as h,M as y,d as b}from"./generic-713f097f.js";import{g as C}from"./renditions-96da564c.js";import x from"@babel/runtime/helpers/toConsumableArray";import{s as j}from"./autoNextVideo-214dc46e.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./util-b003fd8d.js";var E,N=p(),w=[];null==N||N.map((function(e){return w.push.apply(w,x(e.episodes))}));var B=function(e,l){var t;E=(null==l||null===(t=l.series)||void 0===t?void 0:t.cb)||null;var n=f(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),t=n.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];t-l<=10&&g()<=(null==w?void 0:w.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var i,o=w.filter((function(e,l){return l==g()}));if((null==o?void 0:o.length)>0)if(null!==(i=document.getElementsByClassName("next-ep-preview"))&&void 0!==i&&i[0]){var a,r,s,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(r=document.getElementsByClassName("next-ep-title"))||void 0===r?void 0:r[0],C=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],x=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],j=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=j)||void 0===v?void 0:v.length)>60&&(j=j.substr(0,60)+"..."),b.textContent="".concat(j),C.src=(null===(m=o[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),x.onclick=function(){return V(e)}}else{var N,B,k,M,I,P,T,D=document.createElement("div");D.className="next-ep-preview",D.style.visibility="hidden",document.getElementById(e).append(D);var L=document.createElement("div");L.className="next-ep-header",L.textContent="Next up";var O=null===(N=o[0])||void 0===N?void 0:N.title,F=document.createElement("img");F.className="next-ep-img",F.src=(null===(B=o[0])||void 0===B||null===(k=B.gist)||void 0===k||null===(M=k.imageGist)||void 0===M?void 0:M.r16x9)||(null===(I=window)||void 0===I||null===(P=I.customData)||void 0===P?void 0:P.fallbackImage);var G=document.createElement("div");G.className="next-ep-title",(null===(T=O)||void 0===T?void 0:T.length)>60&&(O=O.substr(0,60)+"..."),G.textContent="".concat(O);var R=document.createElement("div");R.className="next-ep-content",R.append(F),R.append(G),R.onclick=function(){return V(e)},D.append(L),D.append(R)}},V=function(e,l){var t=f(e),n=Math.floor(t.currentTime());if(Math.floor(t.duration())!=n){t.pause(e);var i=g();j(i,e,w,E)}};function k(n,i){var o=f(n);o.on("loadeddata",(function(){var t,a,r;(null===(t=C(n))||void 0===t?void 0:t.length)>0&&e(n,i),(null===(a=h(n))||void 0===a?void 0:a.length)>0&&l(n,i),null!=i&&null!==(r=i.series)&&void 0!==r&&r.enable&&B(n,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var e,l,i,o;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&t(n,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}function M(e,l){!function(){"Chrome"==b()&&import("./chromett-a3cbb2e1.js").then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));import("./skin-3470b8fa.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),k(e,l),function(e,l){var t=f(e);t.controlBar.getChild("FullscreenToggle").el().appendChild(y(u(window.controlsColor))),t.controlBar.getChild("FullscreenToggle").el().appendChild(y(v(window.controlsColor)));var n=document.getElementsByClassName("vjs-time-control");l.liveVideo&&(n[0].style.display="none")}(e,l),function(e,l){var t,u,v,p,f,g;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&i(e,"defaultV2",c());l.liveVideo||o(e);(null==l||null===(t=l.relatedVideos)||void 0===t||null===(u=t.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&r(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&s(e,null==l?void 0:l.playlist);null!=l&&null!==(g=l.series)&&void 0!==g&&g.enable&&d(e,l)}(e,l),function(e,l){var t=f(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(n),o.alt="Provider Image",i.append(o),t.el().appendChild(i),t.on("useractive",(function(){i.classList.remove("vjs-fade")})),t.on("userinactive",(function(){t.paused()||i.classList.add("vjs-fade")})),t.on("fullscreenchange",(function(){t.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}(e,l)}export{M as initialiseSkin};