@viewlift/player-backup 1.0.61 → 1.0.63-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{autoNextVideo-50ffd441.js → autoNextVideo-81dafcd5.js} +1 -1
- package/cjs/bundle.css +1 -1
- package/cjs/{caption-settings-587c51ea.js → caption-settings-30367b99.js} +1 -1
- package/cjs/{chromecast-5dad1eb5.js → chromecast-c43dfe8f.js} +1 -1
- package/cjs/{features-e9401bd9.js → features-a946a835.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{keyboardShortcuts-9f797b42.js → keyboardShortcuts-6b1f1884.js} +1 -1
- package/cjs/{multicam-2d048d21.js → multicam-21ee445f.js} +1 -1
- package/cjs/{multicamv2-bd5820a6.js → multicamv2-5e893bd8.js} +1 -1
- package/cjs/{mwebPotraitTray-62d82542.js → mwebPotraitTray-d6c3d95e.js} +1 -1
- package/cjs/{nextEpisodeButton-e4d73ba4.js → nextEpisodeButton-723990d6.js} +1 -1
- package/cjs/{playlist-c805bb8b.js → playlist-17d924d8.js} +1 -1
- package/cjs/{renditions-a603eee8.js → renditions-eee5b220.js} +1 -1
- package/cjs/{resolution-3354cead.js → resolution-c2f5d636.js} +1 -1
- package/cjs/{series-4aec541f.js → series-5c3c15dd.js} +1 -1
- package/cjs/{series-v2-84ef0d40.js → series-v2-b1b0e057.js} +1 -1
- package/cjs/{settings-icon-87854110.js → settings-icon-2c19e148.js} +1 -1
- package/cjs/{skin-c7ccea8f.js → skin-071eb264.js} +1 -1
- package/cjs/{skin-76fc1f46.js → skin-47f06ed0.js} +1 -1
- package/cjs/{skin-8d437032.js → skin-75438aac.js} +1 -1
- package/cjs/skin-86b6469d.js +1 -0
- package/cjs/{skin-4f320cb6.js → skin-ac05cb75.js} +1 -1
- package/cjs/{util-835bacf7.js → util-2720e3a7.js} +1 -1
- package/cjs/{videoSelector-e5e5db6c.js → videoSelector-5cf9c9e5.js} +1 -1
- package/esm/{autoNextVideo-69d64a90.js → autoNextVideo-3d98a3c6.js} +1 -1
- package/esm/bundle.css +1 -1
- package/esm/{caption-settings-174fd3d3.js → caption-settings-79b1ee80.js} +1 -1
- package/esm/{chromecast-e2000c4e.js → chromecast-d941c74a.js} +1 -1
- package/esm/{features-c246b1d0.js → features-ce48d5ef.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{keyboardShortcuts-0650de3e.js → keyboardShortcuts-7df94fc8.js} +1 -1
- package/esm/{multicam-d7ee96ed.js → multicam-33c32e53.js} +1 -1
- package/esm/{multicamv2-1939e3f8.js → multicamv2-e44055d7.js} +1 -1
- package/esm/{mwebPotraitTray-dbdf3d1e.js → mwebPotraitTray-6fdfc363.js} +1 -1
- package/esm/{nextEpisodeButton-e6c19115.js → nextEpisodeButton-19e13600.js} +1 -1
- package/esm/{playlist-b1f69275.js → playlist-57965671.js} +1 -1
- package/esm/{renditions-4d6b5b1b.js → renditions-18852ab0.js} +1 -1
- package/esm/{resolution-908b6145.js → resolution-6079139b.js} +1 -1
- package/esm/{series-6dddebcf.js → series-267cb706.js} +1 -1
- package/esm/{series-v2-b470b0e2.js → series-v2-6def4c4a.js} +1 -1
- package/esm/{settings-icon-4c4c2a36.js → settings-icon-bb6e69bb.js} +1 -1
- package/esm/skin-68977397.js +1 -0
- package/esm/{skin-0b805562.js → skin-a38487fe.js} +1 -1
- package/esm/{skin-1c5d53d8.js → skin-a7f66e6b.js} +1 -1
- package/esm/{skin-2a7ae6e4.js → skin-c3c991ef.js} +1 -1
- package/esm/{skin-1701672c.js → skin-f84b0b47.js} +1 -1
- package/esm/{util-2b4b9f11.js → util-42cd9f6e.js} +1 -1
- package/esm/{videoSelector-e7c1ca51.js → videoSelector-31a45a87.js} +1 -1
- package/package.json +1 -1
- package/cjs/skin-093cf3e2.js +0 -1
- package/esm/skin-20fe3397.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=require("./chromecast-
|
|
1
|
+
"use strict";var e,t=require("./chromecast-c43dfe8f.js"),i=require("./util-2720e3a7.js"),o=0,n=0,d=function e(i,o,d,c){n=i,i>d.length-1||t.load(o,d[i].id).then((function(e){t.highlightVideo(n),n++,t.setVideoIdx(n),u(e)})).catch((function(i){u(i),setTimeout((function(){t.highlightVideo(n),n++,t.setVideoIdx(n),e(n,o,d)}),5e3)}))},u=function(t){e&&e(t)};exports.autoPlayNext=function(c){clearTimeout(o);var h=null==c?void 0:c.content;e=null==c?void 0:c.cb;var r=c.playerId;i.onVideoEnded(r,(function(){var e=t.getPlayer(r);0!==(null==e?void 0:e.currentTime())&&((n=t.getVideoIdx())>h.length-1||t.load(r,h[n].id).then((function(e){t.highlightVideo(n),t.setCurrentVideo(e.response),n++,t.setVideoIdx(n),u(e)})).catch((function(e){u(e),t.highlightVideo(n),n++,t.setVideoIdx(n),o=setTimeout((function(){t.isPaused(r)&&d(n,r,h)}),5e3)})))}))},exports.switchToNext=d;
|
package/cjs/bundle.css
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
|
|
18
19
|
.widget-selection{
|
|
19
20
|
display: flex;
|
|
20
21
|
align-items: center;
|
|
@@ -135,7 +136,6 @@
|
|
|
135
136
|
.widget-selector-content #sr-widget{
|
|
136
137
|
padding: 0 18px;
|
|
137
138
|
}
|
|
138
|
-
|
|
139
139
|
.vjs-poster {
|
|
140
140
|
display: inline-block;
|
|
141
141
|
vertical-align: middle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),r=require("./icons-0f7b3404.js"),l=require("./chromecast-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),r=require("./icons-0f7b3404.js"),l=require("./chromecast-c43dfe8f.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var s=i.getComponent("Component"),d=function(){n(m,s);var d,u,p=(d=m,u=c(),function(){var e,t=o(d);if(u){var n=o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function m(t){var n,a,o,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,m),(i=p.call(this,t,r)).playerId=r.playerId,i.seriesData=r.sres,i.currentVideoData=r.res,i.initialiseStructure(),i.loadCSS(),null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(a=n[0])||void 0===a||null===(o=a.style)||void 0===o||o.setProperty("display","none","important"),i}return t(m,[{key:"createEl",value:function(){var e=i.dom.createEl("div",{className:"caption-selection vjs-control vjs-button"});e.style.position="unset";var t=i.dom.createEl("div",{className:"caption-selector-icon",innerHTML:"".concat(r.CaptionsSvgV2())});return i.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./caption-settings-34ca0188.js")})).then((function(e){var t=document.createElement("style");t.id="video-captions",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this,t=l.getCaptions(this.playerId);null==t||t.map((function(t){return l.disableCaptions(e.playerId,t.id)}));var n=this.el(),a=i.dom.createEl("div",{className:"caption-selection-container hidden"});i.dom.$(".caption-selector-icon",this.el()).onclick=function(){var e;null!==(e=a.classList)&&void 0!==e&&e.contains("hidden")?(l.closeOpenDrawers(),a.classList.remove("hidden"),n.classList.add("open"),a.style.right="0px"):(a.classList.add("hidden"),n.classList.remove("open"),a.style.right="-350px")};var o=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height");a.style.height="".concat(o),i.dom.appendContent(n,a),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(a),l.detectOrientationChange(this.playerId,a)}},{key:"addFunctionality",value:function(e){var t=this,n=this.el(),a=i.dom.createEl("div",{className:"caption-selector-head"}),o=i.dom.createEl("div",{className:"caption-selector-cross-icon",innerHTML:"".concat(r.crossIconSvg())});o.onclick=function(){e.classList.add("hidden"),n.classList.remove("open"),e.style.right="-350px"};var c=i.dom.createEl("div",{className:"caption-selector-title",innerHTML:"Captions"}),s=i.dom.createEl("div",{className:"caption-selector-content"}),d=i.dom.createEl("div",{className:"caption-container"}),u=this.createLanguageContanier();i.dom.appendContent(d,u),i.dom.appendContent(a,o),i.dom.appendContent(a,c),i.dom.appendContent(e,a),i.dom.appendContent(e,s),i.dom.appendContent(s,d),l.getPlayer(this.playerId).on("fullscreenchange",(function(){var n=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(n,"px")}))}},{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.getCaptions(e.playerId).map((function(t){return l.disableCaptions(e.playerId,t.id)}))},i.dom.appendContent(a,r),i.dom.appendContent(a,o),i.dom.appendContent(t,a);for(var c=l.getCaptions(this.playerId),s=function(n){var a,o=document.createElement("label");o.className="caption-language-holder",o.setAttribute("for","language-radio-".concat(n));var r=document.createElement("div");r.className="caption - ".concat(n),r.textContent=null==c||null===(a=c[n])||void 0===a?void 0:a.label;var s=i.dom.createEl("input",{className:"radio - ".concat(n),id:"language-radio-".concat(n),name:"language-radio"});s.onchange=function(t){l.enableCaptions(e.playerId,c[n].id)},s.setAttribute("type","radio"),i.dom.appendContent(o,s),i.dom.appendContent(o,r),i.dom.appendContent(t,o)},d=0;d<c.length;d++)s(d);return t}},{key:"createFontSizeContainer",value:function(){var e=i.dom.createEl("div",{className:"caption-font-container"}),t=i.dom.createEl("div",{className:"caption-font-container-title",innerHTML:"Font Size"});i.dom.appendContent(e,t);for(var n=[{size:14},{size:18},{size:24}],a=0;a<n.length;a++){var o,r=document.createElement("label");r.className="caption-font-holder",r.setAttribute("for","font".concat(a));var l=document.createElement("div");l.className="fontsize - ".concat(a),l.textContent=(null==n||null===(o=n[a])||void 0===o?void 0:o.size)+"pt";var c=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)});c.setAttribute("type","radio"),c.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,c),i.dom.appendContent(r,l),i.dom.appendContent(e,r)}return e}}]),m}();exports.default=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("axios");require("js-cookie");var r=require("ua-parser-js"),l=require("@babel/runtime/helpers/toConsumableArray"),a={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 s(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 d(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?s(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var u={name:"@viewlift/player",version:"1.0.74",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,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,t){var n,o;return e({data:null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):i({url:w(),params:d({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":u.version},withCredentials:!0})},v=function(){var e=t(n.mark((function e(t,o){var r,l;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return l={siteOwner:null==t?void 0:t.siteOwner,userId:null==t?void 0:t.userId,videoId:null==t?void 0:t.videoId,watchedPercentage:null==t?void 0:t.watchedPercentage,watchedTime:null==t?void 0:t.watchedTime},e.abrupt("return",i({url:y(),method:"POST",headers:{Authorization:r,"x-api-key":t.xApiKey},params:{version:"v2"},data:JSON.stringify(l),withCredentials:!0}));case 8:if("v2"!=o){e.next=10;break}return e.abrupt("return",i({url:E(),method:"POST",headers:{Authorization:r},data:d({},t),params:d({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),m=function(e,t){var n,o,r=(null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var l,a,s=JSON.parse(atob(t.split(".")[1])),d=(null==s?void 0:s.site)||null;return i({method:"GET",url:f(e),params:{site:d},headers:{Authorization:t,"x-api-key":null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a?void 0:a.xApiKey},timeout:15e3})}if("v2"==r){var u,c;JSON.parse(atob(t.split(".")[1]));var v=window.contentType;return i({method:"GET",url:I(e,v),headers:{Authorization:t,"x-api-key":null===(u=window)||void 0===u||null===(c=u.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},p=function(e){return T()+"".concat(null==a?void 0:a.getSeriesWatchHistoryV2,"/").concat(e)},g=function(){return T()+"".concat(null==a?void 0:a.getSeriesWatchHistoryV1)},f=function(e){return T()+"".concat(null==a?void 0:a.getVideoInfoV1,"/").concat(e)},I=function(e,t){return T()+"".concat(null==a?void 0:a.getVideoInfoV2,"/").concat(t,"/").concat(e)},y=function(){return T()+"".concat(null==a?void 0:a.saveWatchHistoryV1)},E=function(){return T()+"".concat(null==a?void 0:a.saveWatchHistoryV2)},w=function(){return T()+"".concat(null==a?void 0:a.getVideoDetails)},T=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==a?void 0:a.apiBaseUrl)},h=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},_=null;function b(){return{set:function(e){e&&(_=e)},get:function(){return _}}}var O=function(){var e=t(n.mark((function e(){var t,o,r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=b().get(),o=T(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(t)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),D=null,x=function(){var e=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!h(t)){e.next=6;break}return D||(D=O().then((function(e){var n,o,i=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&b().set(r),i||t})).catch((function(e){return console.error("Error fetching refresh token",e),t})).finally((function(){D=null}))),e.abrupt("return",D);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(e,t){if(Promise.resolve().then((function(){return require("./error-26d5a3c3.js")})).then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var 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)}},V=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var C=function(){var e,t;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(t=e.userAgentData)||void 0===t?void 0:t.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"};function k(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 L(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?k(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):k(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}window._deviceInfo=r(navigator.userAgent);var P=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},R=function(e){var t=A(e,"video.tags",[]),n=A(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},A=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)},F=function(){var e,t,n,o,i,r,l,a,s,d,u,c,v,m,p,g,f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",I=arguments.length>1?arguments[1]:void 0,y=arguments.length>2?arguments[2]:void 0,E=(null==y?void 0:y.contentType)||"video",w=null==y||null===(e=y[E])||void 0===e?void 0:e.metadata,T=le(I);if(!f.includes("VIEWLIFT_"))return f;var h=window.getComputedStyle(document.getElementById(I),null),_=Math.trunc(h.getPropertyValue("height").slice(0,-2)),b=Math.trunc(h.getPropertyValue("width").slice(0,-2)),O="linearchannel"===E?null==y||null===(t=y.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(o=n.find((function(e){return(null==e?void 0:e.id)===(null==y?void 0:y.id)})))||void 0===o||null===(i=o.content)||void 0===i?void 0:i.id:A(y,"video.gist.id",""),D=L(L({},N(w)),{},{VIEWLIFT_WIDTH:b,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE:P(b,_),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===(r=window)||void 0===r?void 0:r.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:navigator.userAgent,VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:A(y,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:A(y,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:A(y,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==T||null===(l=T.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==T||null===(a=T.options_)||void 0===a?void 0:a.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:R(y),VIEWLIFT_MEDIA_ID:O,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(A(y,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:O,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+A(y,"video.gist.permalink","")),VIEWLIFT_COPPA:A(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.site)||void 0===u?void 0:u.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:A(null===(c=window)||void 0===c||null===(v=c.app_data)||void 0===v||null===(m=v.site)||void 0===m?void 0:m.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*A(y,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:A(y,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:O,VIEWLIFT_CONTENT_TITLE:A(y,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:A(y,"video.series[0].gist.title",A(y,"seriesInfo.title","VIEWLIFT_CONTENT_SERIES_TITLE")),VIEWLIFT_CONTENT_EPISODE:A(y,"video.currentEpisode","VIEWLIFT_CONTENT_EPISODE"),VIEWLIFT_CONTENT_SEASON:A(y,"video.currentSeason","VIEWLIFT_CONTENT_SEASON"),VIEWLIFT_CONTENT_GENRE:A(y,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER"},null===(p=window)||void 0===p||null===(g=p.customData)||void 0===g?void 0:g.macros);for(var x in D){var S=new RegExp("\\b("+x+")\\b","g");f=f.replace(S,D[x])}return f},N=function(e){var t,n,o,i,r,l,a={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){s.set(e.name,e.value)})));var d=(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,u=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return d||u?(W()?d?a=L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):u&&(a=L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):d?a=L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):u&&(a=L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),d?a=L(L({},a),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||""}):u&&(a=L(L({},a),{},{VIEWLIFT_SFID:s.get("sfid.tve")||""})),a=W()?L(L({},a),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):L(L({},a),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(a=L(L({},a),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||""}),a=W()?L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),a},B=function(e,t){var n,o,i,r,l,a,s,d,u,c,v,m,p,g=(null==e?void 0:e.contentType)||"video",f=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,I=null==e||null===(o=e[g])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,y=null==e||null===(r=e[g])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,E=(null==e||null===(a=e[g])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(u=e[g])||void 0===u||null===(c=u.liveDetails)||void 0===c||c.isDvrEnabled;var w=(null==e||null===(v=e[g])||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!=y&&y.hls)return U(y);if(f){var T=M(I,t);return T.src=F(T.src,t,e),T}if("Safari"!==C()&&w)return j(I);if(E){var h=U(I);return h.src=F(h.src,t,e),h}if(null!=I&&I.mpeg){var _=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(I);return _.src=F(_.src,t,e),_}return null},j=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},U=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},M=function(e,t){var n=e.fairPlay,i=e.widevine,r=e.playReady,l=C();if(le(t),"Safari"===l){var a=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,(function(e,t,o){console.log(e),e&&n(e),n(null,new Uint8Array(o))}))},getContentId:function(e,t){if(t)return new TextDecoder("utf-16").decode(t.slice(16))},getLicense:function(t,n,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,(function(e,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return Y(t),a}var s,d={src:i.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(Y(t),d.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}}}):(d.keySystemOptions=[],d.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:i.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),d.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),d};var H,z,G,q,X,Y=function(e){var t=le(e);if("function"==typeof t.eme)try{t.eme()}catch(e){console.log("EME ERROR :",e)}},J=function(e){z=e},K=function(e){G=e},Z=function(e){if(q){var t=q.get(e);K(t+1)}},Q=function(e){var t=le(e);t.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,t.removeRemoteTextTrack(e)}))},$=function(e,t){var n=le(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})}))},ee=!1,te=function(e,t,n){var o=F(t,e,n),i=le(e);t&&window.google&&(i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,t){var n,o,i,r=le(e);if(null!==r.el_){ee=!0;var l={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(),ee&&null!==r.el_&&("function"==typeof r.ima?r.ima(l):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var a=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&a.hasAttribute("controls")&&a.removeAttribute("controls");var s="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,s="touchend"),r.one(s,(function(){d&&r.ima.initializeAdDisplayContainer()}));var u=(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(){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))},ne=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");return null==t?void 0:t.querySelector("svg")},oe="";function ie(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 re=function(e){return!!o.getPlayer("".concat(e))},le=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},ae=function(){var e=t(n.mark((function e(t,o,i){var r,l,a,s,d,u;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ce.set(!1),e.next=3,x();case 3:return s=e.sent,Z(o),d=0,u=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&m(o,s).then((function(e){var t,n,o,i,r,l;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)),d=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,u=(null==e||null===(l=e.data)||void 0===l?void 0:l.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))})),e.abrupt("return",new Promise((function(e,n){c(o,s).then((function(o){var i,r,l,a,s,c,v,m,p,g,f=null==o?void 0:o.data,I=(null==f||null===(i=f.video)||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;J(o.data);var y=(null==f||null===(l=f.ads)||void 0===l||null===(a=l.preRoll)||void 0===a||null===(s=a.adTags)||void 0===s||null===(c=s.web)||void 0===c?void 0:c.active)&&(null==f||null===(v=f.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(p=m.adTags)||void 0===p||null===(g=p.web)||void 0===g?void 0:g.url);y&&te(t,y,f);var E=B(f,t);if(E){var w,T,h,_,b,O,D,x,C,k,L,P,R,A,W=(null==f||null===(w=f.video)||void 0===w||null===(T=w.gist)||void 0===T?void 0:T.videoImageUrl)||(null==f||null===(h=f.video)||void 0===h||null===(_=h.gist)||void 0===_||null===(b=_.imageGist)||void 0===b?void 0:b.r16x9),F=le(t);if(F.poster(W),de(t,E),F.on("loadstart",(function(){I&&e({status:!0,msg:"Video Loaded",response:f})})),F.on("loadeddata",(function(){V(),e({status:!0,msg:"Video Loaded",response:f})})),F.one("play",(function(){d&&u<95&&setTimeout((function(){F.currentTime(d)}),0)})),F.one("error",(function(){var e;n({status:!1,msg:(null==F||null===(e=F.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==f||null===(O=f.video)||void 0===O||null===(D=O.contentDetails)||void 0===D||null===(x=D.closedCaptions)||void 0===x?void 0:x.length)>0||(null==f||null===(C=f.video)||void 0===C||null===(k=C.closedCaptions)||void 0===k?void 0:k.length)>0)L=((null==f||null===(P=f.video)||void 0===P||null===(R=P.contentDetails)||void 0===R?void 0:R.closedCaptions)||(null==f||null===(A=f.video)||void 0===A?void 0:A.closedCaptions)).filter((function(e){return"VTT"===e.format})),$(t,L);else Q(t)}else S(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){ue(e,t,n,o)}))})));case 9:case"end":return e.stop()}}),e)})));return function(t,n,o){return e.apply(this,arguments)}}(),se=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()},de=function(e,t){le(e).src(t)},ue=function(t,n,o,i){var r,l,a,s,d,u,c=null==t||null===(r=t.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==t||null===(a=t.response)||void 0===a||null===(s=a.data)||void 0===s?void 0:s.errorMessage)||(null==t?void 0:t.message);re(n)&&S(n,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),o&&o(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ie(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}))},ce={chromecast_disconnected:!1,set:function(e){this.chromecast_disconnected=e},get:function(){return this.chromecast_disconnected}};exports.addCaptions=$,exports.addChromecastConfigurationDVR=function(e,t){var n=le(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,r,l,a,s=this.el(),d=o.dom.getPointerPosition(s,t).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(r=i.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*d,v.seek()}}))},exports.chromecastDisconnectStateManager=ce,exports.clearError=V,exports.closeOpenDrawers=function(){var e=l(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var t,n;null==e||null===(t=e.childNodes)||void 0===t||null===(n=t[0])||void 0===n||n.click()}))},exports.createIconMarkup=function(e){return ne(e)},exports.createIdxMapping=function(e){q=new Map,e.map((function(e,t){q.set(e.id,t)}))},exports.detectBrowser=C,exports.detectOrientationChange=function(e,t){var n,o=function(){return function(e,t){var n=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape";if(oe!==n){var o=window.getComputedStyle(document.getElementById(e),null).getPropertyValue("height");t&&(t.style.height="".concat(o)),oe=n}}(e,t)};window._orientationChangeHandler=o;window.addEventListener("resize",(function(){clearTimeout(n),n=setTimeout((function(){o()}),100)}))},exports.disableCaptions=function(e,t){for(var n=le(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!==t||(i.mode="hidden")}},exports.disableControls=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")},exports.dispose=function(e){var t=le(e);if(se(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.enableCaptions=function(e,t){var n,o,i;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(o=n[0])||void 0===o||null===(i=o.style)||void 0===i||i.setProperty("display","flex"));for(var r=le(e).textTracks(),l=0;l<r.length;l++){var a=r[l];"subtitles"!==a.kind&&"captions"!==a.kind||a.id!=t||(a.mode="showing")}},exports.getCaptions=function(e){var t,n=le(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},exports.getChromecastCustomData=function(e,t,n){var o,i,r,l,a,s,d,u,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 g=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;p.licenseUrl=g;var f=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=f}var I=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=I;var y=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;p.duration=y;var E=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=E;var w=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return p.mediaImage=w,p.subTitles=n,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},exports.getCurrentSeries=function(){return H},exports.getCurrentVideo=function(){return z},exports.getLinearChannelDetails=function(e,t){var n,o;return i({url:T()+a.getLinearChannelDetails,params:d(d(d(d(d({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===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:t}})},exports.getPlayer=le,exports.getSeriesDetails=function(e,t){var n,o,r=JSON.parse(atob(t.split(".")[1])),l=(null==r?void 0:r.site)||null;return r&&r.countryCode,null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,t){var n,o;return e({data:null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.seriesData})})):i({url:T()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=function(e){var t,n;if("v1"==((null===(t=window)||void 0===t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1"))return i({method:"GET",url:g(),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:p(o),headers:{Authorization:e.token},timeout:15e3})},exports.getSeriesWatchMap=function(){return X},exports.getSource=B,exports.getToken=x,exports.getVideoDetails=c,exports.getVideoIdx=function(){return G},exports.getVideoInfo=m,exports.handleError=S,exports.highlightVideo=function(e){l(document.querySelectorAll("[video-idx]")).map((function(t){var n=t.getAttribute("video-idx");t.style.border=n==e?"2px solid white":"none"}))},exports.impolicy16x9=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},exports.initialiseAdvertisement=te,exports.initialisePlugins=function(e){var t,n,o=le(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.cast?console.log("Chromecast plugin is not available"):null==o||o.chromecast({receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}),null!=e&&e.airplay&&"Safari"==C()?null==o||o.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},exports.initiateErrorHandling=ue,exports.isNotAValidSkin=function(e){return"live"!==e&&"carousel"!==e&&"V2"!==e&&"defaultV2"!==e&&"multiplayer"!==e},exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=re,exports.isTokenExpired=h,exports.load=ae,exports.loadVideo=de,exports.loadVideoInstantly=function(e,t,n){var o=le(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)}))}))},exports.parseHtmlString=function(e){var t=(new DOMParser).parseFromString(e,"text/html");return null==t?void 0:t.querySelector("body")},exports.parseSvgString=ne,exports.pause=function(e){o(e).pause()},exports.play=function(e){o(e).play()},exports.refreshTokenManager=b,exports.rewind=function(e,t){var n=o(e),i=n.currentTime(),r=i<=t?0:i-t;n.currentTime(r)},exports.saveWatchHistory=v,exports.setCurrentSeries=function(e){H=e},exports.setCurrentVideo=J,exports.setSeriesWatchMap=function(e){X=e},exports.setVideoIdx=K,exports.setVideoIdxById=Z,exports.skip=function(e,t){var n=o(e),i=n.currentTime()+t;n.currentTime(i)};
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("axios");require("js-cookie");var r=require("ua-parser-js"),l=require("@babel/runtime/helpers/toConsumableArray"),a={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 s(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 d(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?s(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var u={name:"@viewlift/player",version:"1.0.74",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,t){var n,o,r,l;return null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.overrideEntitlementResponse?new Promise((function(e,t){var n,o;return e({data:null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.overrideEntitlementResponse})})):i({url:w(),params:d({id:e,deviceType:"web_browser",contentConsumption:"web"},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.entitlement),method:"GET",headers:{Authorization:t,"Sdk-Version":u.version},withCredentials:!0})},v=function(){var e=t(n.mark((function e(t,o){var r,l;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:if(r=e.sent,"v1"!=o){e.next=8;break}return l={siteOwner:null==t?void 0:t.siteOwner,userId:null==t?void 0:t.userId,videoId:null==t?void 0:t.videoId,watchedPercentage:null==t?void 0:t.watchedPercentage,watchedTime:null==t?void 0:t.watchedTime},e.abrupt("return",i({url:y(),method:"POST",headers:{Authorization:r,"x-api-key":t.xApiKey},params:{version:"v2"},data:JSON.stringify(l),withCredentials:!0}));case 8:if("v2"!=o){e.next=10;break}return e.abrupt("return",i({url:E(),method:"POST",headers:{Authorization:r},data:d({},t),params:d({},(null==t?void 0:t.profileId)&&{profileId:null==t?void 0:t.profileId})}));case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),m=function(e,t){var n,o,r=(null===(n=window)||void 0===n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";if("v1"==r){var l,a,s=JSON.parse(atob(t.split(".")[1])),d=(null==s?void 0:s.site)||null;return i({method:"GET",url:f(e),params:{site:d},headers:{Authorization:t,"x-api-key":null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a?void 0:a.xApiKey},timeout:15e3})}if("v2"==r){var u,c;JSON.parse(atob(t.split(".")[1]));var v=window.contentType;return i({method:"GET",url:I(e,v),headers:{Authorization:t,"x-api-key":null===(u=window)||void 0===u||null===(c=u.watchHistory)||void 0===c?void 0:c.xApiKey},timeout:15e3})}},p=function(e){return T()+"".concat(null==a?void 0:a.getSeriesWatchHistoryV2,"/").concat(e)},g=function(){return T()+"".concat(null==a?void 0:a.getSeriesWatchHistoryV1)},f=function(e){return T()+"".concat(null==a?void 0:a.getVideoInfoV1,"/").concat(e)},I=function(e,t){return T()+"".concat(null==a?void 0:a.getVideoInfoV2,"/").concat(t,"/").concat(e)},y=function(){return T()+"".concat(null==a?void 0:a.saveWatchHistoryV1)},E=function(){return T()+"".concat(null==a?void 0:a.saveWatchHistoryV2)},w=function(){return T()+"".concat(null==a?void 0:a.getVideoDetails)},T=function(){var e;return(null===(e=window)||void 0===e?void 0:e.playerEntitlementUrl)||(null==a?void 0:a.apiBaseUrl)},h=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},_=null;function b(){return{set:function(e){e&&(_=e)},get:function(){return _}}}var O=function(){var e=t(n.mark((function e(){var t,o,r;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=b().get(),o=T(),e.prev=2,e.next=5,i({method:"GET",url:"".concat(o,"/identity/refresh/").concat(t)});case 5:return r=e.sent,e.abrupt("return",r);case 9:throw e.prev=9,e.t0=e.catch(2),console.error("Error fetching refresh token",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),D=null,x=function(){var e=t(n.mark((function e(){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=sessionStorage.getItem("vlp_token"))||!h(t)){e.next=6;break}return D||(D=O().then((function(e){var n,o,i=null==e||null===(n=e.data)||void 0===n?void 0:n.authorizationToken,r=null==e||null===(o=e.data)||void 0===o?void 0:o.refreshToken;return i&&sessionStorage.setItem("vlp_token",i),r&&b().set(r),i||t})).catch((function(e){return console.error("Error fetching refresh token",e),t})).finally((function(){D=null}))),e.abrupt("return",D);case 6:return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(e,t){if(Promise.resolve().then((function(){return require("./error-26d5a3c3.js")})).then((function(e){var t=document.createElement("style");t.id="errorblock",t.append("".concat(e.default)),document.head.appendChild(t)})),document.getElementsByClassName("error-container")[0]){var n=document.getElementsByClassName("error-message")[0];n&&(n.innerHTML="".concat(t))}else{var 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)}},C=function(){document.getElementsByClassName("error-container")[0]&&document.getElementsByClassName("error-container")[0].remove()};var V=function(){var e,t;return navigator.userAgent.indexOf("Edg")>-1&&"macOS"!=(null===(e=window.navigator)||void 0===e||null===(t=e.userAgentData)||void 0===t?void 0:t.platform)?"IE":-1!=(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))?"Opera":-1!=navigator.userAgent.indexOf("Chrome")?"Chrome":-1!=navigator.userAgent.indexOf("Safari")?"Safari":-1!=navigator.userAgent.indexOf("Firefox")?"Firefox":"Unknown"};function k(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 L(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?k(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):k(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}window._deviceInfo=r(navigator.userAgent);var P=function(e,t){return e&&t?"".concat(e,"x").concat(t):e>1024?"L":e>768?"M":"S"},R=function(e){var t=A(e,"video.tags",[]),n=A(e,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE");return t.length>0?t.map((function(e){return e.title})).join(","):n},A=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)},F=function(){var e,t,n,o,i,r,l,a,s,d,u,c,v,m,p,g,f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",I=arguments.length>1?arguments[1]:void 0,y=arguments.length>2?arguments[2]:void 0,E=(null==y?void 0:y.contentType)||"video",w=null==y||null===(e=y[E])||void 0===e?void 0:e.metadata,T=le(I);if(!f.includes("VIEWLIFT_"))return f;var h=window.getComputedStyle(document.getElementById(I),null),_=Math.trunc(h.getPropertyValue("height").slice(0,-2)),b=Math.trunc(h.getPropertyValue("width").slice(0,-2)),O="linearchannel"===E?null==y||null===(t=y.linearchannel)||void 0===t||null===(n=t.channels)||void 0===n||null===(o=n.find((function(e){return(null==e?void 0:e.id)===(null==y?void 0:y.id)})))||void 0===o||null===(i=o.content)||void 0===i?void 0:i.id:A(y,"video.gist.id",""),D=L(L({},N(w)),{},{VIEWLIFT_WIDTH:b,VIEWLIFT_HEIGHT:_,VIEWLIFT_SIZE:P(b,_),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===(r=window)||void 0===r?void 0:r.ip)||"VIEWLIFT_IP",VIEWLIFT_USER_AGENT:navigator.userAgent,VIEWLIFT_DNT:"1"===navigator.doNotTrack?"1":"0",VIEWLIFT_DESCRIPTION:A(y,"video.gist.description","VIEWLIFT_DESCRIPTION"),VIEWLIFT_DURATION:A(y,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_MIN_DURATION:0,VIEWLIFT_MAX_DURATION:A(y,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_AUTOPLAY:(null==T||null===(l=T.options_)||void 0===l?void 0:l.autoplay)||1,VIEWLIFT_MUTE:(null==T||null===(a=T.options_)||void 0===a?void 0:a.autoplay)||0,VIEWLIFT_DEVICE_ID:localStorage.getItem("deviceId")||"VIEWLIFT_DEVICE_ID",VIEWLIFT_KEYWORDS:R(y),VIEWLIFT_MEDIA_ID:O,VIEWLIFT_ENCODED_VIDEO_TITLE:encodeURI(A(y,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE")),VIEWLIFT_VIDEO_ID:O,VIEWLIFT_VIDEO_URL:encodeURI(window.location.host+A(y,"video.gist.permalink","")),VIEWLIFT_COPPA:A(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(u=d.site)||void 0===u?void 0:u.settings,"compliance.coppa")?1:0,VIEWLIFT_GDPR:A(null===(c=window)||void 0===c||null===(v=c.app_data)||void 0===v||null===(m=v.site)||void 0===m?void 0:m.settings,"compliance.gdpr")?1:0,VIEWLIFT_CONTENT_DURATION_MS:1e3*A(y,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_DURATION:A(y,"video.gist.runtime","VIEWLIFT_DURATION"),VIEWLIFT_CONTENT_ID:O,VIEWLIFT_CONTENT_TITLE:A(y,"video.gist.title","VIEWLIFT_ENCODED_VIDEO_TITLE"),VIEWLIFT_CONTENT_SERIES_TITLE:A(y,"video.series[0].gist.title",A(y,"seriesInfo.title","VIEWLIFT_CONTENT_SERIES_TITLE")),VIEWLIFT_CONTENT_EPISODE:A(y,"video.currentEpisode","VIEWLIFT_CONTENT_EPISODE"),VIEWLIFT_CONTENT_SEASON:A(y,"video.currentSeason","VIEWLIFT_CONTENT_SEASON"),VIEWLIFT_CONTENT_GENRE:A(y,"video.gist.primaryCategory.title","VIEWLIFT_CONTENT_GENRE"),VIEWLIFT_USER:sessionStorage.getItem("uid")||"VIEWLIFT_USER"},null===(p=window)||void 0===p||null===(g=p.customData)||void 0===g?void 0:g.macros);for(var x in D){var S=new RegExp("\\b("+x+")\\b","g");f=f.replace(S,D[x])}return f},N=function(e){var t,n,o,i,r,l,a={},s=new Map;(null==e?void 0:e.length)>0&&(null==e||e.map((function(e){s.set(e.name,e.value)})));var d=(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,u=(null===(i=window)||void 0===i||null===(r=i.customData)||void 0===r||null===(l=r.subscription)||void 0===l?void 0:l.TVE)||!1;return d||u?(W()?d?a=L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||""}):u&&(a=L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.tve")||""})):d?a=L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||""}):u&&(a=L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.web.tve")||""})),d?a=L(L({},a),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||""}):u&&(a=L(L({},a),{},{VIEWLIFT_SFID:s.get("sfid.tve")||""})),a=W()?L(L({},a),{},{VIEWLIFT_PROF:s.get("prof.mweb")||""}):L(L({},a),{},{VIEWLIFT_PROF:s.get("prof.web")||""})):(a=L(L({},a),{},{VIEWLIFT_SFID:s.get("sfid.dtc")||""}),a=W()?L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.mweb.dtc")||"",VIEWLIFT_PROF:s.get("prof.mweb")||""}):L(L({},a),{},{VIEWLIFT_CSID:s.get("csid.web.dtc")||"",VIEWLIFT_PROF:s.get("prof.web")||""})),a},B=function(e,t){var n,o,i,r,l,a,s,d,u,c,v,m,p,g=(null==e?void 0:e.contentType)||"video",f=null==e||null===(n=e[g])||void 0===n?void 0:n.drmEnabled,I=null==e||null===(o=e[g])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.videoAssets,y=null==e||null===(r=e[g])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.audioAssets,E=(null==e||null===(a=e[g])||void 0===a||null===(s=a.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.hls)||!1;null==e||null===(u=e[g])||void 0===u||null===(c=u.liveDetails)||void 0===c||c.isDvrEnabled;var w=(null==e||null===(v=e[g])||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!=y&&y.hls)return U(y);if(f){var T=M(I,t);return T.src=F(T.src,t,e),T}if("Safari"!==V()&&w)return j(I);if(E){var h=U(I);return h.src=F(h.src,t,e),h}if(null!=I&&I.mpeg){var _=function(e){var t=null==e?void 0:e.mpeg;return{src:t[t.length-1].url,type:"video/mp4"}}(I);return _.src=F(_.src,t,e),_}return null},j=function(e){var t=null==e?void 0:e.dash;return t?{src:t,type:"application/dash+xml"}:null},U=function(e){var t=null==e?void 0:e.hls;return t?{src:t,type:"application/x-mpegURL"}:null},M=function(e,t){var n=e.fairPlay,i=e.widevine,r=e.playReady,l=V();if(le(t),"Safari"===l){var a=function(e){var t=e.url;return{src:t,type:"application/x-mpegURL",keySystems:{"com.apple.fps.1_0":{getCertificate:function(t,n){var i={uri:e.certificateUrl,method:"GET",responseType:"arraybuffer"};o.xhr(i,(function(e,t,o){console.log(e),e&&n(e),n(null,new Uint8Array(o))}))},getContentId:function(e,t){if(t)return new TextDecoder("utf-16").decode(t.slice(16))},getLicense:function(t,n,i,r){var l={uri:e.licenseUrl,method:"POST",responseType:"arraybuffer",body:i,headers:{"Content-type":"application/octet-stream","X-AxDRM-Message":e&&e.licenseToken}};o.xhr(l,(function(e,t,n){console.log(e),e&&r(e),r(null,n)}))}}}}}(n);return Y(t),a}var s,d={src:i.url,type:"application/dash+xml"};return"caliente"==(null===(s=window)||void 0===s?void 0:s.siteName)?(Y(t),d.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}}}):(d.keySystemOptions=[],d.keySystemOptions.push({name:"com.widevine.alpha",options:{serverURL:i.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":i.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}}),d.keySystemOptions.push({name:"com.microsoft.playready",options:{serverURL:r.licenseUrl,httpRequestHeaders:{"X-AxDRM-Message":r.licenseToken},videoRobustness:"SW_SECURE_CRYPTO",audioRobustness:"SW_SECURE_CRYPTO"}})),d};var H,z,G,q,X,Y=function(e){var t=le(e);if("function"==typeof t.eme)try{t.eme()}catch(e){console.log("EME ERROR :",e)}},J=function(e){z=e},K=function(e){G=e},Z=function(e){if(q){var t=q.get(e);K(t+1)}},Q=function(e){var t=le(e);t.remoteTextTracks().tracks_.map((function(e){"subtitles"==(null==e?void 0:e.kind)||null==e||e.kind,t.removeRemoteTextTrack(e)}))},$=function(e,t){var n=le(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})}))},ee=!1,te=function(e,t,n){var o=F(t,e,n),i=le(e);t&&window.google&&(i.ima.initializeAdDisplayContainer&&i.ima.initializeAdDisplayContainer(),function(e,t){var n,o,i,r=le(e);if(null!==r.el_){ee=!0;var l={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(),ee&&null!==r.el_&&("function"==typeof r.ima?r.ima(l):setTimeout((function(){r.ima.setContentWithAdTag(null,t,!0),r.ima.requestAds()}),1e3));var a=document.getElementById("".concat(e));(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&a.hasAttribute("controls")&&a.removeAttribute("controls");var s="click",d=!1;(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i))&&(d=!0,s="touchend"),r.one(s,(function(){d&&r.ima.initializeAdDisplayContainer()}));var u=(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(){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))},ne=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");return null==t?void 0:t.querySelector("svg")},oe="";function ie(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 re=function(e){return!!o.getPlayer("".concat(e))},le=function(e){return!!o.getPlayer("".concat(e))&&o.getPlayer("".concat(e))},ae=function(){var e=t(n.mark((function e(t,o,i){var r,l,a,s,d,u;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ce.set(!1),e.next=3,x();case 3:return s=e.sent,Z(o),d=0,u=0,null!==(r=window)&&void 0!==r&&r.watchHistory&&null!==(l=window)&&void 0!==l&&null!==(a=l.watchHistory)&&void 0!==a&&a.enable&&m(o,s).then((function(e){var t,n,o,i,r,l;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)),d=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,u=(null==e||null===(l=e.data)||void 0===l?void 0:l.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))})),e.abrupt("return",new Promise((function(e,n){c(o,s).then((function(o){var i,r,l,a,s,c,v,m,p,g,f=null==o?void 0:o.data,I=(null==f||null===(i=f.video)||void 0===i||null===(r=i.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;J(o.data);var y=(null==f||null===(l=f.ads)||void 0===l||null===(a=l.preRoll)||void 0===a||null===(s=a.adTags)||void 0===s||null===(c=s.web)||void 0===c?void 0:c.active)&&(null==f||null===(v=f.ads)||void 0===v||null===(m=v.preRoll)||void 0===m||null===(p=m.adTags)||void 0===p||null===(g=p.web)||void 0===g?void 0:g.url);y&&te(t,y,f);var E=B(f,t);if(E){var w,T,h,_,b,O,D,x,V,k,L,P,R,A,W=(null==f||null===(w=f.video)||void 0===w||null===(T=w.gist)||void 0===T?void 0:T.videoImageUrl)||(null==f||null===(h=f.video)||void 0===h||null===(_=h.gist)||void 0===_||null===(b=_.imageGist)||void 0===b?void 0:b.r16x9),F=le(t);if(F.poster(W),de(t,E),F.on("loadstart",(function(){I&&e({status:!0,msg:"Video Loaded",response:f})})),F.on("loadeddata",(function(){C(),e({status:!0,msg:"Video Loaded",response:f})})),F.one("play",(function(){d&&u<95&&setTimeout((function(){F.currentTime(d)}),0)})),F.one("error",(function(){var e;n({status:!1,msg:(null==F||null===(e=F.error())||void 0===e?void 0:e.message)||"Some error occured"})})),(null==f||null===(O=f.video)||void 0===O||null===(D=O.contentDetails)||void 0===D||null===(x=D.closedCaptions)||void 0===x?void 0:x.length)>0||(null==f||null===(V=f.video)||void 0===V||null===(k=V.closedCaptions)||void 0===k?void 0:k.length)>0)L=((null==f||null===(P=f.video)||void 0===P||null===(R=P.contentDetails)||void 0===R?void 0:R.closedCaptions)||(null==f||null===(A=f.video)||void 0===A?void 0:A.closedCaptions)).filter((function(e){return"VTT"===e.format})),$(t,L);else Q(t)}else S(t,"Incompatible Source, only hls,mp4,drm content is allowed"),n("Incompatible Source, only hls,mp4,drm content is allowed")})).catch((function(e){ue(e,t,n,o)}))})));case 9:case"end":return e.stop()}}),e)})));return function(t,n,o){return e.apply(this,arguments)}}(),se=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()},de=function(e,t){le(e).src(t)},ue=function(t,n,o,i){var r,l,a,s,d,u,c=null==t||null===(r=t.response)||void 0===r||null===(l=r.data)||void 0===l?void 0:l.errorCode,v=(null==t||null===(a=t.response)||void 0===a||null===(s=a.data)||void 0===s?void 0:s.errorMessage)||(null==t?void 0:t.message);re(n)&&S(n,(null===(d=window)||void 0===d?void 0:d.customErrors)&&(null===(u=window)||void 0===u?void 0:u.customErrors[c])||"".concat(v)),o&&o(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(o),!0).forEach((function(n){e(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ie(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}))},ce={chromecast_disconnected:!1,set:function(e){this.chromecast_disconnected=e},get:function(){return this.chromecast_disconnected}};exports.addCaptions=$,exports.addChromecastConfigurationDVR=function(e,t){var n=le(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,r,l,a,s=this.el(),d=o.dom.getPointerPosition(s,t).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(r=i.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*d,v.seek()}}))},exports.chromecastDisconnectStateManager=ce,exports.clearError=C,exports.closeOpenDrawers=function(){var e=l(document.getElementsByClassName("vjs-control vjs-button open"));null==e||e.map((function(e){var t,n;null==e||null===(t=e.childNodes)||void 0===t||null===(n=t[0])||void 0===n||n.click()}))},exports.createIconMarkup=function(e){return ne(e)},exports.createIdxMapping=function(e){q=new Map,e.map((function(e,t){q.set(e.id,t)}))},exports.detectBrowser=V,exports.detectOrientationChange=function(e,t){var n,o=function(){return function(e,t){var n=window.matchMedia("(orientation: portrait)").matches?"potrait":"landscape";if(oe!==n){var o=window.getComputedStyle(document.getElementById(e),null).getPropertyValue("height");t&&(t.style.height="".concat(o)),oe=n}}(e,t)};window._orientationChangeHandler=o;window.addEventListener("resize",(function(){clearTimeout(n),n=setTimeout((function(){o()}),100)}))},exports.disableCaptions=function(e,t){for(var n=le(e).textTracks(),o=0;o<n.length;o++){var i=n[o];"subtitles"!==i.kind&&"captions"!==i.kind||i.id!==t||(i.mode="hidden")}},exports.disableControls=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")},exports.dispose=function(e){var t=le(e);if(se(),window._orientationChangeHandler&&(window.removeEventListener("resize",window._orientationChangeHandler),delete window._orientationChangeHandler),window._multiplayer_dbClickHandler&&(window.removeEventListener("dblclick",window._multiplayer_dbClickHandler),delete window._multiplayer_dbClickHandler),window._multiplayer_dbTapHandler&&(window.removeEventListener("touchend",window._multiplayer_dbTapHandler),delete window._multiplayer_dbTapHandler),window.onresize=null,t)t.dispose();else{var n=document.getElementById(e);n&&n.remove()}},exports.enableCaptions=function(e,t){var n,o,i;document.getElementsByClassName("vjs-text-track-display-ttml")&&(null===(n=document.getElementsByClassName("vjs-text-track-display-ttml"))||void 0===n||null===(o=n[0])||void 0===o||null===(i=o.style)||void 0===i||i.setProperty("display","flex"));for(var r=le(e).textTracks(),l=0;l<r.length;l++){var a=r[l];"subtitles"!==a.kind&&"captions"!==a.kind||a.id!=t||(a.mode="showing")}},exports.getCaptions=function(e){var t,n=le(e);return(null==n||null===(t=n.textTracks())||void 0===t?void 0:t.tracks_.filter((function(e){return"subtitles"==e.kind||"captions"===e.kind})))||[]},exports.getChromecastCustomData=function(e,t,n){var o,i,r,l,a,s,d,u,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 g=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;p.licenseUrl=g;var f=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=f}var I=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=I;var y=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;p.duration=y;var E=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=E;var w=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return p.mediaImage=w,p.subTitles=n,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},exports.getCurrentSeries=function(){return H},exports.getCurrentVideo=function(){return z},exports.getLinearChannelDetails=function(e,t){var n,o;return i({url:T()+a.getLinearChannelDetails,params:d(d(d(d(d({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===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.entitlement),method:"GET",headers:{Authorization:t}})},exports.getPlayer=le,exports.getSeriesDetails=function(e,t){var n,o,r=JSON.parse(atob(t.split(".")[1])),l=(null==r?void 0:r.site)||null;return r&&r.countryCode,null!==(n=window)&&void 0!==n&&null!==(o=n.customData)&&void 0!==o&&o.seriesData?new Promise((function(e,t){var n,o;return e({data:null===(n=window)||void 0===n||null===(o=n.customData)||void 0===o?void 0:o.seriesData})})):i({url:T()+"/v3/content/series/".concat(e),params:{site:l},method:"GET",headers:{Authorization:t}})},exports.getSeriesWatchHistory=function(e){var t,n;if("v1"==((null===(t=window)||void 0===t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1"))return i({method:"GET",url:g(),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:p(o),headers:{Authorization:e.token},timeout:15e3})},exports.getSeriesWatchMap=function(){return X},exports.getSource=B,exports.getToken=x,exports.getVideoDetails=c,exports.getVideoIdx=function(){return G},exports.getVideoInfo=m,exports.handleError=S,exports.highlightVideo=function(e){l(document.querySelectorAll("[video-idx]")).map((function(t){var n=t.getAttribute("video-idx");t.style.border=n==e?"2px solid white":"none"}))},exports.impolicy16x9=function(e){return e?e+"?impolicy=resize&w=1920&h=1080":null},exports.initialiseAdvertisement=te,exports.initialisePlugins=function(e){var t,n,o=le(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.cast?console.log("Chromecast plugin is not available"):null==o||o.chromecast({receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}),null!=e&&e.airplay&&"Safari"==V()?null==o||o.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},exports.initiateErrorHandling=ue,exports.isPaused=function(e){return o(e).paused()},exports.isPlayerInitialised=re,exports.isTokenExpired=h,exports.load=ae,exports.loadVideo=de,exports.loadVideoInstantly=function(e,t,n){var o=le(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)}))}))},exports.parseHtmlString=function(e){var t=(new DOMParser).parseFromString(e,"text/html");return null==t?void 0:t.querySelector("body")},exports.parseSvgString=ne,exports.pause=function(e){o(e).pause()},exports.play=function(e){o(e).play()},exports.refreshTokenManager=b,exports.rewind=function(e,t){var n=o(e),i=n.currentTime(),r=i<=t?0:i-t;n.currentTime(r)},exports.saveWatchHistory=v,exports.setCurrentSeries=function(e){H=e},exports.setCurrentVideo=J,exports.setSeriesWatchMap=function(e){X=e},exports.setVideoIdx=K,exports.setVideoIdxById=Z,exports.skip=function(e,t){var n=o(e),i=n.currentTime()+t;n.currentTime(i)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./chromecast-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),l=require("@babel/runtime/helpers/getPrototypeOf"),i=require("video.js"),a=require("./chromecast-c43dfe8f.js"),s=require("./renditions-eee5b220.js"),u=require("./localisation-56e0a999.js");function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){var t=p();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}exports.addCaptionButton=function(e,t){Promise.resolve().then((function(){return require("./caption-settings-30367b99.js")})).then((function(r){var n,o,l,s,u=r.default,c=a.getPlayer(e);i.registerComponent("captionSelector",u),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("caption-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),c.getChild("controlBar").addChild("captionSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addDBClickFullScreen=function(e){var t=a.getPlayer(e).el(),r=0,n=a.getPlayer(e);n.addChild("fullscreenToggle");var o=function(){var e,r=null==t||null===(e=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===e?void 0:e[0];r&&r.click()};n.el().addEventListener("dblclick",o),window._multiplayer_dbClickHandler=o;n.el().addEventListener("touchend",(function(){var e=(new Date).getTime(),n=e-r;if(n<300&&n>0){var o,l=null==t||null===(o=t.getElementsByClassName("vjs-fullscreen-control"))||void 0===o?void 0:o[0];l&&l.click()}r=e})),window._multiplayer_dbTapHandler=o},exports.addMulticamSelector=function(e,t){Promise.resolve().then((function(){return require("./multicamv2-5e893bd8.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("streamSelector",n),o.getChild("controlBar").addChild("streamSelector",{playerId:e,streams:t},o.controlBar.children().length-4)}))},exports.addMulticamView=function(e,t){Promise.resolve().then((function(){return require("./multicam-21ee445f.js")})).then((function(r){var n=r.default,o=t.streams,l=a.getPlayer(e);i.registerComponent("multicamModule",n),l.getChild("controlBar").addChild("multicamModule",{playerId:e,streams:o,config:t},l.controlBar.children().length)}));var r=document.querySelector(".vjs-control-bar");r&&"live"==(null==t?void 0:t.skin)&&(r.style.background="transparent")},exports.addMwebPotraitTrayModule=function(e,t){Promise.resolve().then((function(){return require("./mwebPotraitTray-d6c3d95e.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("mwebPotraitTray",n),o.getChild("controlBar").addChild("mwebPotraitTray",{playerId:e,config:t},0)}))},exports.addNextEpisodeButton=function(e,t,r){Promise.resolve().then((function(){return require("./nextEpisodeButton-723990d6.js")})).then((function(n){var o=n.default,l=a.getPlayer(r);i.registerComponent("nextEpisodeButtonModule",o),l.getChild("controlBar").addChild("nextEpisodeButtonModule",{playerId:r,sres:e,res:t},l.controlBar.children().length-5)}))},exports.addOutputtingOverlay=function(e,t){var r=a.getPlayer(e).el(),n=i.dom.createEl("div",{className:"output-overlay",innerHTML:'<iframe frameBorder="0" src='.concat(t,"></iframe>")});r.append(n)},exports.addPlaylistSelector=function(e,t){Promise.resolve().then((function(){return require("./playlist-17d924d8.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("playlistSelector",n),o.getChild("controlBar").addChild("playlistSelector",{playerId:e,playlist:t},o.controlBar.children().length-3)}))},exports.addResolutionModule=function(e,t,r){Promise.resolve().then((function(){return require("./resolution-c2f5d636.js")})).then((function(n){var o=n.default;document.getElementById(e).getElementsByClassName("container")[0]&&document.getElementById(e).getElementsByClassName("container")[0].remove();var l=a.getPlayer(e),u=s.getRenditions(e);(null==u?void 0:u.length)>0&&(i.registerComponent("resolutionModule",o),l.getChild("controlBar").addChild("resolutionModule",{playerId:e,skin:t,icon:r,renditions:u},l.controlBar.children().length-4))}))},exports.addRewindButton=function(e,o,l){var s=function(o){n(s,o);var i=d(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-rewind-button");var u=a.parseSvgString(l);return o.append(u),n}return r(s,[{key:"handleClick",value:function(){a.rewind(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSeriesModule=function(e,t,r){Promise.resolve().then((function(){return require("./series-5c3c15dd.js")})).then((function(n){var o=n.seriesModule,l=a.getPlayer(e);i.registerComponent("seriesModule",o),l.getChild("controlBar").addChild("seriesModule",{playerId:e,seriesData:t},l.controlBar.children().length-4);for(var s=document.querySelectorAll(".season-title-sdk"),u=function(e){s[e].addEventListener("click",(function(){t[e]&&n.handleSeasonChange(t[e],e,l,r)}))},c=0;c<s.length;c++)u(c)}))},exports.addSeriesSelectorV2=function(t,r){Promise.resolve().then((function(){return require("./series-v2-b1b0e057.js")})).then((function(n){var o=n.default,l=a.getPlayer(t);i.registerComponent("seriesV2",o),l.getChild("controlBar").addChild("seriesV2",function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?c(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({playerId:t},r),l.controlBar.children().length-3)}))},exports.addSettingsButtonV2=function(e,t){Promise.resolve().then((function(){return require("./settings-icon-2c19e148.js")})).then((function(r){var n,o,l,s,u=r.default,c=a.getPlayer(e);i.registerComponent("settingsSelector",u),null===(n=document)||void 0===n||null===(o=n.getElementById(e))||void 0===o||null===(l=o.getElementsByClassName("settings-selection vjs-control vjs-button"))||void 0===l||null===(s=l[0])||void 0===s||s.remove(),c.getChild("controlBar").addChild("settingsSelector",{playerId:e,options:t},c.controlBar.children().length-3)}))},exports.addSkipButton=function(e,o,l){var s=function(o){n(s,o);var i=d(s);function s(e,r){var n;t(this,s);var o=(n=i.call(this,e,r)).el_;o.classList.add("vjs-skip-button");var u=a.parseSvgString(l);return o.append(u),n}return r(s,[{key:"handleClick",value:function(){a.skip(e,10)}}]),s}(i.getComponent("Button"));i.registerComponent("MyButton",s),i(e).getChild("controlBar").addChild("myButton",{},1)},exports.addSlowMotion=function(e){var o=function(e){n(i,e);var o=d(i);function i(e,r){var n;t(this,i);var l=(n=o.call(this,e,r)).el_;return l.classList.add("vjs-slowmo-button"),l.textContent=u.getLocalisation("slowMoText")||"Slow Mo",n}return r(i,[{key:"handleClick",value:function(){1==l.playbackRate()?(l.playbackRate(.5),this.el().style.background="darkgray"):(l.playbackRate(1),this.el().style.background="none")}}]),i}(i.getComponent("Button"));i.registerComponent("MyButton",o);var l=i(e);l.getChild("controlBar").addChild("myButton",{},2)},exports.addVideoSelector=function(e,t){Promise.resolve().then((function(){return require("./videoSelector-5cf9c9e5.js")})).then((function(r){var n=r.default,o=a.getPlayer(e);i.registerComponent("videoSelector",n),o.getChild("controlBar").addChild("videoSelector",{playerId:e,related:t},o.controlBar.children().length-3)}))};
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/regenerator"),n=require("axios"),o=require("./chromecast-5dad1eb5.js"),r=require("video.js"),l=require("./util-835bacf7.js"),a=require("./renditions-a603eee8.js"),d=require("./resolution-3354cead.js"),s=require("./localisation-56e0a999.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?v(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");function m(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=m(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=t(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(n=JSON.parse(atob(t.split(".")[1])))||!n.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==n?void 0:n.userId);case 9:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=m(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var i,n,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,i,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.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(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var i,n;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(i=t.el_)&&void 0!==i&&null!==(n=i.className)&&void 0!==n&&n.includes("vjs-waiting"))c("BUFFERING",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,i,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",f({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,i,n,o,r,l;c("AD_REQUEST",f({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",f({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var i=Math.floor(e.currentTime());i>=30&&i%30==0&&!t.includes(i)&&(t.push(i),fireEvent({eventName:"PING",videoPosition:i,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),i=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(b(t,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var g,y,b=function(e,t,i){return e>=t&&e<=i};function T(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function P(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?T(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}window.fireEvent=function(){var e=t(i.mark((function e(t){var r,l,a,d,s,u,c,v,m,h,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=f,e.t1=f,e.t2=f({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=w(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(i=t.adPosition)?String(i):"":"",e.next=20,p();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s||null===(u=s.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,n({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var i}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var I=[],E=0,O=null;function j(e,t,i){var n,r,l,a,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];y=(null==t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1";var s=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,f=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,m={};"v1"==y?m={videoId:g,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==y&&(m=P(P({videoId:g,watchedTime:Math.floor(e.currentTime()),watchedPercentage:d?100:Math.floor(u/c*100),doneWatching:d,profileId:s},O&&{seriesId:O}),f&&{originalObjectId:f})),o.saveWatchHistory(m,y).then((function(e){})).catch((function(e){})),E=u+i}var k=function(e,t,i){var n=o.getPlayer(e);if(n)if(t>=0&&t<=100){n.muted()&&n.muted(!1);var r=parseFloat(t)/100;n.volume(r),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},S=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function D(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?D(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var C=function(e,t,i,n){var r,l,a=n.res,d=n.sres,s=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),s.on("loadstart",(function(){c&&i.resolve({status:!0,msg:"Video Loaded",response:a})})),s.on("loadeddata",(function(){var n;(null==s||!s.muted())&&k(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),i.resolve(A({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(n=t.watchHistory)&&void 0!==n&&n.enable&&!t.isAnonymousUser){var l,u,c=A(A({},t),a);!function(e,t,i){var n,r,l;null!=t&&t.series&&null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable&&(O=null==t||null===(r=t.series)||void 0===r?void 0:r.id),I=[],E=0,g=i;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,d=o.getPlayer(e);d&&(d.on("timeupdate",(function(){var e=Math.floor(d.currentTime());I.includes(E)||(e==E?(I.push(e),j(d,t,a)):e>E&&(E=e+a))})),d.one("ended",(function(){j(d,t,a,!0)})))}(e,c,null==r||null===(l=r.video)||void 0===l||null===(u=l.gist)||void 0===u?void 0:u.id)}})),s.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];s.trigger("subtitlechanged",t)})),s.on("subtitlechanged",(function(e,t){var i,n,o,r,l,a,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(d=a.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var w,p=m.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),s.on("loadedmetadata",(function(){window.endFirstFrame(s)})),s.one("error",(function(){var t,n;o.handleError(e,(null==s||null===(t=s.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==s||null===(n=s.error())||void 0===n?void 0:n.message)||"Some error occured"})})),s.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var i,n,r,l=null===(i=o.getCurrentVideo())||void 0===i||null===(n=i.video)||void 0===n||null===(r=n.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},d=a.t,u=a.p;d&&u<95&&setTimeout((function(){s.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){s.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),s.on("volumechange",(function(){var e=100*s.volume().toFixed(2);s.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},F=function(e,t){var i=null==t?void 0:t.skin;"live"==i?Promise.resolve().then((function(){return require("./skin-c7ccea8f.js")})).then((function(i){i.initialiseSkin(e,t)})):"default"==i?Promise.resolve().then((function(){return require("./skin-8d437032.js")})).then((function(i){i.initialiseSkin(e,t)})):"carousel"==i?Promise.resolve().then((function(){return require("./skin-4f320cb6.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==i?Promise.resolve().then((function(){return require("./skin-093cf3e2.js")})).then((function(i){i.initialiseSkin(e,t)})):"multiplayer"==i&&Promise.resolve().then((function(){return require("./skin-76fc1f46.js")})).then((function(i){i.initialiseSkin(e,t)}))},R=function(e){return new Promise((function(t,i){if(x(e))i("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){t()},n.onerror=function(t){i("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(n)}}))},x=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},M=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var H,_=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){R("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),R("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:_,loadEMELibrary:B});function V(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function q(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?V(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var L=function(n,l,a,d){var s,u,c,v,f,m,w,p,h,g,y,b,T,P,I,E,O,j,k,S,D,A,R,x,H,N,V,L,W,U,z,G,J,K=l.res,Q=void 0===K?null:K,Y=l.sres,X=void 0===Y?null:Y,Z=(null===(s=window)||void 0===s||null===(u=s.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(f=v.getInstance())||void 0===f?void 0:f.S)||void 0,$=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==Z&&"NOT_CONNECTED"!==Z?["html5","chromecast"]:["chromecast","html5"]:["html5"],ee=(null===(m=Q)||void 0===m?void 0:m.contentType)||"video",te=o.impolicy16x9(null===(w=Q)||void 0===w||null===(p=w[ee])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=Q)||void 0===g||null===(y=g[ee])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(P=Q)||void 0===P||null===(I=P[ee])||void 0===I||null===(E=I.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,ne=(null===(O=Q)||void 0===O||null===(j=O[ee])||void 0===j||null===(k=j.streamingInfo)||void 0===k?void 0:k.isLiveStream)||!1,oe=(null==a?void 0:a.drmLibrary)||!1,re=(null===(S=Q)||void 0===S||null===(D=S.ads)||void 0===D||null===(A=D.preRoll)||void 0===A||null===(R=A.adTags)||void 0===R||null===(x=R.web)||void 0===x?void 0:x.active)&&(null===(H=Q)||void 0===H||null===(N=H.ads)||void 0===N||null===(V=N.preRoll)||void 0===V||null===(L=V.adTags)||void 0===L||null===(W=L.web)||void 0===W?void 0:W.url);Q=q(q({},Q),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var le=(J={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(J,"autoplay",null==a?void 0:a.autoplay),e(J,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!re),e(J,"loop",(null==a?void 0:a.loop)||!1),e(J,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(J,"html5",q(q({dash:q(q({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:q(q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(U=a.customData)||void 0===U?void 0:U.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(z=a.customData)||void 0===z?void 0:z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(G=a.customData)||void 0===G?void 0:G.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(J,"poster",te),e(J,"techOrder",$),e(J,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(n),i=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return o.getChromecastCustomData(Q,e,i)}}),J),ae=r(n,le,function(){var e=t(i.mark((function e(){var t,l,s,u,c,v,f,m,w,p,h,g,y,b,T,P,I,E,O,j,k,S,D,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.initialisePlugins(a),ne&&d.resolve(q({status:!0,msg:"Player Initialised"},X?{seriesResponse:X,response:Q}:{response:Q})),window.initialise(ae),window.firstFrame(ae),"white"!==window.controlsColor&&M(window.controlsColor,ae),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=Q)||void 0===t||null===(l=t[ee])||void 0===l?void 0:l.drmEnabled,T=null===(s=Q)||void 0===s||null===(u=s[ee])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!oe){e.next=21;break}if("Safari"!==o.detectBrowser()){e.next=14;break}return e.next=12,B();case 12:e.next=21;break;case 14:if("caliente"!=(null===(P=window)||void 0===P?void 0:P.siteName)){e.next=19;break}return e.next=17,B();case 17:e.next=21;break;case 19:return e.next=21,_();case 21:ie&&o.addChromecastConfigurationDVR(n,T),!re||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(n,re,Q),(I=o.getSource(Q,n))?o.loadVideo(n,I):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Q}),o.handleError(n,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(f=Q)||void 0===f||null===(m=f[ee])||void 0===m||null===(w=m.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=Q)||void 0===h||null===(g=h[ee])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(A=(null===(O=Q)||void 0===O||null===(j=O[ee])||void 0===j||null===(k=j.contentDetails)||void 0===k?void 0:k.closedCaptions)||(null===(S=Q)||void 0===S||null===(D=S[ee])||void 0===D?void 0:D.closedCaptions),E=A.filter((function(e){return"VTT"===e.format})),o.addCaptions(n,E)),null!=a&&a.disableControls?o.disableControls(n):F(n,q(q(q({},a),le),{},{liveVideo:ne,isDvrEnabled:ie,res:Q,sres:X})),C(n,q(q(q({},a),le),{},{liveVideo:ne}),d,{res:Q,sres:X});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,i){var n,r,l,a,d,c,v,f,m,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(n=e.epg)||void 0===n?void 0:n.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=g;var b=null==e?void 0:e.token;if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),b&&!o.isTokenExpired(b)){H=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=H)||void 0===l?void 0:l.siteId,window.siteName=null===(a=H)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(d=H)||void 0===d||!d.anonymousId),e.siteOwner=(null===(c=H)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=H)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=H)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b);var T=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,I=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,s.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return N})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return N})).then((function(e){e.importChromecast()})),I&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return N})).then((function(e){e.importAirplay()})),O&&R("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then((function(){return e=O,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var k=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(k&&k.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var S,D=null==e||null===(S=e.series)||void 0===S?void 0:S.id;o.getSeriesDetails(D,b).then((function(n){var r,l,a,d=n.data,s=n.data.seasons;o.setCurrentSeries(s);var u=g||(null==s||null===(r=s[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var i=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(i)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(n){var r,l,a;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(n.data),L(T,{res:null==n?void 0:n.data,sres:d},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))})).catch((function(e){o.initiateErrorHandling(e,T,i)}))}else if(h){var A=null==e?void 0:e.epg;o.getLinearChannelDetails(A,b).then((function(n){var o=null==n?void 0:n.data;o.contentType="linearchannel",L(T,{res:o},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else o.getVideoDetails(g,b).then((function(n){var r,l,a,d;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(d=e.watchHistory)&&void 0!==d&&d.enable?o.getVideoInfo(g,b).then((function(n){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",L(T,{res:s},e,{resolve:t,reject:i})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),L(T,{res:s},e,{resolve:t,reject:i})})):L(T,{res:s},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else i({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}})}}))},getRenditions:a.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:k,getVolume:S,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/regenerator"),n=require("axios"),o=require("./chromecast-c43dfe8f.js"),r=require("video.js"),l=require("./util-2720e3a7.js"),a=require("./renditions-eee5b220.js"),d=require("./resolution-c2f5d636.js"),s=require("./localisation-56e0a999.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?v(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");function m(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=m(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=t(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(n=JSON.parse(atob(t.split(".")[1])))||!n.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==n?void 0:n.userId);case 9:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=m(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var i,n,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,i,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.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(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var i,n;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(i=t.el_)&&void 0!==i&&null!==(n=i.className)&&void 0!==n&&n.includes("vjs-waiting"))c("BUFFERING",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,i,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",f({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,i,n,o,r,l;c("AD_REQUEST",f({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",f({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var i=Math.floor(e.currentTime());i>=30&&i%30==0&&!t.includes(i)&&(t.push(i),fireEvent({eventName:"PING",videoPosition:i,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),i=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(b(t,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var g,y,b=function(e,t,i){return e>=t&&e<=i};function T(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function P(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?T(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}window.fireEvent=function(){var e=t(i.mark((function e(t){var r,l,a,d,s,u,c,v,m,h,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=f,e.t1=f,e.t2=f({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=w(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(i=t.adPosition)?String(i):"":"",e.next=20,p();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s||null===(u=s.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,n({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var i}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var I=[],E=0,O=null;function j(e,t,i){var n,r,l,a,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];y=(null==t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1";var s=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,f=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,m={};"v1"==y?m={videoId:g,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==y&&(m=P(P({videoId:g,watchedTime:Math.floor(e.currentTime()),watchedPercentage:d?100:Math.floor(u/c*100),doneWatching:d,profileId:s},O&&{seriesId:O}),f&&{originalObjectId:f})),o.saveWatchHistory(m,y).then((function(e){})).catch((function(e){})),E=u+i}var k=function(e,t,i){var n=o.getPlayer(e);if(n)if(t>=0&&t<=100){n.muted()&&n.muted(!1);var r=parseFloat(t)/100;n.volume(r),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},S=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function D(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?D(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var C=function(e,t,i,n){var r,l,a=n.res,d=n.sres,s=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),s.on("loadstart",(function(){c&&i.resolve({status:!0,msg:"Video Loaded",response:a})})),s.on("loadeddata",(function(){var n;(null==s||!s.muted())&&k(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),i.resolve(A({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(n=t.watchHistory)&&void 0!==n&&n.enable&&!t.isAnonymousUser){var l,u,c=A(A({},t),a);!function(e,t,i){var n,r,l;null!=t&&t.series&&null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable&&(O=null==t||null===(r=t.series)||void 0===r?void 0:r.id),I=[],E=0,g=i;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,d=o.getPlayer(e);d&&(d.on("timeupdate",(function(){var e=Math.floor(d.currentTime());I.includes(E)||(e==E?(I.push(e),j(d,t,a)):e>E&&(E=e+a))})),d.one("ended",(function(){j(d,t,a,!0)})))}(e,c,null==r||null===(l=r.video)||void 0===l||null===(u=l.gist)||void 0===u?void 0:u.id)}})),s.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];s.trigger("subtitlechanged",t)})),s.on("subtitlechanged",(function(e,t){var i,n,o,r,l,a,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(d=a.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var w,p=m.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),s.on("loadedmetadata",(function(){window.endFirstFrame(s)})),s.one("error",(function(){var t,n;o.handleError(e,(null==s||null===(t=s.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==s||null===(n=s.error())||void 0===n?void 0:n.message)||"Some error occured"})})),s.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var i,n,r,l=null===(i=o.getCurrentVideo())||void 0===i||null===(n=i.video)||void 0===n||null===(r=n.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},d=a.t,u=a.p;d&&u<95&&setTimeout((function(){s.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){s.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),s.on("volumechange",(function(){var e=100*s.volume().toFixed(2);s.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},F=function(e,t){var i=null==t?void 0:t.skin;"live"==i?Promise.resolve().then((function(){return require("./skin-071eb264.js")})).then((function(i){i.initialiseSkin(e,t)})):"default"==i?Promise.resolve().then((function(){return require("./skin-75438aac.js")})).then((function(i){i.initialiseSkin(e,t)})):"carousel"==i?Promise.resolve().then((function(){return require("./skin-ac05cb75.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==i?Promise.resolve().then((function(){return require("./skin-86b6469d.js")})).then((function(i){i.initialiseSkin(e,t)})):"multiplayer"==i&&Promise.resolve().then((function(){return require("./skin-47f06ed0.js")})).then((function(i){i.initialiseSkin(e,t)}))},R=function(e){return new Promise((function(t,i){if(x(e))i("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){t()},n.onerror=function(t){i("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(n)}}))},x=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},M=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var H,_=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){R("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),R("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:_,loadEMELibrary:B});function V(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function q(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?V(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var L=function(n,l,a,d){var s,u,c,v,f,m,w,p,h,g,y,b,T,P,I,E,O,j,k,S,D,A,R,x,H,N,V,L,W,U,z,G,J,K=l.res,Q=void 0===K?null:K,Y=l.sres,X=void 0===Y?null:Y,Z=(null===(s=window)||void 0===s||null===(u=s.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(f=v.getInstance())||void 0===f?void 0:f.S)||void 0,$=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==Z&&"NOT_CONNECTED"!==Z?["html5","chromecast"]:["chromecast","html5"]:["html5"],ee=(null===(m=Q)||void 0===m?void 0:m.contentType)||"video",te=o.impolicy16x9(null===(w=Q)||void 0===w||null===(p=w[ee])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=Q)||void 0===g||null===(y=g[ee])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(P=Q)||void 0===P||null===(I=P[ee])||void 0===I||null===(E=I.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,ne=(null===(O=Q)||void 0===O||null===(j=O[ee])||void 0===j||null===(k=j.streamingInfo)||void 0===k?void 0:k.isLiveStream)||!1,oe=(null==a?void 0:a.drmLibrary)||!1,re=(null===(S=Q)||void 0===S||null===(D=S.ads)||void 0===D||null===(A=D.preRoll)||void 0===A||null===(R=A.adTags)||void 0===R||null===(x=R.web)||void 0===x?void 0:x.active)&&(null===(H=Q)||void 0===H||null===(N=H.ads)||void 0===N||null===(V=N.preRoll)||void 0===V||null===(L=V.adTags)||void 0===L||null===(W=L.web)||void 0===W?void 0:W.url);Q=q(q({},Q),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var le=(J={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(J,"autoplay",null==a?void 0:a.autoplay),e(J,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!re),e(J,"loop",(null==a?void 0:a.loop)||!1),e(J,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(J,"html5",q(q({dash:q(q({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:q(q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(U=a.customData)||void 0===U?void 0:U.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(z=a.customData)||void 0===z?void 0:z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(G=a.customData)||void 0===G?void 0:G.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(J,"poster",te),e(J,"techOrder",$),e(J,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(n),i=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return o.getChromecastCustomData(Q,e,i)}}),J),ae=r(n,le,function(){var e=t(i.mark((function e(){var t,l,s,u,c,v,f,m,w,p,h,g,y,b,T,P,I,E,O,j,k,S,D,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.initialisePlugins(a),ne&&d.resolve(q({status:!0,msg:"Player Initialised"},X?{seriesResponse:X,response:Q}:{response:Q})),window.initialise(ae),window.firstFrame(ae),"white"!==window.controlsColor&&M(window.controlsColor,ae),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=Q)||void 0===t||null===(l=t[ee])||void 0===l?void 0:l.drmEnabled,T=null===(s=Q)||void 0===s||null===(u=s[ee])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!oe){e.next=21;break}if("Safari"!==o.detectBrowser()){e.next=14;break}return e.next=12,B();case 12:e.next=21;break;case 14:if("caliente"!=(null===(P=window)||void 0===P?void 0:P.siteName)){e.next=19;break}return e.next=17,B();case 17:e.next=21;break;case 19:return e.next=21,_();case 21:ie&&o.addChromecastConfigurationDVR(n,T),!re||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(n,re,Q),(I=o.getSource(Q,n))?o.loadVideo(n,I):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Q}),o.handleError(n,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(f=Q)||void 0===f||null===(m=f[ee])||void 0===m||null===(w=m.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=Q)||void 0===h||null===(g=h[ee])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(A=(null===(O=Q)||void 0===O||null===(j=O[ee])||void 0===j||null===(k=j.contentDetails)||void 0===k?void 0:k.closedCaptions)||(null===(S=Q)||void 0===S||null===(D=S[ee])||void 0===D?void 0:D.closedCaptions),E=A.filter((function(e){return"VTT"===e.format})),o.addCaptions(n,E)),null!=a&&a.disableControls?o.disableControls(n):F(n,q(q(q({},a),le),{},{liveVideo:ne,isDvrEnabled:ie,res:Q,sres:X})),C(n,q(q(q({},a),le),{},{liveVideo:ne}),d,{res:Q,sres:X});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,i){var n,r,l,a,d,c,v,f,m,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(n=e.epg)||void 0===n?void 0:n.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=g;var b=null==e?void 0:e.token;if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),b&&!o.isTokenExpired(b)){H=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=H)||void 0===l?void 0:l.siteId,window.siteName=null===(a=H)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(d=H)||void 0===d||!d.anonymousId),e.siteOwner=(null===(c=H)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=H)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=H)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b);var T=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,I=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,s.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",e.skin="default",Promise.resolve().then((function(){return N})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return N})).then((function(e){e.importChromecast()})),I&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return N})).then((function(e){e.importAirplay()})),O&&R("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then((function(){return e=O,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var k=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(k&&k.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var S,D=null==e||null===(S=e.series)||void 0===S?void 0:S.id;o.getSeriesDetails(D,b).then((function(n){var r,l,a,d=n.data,s=n.data.seasons;o.setCurrentSeries(s);var u=g||(null==s||null===(r=s[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var i=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(i)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(n){var r,l,a;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(n.data),L(T,{res:null==n?void 0:n.data,sres:d},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))})).catch((function(e){o.initiateErrorHandling(e,T,i)}))}else if(h){var A=null==e?void 0:e.epg;o.getLinearChannelDetails(A,b).then((function(n){var o=null==n?void 0:n.data;o.contentType="linearchannel",L(T,{res:o},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else o.getVideoDetails(g,b).then((function(n){var r,l,a,d;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(d=e.watchHistory)&&void 0!==d&&d.enable?o.getVideoInfo(g,b).then((function(n){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",L(T,{res:s},e,{resolve:t,reject:i})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),L(T,{res:s},e,{resolve:t,reject:i})})):L(T,{res:s},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else i({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}})}}))},getRenditions:a.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:k,getVolume:S,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./chromecast-
|
|
1
|
+
"use strict";var e=require("./chromecast-c43dfe8f.js");exports.initialiseKeyboardEvents=function(r,t){var u,i,o=e.getPlayer(r),l=null==o||null===(u=o.controlBar)||void 0===u||null===(i=u.playToggle)||void 0===i?void 0:i.el_,n=document.getElementsByTagName("video")[0];n&&n.addEventListener("keydown",(function(u){switch(u.key){case" ":return u.preventDefault(),n&&n.focus(),void(l&&l.click());case"m":case"M":return u.preventDefault(),n&&n.focus(),void(o.muted()?o.muted(!1):o.muted(!0));case"f":u.preventDefault(),n&&n.focus();var i=document.querySelector(".vjs-fullscreen-control");return void(i&&i.click());case"F":u.preventDefault();var c=document.querySelector(".vjs-fullscreen-control");return void(c&&c.click());case"ArrowLeft":if((1==t.liveVideo||1==t.liveui)&&0==t.liveui)break;return u.preventDefault(),n&&n.focus(),void e.rewind(r,10);case"ArrowRight":if(1==t.liveVideo||1==t.liveui)break;return u.preventDefault(),n&&n.focus(),void e.skip(r,10);default:return}}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),i=require("@babel/runtime/helpers/assertThisInitialized"),l=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),a=require("video.js"),s=require("./loader-393b838a.js"),u=require("./chromecast-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),i=require("@babel/runtime/helpers/assertThisInitialized"),l=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),a=require("video.js"),s=require("./loader-393b838a.js"),u=require("./chromecast-c43dfe8f.js");function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var d=a.getComponent("Component"),v=function(){l(p,d);var v,m,h=(v=p,m=c(),function(){var e,t=n(v);if(m){var i=n(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return r(this,e)});function p(t){var l,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,p),l=h.call(this,t,r),o(i(l),"multicamCssPositioning",(function(e,t){var r,n,o,a,s,u,c,d,v=window.getComputedStyle(document.getElementById(t),null),m=v.getPropertyValue("height"),h=v.getPropertyValue("width"),p=m.slice(0,-2);h.slice(0,-2)-135<=135?(e.style.bottom="290px",e.style.height="352px"):"live"==l.config.skin&&(null===(r=i(l))||void 0===r||null===(n=r.config)||void 0===n||!n.liveui)&&(null===(o=i(l))||void 0===o||null===(a=o.config)||void 0===a||!a.liveVideo)||null!==(s=i(l))&&void 0!==s&&null!==(u=s.config)&&void 0!==u&&u.liveui&&null!==(c=i(l))&&void 0!==c&&null!==(d=c.config)&&void 0!==d&&d.liveVideo?(e.style.bottom="".concat(p-135,"px"),e.style.height="".concat(p-85,"px")):(e.style.bottom="3rem",e.style.height="".concat(p-105,"px"))})),l.playerId=r.playerId,l.streams=null==r?void 0:r.streams,l.config=null==r?void 0:r.config,l.createUI(null==r?void 0:r.streams),l}return t(p,[{key:"createEl",value:function(){return a.dom.createEl("div",{className:"multicamera-parent"})}},{key:"createUI",value:function(e){var t,i,l,r,n,o,a=this,s=this.el();null!=this&&null!==(t=this.config)&&void 0!==t&&t.liveui&&null!=this&&null!==(i=this.config)&&void 0!==i&&i.liveVideo||0==(null==this||null===(l=this.config)||void 0===l?void 0:l.liveui)&&0==(null==this||null===(r=this.config)||void 0===r?void 0:r.liveVideo)?null==s||null===(n=s.classList)||void 0===n||n.add("".concat(this.config.skin)):null==s||null===(o=s.classList)||void 0===o||o.add("default"),this.loadCSS();for(var u=0;u<e.length;u++)this.createTile(e[u],u);this.multicamCssPositioning(s,this.playerId),window.onresize=function(){a.multicamCssPositioning(s,a.playerId)}}},{key:"getOffset",value:function(e){var t=e.getBoundingClientRect();return{left:t.left+window.scrollX,top:t.top+window.scrollY}}},{key:"createTile",value:function(e,t){var i=this,l=this.el(),r=a.dom.createEl("div",{className:"tile ".concat(t)});return 0==t&&(r.style.border="2px solid red"),r.style.backgroundImage="url(".concat(e.img,")"),a.dom.appendContent(l,r),r.addEventListener("click",(function(t){s.showLoader(i.playerId),i.removeSelectedTile();var l=document.getElementsByClassName("".concat(t.srcElement.className))[0];l&&(l.style.border="2px solid red"),u.load(i.playerId,e.id).then((function(e){u.play(i.playerId)}))})),l}},{key:"removeSelectedTile",value:function(){for(var e=document.getElementsByClassName("tile"),t=0;t<e.length;t++)e[t].style.border=0}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./multicam-a41fe4a6.js")})).then((function(e){var t=document.createElement("style");t.id="multicam",t.append("".concat(e.default)),document.head.appendChild(t)}))}}]),p}();exports.default=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),o=require("./icons-0f7b3404.js"),l=require("./chromecast-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),s=require("video.js"),o=require("./icons-0f7b3404.js"),l=require("./chromecast-c43dfe8f.js");function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var c=s.getComponent("Component"),d=function(){r(p,c);var d,u,m=(d=p,u=i(),function(){var e,t=n(d);if(u){var r=n(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function p(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,p),(r=m.call(this,t,a)).playerId=a.playerId,r.seriesData=a.sres,r.streams=a.streams,r.currentVideoData=a.res,r.initialiseStructure(),r.loadCSS(),r}return t(p,[{key:"createEl",value:function(){var e=s.dom.createEl("div",{className:"stream-selection vjs-control vjs-button"});e.style.position="unset";var t=s.dom.createEl("div",{className:"stream-selector-icon",innerHTML:"".concat(o.BroadcastIcon())});return s.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./multicamv2-76d8530b.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=s.dom.createEl("div",{className:"stream-container hidden"});s.dom.$(".stream-selector-icon",this.el()).onclick=function(){var r;null!==(r=t.classList)&&void 0!==r&&r.contains("hidden")?(l.closeOpenDrawers(),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 r=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(r,"px"),document.getElementById(this.playerId).style.overflow="hidden",s.dom.appendContent(e,t),this.addFunctionality(t)}},{key:"addFunctionality",value:function(e){var t=this,r=this.el(),a=s.dom.createEl("div",{className:"stream-selector-head"}),n=s.dom.createEl("div",{className:"stream-selector-cross-icon",innerHTML:"".concat(o.crossIconSvg())});n.onclick=function(){e.classList.add("hidden"),r.classList.remove("open"),e.style.right="-350px"};for(var i=s.dom.createEl("div",{className:"stream-selector-title",innerHTML:"Streams"}),c=s.dom.createEl("div",{className:"stream-selector-content"}),d=s.dom.createEl("div",{className:"stream-tray"}),u=function(e){var r,a=s.dom.createEl("div",{className:"stream -".concat(e),innerHTML:"".concat(o.SelectedStream())});0==e&&(a.classList.add("selected"),a.style.border="4px solid #D2393B"),a.onclick=function(){for(var r=s.dom.$$(".stream"),n=0;n<r.length;n++)r[n].style.border="none",r[n].classList.remove("selected");a.classList.add("selected"),a.style.border="4px solid #D2393B",l.load(t.playerId,t.streams[e].id).then((function(e){l.play(t.playerId),console.log(e)})).catch((function(e){console.log(e)}))},a.style.backgroundImage="url(".concat(t.streams[e].img,")");var n=document.createElement("img");n.className="stream-thumbnail-image",n.src="".concat(null==t||null===(r=t.streams[e])||void 0===r?void 0:r.img),n.alt="No Thumbnail Available",a.append(n),s.dom.appendContent(d,a),s.dom.appendContent(c,d)},m=0;m<this.streams.length;m++)u(m);s.dom.appendContent(a,n),s.dom.appendContent(a,i),s.dom.appendContent(e,a),s.dom.appendContent(e,c),l.getPlayer(this.playerId).on("fullscreenchange",(function(){var r=window.getComputedStyle(document.getElementById(t.playerId),null).getPropertyValue("height").slice(0,-2);e.style.height="".concat(r,"px")}))}}]),p}();exports.default=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),s=require("./loader-393b838a.js"),i=require("./chromecast-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),s=require("./loader-393b838a.js"),i=require("./chromecast-c43dfe8f.js");function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var c=o.getComponent("Component"),d=function(){l(m,c);var d,u,v=(d=m,u=a(),function(){var e,t=n(d);if(u){var l=n(this).constructor;e=Reflect.construct(t,arguments,l)}else e=t.apply(this,arguments);return r(this,e)});function m(t){var l,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,m),(l=v.call(this,t,r)).playerId=r.playerId,l.config=r.config,l.createUI(null==r?void 0:r.config.streams),l}return t(m,[{key:"createEl",value:function(){return o.dom.createEl("div",{className:"mweb-potrait-parent"})}},{key:"createUI",value:function(e){var t,l,r,n,s,i,a,c,d=this.el(),u=1==(null==this||null===(t=this.config)||void 0===t?void 0:t.liveui)&&1==(null==this||null===(l=this.config)||void 0===l?void 0:l.liveVideo)||!(null!=this&&null!==(r=this.config)&&void 0!==r&&r.liveui)&&!(null!=this&&null!==(n=this.config)&&void 0!==n&&n.liveVideo)||!1;u?null==d||null===(s=d.classList)||void 0===s||s.add("dvr"):null==d||null===(i=d.classList)||void 0===i||i.add("nondvr");var v=o.dom.createEl("div",{className:"broadcast"});v.innerHTML="Broadcasts";var m=o.dom.createEl("div",{className:"potraittray hideMWebTray"});u?null==m||null===(a=m.classList)||void 0===a||a.add("dvr"):null==m||null===(c=m.classList)||void 0===c||c.add("nondvr"),m.style.width="".concat(window.innerWidth-50,"px");var h=o.dom.createEl("div",{className:"tilecontainer-potrait"});o.dom.appendContent(d,v),o.dom.appendContent(d,m),o.dom.appendContent(m,h),v.addEventListener("click",(function(){null!=m&&m.classList.contains("hideMWebTray")?(m.classList.remove("hideMWebTray"),d.style.background="darkgray"):(null==m||m.classList.add("hideMWebTray"),d.style.background="gray")})),this.loadCSS();for(var p=0;p<e.length;p++)this.createTile(e[p],p)}},{key:"createTile",value:function(e,t){var l=this,r=this.el(),n=o.dom.createEl("div",{className:"tile-potrait-mweb ".concat(t)});0==t&&(n.style.border="2px solid red"),n.style.backgroundImage="url(".concat(e.img,")");var a=o.dom.$(".tilecontainer-potrait",this.contentEl());return o.dom.appendContent(a,n),n.addEventListener("click",(function(t){s.showLoader(l.playerId),l.removeSelectedTile();var r=document.getElementsByClassName("".concat(t.srcElement.className))[0];r&&(r.style.border="2px solid red"),i.load(l.playerId,e.id).then((function(e){i.play(l.playerId)}))})),r}},{key:"removeSelectedTile",value:function(){for(var e=document.getElementsByClassName("tile-potrait-mweb"),t=0;t<e.length;t++)e[t].style.border=0}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./mwebPotrait-3c11d7cf.js")})).then((function(e){var t=document.createElement("style");t.className="mweb",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"toggleProgressControls",value:function(e){var t=document.querySelector(".vjs-progress-control.vjs-control"),l=document.querySelector(".vjs-play-control.vjs-control.vjs-button"),r=document.querySelector(".vjs-remaining-time.vjs-time-control.vjs-control"),n=document.querySelector(".vjs-seek-to-live-control.vjs-control");e?(null==t||t.classList.add("hide-controls"),null==l||l.classList.add("hide-controls"),null==r||r.classList.add("hide-controls"),null==n||n.classList.add("hide-controls")):(null!=t&&t.classList.contains("hide-controls")&&(null==t||t.classList.remove("hide-controls")),null!=l&&l.classList.contains("hide-controls")&&(null==l||l.classList.remove("hide-controls")),null!=r&&r.classList.contains("hide-controls")&&(null==r||r.classList.remove("hide-controls")),null!=n&&n.classList.contains("hide-controls")&&(null==n||n.classList.remove("hide-controls")))}}]),m}();exports.default=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),t=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),l=require("./icons-0f7b3404.js"),s=require("./chromecast-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),t=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),i=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),l=require("./icons-0f7b3404.js"),s=require("./chromecast-c43dfe8f.js");function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray");var d=o.getComponent("Component"),u=function(){t(p,d);var s,u,c=(s=p,u=a(),function(){var e,n=i(s);if(u){var t=i(this).constructor;e=Reflect.construct(n,arguments,t)}else e=n.apply(this,arguments);return r(this,e)});function p(n){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(this,p),(t=c.call(this,n,r)).playerId=r.playerId,t.seriesData=r.sres,t.currentVideoData=r.res,t.initialiseStructure(),t.loadCSS(),t}return n(p,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"play-next"}),n=o.dom.createEl("div",{className:"play-next-icon",innerHTML:"".concat(l.PlayNextEpisodeSvg(window.controlsColor?window.controlsColor:"white"))});return o.dom.appendContent(e,n),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./nextEpisodeButton-b6e6586f.js")})).then((function(e){var n=document.createElement("style");n.id="multicam",n.append("".concat(e.default)),document.head.appendChild(n)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),n=o.dom.createEl("div",{className:"next-eps nextepisode-hidden"}),t=o.dom.createEl("div",{className:"next",innerHTML:"Next Episode"}),r=o.dom.createEl("div",{className:"nextep-meta-details next-margin"}),i=o.dom.createEl("div",{className:"next-eps-image"}),l=o.dom.createEl("div",{className:"next-eps-description"});o.dom.appendContent(r,i),o.dom.appendContent(r,l),o.dom.appendContent(n,t),o.dom.appendContent(n,r),this.toggleContentOnHover(e,n),o.dom.appendContent(e,n)}},{key:"toggleContentOnHover",value:function(e,n){e.addEventListener("mouseover",(function(){o.dom.removeClass(n,"nextepisode-hidden")})),n.addEventListener("mouseover",(function(){o.dom.removeClass(n,"nextepisode-hidden")})),e.addEventListener("mouseout",(function(){o.dom.addClass(n,"nextepisode-hidden")})),n.addEventListener("mouseout",(function(){o.dom.addClass(n,"nextepisode-hidden")}))}}]),p}(),c=function(e,n){for(var t=-1,r=0;r<e.length;r++)for(var i=0;i<e[r].episodes.length;i++)if(e[r].episodes[i].id===n){t=r;break}return t},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;if(!(e&&n>=0))return{prevEp:null,nextEp:null};var t=e.episodes.length,r=n-1>=0?n-1:t-1,i=(n+1)%t,o=t>1?e.episodes[r]:null,l=t>1?e.episodes[i]:null;return r===i&&(0===r?l=null:o=null),{prevEp:o,nextEp:l,prevEpIdx:r,nextEpIdx:i}},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,t=null;return e?(e.episodes.forEach((function(e,r){e.gist.id===n&&(t=r)})),t):null},m=function(e){var n,t;o.dom.$(".next-eps"),o.dom.$(".play-next").onclick=function(){var n;s.load("my-player",null==e||null===(n=e.gist)||void 0===n?void 0:n.id).then((function(e){s.setCurrentVideo(e.response)}))};var r=o.dom.$(".next-eps-image"),i=s.parseHtmlString("<img src=".concat(null==e||null===(n=e.gist)||void 0===n?void 0:n.videoImageUrl," />")),l=null==i?void 0:i.firstChild;null==r||r.append(l);for(var a=o.dom.$(".next-eps-description"),d=s.parseHtmlString("<div class='next-eps-title'>".concat(null==e?void 0:e.title,"</div>\n <div class='next-eps-description-details'>").concat(null==e||null===(t=e.gist)||void 0===t?void 0:t.description,"</div>"));null!=d&&d.firstChild;)null==a||a.appendChild(d.firstChild)};exports.default=u,exports.initaliseFunctionality=function(e,n){var t=c(e,n.video.gist.id),r=v(e[t],n.video.gist.id),i=p(e[t],r);m(i.nextEp)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),s=require("./icons-0f7b3404.js"),r=require("./chromecast-
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),l=require("@babel/runtime/helpers/inherits"),i=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("video.js"),s=require("./icons-0f7b3404.js"),r=require("./chromecast-c43dfe8f.js"),c=require("./autoNextVideo-81dafcd5.js");function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-2720e3a7.js");var u=o.getComponent("Component"),p=function(){l(y,u);var p,m,v=(p=y,m=d(),function(){var e,t=a(p);if(m){var n=a(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return i(this,e)});function y(e){var n,l,i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,y),(a=v.call(this,e,o)).playerId=o.playerId,a.seriesData=o.sres,a.videos=null==o||null===(n=o.playlist)||void 0===n?void 0:n.content,a.cb=(null==o||null===(l=o.playlist)||void 0===l?void 0:l.cb)||null,a.autoNext=(null==o||null===(i=o.playlist)||void 0===i?void 0:i.autoNext)||!1,a.currentVideoData=o.res,a.initialiseStructure(),a.loadCSS(),a.autoNext&&c.autoPlayNext({playerId:a.playerId,content:a.videos,cb:a.cb}),a}return n(y,[{key:"createEl",value:function(){var e=o.dom.createEl("div",{className:"playlist-selection vjs-control vjs-button"});e.style.position="unset";var t=o.dom.createEl("div",{className:"playlist-selector-icon",innerHTML:"".concat(s.EpisodesSvg())});return o.dom.appendContent(e,t),e}},{key:"loadCSS",value:function(){Promise.resolve().then((function(){return require("./playlist-df87ca90.js")})).then((function(e){var t=document.createElement("style");t.id="playlist-selection",t.append("".concat(e.default)),document.head.appendChild(t)}))}},{key:"initialiseStructure",value:function(){var e=this.el(),t=o.dom.createEl("div",{className:"selection-container hidden"});o.dom.$(".playlist-selector-icon",this.el()).onclick=function(){var n;null!==(n=t.classList)&&void 0!==n&&n.contains("hidden")?(r.closeOpenDrawers(),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 n=window.getComputedStyle(document.getElementById(this.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(n,"px"),o.dom.appendContent(e,t),document.getElementById(this.playerId).style.overflow="hidden",this.addFunctionality(t)}},{key:"addFunctionality",value:function(t){var n=this,l=this.el(),i=o.dom.createEl("div",{className:"playlist-selector-head"}),a=o.dom.createEl("div",{className:"playlist-selector-cross-icon",innerHTML:"".concat(s.crossIconSvg())});a.onclick=function(){t.classList.add("hidden"),l.classList.remove("open"),t.style.right="-350px"};for(var c=o.dom.createEl("div",{className:"playlist-selector-title",innerHTML:"Playlist"}),d=o.dom.createEl("div",{className:"playlist-selector-content"}),u=function(t){var l,i,a=o.dom.createEl("div",{className:"playlist-container"}),s=o.dom.createEl("div",{className:"playlist-section",index:t}),c=o.dom.createEl("div",{className:"playlist-title",innerHTML:"".concat((null===(l=n.videos[t])||void 0===l?void 0:l.title)||"")}),u=o.dom.createEl("div",{className:"playlist-progress-bar",innerHTML:"<div style='width:".concat(n.videos[t].watchedPercentage,"%' class='playlist-progress-bar-value'></div>")});o.dom.appendContent(s,c),o.dom.appendContent(s,u),o.dom.appendContent(a,s),o.dom.appendContent(d,a);var p=o.dom.createEl("div",{className:"playlist-section-expanded hidden"}),m=o.dom.createEl("div",{className:"playlist-description",innerHTML:"".concat((null===(i=n.videos[t])||void 0===i?void 0:i.description)||"")}),v=o.dom.createEl("div",{className:"playlist-image"});v.style.backgroundImage="url(".concat(n.videos[t].img,")"),o.dom.appendContent(p,v),o.dom.appendContent(p,m),o.dom.appendContent(a,p),o.dom.appendContent(d,a),p.onclick=function(e){e.stopPropagation(),r.setVideoIdx(t+1),r.load(n.playerId,n.videos[t].id).then((function(e){null!=n&&n.cb&&n.cb(e)})).catch((function(e){null!=n&&n.cb&&n.cb(e)}))},s.onclick=function(t){var n,l,i,o=document.getElementsByClassName("playlist-selector-content")[0].childNodes,s=(o=e(o))[t.target.index].getElementsByClassName("playlist-section-expanded")[0];null!=s&&null!==(n=s.classList)&&void 0!==n&&n.contains("hidden")?(a.style.backgroundColor="#0000007d",null==s||null===(l=s.classList)||void 0===l||l.remove("hidden")):(null==s||null===(i=s.classList)||void 0===i||i.add("hidden"),a.style.backgroundColor="unset")}},p=0;p<this.videos.length;p++)u(p);o.dom.appendContent(i,a),o.dom.appendContent(i,c),o.dom.appendContent(t,i),o.dom.appendContent(t,d),r.getPlayer(this.playerId).on("fullscreenchange",(function(){var e=window.getComputedStyle(document.getElementById(n.playerId),null).getPropertyValue("height").slice(0,-2);t.style.height="".concat(e,"px")}))}}]),y}();exports.default=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=require("./chromecast-
|
|
1
|
+
"use strict";var l=require("./chromecast-c43dfe8f.js");exports.getRenditions=function(i){var n,t=l.getPlayer(i),e=[];if((null==t||null===(n=t.tech_)||void 0===n?void 0:n.vhs)||!1){var o,d,u=null==t||null===(o=t.tech_)||void 0===o||null===(d=o.vhs)||void 0===d?void 0:d.representations();(null==u?void 0:u.length)>0&&(e=null==u?void 0:u.sort((function(l,i){return(null==l?void 0:l.height)==(null==i?void 0:i.height)?(null==i?void 0:i.bandwidth)-(null==l?void 0:l.bandwidth):(null==i?void 0:i.height)-(null==l?void 0:l.height)})))}else{var v,r,h=null==t||null===(v=t.dash)||void 0===v||null===(r=v.mediaPlayer)||void 0===r?void 0:r.getBitrateInfoListFor("video");(null==h?void 0:h.length)>0&&(e=null==h?void 0:h.sort((function(l,i){return i.height-l.height})))}return e};
|