@viewlift/player-backup 1.0.20 → 1.0.21

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 (52) hide show
  1. package/cjs/{autoNextVideo-7b7e4048.js → autoNextVideo-56b33d9e.js} +1 -1
  2. package/cjs/bundle.css +4 -4
  3. package/cjs/{caption-settings-cb18f7f2.js → caption-settings-d6c88aed.js} +1 -1
  4. package/cjs/{features-430c426f.js → features-df8e9920.js} +1 -1
  5. package/cjs/generic-e7a63618.js +1 -0
  6. package/cjs/index.js +1 -1
  7. package/cjs/{keyboardShortcuts-53e56e40.js → keyboardShortcuts-464a2d8b.js} +1 -1
  8. package/cjs/{multicam-9670b0c6.js → multicam-c53f0d53.js} +1 -1
  9. package/cjs/{multicamv2-1ebef763.js → multicamv2-24183e0b.js} +1 -1
  10. package/cjs/{mwebPotraitTray-08552912.js → mwebPotraitTray-a4b25327.js} +1 -1
  11. package/cjs/{nextEpisodeButton-e1f3d28e.js → nextEpisodeButton-49890fcf.js} +1 -1
  12. package/cjs/{playlist-30651398.js → playlist-121b2ae3.js} +1 -1
  13. package/cjs/{renditions-80e596e5.js → renditions-8db1b641.js} +1 -1
  14. package/cjs/{resolution-71bc128d.js → resolution-563a1ba0.js} +1 -1
  15. package/cjs/{series-c4d6cb58.js → series-90feed57.js} +1 -1
  16. package/cjs/{series-v2-0d52e74b.js → series-v2-c174a244.js} +1 -1
  17. package/cjs/{settings-icon-ea10edde.js → settings-icon-0aa0abe9.js} +1 -1
  18. package/cjs/skin-0c3657a9.js +1 -0
  19. package/cjs/{skin-1b4d04c2.js → skin-1fcb10e7.js} +1 -1
  20. package/cjs/{skin-3d9f73f6.js → skin-4c8c6e23.js} +1 -1
  21. package/cjs/{skin-1a0120c1.js → skin-80b6248c.js} +1 -1
  22. package/cjs/{skin-0ce4a632.js → skin-85b7e33c.js} +1 -1
  23. package/cjs/{util-e2fa114d.js → util-77826b59.js} +1 -1
  24. package/cjs/{videoSelector-0a67bd6f.js → videoSelector-1333afb7.js} +1 -1
  25. package/esm/{autoNextVideo-6dd07682.js → autoNextVideo-359b4578.js} +1 -1
  26. package/esm/bundle.css +4 -4
  27. package/esm/{caption-settings-f0fdf415.js → caption-settings-20586b62.js} +1 -1
  28. package/esm/{features-7a3fe2bb.js → features-3a0c4853.js} +1 -1
  29. package/esm/generic-9fe79484.js +1 -0
  30. package/esm/index.js +1 -1
  31. package/esm/{keyboardShortcuts-892e3702.js → keyboardShortcuts-dbb4d620.js} +1 -1
  32. package/esm/{multicam-0fc7b725.js → multicam-5c88ebcb.js} +1 -1
  33. package/esm/{multicamv2-1321fff3.js → multicamv2-961f6e0d.js} +1 -1
  34. package/esm/{mwebPotraitTray-39c7d4b8.js → mwebPotraitTray-1d16253e.js} +1 -1
  35. package/esm/{nextEpisodeButton-17c1b8eb.js → nextEpisodeButton-879a381b.js} +1 -1
  36. package/esm/{playlist-0f35f5a0.js → playlist-080a0b3f.js} +1 -1
  37. package/esm/{renditions-2fe24495.js → renditions-b6ca6ed3.js} +1 -1
  38. package/esm/{resolution-8d47ea4e.js → resolution-dcd52ff1.js} +1 -1
  39. package/esm/{series-f4edd0cf.js → series-3e2753ad.js} +1 -1
  40. package/esm/{series-v2-c96b8976.js → series-v2-1607b372.js} +1 -1
  41. package/esm/{settings-icon-ddd3379f.js → settings-icon-8003580c.js} +1 -1
  42. package/esm/{skin-e32e8469.js → skin-185d9364.js} +1 -1
  43. package/esm/{skin-250f2c4f.js → skin-4a285a68.js} +1 -1
  44. package/esm/{skin-1e34ae28.js → skin-7d48d134.js} +1 -1
  45. package/esm/{skin-086e6205.js → skin-d8917b4d.js} +1 -1
  46. package/esm/{skin-adbdde7a.js → skin-f91e6b8a.js} +1 -1
  47. package/esm/{util-e2125c7f.js → util-72c30630.js} +1 -1
  48. package/esm/{videoSelector-b7d94ae7.js → videoSelector-679e4f04.js} +1 -1
  49. package/package.json +1 -1
  50. package/cjs/generic-3468cb75.js +0 -1
  51. package/cjs/skin-621f6c4b.js +0 -1
  52. package/esm/generic-fd09b212.js +0 -1
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import t from"video.js";import n from"axios";import"js-cookie";import o from"ua-parser-js";var i={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"};function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var l={name:"@viewlift/player",version:"1.0.31",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.0","videojs-ima":"^2.1.0"}},d=function(e,t){var o,i,r,d;return null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.overrideEntitlementResponse?new Promise((function(e,t){var n,o;return e({data:null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):n({url:T(),params:a({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(d=r.customData)||void 0===d?void 0:d.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":l.version},withCredentials:!0})},s=function(e,t){var o,i,r=JSON.parse(atob(t.split(".")[1])),a=(null==r?void 0:r.site)||null;return r&&r.countryCode,null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.seriesData?new Promise((function(e,t){var n,o;return e({data:null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.seriesData})})):n({url:y()+"/v3/content/series/".concat(e),params:{site:a},method:"GET",headers:{Authorization:t}})},c=function(e,t,o){if("v1"==o){var i={siteOwner:null==e?void 0:e.siteOwner,userId:null==e?void 0:e.userId,videoId:null==e?void 0:e.videoId,watchedPercentage:null==e?void 0:e.watchedPercentage,watchedTime:null==e?void 0:e.watchedTime};return n({url:f(),method:"POST",headers:{Authorization:t,"x-api-key":e.xApiKey},params:{version:"v2"},data:JSON.stringify(i),withCredentials:!0})}if("v2"==o){var r=a({doneWatching:null==e?void 0:e.doneWatching,videoId:null==e?void 0:e.videoId,watchedPercentage:null==e?void 0:e.watchedPercentage,watchedTime:null==e?void 0:e.watchedTime},(null==e?void 0:e.seriesId)&&{seriesId:e.seriesId});return n({url:E(),method:"POST",headers:{Authorization:t},data:r,params:a({},(null==e?void 0:e.profileId)&&{profileId:null==e?void 0:e.profileId})})}},u=function(e,t){var o,i,r=(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";if("v1"==r){var a,l,d=JSON.parse(atob(t.split(".")[1])),s=(null==d?void 0:d.site)||null;return n({method:"GET",url:p(e),params:{site:s},headers:{Authorization:t,"x-api-key":null===(a=window)||void 0===a||null===(l=a.watchHistory)||void 0===l?void 0:l.xApiKey}})}if("v2"==r){var c,u;JSON.parse(atob(t.split(".")[1]));var v=window.contentType;return n({method:"GET",url:g(e,v),headers:{Authorization:t,"x-api-key":null===(c=window)||void 0===c||null===(u=c.watchHistory)||void 0===u?void 0:u.xApiKey}})}},v=function(e){var t,o;if("v1"==((null===(t=window)||void 0===t||null===(o=t.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1"))return n({method:"GET",url:I(),params:{site:null==e?void 0:e.siteOwner,version:"v2",seriesId:e.videoId},headers:{Authorization:e.token}});var i=e.videoId;return n({method:"GET",url:m(i),headers:{Authorization:e.token}})},m=function(e){return y()+"".concat(null==i?void 0:i.getSeriesWatchHistoryV2,"/").concat(e)},I=function(){return y()+"".concat(null==i?void 0:i.getSeriesWatchHistoryV1)},p=function(e){return y()+"".concat(null==i?void 0:i.getVideoInfoV1,"/").concat(e)},g=function(e,t){return y()+"".concat(null==i?void 0:i.getVideoInfoV2,"/").concat(t,"/").concat(e)},f=function(){return y()+"".concat(null==i?void 0:i.saveWatchHistoryV1)},E=function(){return y()+"".concat(null==i?void 0:i.saveWatchHistoryV2)},T=function(){return y()+"".concat(null==i?void 0:i.getVideoDetails)},y=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==i?void 0:i.apiBaseUrl)},w=function(e){var t=JSON.parse(atob(null==e?void 0:e.split(".")[1])),n=null==t?void 0:t.exp;if(new Date(1e3*n).getTime()<(new Date).getTime())return!0},O=function(e,t){if(import("./error-2395864b.js").then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var o=document.getElementById(e),i=document.createElement("div");i.className="error-container";var r=document.createElement("div");r.className="error-message",r.innerHTML="".concat(t),i.appendChild(r),o.append(i)}},h=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var _=function(){var e,t,n,o;return null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.onlyPlayReadyDRM||navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(n=window.navigator)||void 0===n||null===(o=n.userAgentData)||void 0===o?void 0:o.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 D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function b(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?D(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):D(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}window._deviceInfo=o(navigator.userAgent);var S=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},V=function(e){var t=L(e,"video.tags",[]),n=L(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},L=function(e,t,n){for(var o=0,i=(t=t.split(".")).length;o<i;o++){var r;e=null===(r=e)||void 0===r?void 0:r[t[o]]}return e||n},W=function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},C=function(){var e,t,n,o,i,r,a,l,d,s,c,u,v=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",m=arguments.length>1?arguments[1]:void 0,I=arguments.length>2?arguments[2]:void 0,p=null==I||null===(e=I.video)||void 0===e?void 0:e.metadata,g=Ie(m);if(!v.includes("VIEWLIFT_"))return v;var f=window.getComputedStyle(document.getElementById(m),null),E=Math.trunc(f.getPropertyValue("height").slice(0,-2)),T=Math.trunc(f.getPropertyValue("width").slice(0,-2)),y=L(I,"video.gist.id",""),w=b(b({},P(p)),{},{VIEWLIFT_WIDTH:T,VIEWLIFT_HEIGHT:E,VIEWLIFT_SIZE:S(T,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===(t=window)||void 0===t?void 0:t.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:navigator.userAgent,VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:L(I,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:L(I,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:L(I,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==g||null===(n=g.options_)||void 0===n?void 0:n.autoplay)||1,VIEWLIFT_MUTE:(null==g||null===(o=g.options_)||void 0===o?void 0:o.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:V(I),VIEWLIFT_MEDIA_ID:y,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(L(I,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:y,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+L(I,"video.gist.permalink","")),VIEWLIFT_COPPA:L(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:L(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*L(I,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:L(I,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:y,VIEWLIFT_CONTENT_TITLE:L(I,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:L(I,"video.series[0].gist.title",L(I,"seriesInfo.title","VIEWLIFT_CONTENT_SERIES_TITLE")),VIEWLIFT_CONTENT_EPISODE:L(I,"video.currentEpisode","VIEWLIFT_CONTENT_EPISODE"),VIEWLIFT_CONTENT_SEASON:L(I,"video.currentSeason","VIEWLIFT_CONTENT_SEASON"),VIEWLIFT_CONTENT_GENRE:L(I,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER"},null===(c=window)||void 0===c||null===(u=c.customData)||void 0===u?void 0:u.macros);for(var O in w){var h=new RegExp("\\b("+O+")\\b","g");v=v.replace(h,w[O])}return v},P=function(e){var t,n,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===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(o=n.subscription)||void 0===o?void 0:o.SVOD)||!1,c=(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||c?(W()?s?l=b(b({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):c&&(l=b(b({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.tve")||""})):s?l=b(b({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""}):c&&(l=b(b({},l),{},{VIEWLIFT_CSID:d.get("csid.web.tve")||""})),s?l=b(b({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}):c&&(l=b(b({},l),{},{VIEWLIFT_SFID:d.get("sfid.tve")||""})),l=W()?b(b({},l),{},{VIEWLIFT_PROF:d.get("prof.mweb")||""}):b(b({},l),{},{VIEWLIFT_PROF:d.get("prof.web")||""})):(l=b(b({},l),{},{VIEWLIFT_SFID:d.get("sfid.dtc")||""}),l=W()?b(b({},l),{},{VIEWLIFT_CSID:d.get("csid.mweb.dtc")||""}):b(b({},l),{},{VIEWLIFT_CSID:d.get("csid.web.dtc")||""})),l};function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function F(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?A(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):A(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var R,N,j,k,B,U=function(e,t){var n,o,i,r,a,l,d,s,c,u,v,m=null==e||null===(n=e.video)||void 0===n?void 0:n.drmEnabled,I=null==e||null===(o=e.video)||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,p=(null==e||null===(r=e.video)||void 0===r||null===(a=r.streamingInfo)||void 0===a||null===(l=a.videoAssets)||void 0===l?void 0:l.hls)||!1,g=(null==e||null===(d=e.video)||void 0===d||null===(s=d.liveDetails)||void 0===s?void 0:s.isDvrEnabled)||!1,f=(null==e||null===(c=e.video)||void 0===c||null===(u=c.streamingInfo)||void 0===u||null===(v=u.videoAssets)||void 0===v?void 0:v.dash)||!1;if(m){var E=z(I,t);return E.src=C(E.src,t,e),g&&(E=F(F({},E),{},{src:x(F(F({},e.video),{},{src:"".concat(E.src)}))})),E}if("Safari"!==_()&&f)return M(I);if(p){var T=H(I);return T.src=C(T.src,t,e),g&&(T=F(F({},T),{},{src:x(F(F({},e.video),{},{src:"".concat(T.src)}))})),T}if(null!=I&&I.mpeg){var y=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(I);return y.src=C(y.src,t,e),y}return null},x=function(e){var t=e.src;if(e.liveDetails.startOverTime){var n=e.liveDetails.startOverTime,o=e.gist.scheduleStartDate,i=e.gist.scheduleEndDate,r=new Date,a=0,l=r.getTime();a=l-o<1e3*n?l-o:1e3*n;var d=null;i<=l&&null!=i&&(d=new Date(i)),r.setMilliseconds(r.getMilliseconds()-a),t=t.includes("?")?i&&d?"".concat(e.src,"&start=").concat(r.toISOString(),"&end=").concat(d.toISOString()):"".concat(e.src,"&start=").concat(r.toISOString()):i&&d?"".concat(e.src,"?start=").concat(r.toISOString(),"&end=").concat(d.toISOString()):"".concat(e.src,"?start=").concat(r.toISOString())}return t},M=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},H=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},z=function(e,n){var o=e.fairPlay,i=e.widevine,r=e.playReady,a=_(),l=Ie(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,o){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};t.xhr(i,(function(e,t,n){console.log(e),e&&o(e),o(null,new Uint8Array(n))}))},getContentId:function(e,t){if(t)return new TextDecoder("utf-16").decode(t.slice(16))},getLicense:function(n,o,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}};t.xhr(a,(function(e,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(o);try{l.eme()}catch(e){console.log("EME ERROR :",e)}return d}if("Chrome"===a||"Firefox"===a){var s={src:i.url,type:"application/dash+xml",keySystemOptions:[]};return s.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:i.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),s}if("IE"===a){var c={src:r.url,type:"application/dash+xml",keySystemOptions:[]};return c.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),c}};var G=function(e){N=e},Y=function(){return N},J=function(e){R=e},K=function(){return R},q=function(){return j},X=function(e){j=e},Z=function(e){B=e},Q=function(){return B},$=function(e){k=new Map,e.map((function(e,t){k.set(e.id,t)}))},ee=function(e){if(k){var t=k.get(e);X(t+1)}},te=function(e,t){for(var n=Ie(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!=t||(i.mode="showing")}},ne=function(e,t){for(var n=Ie(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!==t||(i.mode="hidden")}},oe=function(e){var t,n=Ie(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},ie=function(e,t){var n=Ie(e);n.remoteTextTracks().tracks_.map((function(e){n.removeRemoteTextTrack(e)})),t.map((function(e){n.addRemoteTextTrack({src:e.url,srcLang:e.language,label:e.language})}))},re=!1,ae=function(e,t,n){var o=C(t,e,n),i=Ie(e);t&&window.google&&(i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,t){var n,o,i,r=Ie(e);if(null!==r.el_){re=!0;var a={id:e,adTagUrl:"".concat(t,"&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(),re&&null!==r.el_&&("function"==typeof r.ima?r.ima(a):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var l=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&l.hasAttribute("controls")&&l.removeAttribute("controls");var d="click",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 c=(null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.adEventHandler)||null;r.one("ads-ad-started",(function(){c&&c({status:"STARTED",msg:"Advertisement Started"})})),r.one("ads-manager",(function(e){e.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,(function(){c&&c({status:"ENDED",msg:"Advertisement Ended"})}))})),r.on("adserror",(function(e){c&&c({status:"ERROR",msg:"Advertisement Error"})}))}}(e,o))};function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var de=function(e){t(e).play()},se=function(e){t(e).pause()},ce=function(e,n){var o=t(e),i=o.currentTime()+n;o.currentTime(i)},ue=function(e,n){var o=t(e),i=o.currentTime(),r=i<=n?0:i-n;o.currentTime(r)},ve=function(e){return!!t.getPlayer("".concat(e))},me=function(e){return t(e).paused()},Ie=function(e){return!!t.getPlayer("".concat(e))&&t.getPlayer("".concat(e))},pe=function(e,t,n){var o,i,r;ee(t);var a=0,l=0;return null!==(o=window)&&void 0!==o&&o.watchHistory&&null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.enable&&u(t,n).then((function(e){var t,n,o,i,r,d;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),a=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,l=(null==e||null===(d=e.data)||void 0===d?void 0:d.watchedPercentage)||null})).catch((function(e){var t,n,o,i;null!==(t=window)&&void 0!==t&&null!==(n=t.watchHistory)&&void 0!==n&&n.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})),new Promise((function(o,i){d(t,n).then((function(t){var n,r,d,s,c,u,v,m,I,p,g=null==t?void 0:t.data,f=(null==g||null===(n=g.video)||void 0===n||null===(r=n.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;G(t.data);var E=(null==g||null===(d=g.ads)||void 0===d||null===(s=d.preRoll)||void 0===s||null===(c=s.adTags)||void 0===c||null===(u=c.web)||void 0===u?void 0:u.active)&&(null==g||null===(v=g.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(I=m.adTags)||void 0===I||null===(p=I.web)||void 0===p?void 0:p.url);E&&ae(e,E,g);var T=U(g,e);if(T){var y,w,_,D,b,S,V,L,W,C,P,A=null==g||null===(y=g.video)||void 0===y||null===(w=y.gist)||void 0===w?void 0:w.videoImageUrl,F=Ie(e);if(F.poster(A),Te(e,T),F.on("loadstart",(function(){f&&o({status:!0,msg:"Video Loaded",response:g})})),F.on("loadeddata",(function(){h(),o({status:!0,msg:"Video Loaded",response:g})})),F.one("play",(function(){a&&l<95&&setTimeout((function(){F.currentTime(a)}),0)})),F.one("error",(function(){var e;i({status:!1,msg:(null==F||null===(e=F.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==g||null===(_=g.video)||void 0===_||null===(D=_.contentDetails)||void 0===D||null===(b=D.closedCaptions)||void 0===b?void 0:b.length)>0||(null==g||null===(S=g.video)||void 0===S||null===(V=S.closedCaptions)||void 0===V?void 0:V.length)>0)L=((null==g||null===(W=g.video)||void 0===W||null===(C=W.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null==g||null===(P=g.video)||void 0===P?void 0:P.closedCaptions)).filter((function(e){return"VTT"===e.format})),ie(e,L);else!function(e){var t=Ie(e);t.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,t.removeRemoteTextTrack(e)}))}(e)}else O(e,"Incompatible Source, only hls,mp4,drm content is allowed"),i("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(n){ye(n,e,i,t)}))}))},ge=function(e,t,n){var o=Ie(e);return o.src(t),new Promise((function(e,t){var i=0;o.one("loadedmetadata",(function(){clearTimeout(i),e({status:!0,msg:"video loaded"})})),o.one("loadstart",(function(e){i=setTimeout((function(){t("FAILED: Took too long to load")}),n)}))}))},fe=function(e){var t=Ie(e);if(Ee(),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},Ee=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()},Te=function(e,t){Ie(e).src(t)},ye=function(t,n,o,i){var r,a,l,d,s,c,u=null==t||null===(r=t.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.errorCode,v=(null==t||null===(l=t.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.errorMessage)||(null==t?void 0:t.message);ve(n)&&O(n,(null===(s=window)||void 0===s?void 0:s.customErrors)&&(null===(c=window)||void 0===c?void 0:c.customErrors[u])||"".concat(v)),o&&o(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?le(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):le(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({status:!1,response:t,msg:"".concat(v)},i&&{videoId:i}))},we=function(e){var t=document.getElementById(e),n=t.getElementsByClassName("vjs-control-bar")[0];n&&(n.style.visibility="hidden");var o=t.getElementsByClassName("vjs-big-play-button")[0];o&&(o.style.display="none");var i=t.getElementsByClassName("vjs-fullscreen-control")[0];i&&(i.style.display="none")};export{d as A,ye as B,u as C,ae as D,ie as E,J as F,K as G,q as H,me as I,X as J,$ as K,ee as L,Y as a,G as b,h as c,_ as d,Q as e,v as f,Ie as g,O as h,Z as i,ce as j,se as k,ge as l,Te as m,ve as n,pe as o,de as p,fe as q,ue as r,c as s,te as t,ne as u,oe as v,U as w,we as x,w as y,s as z};