@viewlift/player-backup 2.0.152-backup → 2.0.153-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/bundle.css CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
 
6
6
 
7
+
7
8
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
8
9
  height: 0.7em;
9
10
  position: absolute;
@@ -223,7 +224,6 @@
223
224
  font-weight: bold
224
225
  }
225
226
 
226
-
227
227
  /* CSS for videojs-dvr-seekbar */
228
228
 
229
229
  .video-js.vjs-dvr-seekbar {
@@ -397,6 +397,7 @@
397
397
 
398
398
 
399
399
 
400
+
400
401
  .video-js .multicamera-parent.default{
401
402
  height: 345px;
402
403
  position: absolute;
@@ -479,7 +480,6 @@
479
480
 
480
481
 
481
482
 
482
-
483
483
  /* nextep */
484
484
  .next-ep-preview{
485
485
  position: absolute;
@@ -0,0 +1 @@
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator");require("axios");var o=require("./generic-04e8a4ee.js"),r=require("./player_instance-fcf6a8fb.js"),i=require("video.js"),l=require("./util-13a95346.js"),a=require("./captions-dbc83a75.js"),u=require("./resolution-f9dcc1b4.js"),s=require("./skin-516012d7.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-31d70bec.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-a50a8ffc.js"),g=require("@babel/runtime/helpers/toConsumableArray"),m=function(e){return new Promise((function(n,t){if(y(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},y=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},h=function(e,n,t){var o=r.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var n=r.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var e=n(t.mark((function e(n){var l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(i),e.finish(13);case 16:(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==a||a.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==o.detectBrowser()?null==a||a.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t=r.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,r,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}}))};var S=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),m("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.js")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-3854764f.js")}));case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),j=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:S,loadEMELibrary:O,loadMuxPlugin:I,loadDvrSeekbar:P,loadContribDash:T});function C(e){return E.apply(this,arguments)}function E(){return(E=n(t.mark((function e(n){var r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(null==n?void 0:n.airplay)||!1,e.next=3,S();case 3:r&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return j})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,n){return x.apply(this,arguments)}function x(){return(x=n(t.mark((function e(n,r){var i,l,a,u,s,d,c,v,p,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=(null==r?void 0:r.contentType)||"video",v=null==r||null===(i=r[c])||void 0===i?void 0:i.drmEnabled,null==r||null===(l=r[c])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==r||null===(u=r[c])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==o.detectBrowser()?O():"caliente"!=(null===(f=window)||void 0===f?void 0:f.siteName)?T():O():"Safari"!=o.detectBrowser()&&p?T():null,w(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function R(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function L(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?R(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):R(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var A=new Set,N=null,V=function(e,n,t){var r,i,l,a,u,s,d,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(r=e[p])||void 0===r?void 0:r.id)||"Null",v["c3.cm.contentType"]=F(e),v[null==t||null===(i=t.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===o.getUserId()?"NULL":o.getUserId(),v["c3.cm.categoryType"]=H(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(s=e[p])&&void 0!==s&&null!==(d=s.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[t.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=U(e),v["c3.cm.genreList"]=M(e),v["c3.cm.genre"]=_(e),v["c3.cm.channel"]=B(e);var f=J(c.getCurrentSeries(),e);return v=L(L({},v),f)},_=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},M=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},B=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},H=function(e){return(null==e?void 0:e.contentType)||"null"},U=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},q=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},F=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var W,G,J=function(e,n){var t,r,i,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var s=o.getSeasonNumber(),d=o.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(r=t.series)||void 0===r?void 0:r.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[s-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},K=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},z=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},X=function(){var e=n(t.mark((function e(n,o){var i,l,a,u,s,d,v,p,f,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,a=i.paymentHandler,u=i.tveProvider,s=i.enable,d=i.appName,v=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(p=r.getPlayer(n),"function"==typeof(f=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(g=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=K(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})})),n||f("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var e,n;N&&N!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),A.clear(),N=p.currentSrc();var t=z(p.currentType()),r=c.getCurrentVideo(),i=V(r,p,g);i[null==g||null===(e=g.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",i[null==g||null===(n=g.Constants)||void 0===n?void 0:n.ASSET_NAME]=q(r,o),i.authToken=v||"NULL",i.streamType=t,i.D2CType=a||"NONE",i.subscriberType=u||(a?"D2C":"FREE"),i["c3.cm.affiliate"]=u||"NULL",Y.setData(i),f("contentInfo",i)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})})),p.on("play",(function(){A.has(p.currentSrc())||(A.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){A.has(p.currentSrc())&&A.delete(p.currentSrc()),f("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==A||A.clear(),f("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Y=(W={},{setData:function(e){W=L(L({},W),e)},getData:function(){return W}}),Q=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-c66f708d.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-e715e264.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-3d24dba4.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-54812f5e.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-71930b6b.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-7ddd73cc.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t&&Promise.resolve().then((function(){return require("./skin-a867a331.js")})).then((function(t){t.initialiseSkin(e,n)}))};function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Z(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):$(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var ee=[],ne=0,te=null;function oe(){console.log("Cleaning up watch history data"),G=null,ee=[],ne=0,te=null}function re(e,n,t){var r,i,l,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(r=n.watchHistory)||void 0===r||r.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(e.currentTime()),m=s?100:Math.floor(c/v*100),y={};f?le(y={completed:s,watchedTime:g,watchedPercentage:m},d,n.siteOwner):(y=Z(Z({videoId:G,watchedTime:g,watchedPercentage:m,doneWatching:s,profileId:d},te&&{seriesId:te}),p&&{originalObjectId:p}),o.saveWatchHistory(y).then((function(e){})).catch((function(e){}))),ne=c+t}function ie(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function le(n,t,o){var r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),i=ie(r),l=(new Date).getTime(),a=c.getCurrentVideo(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return Z(Z({},n),{},e({},t,u[t]))}),{}),d=i.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===G}));d<0?i.push(Z(Z({content:s},n),{},{addedDate:l,updateDate:l})):i[d]=Z(Z(Z({},i[d]),n),{},{updateDate:l}),localStorage.setItem("".concat(r),JSON.stringify(i))}function ae(e,n,t){var o=ie(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),r}var ue=!1,se=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!ue){var l=de(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,n);return a&&o.loadVideo(n,a),ue=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function de(e,n,t){if(Array.isArray(e))return e.map((function(e){return de(e,n,t)}));if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach((function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=de(e[r],n,t)})),o}return e}function ce(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ve(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ve(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function ve(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function fe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):pe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var ge=function(e,n,t,i){var l,u,s,d,p,f=i.res,g=i.sres,m=r.getPlayer(e),y=(null==f?void 0:f.contentType)||"video",b=(null==f||null===(l=f[y])||void 0===l?void 0:l.drmEnabled)||!1,w=(null==f||null===(u=f[y])||void 0===u||null===(s=u.streamingInfo)||void 0===s?void 0:s.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),m&&(m.on("loadstart",(function(){w?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(fe({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:f}:{response:f}))})),m.on("loadeddata",(function(){var t,i,l,u=a.getCaptions(e);if(null==u||u.map((function(n){return a.disableCaptions(e,n.id)})),k&&"Safari"===o.detectBrowser())try{var s;null==m||null===(s=m.liveTracker)||void 0===s||s.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&h(e,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(o.clearError(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,g=fe(fe({},n),f);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(te=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ee=[],ne=0,G=t;var a=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,u=r.getPlayer(e);u&&(u.on("dispose",oe),u.on("timeupdate",(function(){if(!u.seeking()){var e=Math.floor(u.currentTime());ee.includes(ne)||(e!=ne||e<a?e>ne&&(ne=e+a):(ee.push(e),re(u,n,a)))}})),u.one("ended",(function(){re(u,n,a,!0)})))}(e,g,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var y,b,w,S,O,I,P=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),T=null==P?void 0:P.gist,j={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==P||null===(S=P.series)||void 0===S?void 0:S.title,video_stream_type:null!=P&&null!==(O=P.streamingInfo)&&void 0!==O&&O.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:j})}})),m.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,r,i,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var g,m=f.getMediaSession(),y=m.media.tracks.filter((function(e){return"TEXT"==e.type}));g=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),m.editTracksInfo(g)}})),m.tech_.on("retryplaylist",(function(){w&&se(f,e)})),m.on("error",(function(){var n,r;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&w)?se(f,e):(o.handleError(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(r=m.error())||void 0===r?void 0:r.message)||"Some error occured",response:f}))})),m.one("play",(function(){var e,t,o,r,i;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout((function(){m.currentTime(p)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(w){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})),m.one("loadeddata",(function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==v(m.dash)){var t,r,i,l=null==m||null===(t=m.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),u=ce(n);try{for(u.s();!(i=u.n()).done;){var s=i.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=ce(n);try{for(c.s();!(d=c.n()).done;){var p,f,g,y=d.value;if(("Chrome"==o.detectBrowser()||"Edge"==o.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!b))&&null!=y&&null!==(g=y.label)&&void 0!==g&&g.includes("5.1"))m.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function me(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function ye(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function he(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function be(e,n){var t=r.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var a=i.playLive,u=i.playFromBegining,s=i.programs;c.setCurrentEpgPrograms(s),t.on("loadeddata",(function(){f.checkDvrStartOverEnabled(n)?u?f.playFromBeginningHandler(t,n):a?f.playLiveOrResumeHandler(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,r=n.videoId,i=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,u=a.watchLive;a.resume;var s=a.startFromBegining,d=r;if(i&&null!=i&&i.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var g=f.getCurrentProgramThumbnail(n);g&&(p.style.backgroundImage="url(".concat(g,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=ke(o,v),p.style.display="flex",e.el().appendChild(p),f.pauseAndHideControl(e),we("watch-live-resume-btn",u,(function(){f.showControl(e,p),f.playLiveOrResumeHandler(e,d)})),we("watch-begining-btn",s,(function(){f.showControl(e,p),f.playFromBeginningHandler(e,n)}))}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),r=!1,i=e.seekable(),l=i.start(0),a=i.end(i.length-1)-l,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",(function(){r=!0})),e.on("seeked",(function(){r=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(s,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!r){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(s,t),o=t,function(e,n){he(n).forEach((function(t){var o=t.id,r=t.title,i=t.time,l=document.getElementById(o);if(l){var a=Math.min(i/n*100,99.5);l.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=me(o,r,Math.min(i/n*100,99.5));u.appendChild(s)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function we(e,n,t){var o,r,i=document.getElementById(e);i&&(r=n,(o=i)&&(o.style.color="".concat((null==r?void 0:r.textColor)||"#000"),o.style.backgroundColor="".concat((null==r?void 0:r.backGroundColor)||"#DCF95B")),i.addEventListener("click",t))}function ke(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,r=t.resume,i=t.startFromBegining,l=n?(null==r?void 0:r.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==i?void 0:i.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}function Se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Oe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Se(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Ie=function(l,u,d,c){var v,p,f,g,m,y,h,b,w,S,O,I,P,T,j,C,E,x,R,L,A,N,V,_,M,B,H,U,q,F,W,G,J,K,z,$,Z,ee,ne,te,oe=u.res,re=void 0===oe?null:oe,ie=u.sres,le=void 0===ie?null:ie,ae=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(v=re)||void 0===v?void 0:v.contentType)||"video",se=s.impolicy16x9(null===(p=re)||void 0===p||null===(f=p[ue])||void 0===f||null===(g=f.gist)||void 0===g?void 0:g.videoImageUrl)||s.impolicy16x9(null===(m=re)||void 0===m||null===(y=m[ue])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),de=(null===(w=re)||void 0===w||null===(S=w[ue])||void 0===S||null===(O=S.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,ce=(null===(I=re)||void 0===I||null===(P=I[ue])||void 0===P||null===(T=P.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,ve=(null===(j=re)||void 0===j||null===(C=j.ads)||void 0===C||null===(E=C.preRoll)||void 0===E||null===(x=E.adTags)||void 0===x||null===(R=x.web)||void 0===R?void 0:R.active)&&(null===(L=re)||void 0===L||null===(A=L.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(V=N.adTags)||void 0===V||null===(_=V.web)||void 0===_?void 0:_.url),pe=(null===(M=re=Oe(Oe({},re),{},{audioAssetSource:null==d?void 0:d.audioAssetSource}))||void 0===M||null===(B=M[ue])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(U=H.app_data)||void 0===U||null===(q=U.appcmsMain)||void 0===q||null===(F=q.adsConfig)||void 0===F?void 0:F.vodAdSticherProvider)||!1,fe=(null==d?void 0:d.latency)||6,me=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var ye=(ne={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==me?void 0:me.pictureInPictureToggle)||!1},playbackRates:null!=me&&me.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:de},e(ne,"autoplay",null==d?void 0:d.autoplay),e(ne,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!ve),e(ne,"loop",(null==d?void 0:d.loop)||!1),e(ne,"audioPosterMode",null==d?void 0:d.audioPosterMode),e(ne,"html5",Oe(Oe({dash:Oe(Oe(Oe({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(W=d.debugConfig)||void 0===W?void 0:W.enable)&&{debug:!0,logLevel:null!=d&&null!==(G=d.debugConfig)&&void 0!==G&&G.logLevel?null==d||null===(J=d.debugConfig)||void 0===J?void 0:J.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:fe},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Oe(Oe({liveRangeSafeTimeDelta:fe,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==d||null===(K=d.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(z=null==d?void 0:d.enableLowInitialPlaylist)||void 0===z||z}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===($=d.debugConfig)||void 0===$?void 0:$.enable)||!1,nativeTextTracks:"Safari"==o.detectBrowser()},0==(null==d||null===(Z=d.customData)||void 0===Z?void 0:Z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(ee=d.customData)||void 0===ee?void 0:ee.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ne,"poster",se),e(ne,"techOrder",ae),e(ne,"chromecast",{requestCustomDataFn:function(e){var n,t,o=r.getPlayer(l),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,r,i,l,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var g,m,y,h,b,w,k,S;f.isDrmEnabled=!0;var O=(null==n||null===(g=n.keySystems)||void 0===g?void 0:g["com.widevine.alpha"])||null,I=(null==O?void 0:O.url)||(null==n||null===(m=n.keySystemOptions)||void 0===m||null===(y=m[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=I;var P=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=P}var T=(null==e||null===(o=e[p])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";f.contentType=T;var j=null==e||null===(i=e[p])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;f.duration=j;var C=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=C;var E=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(re,e,i);return Oe(Oe({},a),{},{convivaMetaData:Oe({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},Y.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,a,u=r.getPlayer(l),s=(null==u?void 0:u.currentSource())||{};!(null===(n=re)||void 0===n||null===(t=n[ue])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(a=s.src)&&void 0!==a&&a.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ne);if(!i.getPlayers()[l]){null!=d&&d.debugConfig&&null!=d&&null!==(te=d.debugConfig)&&void 0!==te&&te.enable&&i.log.level("debug");var he=i(l,ye,function(){var e=n(t.mark((function e(){var n,r,u,s,v,p,f,g,m,y,h,b,w,S,O,I,P,T,j,C,E,x;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(he),console.log(i.VERSION),console.log(i.getPlugins()),e.next=5,D(d,re);case 5:if(w=null===(n=re)||void 0===n||null===(r=n[ue])||void 0===r||null===(u=r.liveDetails)||void 0===u?void 0:u.startOverTime,ce&&c.resolve(Oe({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:re}:{response:re})),S={},de&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&be(l,Oe(Oe({},d),{},{isDvrEnabled:de})),o.inititateBeacon(l,null==d?void 0:d.analyticsCb,S),X(l,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),de&&k(l,w),!ve||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(l,ve,re),O=o.getSource(re,l),console.log(O),null!=d&&d.nearestClusterUrl&&(O=o.getUpdatedClusterSource(O,d.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,o.getSGAIEnabledSource(l,re);case 20:O=e.sent;case 21:O?o.loadVideo(l,O):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:re}),o.handleError(l,"Incompatible / Missing Source")),((null===(p=re)||void 0===p||null===(f=p[ue])||void 0===f||null===(g=f.contentDetails)||void 0===g||null===(m=g.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=re)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(x=(null===(P=re)||void 0===P||null===(T=P[ue])||void 0===T||null===(j=T.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null===(C=re)||void 0===C||null===(E=C[ue])||void 0===E?void 0:E.closedCaptions),I=x.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),a.addCaptions(l,I)),null!=d&&d.disableControls?o.disableControls(l):Q(l,Oe(Oe(Oe({},d),ye),{},{liveVideo:ce,isDvrEnabled:de,res:re,sres:le})),ge(l,Oe(Oe(Oe({},d),ye),{},{liveVideo:ce}),c,{res:re,sres:le});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},Pe={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Te(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function je(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Te(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Ce,Ee=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=De(e);Ie(r,{res:i},e,{resolve:t,reject:o})},De=function(e){var n,t,r,i,l,a,u,s,d=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,v=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,p=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.url)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,m=(null==e||null===(a=e.streamingInfo)||void 0===a?void 0:a.subtitles)||[],y=(null==e||null===(u=e.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,h=null==e?void 0:e.token,b=o.getDecodedToken(h),w=null==b?void 0:b.site;return je(je({id:null==Pe?void 0:Pe[w]},!v&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:v,streamingInfo:{videoAssets:je(je({},y&&{drmProvider:y}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==d?void 0:d.isDvrEnabled},gist:je({},f&&{videoImageUrl:f}),contentDetails:je({},(null==m?void 0:m.length)>0&&{closedCaptions:g(m)})},ads:{preRoll:{adTags:{web:je(je({},p&&{active:!0}),p&&{url:p})}}}})};function xe(e,n){return Re.apply(this,arguments)}function Re(){return(Re=n(t.mark((function e(n,r){var i,l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.resolve,l=r.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,o.getToken();case 6:d=e.sent,o.getVideoDetails(a,d).then((function(e){var t,r,v,p;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(v=r.gist)||void 0===v?void 0:v.contentType,c.setCurrentVideo(null==e?void 0:e.data);var f,g=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(p=n.watchHistory)&&void 0!==p&&p.enable&&!s)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,y,h,b=ae((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;g.contentType="video",Ie(u,{res:g},n,{resolve:i,reject:l})}else o.getVideoInfo(a,d).then((function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,g.contentType="video"})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})).finally((function(){Ie(u,{res:g},n,{resolve:i,reject:l})}));else Ie(u,{res:g},n,{resolve:i,reject:l})})).catch((function(e){o.initiateErrorHandling(e,u,l,a)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(e,n){return Ae.apply(this,arguments)}function Ae(){return(Ae=n(t.mark((function e(n,r){var i,l,a,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.resolve,l=r.reject,e.next=3,o.getToken();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,o.getLinearChannelDetails(s,a).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Ie(u,{res:t},n,{resolve:i,reject:l})})).catch((function(e){o.initiateErrorHandling(e,u,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(e,n){return Ve.apply(this,arguments)}function Ve(){return(Ve=n(t.mark((function e(n,r){var i,l,a,u,s,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r.resolve,a=r.reject,e.next=3,o.getToken();case 3:u=e.sent,s=null==n?void 0:n.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==n||null===(i=n.series)||void 0===i?void 0:i.id,o.getSeriesDetails(v,u).then((function(e){var t,r,i,d=e.data,p=e.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(t=p[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.id);o.createSeriesWatchMap(v,u),o.getVideoDetails(f,u).then((function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(e.data),Ie(s,{res:null==e?void 0:e.data,sres:d},n,{resolve:l,reject:a})})).catch((function(e){o.initiateErrorHandling(e,s,a,videoId)}))})).catch((function(e){o.initiateErrorHandling(e,s,a)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Me(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):_e(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}exports.VLPlayerCore=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var r=n(t.mark((function n(r,i){var l,a,u,c,v,p,f,g,y,h,b,w,k,S,O,I,P,T,j,E,D,x,R,L,A;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(k=(null==e?void 0:e.videoSourceUrl)||!1,S=null==e?void 0:e.asat,O=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,I=null==e?void 0:e.videoId,P=(null==e||null===(a=e.series)||void 0===a?void 0:a.enable)||!1,T=(null==e?void 0:e.streamingInfo)||!1,window.videoId=I,j=null==e?void 0:e.token,!o.token_authentication_enabled(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),o.refreshTokenManager().set(null==e?void 0:e.refreshToken),j&&!o.isTokenExpired(j)){n.next=16;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:Ce=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(u=Ce)||void 0===u?void 0:u.site,window.siteId=null===(c=Ce)||void 0===c?void 0:c.siteId,e.isAnonymousUser=!(null===(v=Ce)||void 0===v||!v.anonymousId),e.siteOwner=(null===(p=Ce)||void 0===p?void 0:p.site)||null,e.userId=(null===(f=Ce)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(g=Ce)||void 0===g?void 0:g.userId),window.watchHistory=e.watchHistory||null,E=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(y=e.series)&&void 0!==y&&y.enable?null:null==e?void 0:e.chromecastReceiverId,D=(null==e||null===(h=e.analytics)||void 0===h?void 0:h.gaId)||null,(x=null==e?void 0:e.errors)&&(window.customErrors=x),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(b=e.customData)||void 0===b?void 0:b.localisation),o.baseUrlManager.set(e.apiBaseUrl),null!=e&&e.skin&&!s.isNotAValidSkin(e.skin)||(e.skin="VL_ONE"),n.next=35,C(e);case 35:D&&m("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then((function(){return o.runGtag(D)})).catch((function(e){})),(R=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(E)))&&R.addEventListener("contextmenu",(function(e){return e.preventDefault()})),k?(A={directPlaybackUrl:k,id:L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?o.getVideoDetails(L,j).then((function(n){var t=(null==n?void 0:n.data)||{};Ie(E,{res:Me(Me({},t),A)},e,{resolve:r,reject:i})})).catch((function(e){o.initiateErrorHandling(e,E,i,L)})):Ie(E,{res:A},e,{resolve:r,reject:i})):T?Ee(e,{resolve:r,reject:i}):P?Ne(e,{resolve:r,reject:i}):O?Le(e,{resolve:r,reject:i}):xe(e,{resolve:r,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return r.apply(this,arguments)}}())},getRenditions:u.getRenditions,skip:o.skip,getPlayer:r.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,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:a.enableCaptions,disableCaptions:a.disableCaptions,getCaptions:a.getCaptions,playSelectedResolution:u.playSelectedResolution,getSource:o.getSource,setVolume:h,getVolume:b,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:o.getEntitlementData,adsQueuePointManager:o.adsQueuePointManager,getSsaiEvents:o.getSsaiEvents,playerEvents:l.playerEvents,onReplay:l.onReplay}},exports.initiateMarker=function(e){var n=r.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;ye(),he(l).forEach((function(e){var n=e.id,t=e.title,r=e.time,i=me(n,t,Math.min(r/l*100,99.5));o.appendChild(i)}))}},exports.removeMarkers=ye;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./generic-04e8a4ee.js"),require("./player_instance-fcf6a8fb.js"),require("video.js");var e=require("./index-86235530.js");require("./util-13a95346.js"),require("./captions-dbc83a75.js"),require("./resolution-f9dcc1b4.js"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("js-cookie"),require("./currentVideoInfo-31d70bec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/typeof"),require("./icons-2609dbe4.js"),require("./helper-a50a8ffc.js"),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"),module.exports=e.VLPlayerCore;
1
+ "use strict";require("video.js/dist/video-js.min.css"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("./generic-04e8a4ee.js"),require("./player_instance-fcf6a8fb.js"),require("video.js");var e=require("./index-804f617a.js");require("./util-13a95346.js"),require("./captions-dbc83a75.js"),require("./resolution-f9dcc1b4.js"),require("./skin-516012d7.js"),require("./localisation-56e0a999.js"),require("js-cookie"),require("./currentVideoInfo-31d70bec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/typeof"),require("./icons-2609dbe4.js"),require("./helper-a50a8ffc.js"),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"),module.exports=e.VLPlayerCore;
@@ -1 +1 @@
1
- "use strict";var e=require("./features-85633418.js"),n=require("./player_instance-fcf6a8fb.js"),t=require("./index-4be4e08d.js"),r=require("./generic-04e8a4ee.js");require("videojs-contrib-quality-menu");var l=require("./index-86235530.js"),o=require("./helper-a50a8ffc.js"),i=require("./currentVideoInfo-31d70bec.js"),a=require("video.js"),d=require("@babel/runtime/helpers/toConsumableArray"),s=require("@babel/runtime/helpers/asyncToGenerator"),u=require("@babel/runtime/regenerator");require("@babel/runtime/helpers/defineProperty"),require("js-cookie");var c=require("./skin-516012d7.js");require("axios");var v=require("./icons-2609dbe4.js");require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./resolution-f9dcc1b4.js"),require("@babel/runtime/helpers/assertThisInitialized"),require("./localisation-56e0a999.js"),require("./autoNextVideo-c77ff5db.js"),require("./util-13a95346.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("./captions-dbc83a75.js"),require("video.js/dist/video-js.min.css");function p(a,d){var s=n.getPlayer(a);s&&(s.on("loadeddata",(function(){var e,u,c,v,p,m=o.checkDvrStartOverEnabled(d),f=i.getCurrentEpgPrograms();s.qualityLevels()&&s.qualityLevels().length&&function(e){var t=n.getPlayer(e);t&&(null==t||t.qualityMenu,t.qualityMenu({useResolutionLabels:!0}))}(a),!(null!=d&&null!==(e=d.series)&&void 0!==e&&e.enable||null!==(u=window)&&void 0!==u&&null!==(c=u.app_data)&&void 0!==c&&null!==(v=c.appcmsMain)&&void 0!==v&&null!==(p=v.features)&&void 0!==p&&p.auto_play)||null!=d&&d.liveVideo||t.addNextEpPreview(a,d),null!=d&&d.liveVideo||r.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||t.initiateTrickplay(a),m&&f&&f.length?l.initiateMarker(a):l.removeMarkers()})),s.one("play",(function(){var n,t,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.iframeOverlayUrl&&e.addOutputtingOverlay(a,null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.iframeOverlayUrl)})))}function m(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return f(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}function f(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function y(){return y=s(u.mark((function e(t){var l,o,i,a,v,p,f,y,h,b,g,S,k,w,E,j,q,I,C,B,A,T,M,P,x,L,_,V;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:V=function(e,l,o,i,a){var d=n.getPlayer(t);if(!d.seeking()){l.startTimeInSeconds,l.durationInSeconds,Math.floor(d.currentTime());var s,u=m(o);try{for(u.s();!(s=u.n()).done;){var c,v,p,f=s.value,y=f.eventType,h=f.beaconUrls,b=f.startTimeInSeconds,g=f.startTime,S=f.durationInSeconds,k=b||0,w=h,E=(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(p=v.ads)||void 0===p?void 0:p.adEventHandler)||null,j="".concat(k,"_").concat(y),q=x.get("pod-".concat(a))||[];if(console.warn(e,k,"map:",y,"condition1:",e>=k,"map:",x),e>=k&&e<=k+L&&!q.includes(j)){q.push(j),x.set("pod-".concat(a),q);try{_(y,l,w,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,l)}if("function"==typeof E)try{var I,C={eventType:y,startTimeInSeconds:b,startTime:g,durationInSeconds:S,ad:null==l||null===(I=l.ads)||void 0===I?void 0:I[i],adIndex:i};E({adsData:C}),r.triggerSSAIEvents(t,C)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){u.e(e)}finally{u.f()}}},_=function(e,n,t,r){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},P=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},S=function(){g&&clearInterval(g)},h=r.trackingUrlManager.get(),b=n.getPlayer(t),g=null,b.one("loadeddata",(function(){g=setInterval((function(){h&&!b.paused()&&M(h)}),4e3)})),b.on("sourceset",(function(e){console.log(e,"sourceset")})),b.on("dispose",(function(){S()})),k=new Map,w=new Map,E=-1,j=null,q=(null===(l=document)||void 0===l||null===(o=l.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])||null,I=(null==b||null===(i=b.controlBar)||void 0===i?void 0:i.getChild("videoSelector"))||null,C=(null==b||null===(a=b.controlBar)||void 0===a?void 0:a.getChild("seriesV2"))||null,B=(null==b||null===(v=b.el())||void 0===v||null===(p=v.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===p?void 0:p[0])||null,A=(null==b||null===(f=b.el())||void 0===f||null===(y=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===y?void 0:y[0])||null,T=!1,M=function(){var e=s(u.mark((function e(l){var o,i,a,s,v,p,m,f,y,h,b,g,S,M,x,L,_,N;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=new URL(l),j&&s.searchParams.append("nextToken",j),e.next=4,fetch(s.toString(),{method:"GET"});case 4:return v=e.sent,e.next=7,v.json();case 7:if(p=e.sent,m=p.avails,f=p.nextToken||null,j=f,y=[],h=n.getPlayer(t),b=h.controlBar.progressControl,g=b.seekBar.el(),null===(o=document)||void 0===o||o.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),m.map((function(e,n){var t,r;y.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(t=e.adBreakTrackingEvents)||void 0===t||null===(r=t.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===r?void 0:r[0])||[]})})),null!=y&&y.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",y),window.adsQueueList=y),console.log(y,"data"),y.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,r=h.duration();if(!(n>r||Array.isArray(t)&&0==(null==t?void 0:t.length))){var l=n/r*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(l,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(l,"%"),o.style.pointerEvents="none",g.appendChild(o)}})),T||(M=null===(S=document.getElementsByClassName("ssai-ad-container"))||void 0===S?void 0:S[0])&&(M.style.display="none"),!T||!h._timeUpdateHandler){e.next=23;break}return e.abrupt("return");case 23:h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=c.throttle((function(){var e=h.currentTime();if(e!==E){E=e;for(var n=function(){var n=y[t],l=n.startTimeInSeconds,o=n.durationInSeconds,i=n.ads,a=l+o;if(e>=l-1.2&&e<=a+1.2){T=!!(e>=l&&e<=a&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>a&&k.set(l,!0),r.keyboardManager.disable(),q&&q.classList.add("vjs-hidden"),B&&(B.style.pointerEvents="none",B.classList.add("vjs-hidden")),A&&(A.style.pointerEvents="none",A.classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.el().classList.add("vjs-hidden")),C&&(C.el().style.pointerEvents="none",C.el().classList.add("vjs-hidden")),b.el().classList.add("hide-progress-bar");for(var s=e-l,u=0,c=0,v=0;v<i.length;v++){var p,m=null==i||null===(p=i[v])||void 0===p?void 0:p.durationInSeconds;if(s<u+m){c=v;break}u+=m}i[c];var f=Math.max(0,o-s),h=Math.round(f);x.style.display="block",N.textContent="".concat(c+1," of ").concat(i.length," • ").concat(P(h));var g=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));g.push.apply(g,d(n))})),Array.isArray(i)&&0==(null==i?void 0:i.length)&&g.push(null==n?void 0:n.podSlotImpressionBeacon),V(e,n,g,c,t),"break"}w.delete(l)},t=0;t<y.length;t++){if("break"===n())break}T||(x.style.display="none",b.el().classList.remove("hide-progress-bar"),I&&(I.el().style.pointerEvents="auto",I.el().classList.remove("vjs-hidden")),C&&(C.el().style.pointerEvents="auto",C.el().classList.remove("vjs-hidden")),q&&q.classList.remove("vjs-hidden"),B&&(B.style.pointerEvents="auto",B.classList.remove("vjs-hidden")),A&&(A.style.pointerEvents="auto",A.classList.remove("vjs-hidden")),r.keyboardManager.enable())}}),1e3),h.on("timeupdate",h._timeUpdateHandler),null===(i=document)||void 0===i||null===(a=i.querySelectorAll(".ssai-ad-container"))||void 0===a||a.forEach((function(e){return null==e?void 0:e.remove()})),(x=document.createElement("div")).className="ssai-ad-container",(L=document.createElement("div")).className="sponsored-adbox",(_=document.createElement("div")).className="sponsored-text",_.textContent="Sponsored Ad",L.append(_),(N=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",x.append(L),x.append(N),h.el().appendChild(x);case 42:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),x=new Map,L=2.5;case 23:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}var h=function(e,t){var r,l,o,i,d,s,u,c,v,p,m,f,y=n.getPlayer(e),h=(null==t?void 0:t.theme)||{},b=a.dom.$(".vjs-play-progress"),g=a.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");g&&(g.style.color="".concat(null===(r=window)||void 0===r||null===(l=r.app_data)||void 0===l||null===(o=l.appcmsMain)||void 0===o||null===(i=o.brand)||void 0===i||null===(d=i.cta)||void 0===d||null===(s=d.primary)||void 0===s?void 0:s.backgroundColor)),b&&(b.style.background="".concat(null===(u=window)||void 0===u||null===(c=u.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v||null===(p=v.brand)||void 0===p||null===(m=p.cta)||void 0===m||null===(f=m.primary)||void 0===f?void 0:f.backgroundColor));var S=y.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&b&&(b.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&S&&(S.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&g&&(g.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?S.el().style.borderRadius=".3em":S.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(l,a){n.getPlayer(l).addClass("skin_vlone"),p(l,a),function(n,l){var a,d,s,u,c,p,m,f,h,b,g,S,k,w,E,j=(null==l?void 0:l.liveVideo)||!1,q=(null==l||null===(a=l.res)||void 0===a||null===(d=a.video)||void 0===d?void 0:d.isSSAIEnabled)||!1,I=r.getSource(null==l?void 0:l.res,n)||{};I.src;var C=(null==l?void 0:l.skin_settings)||{};o.checkDvrStartOverEnabled(l),null!=C&&C.skipBtn&&0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&e.addSkipButton(n,"VL_ONE",v.SkipSvgV2());(null!=C&&C.rewindBtn&&0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&e.addRewindButton(n,"VL_ONE",v.RewindSvgV2());(null==l||null===(s=l.relatedVideos)||void 0===s||null===(u=s.content)||void 0===u?void 0:u.length)>0&&e.addVideoSelector(n,null==l?void 0:l.relatedVideos);null!=l&&null!==(c=l.series)&&void 0!==c&&c.enable&&e.addSeriesSelectorV2(n,l);(null==l||null===(p=l.streams)||void 0===p?void 0:p.length)>1&&e.addMulticamSelector(n,null==l?void 0:l.streams);if(t.addTVProviderImage(n,l),r.initialiseKeyboardEvents(n,l),"MEDIA_TAILOR"==(null===(m=window)||void 0===m||null===(f=m.app_data)||void 0===f||null===(h=f.appcmsMain)||void 0===h||null===(b=h.adsConfig)||void 0===b?void 0:b.vodAdSticherProvider)&&null!==(g=window)&&void 0!==g&&null!==(S=g.app_data)&&void 0!==S&&null!==(k=S.appcmsMain)&&void 0!==k&&null!==(w=k.adsConfig)&&void 0!==w&&w.vodAdClientSideTracking&&q)if(j)!function(e){y.apply(this,arguments)}(n);else{var B,A=null;if(null!=l&&null!==(B=l.series)&&void 0!==B&&B.enable){var T,M,P,x,L,_=null===(T=i.getCurrentVideo())||void 0===T||null===(M=T.video)||void 0===M||null===(P=M.gist)||void 0===P?void 0:P.id,V=i.getSeriesWatchMap(),N=(null==V?void 0:V.get(_))||{t:0,p:0},O=N.t,D=N.p;"function"==typeof(null===(x=window)||void 0===x||null===(L=x.watchHistory)||void 0===L?void 0:L.cb)&&window.watchHistory.cb({watchedTime:O}),D<95&&(A=O)}else{var U=l.watchHistoryResumeTime;l.watchedPercentage<95&&(A=U)}r.setupAdvertisementMarkers(n,A)}null!=l&&l.isDvrEnabled&&null!=l&&null!==(E=l.dvrConfig)&&void 0!==E&&E.enable&&(e.addStartFromBeginningButton(n,l),e.addWatchLiveButton(n,l))}(l,a),h(l,a)};
1
+ "use strict";var e=require("./features-85633418.js"),n=require("./player_instance-fcf6a8fb.js"),t=require("./index-4be4e08d.js"),r=require("./generic-04e8a4ee.js");require("videojs-contrib-quality-menu");var l=require("./index-804f617a.js"),o=require("./helper-a50a8ffc.js"),i=require("./currentVideoInfo-31d70bec.js"),a=require("video.js"),d=require("@babel/runtime/helpers/toConsumableArray"),s=require("@babel/runtime/helpers/asyncToGenerator"),u=require("@babel/runtime/regenerator");require("@babel/runtime/helpers/defineProperty"),require("js-cookie");var c=require("./skin-516012d7.js");require("axios");var v=require("./icons-2609dbe4.js");require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./resolution-f9dcc1b4.js"),require("@babel/runtime/helpers/assertThisInitialized"),require("./localisation-56e0a999.js"),require("./autoNextVideo-c77ff5db.js"),require("./util-13a95346.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("./captions-dbc83a75.js"),require("video.js/dist/video-js.min.css");function p(a,d){var s=n.getPlayer(a);s&&(s.on("loadeddata",(function(){var e,u,c,v,p,m=o.checkDvrStartOverEnabled(d),f=i.getCurrentEpgPrograms();s.qualityLevels()&&s.qualityLevels().length&&function(e){var t=n.getPlayer(e);t&&(null==t||t.qualityMenu,t.qualityMenu({useResolutionLabels:!0}))}(a),!(null!=d&&null!==(e=d.series)&&void 0!==e&&e.enable||null!==(u=window)&&void 0!==u&&null!==(c=u.app_data)&&void 0!==c&&null!==(v=c.appcmsMain)&&void 0!==v&&null!==(p=v.features)&&void 0!==p&&p.auto_play)||null!=d&&d.liveVideo||t.addNextEpPreview(a,d),null!=d&&d.liveVideo||r.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||t.initiateTrickplay(a),m&&f&&f.length?l.initiateMarker(a):l.removeMarkers()})),s.one("play",(function(){var n,t,r,l;null!==(n=window)&&void 0!==n&&null!==(t=n.customData)&&void 0!==t&&t.iframeOverlayUrl&&e.addOutputtingOverlay(a,null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l?void 0:l.iframeOverlayUrl)})))}function m(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return f(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}function f(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function y(){return y=s(u.mark((function e(t){var l,o,i,a,v,p,f,y,h,b,g,S,k,w,E,j,q,I,C,B,A,T,M,P,x,L,_,V;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:V=function(e,l,o,i,a){var d=n.getPlayer(t);if(!d.seeking()){l.startTimeInSeconds,l.durationInSeconds,Math.floor(d.currentTime());var s,u=m(o);try{for(u.s();!(s=u.n()).done;){var c,v,p,f=s.value,y=f.eventType,h=f.beaconUrls,b=f.startTimeInSeconds,g=f.startTime,S=f.durationInSeconds,k=b||0,w=h,E=(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(p=v.ads)||void 0===p?void 0:p.adEventHandler)||null,j="".concat(k,"_").concat(y),q=x.get("pod-".concat(a))||[];if(console.warn(e,k,"map:",y,"condition1:",e>=k,"map:",x),e>=k&&e<=k+L&&!q.includes(j)){q.push(j),x.set("pod-".concat(a),q);try{_(y,l,w,d)}catch(e){console.error("Error when calling triggerAdBeacon:",e,y,l)}if("function"==typeof E)try{var I,C={eventType:y,startTimeInSeconds:b,startTime:g,durationInSeconds:S,ad:null==l||null===(I=l.ads)||void 0===I?void 0:I[i],adIndex:i};E({adsData:C}),r.triggerSSAIEvents(t,C)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){u.e(e)}finally{u.f()}}},_=function(e,n,t,r){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",n),null==t||t.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},P=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},S=function(){g&&clearInterval(g)},h=r.trackingUrlManager.get(),b=n.getPlayer(t),g=null,b.one("loadeddata",(function(){g=setInterval((function(){h&&!b.paused()&&M(h)}),4e3)})),b.on("sourceset",(function(e){console.log(e,"sourceset")})),b.on("dispose",(function(){S()})),k=new Map,w=new Map,E=-1,j=null,q=(null===(l=document)||void 0===l||null===(o=l.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])||null,I=(null==b||null===(i=b.controlBar)||void 0===i?void 0:i.getChild("videoSelector"))||null,C=(null==b||null===(a=b.controlBar)||void 0===a?void 0:a.getChild("seriesV2"))||null,B=(null==b||null===(v=b.el())||void 0===v||null===(p=v.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===p?void 0:p[0])||null,A=(null==b||null===(f=b.el())||void 0===f||null===(y=f.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===y?void 0:y[0])||null,T=!1,M=function(){var e=s(u.mark((function e(l){var o,i,a,s,v,p,m,f,y,h,b,g,S,M,x,L,_,N;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=new URL(l),j&&s.searchParams.append("nextToken",j),e.next=4,fetch(s.toString(),{method:"GET"});case 4:return v=e.sent,e.next=7,v.json();case 7:if(p=e.sent,m=p.avails,f=p.nextToken||null,j=f,y=[],h=n.getPlayer(t),b=h.controlBar.progressControl,g=b.seekBar.el(),null===(o=document)||void 0===o||o.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),m.map((function(e,n){var t,r;y.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(t=e.adBreakTrackingEvents)||void 0===t||null===(r=t.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===r?void 0:r[0])||[]})})),null!=y&&y.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",y),window.adsQueueList=y),console.log(y,"data"),y.forEach((function(e){var n=e.markerPositionInSeconds,t=e.ads,r=h.duration();if(!(n>r||Array.isArray(t)&&0==(null==t?void 0:t.length))){var l=n/r*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(l,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(l,"%"),o.style.pointerEvents="none",g.appendChild(o)}})),T||(M=null===(S=document.getElementsByClassName("ssai-ad-container"))||void 0===S?void 0:S[0])&&(M.style.display="none"),!T||!h._timeUpdateHandler){e.next=23;break}return e.abrupt("return");case 23:h._timeUpdateHandler&&h.off("timeupdate",h._timeUpdateHandler),h._timeUpdateHandler=c.throttle((function(){var e=h.currentTime();if(e!==E){E=e;for(var n=function(){var n=y[t],l=n.startTimeInSeconds,o=n.durationInSeconds,i=n.ads,a=l+o;if(e>=l-1.2&&e<=a+1.2){T=!!(e>=l&&e<=a&&Array.isArray(i)&&(null==i?void 0:i.length)>0),e>a&&k.set(l,!0),r.keyboardManager.disable(),q&&q.classList.add("vjs-hidden"),B&&(B.style.pointerEvents="none",B.classList.add("vjs-hidden")),A&&(A.style.pointerEvents="none",A.classList.add("vjs-hidden")),I&&(I.el().style.pointerEvents="none",I.el().classList.add("vjs-hidden")),C&&(C.el().style.pointerEvents="none",C.el().classList.add("vjs-hidden")),b.el().classList.add("hide-progress-bar");for(var s=e-l,u=0,c=0,v=0;v<i.length;v++){var p,m=null==i||null===(p=i[v])||void 0===p?void 0:p.durationInSeconds;if(s<u+m){c=v;break}u+=m}i[c];var f=Math.max(0,o-s),h=Math.round(f);x.style.display="block",N.textContent="".concat(c+1," of ").concat(i.length," • ").concat(P(h));var g=[];return null==i||i.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));g.push.apply(g,d(n))})),Array.isArray(i)&&0==(null==i?void 0:i.length)&&g.push(null==n?void 0:n.podSlotImpressionBeacon),V(e,n,g,c,t),"break"}w.delete(l)},t=0;t<y.length;t++){if("break"===n())break}T||(x.style.display="none",b.el().classList.remove("hide-progress-bar"),I&&(I.el().style.pointerEvents="auto",I.el().classList.remove("vjs-hidden")),C&&(C.el().style.pointerEvents="auto",C.el().classList.remove("vjs-hidden")),q&&q.classList.remove("vjs-hidden"),B&&(B.style.pointerEvents="auto",B.classList.remove("vjs-hidden")),A&&(A.style.pointerEvents="auto",A.classList.remove("vjs-hidden")),r.keyboardManager.enable())}}),1e3),h.on("timeupdate",h._timeUpdateHandler),null===(i=document)||void 0===i||null===(a=i.querySelectorAll(".ssai-ad-container"))||void 0===a||a.forEach((function(e){return null==e?void 0:e.remove()})),(x=document.createElement("div")).className="ssai-ad-container",(L=document.createElement("div")).className="sponsored-adbox",(_=document.createElement("div")).className="sponsored-text",_.textContent="Sponsored Ad",L.append(_),(N=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",x.append(L),x.append(N),h.el().appendChild(x);case 42:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),x=new Map,L=2.5;case 23:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}var h=function(e,t){var r,l,o,i,d,s,u,c,v,p,m,f,y=n.getPlayer(e),h=(null==t?void 0:t.theme)||{},b=a.dom.$(".vjs-play-progress"),g=a.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");g&&(g.style.color="".concat(null===(r=window)||void 0===r||null===(l=r.app_data)||void 0===l||null===(o=l.appcmsMain)||void 0===o||null===(i=o.brand)||void 0===i||null===(d=i.cta)||void 0===d||null===(s=d.primary)||void 0===s?void 0:s.backgroundColor)),b&&(b.style.background="".concat(null===(u=window)||void 0===u||null===(c=u.app_data)||void 0===c||null===(v=c.appcmsMain)||void 0===v||null===(p=v.brand)||void 0===p||null===(m=p.cta)||void 0===m||null===(f=m.primary)||void 0===f?void 0:f.backgroundColor));var S=y.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&b&&(b.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&S&&(S.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&g&&(g.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?S.el().style.borderRadius=".3em":S.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(l,a){n.getPlayer(l).addClass("skin_vlone"),p(l,a),function(n,l){var a,d,s,u,c,p,m,f,h,b,g,S,k,w,E,j=(null==l?void 0:l.liveVideo)||!1,q=(null==l||null===(a=l.res)||void 0===a||null===(d=a.video)||void 0===d?void 0:d.isSSAIEnabled)||!1,I=r.getSource(null==l?void 0:l.res,n)||{};I.src;var C=(null==l?void 0:l.skin_settings)||{};o.checkDvrStartOverEnabled(l),null!=C&&C.skipBtn&&0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&e.addSkipButton(n,"VL_ONE",v.SkipSvgV2());(null!=C&&C.rewindBtn&&0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&e.addRewindButton(n,"VL_ONE",v.RewindSvgV2());(null==l||null===(s=l.relatedVideos)||void 0===s||null===(u=s.content)||void 0===u?void 0:u.length)>0&&e.addVideoSelector(n,null==l?void 0:l.relatedVideos);null!=l&&null!==(c=l.series)&&void 0!==c&&c.enable&&e.addSeriesSelectorV2(n,l);(null==l||null===(p=l.streams)||void 0===p?void 0:p.length)>1&&e.addMulticamSelector(n,null==l?void 0:l.streams);if(t.addTVProviderImage(n,l),r.initialiseKeyboardEvents(n,l),"MEDIA_TAILOR"==(null===(m=window)||void 0===m||null===(f=m.app_data)||void 0===f||null===(h=f.appcmsMain)||void 0===h||null===(b=h.adsConfig)||void 0===b?void 0:b.vodAdSticherProvider)&&null!==(g=window)&&void 0!==g&&null!==(S=g.app_data)&&void 0!==S&&null!==(k=S.appcmsMain)&&void 0!==k&&null!==(w=k.adsConfig)&&void 0!==w&&w.vodAdClientSideTracking&&q)if(j)!function(e){y.apply(this,arguments)}(n);else{var B,A=null;if(null!=l&&null!==(B=l.series)&&void 0!==B&&B.enable){var T,M,P,x,L,_=null===(T=i.getCurrentVideo())||void 0===T||null===(M=T.video)||void 0===M||null===(P=M.gist)||void 0===P?void 0:P.id,V=i.getSeriesWatchMap(),N=(null==V?void 0:V.get(_))||{t:0,p:0},O=N.t,D=N.p;"function"==typeof(null===(x=window)||void 0===x||null===(L=x.watchHistory)||void 0===L?void 0:L.cb)&&window.watchHistory.cb({watchedTime:O}),D<95&&(A=O)}else{var U=l.watchHistoryResumeTime;l.watchedPercentage<95&&(A=U)}r.setupAdvertisementMarkers(n,A)}null!=l&&l.isDvrEnabled&&null!=l&&null!==(E=l.dvrConfig)&&void 0!==E&&E.enable&&(e.addStartFromBeginningButton(n,l),e.addWatchLiveButton(n,l))}(l,a),h(l,a)};
package/esm/bundle.css CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
 
6
6
 
7
+
7
8
  .video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
8
9
  height: 0.7em;
9
10
  position: absolute;
@@ -223,7 +224,6 @@
223
224
  font-weight: bold
224
225
  }
225
226
 
226
-
227
227
  /* CSS for videojs-dvr-seekbar */
228
228
 
229
229
  .video-js.vjs-dvr-seekbar {
@@ -397,6 +397,7 @@
397
397
 
398
398
 
399
399
 
400
+
400
401
  .video-js .multicamera-parent.default{
401
402
  height: 345px;
402
403
  position: absolute;
@@ -479,7 +480,6 @@
479
480
 
480
481
 
481
482
 
482
-
483
483
  /* nextep */
484
484
  .next-ep-preview{
485
485
  position: absolute;
@@ -0,0 +1 @@
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import"axios";import{d as o,g as i,a as r,b as l,s as a,c as s,l as u,e as c,h as d,f as v,i as p,j as f,k as m,m as g,n as y,o as b,p as h,q as w,r as k,t as O,u as I,v as S,w as j,x as T,y as P,z as D,A as E,B as C,C as x,D as R,E as A,F as L,G as N,H as _,I as M,J as V,K as B,L as U,M as H}from"./generic-cfba14b3.js";import{g as F}from"./player_instance-34118a5b.js";import q from"video.js";import{o as J,g as K,a as W,s as z,b as G,p as X,c as Y}from"./util-dd92c84e.js";import{g as Q,d as $,a as Z,e as ee}from"./captions-f507e8ee.js";import{g as ne,p as te}from"./resolution-1c59b0f3.js";import{i as oe,a as ie}from"./skin-d5091b86.js";import{s as re}from"./localisation-0bf399a1.js";import{g as le,a as ae,s as se,v as ue,b as ce,c as de,d as ve,e as pe,f as fe}from"./currentVideoInfo-a8a254c2.js";import me from"@babel/runtime/helpers/typeof";import{s as ge,w as ye}from"./icons-37daa6b3.js";import{c as be,p as he,a as we,h as ke,r as Oe,g as Ie,b as Se,d as je,s as Te,e as Pe,f as De}from"./helper-349e076f.js";import Ee from"@babel/runtime/helpers/toConsumableArray";var Ce=function(e){return new Promise((function(n,t){if(xe(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},xe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Re=function(e,n,t){var o=F(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ae=function(e){var n=F(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Le=function(){var e=n(t.mark((function e(n){var i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=F(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,Ce("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(q),e.finish(13);case 16:(s=q.getTech("chromecast"))&&!s.prototype.seeking&&(s.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==o()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),Ne=function(e,n){var t=F(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=q.dom.getPointerPosition(a,n).x;q.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var _e=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Ce("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){q.getPlugin("eme")||q.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(q),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Be=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-08c7635e.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),He=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Ce("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(q)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(q)}))},loadAdsLibrary:_e,loadEMELibrary:Me,loadMuxPlugin:Ve,loadDvrSeekbar:Be,loadContribDash:Ue});function Fe(e){return qe.apply(this,arguments)}function qe(){return(qe=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.airplay)||!1,e.next=3,_e();case 3:i&&"Safari"==o()&&Promise.resolve().then((function(){return He})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Je(e,n){return Ke.apply(this,arguments)}function Ke(){return(Ke=n(t.mark((function e(n,i){var r,l,a,s,u,c,d,v,p,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=(null==i?void 0:i.contentType)||"video",v=null==i||null===(r=i[d])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[d])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==i||null===(s=i[d])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(c=u.videoAssets)||void 0===c?void 0:c.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==o()?Me():"caliente"!=(null===(f=window)||void 0===f?void 0:f.siteName)?Ue():Me():"Safari"!=o()&&p?Ue():null,Le(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function We(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function ze(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?We(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):We(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Ge=new Set,Xe=null,Ye=function(e,n,t){var o,r,l,a,s,u,c,d={},v=(null==e?void 0:e.contentType)||"video";d["c3.cm.id"]=(null===(o=e[v])||void 0===o?void 0:o.id)||"Null",d["c3.cm.contentType"]=on(e),d[null==t||null===(r=t.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),d[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),d[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===i()?"NULL":i(),d["c3.cm.categoryType"]=en(e),d["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),d.DRMEnabled=(null===(s=e[v])||void 0===s?void 0:s.drmEnabled)||"None",d.DAIStream=null!==(u=e[v])&&void 0!==u&&null!==(c=u.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[t.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=nn(e),d["c3.cm.genreList"]=$e(e),d["c3.cm.genre"]=Qe(e),d["c3.cm.channel"]=Ze(e);var p=an(le(),e);return d=ze(ze({},d),p)},Qe=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},$e=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},Ze=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},en=function(e){return(null==e?void 0:e.contentType)||"null"},nn=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},tn=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},on=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var rn,ln,an=function(e,n){var t,o,i,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=l(),d=r();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[c-1])||void 0===i||null===(a=i.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},sn=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},un=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},cn=function(){var e=n(t.mark((function e(n,o){var i,r,l,a,s,u,c,d,v,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=i.appName,c=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=F(n),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready((function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=sn(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),d.on("loadstart",(function(){var e,n;Xe&&Xe!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Ge.clear(),Xe=d.currentSrc();var t=un(d.currentType()),i=ae(),r=Ye(i,d,p);r[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",r[null==p||null===(n=p.Constants)||void 0===n?void 0:n.ASSET_NAME]=tn(i,o),r.authToken=c||"NULL",r.streamType=t,r.D2CType=l||"NONE",r.subscriberType=a||(l?"D2C":"FREE"),r["c3.cm.affiliate"]=a||"NULL",dn.setData(r),v("contentInfo",r)})),d.on("loadedmetadata",(function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),d.on("play",(function(){Ge.has(d.currentSrc())||(Ge.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){Ge.has(d.currentSrc())&&Ge.delete(d.currentSrc()),v("playbackEnded")})),d.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})})),d.on("dispose",(function(){null==Ge||Ge.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),dn=(rn={},{setData:function(e){rn=ze(ze({},rn),e)},getData:function(){return rn}}),vn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-073a035c.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-c132e089.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-3c26aca1.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-4d0355f2.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-3e9a4739.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?import("./skin-328a9023.js").then((function(t){t.initialiseSkin(e,n)})):"news"==t&&import("./skin-5b67e925.js").then((function(t){t.initialiseSkin(e,n)}))};function pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function fn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?pn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):pn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var mn=[],gn=0,yn=null;function bn(){console.log("Cleaning up watch history data"),ln=null,mn=[],gn=0,yn=null}function hn(e,n,t){var o,i,r,l,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,d=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var p=(null==n||null===(l=n.video)||void 0===l?void 0:l.originalObjectId)||null,f=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(d/v*100),y={};f?kn(y={completed:u,watchedTime:m,watchedPercentage:g},c,n.siteOwner):(y=fn(fn({videoId:ln,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:c},yn&&{seriesId:yn}),p&&{originalObjectId:p}),a(y).then((function(e){})).catch((function(e){}))),gn=d+t}function wn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function kn(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=wn(i),l=(new Date).getTime(),a=ae(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return fn(fn({},n),{},e({},t,s[t]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ln}));c<0?r.push(fn(fn({content:u},n),{},{addedDate:l,updateDate:l})):r[c]=fn(fn(fn({},r[c]),n),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function On(e,n,t){var o=wn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var In=!1,Sn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!In){var r=jn(e,"videoAssets","secondaryVideoAssets"),l=s(r,n);return l&&u(n,l),In=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function jn(e,n,t){if(Array.isArray(e))return e.map((function(e){return jn(e,n,t)}));if(null!==e&&"object"===me(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=jn(e[i],n,t)})),o}return e}function Tn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Pn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Pn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function Pn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Dn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function En(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Dn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Dn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Cn=function(e,n,t,i){var r,l,a,s,u,v=i.res,p=i.sres,f=F(e),m=(null==v?void 0:v.contentType)||"video",g=(null==v||null===(r=v[m])||void 0===r?void 0:r.drmEnabled)||!1,y=(null==v||null===(l=v[m])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==v||null===(s=v[m])||void 0===s||null===(u=s.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;se(v),ue.set(v),f&&(f.on("loadstart",(function(){y?t.resolve({status:!0,msg:"Video Loaded",response:v}):t.resolve(En({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:v}:{response:v}))})),f.on("loadeddata",(function(){var t,i,r,l=Q(e);if(null==l||l.map((function(n){return $(e,n.id)})),b&&"Safari"===o())try{var a;null==f||null===(a=f.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==f||!f.muted())&&Re(e,sessionStorage.getItem("volume")||"100");var s=ae();if(c(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var u,d,p=En(En({},n),v);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(yn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),mn=[],gn=0,ln=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=F(e);a&&(a.on("dispose",bn),a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());mn.includes(gn)||(e!=gn||e<l?e>gn&&(gn=e+l):(mn.push(e),hn(a,n,l)))}})),a.one("ended",(function(){hn(a,n,l,!0)})))}(e,p,null==s||null===(u=s.video)||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(r=n.analytics)&&void 0!==r&&r.muxKey&&null!=f&&f.mux){var m,g,y,h,w,k,O=(null===(m=ae())||void 0===m?void 0:m.video)||(null==v?void 0:v.video),I=null==O?void 0:O.gist,S={env_key:null==n||null===(g=n.analytics)||void 0===g?void 0:g.muxKey,player_name:"vl-web-player",player_version:null===(y=window)||void 0===y?void 0:y.vl_player_version,video_id:null==I?void 0:I.id,video_title:null==I?void 0:I.title,video_series:null==O||null===(h=O.series)||void 0===h?void 0:h.title,video_stream_type:null!=O&&null!==(w=O.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};f.mux({debug:!1,data:S})}})),f.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",n)})),f.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),f.tech_.on("retryplaylist",(function(){y&&Sn(v,e)})),f.on("error",(function(){var n,o;(console.log("ERROR",f.error(),f.error().code),4===f.error().code&&y)?Sn(v,e):(d(e,(null==f||null===(n=f.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==f||null===(o=f.error())||void 0===o?void 0:o.message)||"Some error occured",response:v}))})),f.one("play",(function(){var e,t,o,i,r;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable){var l,a,s,u=null===(l=ae())||void 0===l||null===(a=l.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,c=ce(),d=(null==c?void 0:c.get(u))||{t:0,p:0},v=d.t,p=d.p;v&&p<95&&setTimeout((function(){f.currentTime(v)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=f&&f.dvrSeekbar)try{f.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){if(y){f.currentSource();for(var e=f.textTracks(),n=e.length-1;n>=0;n--)f.removeRemoteTextTrack(e[n])}})),f.one("loadeddata",(function(){var e,n=(null==f||null===(e=f.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==me(f.dash)){var t,i,r,l=null==f||null===(t=f.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),s=Tn(n);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var c,d=Tn(n);try{for(d.s();!(c=d.n()).done;){var v,p,m,y=c.value;if(("Chrome"==o()||"Edge"==o()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!g))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))f.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}})))};function xn(e){var n=F(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),r=t.end(t.length-1)-i;An(),Ln(r).forEach((function(e){var n=e.id,t=e.title,i=e.time,l=Rn(n,t,Math.min(i/r*100,99.5));o.appendChild(l)}))}}function Rn(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function An(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function Ln(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(de()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Nn(e,n){var t=F(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,r=n.videoId;n.epg;var l=i.playLive,a=i.playFromBegining,s=i.programs;ve(s),t.on("loadeddata",(function(){be(n)?a?he(t,n):l?we(t,r):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,s=a.watchLive;a.resume;var u=a.startFromBegining,c=i;if(r&&null!=r&&r.enable){var d=JSON.parse(sessionStorage.getItem("epgConfig"));c="".concat(null==d?void 0:d.programId,"-").concat(null==d?void 0:d.channelId)}var v=!!Ie(c),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Se(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=Mn(o,v),p.style.display="flex",e.el().appendChild(p),je(e),_n("watch-live-resume-btn",s,(function(){De(e,p),we(e,c)})),_n("watch-begining-btn",u,(function(){De(e,p),he(e,n)}))}(t,n),ke({player:t,showWatchLive:!0,showStartOver:!0})):Oe(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,c=!0;if(s&&null!=s&&s.enable){var d;c=(null==n||null===(d=n.epg)||void 0===d?void 0:d.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!c||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}Te(u,o),Pe(e,n),ke({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!c||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(Te(u,t),o=t,function(e,n){Ln(n).forEach((function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=Rn(o,i,Math.min(r/n*100,99.5));s.appendChild(u)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function _n(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function Mn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(ye()," ").concat(l,"</button>"),s='<button id="watch-begining-btn">'.concat(ge()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}function Vn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Bn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Vn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Un=function(i,r,l,a){var c,y,b,h,w,k,O,I,S,j,T,P,D,E,C,x,R,A,L,N,_,M,V,B,U,H,J,K,W,z,G,X,Y,Q,$,ee,ne,te,ie,re,le=r.res,ae=void 0===le?null:le,se=r.sres,ue=void 0===se?null:se,ce=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],de=(null===(c=ae)||void 0===c?void 0:c.contentType)||"video",ve=oe(null===(y=ae)||void 0===y||null===(b=y[de])||void 0===b||null===(h=b.gist)||void 0===h?void 0:h.videoImageUrl)||oe(null===(w=ae)||void 0===w||null===(k=w[de])||void 0===k||null===(O=k.gist)||void 0===O||null===(I=O.imageGist)||void 0===I?void 0:I.r16x9),pe=(null===(S=ae)||void 0===S||null===(j=S[de])||void 0===j||null===(T=j.liveDetails)||void 0===T?void 0:T.isDvrEnabled)||!1,fe=(null===(P=ae)||void 0===P||null===(D=P[de])||void 0===D||null===(E=D.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,me=(null===(C=ae)||void 0===C||null===(x=C.ads)||void 0===x||null===(R=x.preRoll)||void 0===R||null===(A=R.adTags)||void 0===A||null===(L=A.web)||void 0===L?void 0:L.active)&&(null===(N=ae)||void 0===N||null===(_=N.ads)||void 0===_||null===(M=_.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(B=V.web)||void 0===B?void 0:B.url),ge=(null===(U=ae=Bn(Bn({},ae),{},{audioAssetSource:null==l?void 0:l.audioAssetSource}))||void 0===U||null===(H=U[de])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(J=window)||void 0===J||null===(K=J.app_data)||void 0===K||null===(W=K.appcmsMain)||void 0===W||null===(z=W.adsConfig)||void 0===z?void 0:z.vodAdSticherProvider)||!1,ye=(null==l?void 0:l.latency)||6,be=(null==l?void 0:l.skin_settings)||{};null==l||l.dvrConfig;var he=(ie={enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==l.skin,liveui:pe},e(ie,"autoplay",null==l?void 0:l.autoplay),e(ie,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!me),e(ie,"loop",(null==l?void 0:l.loop)||!1),e(ie,"audioPosterMode",null==l?void 0:l.audioPosterMode),e(ie,"html5",Bn(Bn({dash:Bn(Bn(Bn({},!q.browser.IS_SAFARI&&{useTTML:!0}),(null==l?void 0:l.debugConfig)&&(null==l||null===(G=l.debugConfig)||void 0===G?void 0:G.enable)&&{debug:!0,logLevel:null!=l&&null!==(X=l.debugConfig)&&void 0!==X&&X.logLevel?null==l||null===(Y=l.debugConfig)||void 0===Y?void 0:Y.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ye},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Bn(Bn({liveRangeSafeTimeDelta:ye,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==l||null===(Q=l.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===($=null==l?void 0:l.enableLowInitialPlaylist)||void 0===$||$}),debug:(null==l?void 0:l.debugConfig)&&(null==l||null===(ee=l.debugConfig)||void 0===ee?void 0:ee.enable)||!1,nativeTextTracks:"Safari"==o()},0==(null==l||null===(ne=l.customData)||void 0===ne?void 0:ne.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(te=l.customData)||void 0===te?void 0:te.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ie,"poster",ve),e(ie,"techOrder",ce),e(ie,"chromecast",{requestCustomDataFn:function(e){var n,t,o=F(i),r=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m,g,y,b,h,w,k,O;f.isDrmEnabled=!0;var I=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(b=y.options)||void 0===b?void 0:b.serverURL);f.licenseUrl=S;var j=(null==I?void 0:I.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(w=h[0])||void 0===w||null===(k=w.options)||void 0===k||null===(O=k.httpRequestHeaders)||void 0===O?void 0:O["X-AxDRM-Message"]);f.licenseToken=j}var T=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=T;var P=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=P;var D=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=D;var E=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(ae,e,r);return Bn(Bn({},a),{},{convivaMetaData:Bn({customerKey:(null==l||null===(n=l.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==l||null===(t=l.convivaConfig)||void 0===t?void 0:t.debug)||!1},dn.getData())})},modifyLoadRequestFn:function(e){var n,t,o,r,l,a=F(i),s=(null==a?void 0:a.currentSource())||{};!(null===(n=ae)||void 0===n||null===(t=n[de])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ie);if(!q.getPlayers()[i]){null!=l&&l.debugConfig&&null!=l&&null!==(re=l.debugConfig)&&void 0!==re&&re.enable&&q.log.level("debug");var we=q(i,he,function(){var e=n(t.mark((function e(){var n,o,r,c,y,b,h,w,k,O,I,S,j,T,P,D,E,C,x,R,A,L;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(q.VERSION),console.log(q.getPlugins()),e.next=5,Je(l,ae);case 5:if(j=null===(n=ae)||void 0===n||null===(o=n[de])||void 0===o||null===(r=o.liveDetails)||void 0===r?void 0:r.startOverTime,fe&&a.resolve(Bn({status:!0,msg:"Player Initialised"},ue?{seriesResponse:ue,response:ae}:{response:ae})),T={},pe&&null!=l&&null!==(c=l.dvrConfig)&&void 0!==c&&c.enable&&Nn(i,Bn(Bn({},l),{},{isDvrEnabled:pe})),p(i,null==l?void 0:l.analyticsCb,T),cn(i,l),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),pe&&Ne(i,j),!me||null!=l&&null!==(y=l.customData)&&void 0!==y&&y.disableAds||f(i,me,ae),P=s(ae,i),console.log(P),null!=l&&l.nearestClusterUrl&&(P=m(P,l.nearestClusterUrl)),!ge){e.next=21;break}return e.next=20,g(i,ae);case 20:P=e.sent;case 21:P?u(i,P):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:ae}),d(i,"Incompatible / Missing Source")),((null===(b=ae)||void 0===b||null===(h=b[de])||void 0===h||null===(w=h.contentDetails)||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0||(null===(O=ae)||void 0===O||null===(I=O[de])||void 0===I||null===(S=I.closedCaptions)||void 0===S?void 0:S.length)>0)&&(L=(null===(E=ae)||void 0===E||null===(C=E[de])||void 0===C||null===(x=C.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(R=ae)||void 0===R||null===(A=R[de])||void 0===A?void 0:A.closedCaptions),D=L.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),Z(i,D)),null!=l&&l.disableControls?v(i):vn(i,Bn(Bn(Bn({},l),he),{},{liveVideo:fe,isDvrEnabled:pe,res:ae,sres:ue})),Cn(i,Bn(Bn(Bn({},l),he),{},{liveVideo:fe}),a,{res:ae,sres:ue});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},Hn={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function qn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Fn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Jn,Kn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=Wn(e);Un(i,{res:r},e,{resolve:t,reject:o})},Wn=function(e){var n,t,o,i,r,l,a,s,u=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,d=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,p=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.posterUrl)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,g=null==e?void 0:e.token,b=y(g),h=null==b?void 0:b.site;return qn(qn({id:null==Hn?void 0:Hn[h]},!d&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:d,streamingInfo:{videoAssets:qn(qn({},m&&{drmProvider:m}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:qn({},p&&{videoImageUrl:p}),contentDetails:qn({},(null==f?void 0:f.length)>0&&{closedCaptions:Ee(f)})},ads:{preRoll:{adTags:{web:qn(qn({},v&&{active:!0}),v&&{url:v})}}}})};function zn(e,n){return Gn.apply(this,arguments)}function Gn(){return(Gn=n(t.mark((function e(n,o){var i,r,l,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,r=o.reject,l=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,k();case 6:u=e.sent,b(l,u).then((function(e){var t,o,c,d;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(c=o.gist)||void 0===c?void 0:c.contentType,se(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(d=n.watchHistory)&&void 0!==d&&d.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=On((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",l,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Un(a,{res:p},n,{resolve:i,reject:r})}else h(l,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){Un(a,{res:p},n,{resolve:i,reject:r})}));else Un(a,{res:p},n,{resolve:i,reject:r})})).catch((function(e){w(e,a,r,l)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xn(e,n){return Yn.apply(this,arguments)}function Yn(){return(Yn=n(t.mark((function e(n,o){var i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,r=o.reject,e.next=3,k();case 3:l=e.sent,a=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,O(s,l).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Un(a,{res:t},n,{resolve:i,reject:r})})).catch((function(e){w(e,a,r,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qn(e,n){return $n.apply(this,arguments)}function $n(){return($n=n(t.mark((function e(n,o){var i,r,l,a,s,u,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.resolve,l=o.reject,e.next=3,k();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,pe.set(parseInt(u)),c=null==n||null===(i=n.series)||void 0===i?void 0:i.id,I(c,a).then((function(e){var t,o,i,u=e.data,d=e.data.seasons;fe(d);var v=videoId||(null==d||null===(t=d[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);S(c,a),b(v,a).then((function(e){var t,o,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,se(e.data),Un(s,{res:null==e?void 0:e.data,sres:u},n,{resolve:r,reject:l})})).catch((function(e){w(e,s,l,videoId)}))})).catch((function(e){w(e,s,l)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function et(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Zn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function nt(){return{loadVideoInstantly:j,onTimeUpdate:J,getVideoDuration:K,onVideoEnded:W,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(t.mark((function n(o,i){var r,l,a,s,u,c,d,v,p,f,m,g,y,h,k,O,I,S,j,T,P,D,E,x,R;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!C(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(y=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,k=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,O=null==e?void 0:e.videoId,I=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=O,j=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),B().set(null==e?void 0:e.refreshToken),j&&!U(j)){n.next=16;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:Jn=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(a=Jn)||void 0===a?void 0:a.site,window.siteId=null===(s=Jn)||void 0===s?void 0:s.siteId,e.isAnonymousUser=!(null===(u=Jn)||void 0===u||!u.anonymousId),e.siteOwner=(null===(c=Jn)||void 0===c?void 0:c.site)||null,e.userId=(null===(d=Jn)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(v=Jn)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,T=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(p=e.series)&&void 0!==p&&p.enable?null:null==e?void 0:e.chromecastReceiverId,P=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,(D=null==e?void 0:e.errors)&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,re(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),M.set(e.apiBaseUrl),null!=e&&e.skin&&!ie(e.skin)||(e.skin="VL_ONE"),n.next=35,Fe(e);case 35:P&&Ce("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return H(P)})).catch((function(e){})),(E=null===(g=document)||void 0===g?void 0:g.getElementById("".concat(T)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y?(R={directPlaybackUrl:y,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?b(x,j).then((function(n){var t=(null==n?void 0:n.data)||{};Un(T,{res:et(et({},t),R)},e,{resolve:o,reject:i})})).catch((function(e){w(e,T,i,x)})):Un(T,{res:R},e,{resolve:o,reject:i})):S?Kn(e,{resolve:o,reject:i}):I?Qn(e,{resolve:o,reject:i}):k?Xn(e,{resolve:o,reject:i}):zn(e,{resolve:o,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:ne,skip:T,getPlayer:F,play:P,pause:D,detectBrowser:o,rewind:E,loadVideo:u,seekToTimeStamp:z,isPlayerInitialised:C,load:x,authenticateLC:R,dispose:A,enableCaptions:ee,disableCaptions:$,getCaptions:Q,playSelectedResolution:te,getSource:s,setVolume:Re,getVolume:Ae,disableControls:v,setPlaybackSpeed:G,getEntitlementData:L,adsQueuePointManager:N,getSsaiEvents:_,playerEvents:X,onReplay:Y}}export{nt as V,xn as i,An as r};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./generic-cfba14b3.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-22eb54fd.js";import"./util-dd92c84e.js";import"./captions-f507e8ee.js";import"./resolution-1c59b0f3.js";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/typeof";import"./icons-37daa6b3.js";import"./helper-349e076f.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
1
+ import"video.js/dist/video-js.min.css";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"./generic-cfba14b3.js";import"./player_instance-34118a5b.js";import"video.js";export{V as default}from"./index-69f16ca4.js";import"./util-dd92c84e.js";import"./captions-f507e8ee.js";import"./resolution-1c59b0f3.js";import"./skin-d5091b86.js";import"./localisation-0bf399a1.js";import"js-cookie";import"./currentVideoInfo-a8a254c2.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/typeof";import"./icons-37daa6b3.js";import"./helper-349e076f.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
@@ -1 +1 @@
1
- import{h as e,d as n,e as o,o as t,p as l,q as r,r as i,s as a}from"./features-d24c4813.js";import{g as s}from"./player_instance-34118a5b.js";import{a as d,i as u,b as c}from"./index-66fa5eb0.js";import{O as v,Q as p,R as m,S as f,c as y,N as h,T as b}from"./generic-cfba14b3.js";import"videojs-contrib-quality-menu";import{i as g,r as w}from"./index-22eb54fd.js";import{c as k}from"./helper-349e076f.js";import{c as S,a as j,b as E}from"./currentVideoInfo-a8a254c2.js";import I from"video.js";import C from"@babel/runtime/helpers/toConsumableArray";import T from"@babel/runtime/helpers/asyncToGenerator";import A from"@babel/runtime/regenerator";import"@babel/runtime/helpers/defineProperty";import"js-cookie";import{t as B}from"./skin-d5091b86.js";import"axios";import{c as x,d as L}from"./icons-37daa6b3.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./resolution-1c59b0f3.js";import"@babel/runtime/helpers/assertThisInitialized";import"./localisation-0bf399a1.js";import"./autoNextVideo-97842e84.js";import"./util-dd92c84e.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"./captions-f507e8ee.js";import"video.js/dist/video-js.min.css";function M(n,o){var t=s(n);t&&(t.on("loadeddata",(function(){var e,l,r,i,a,c=k(o),p=S();t.qualityLevels()&&t.qualityLevels().length&&function(e){var n=s(e);n&&(null==n||n.qualityMenu,n.qualityMenu({useResolutionLabels:!0}))}(n),!(null!=o&&null!==(e=o.series)&&void 0!==e&&e.enable||null!==(l=window)&&void 0!==l&&null!==(r=l.app_data)&&void 0!==r&&null!==(i=r.appcmsMain)&&void 0!==i&&null!==(a=i.features)&&void 0!==a&&a.auto_play)||null!=o&&o.liveVideo||d(n,o),null!=o&&o.liveVideo||v()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||u(n),c&&p&&p.length?g(n):w()})),t.one("play",(function(){var o,t,l,r;null!==(o=window)&&void 0!==o&&null!==(t=o.customData)&&void 0!==t&&t.iframeOverlayUrl&&e(n,null===(l=window)||void 0===l||null===(r=l.customData)||void 0===r?void 0:r.iframeOverlayUrl)})))}function _(e,n){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,n){if(e){if("string"==typeof e)return N(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?N(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){o&&(e=o);var t=0,l=function(){};return{s:l,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==o.return||o.return()}finally{if(a)throw r}}}}function N(e,n){(null==n||n>e.length)&&(n=e.length);for(var o=0,t=Array(n);o<n;o++)t[o]=e[o];return t}function O(){return O=T(A.mark((function e(n){var o,t,l,r,i,a,d,u,c,v,y,h,b,g,w,k,S,j,E,I,x,L,M,N,O,D,P,V;return A.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:V=function(e,o,t,l,r){var i=s(n);if(!i.seeking()){o.startTimeInSeconds,o.durationInSeconds,Math.floor(i.currentTime());var a,d=_(t);try{for(d.s();!(a=d.n()).done;){var u,c,v,p=a.value,m=p.eventType,y=p.beaconUrls,h=p.startTimeInSeconds,b=p.startTime,g=p.durationInSeconds,w=h||0,k=y,S=(null===(u=window)||void 0===u||null===(c=u.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.adEventHandler)||null,j="".concat(w,"_").concat(m),E=O.get("pod-".concat(r))||[];if(console.warn(e,w,"map:",m,"condition1:",e>=w,"map:",O),e>=w&&e<=w+D&&!E.includes(j)){E.push(j),O.set("pod-".concat(r),E);try{P(m,o,k,i)}catch(e){console.error("Error when calling triggerAdBeacon:",e,m,o)}if("function"==typeof S)try{var I,C={eventType:m,startTimeInSeconds:h,startTime:b,durationInSeconds:g,ad:null==o||null===(I=o.ads)||void 0===I?void 0:I[l],adIndex:l};S({adsData:C}),f(n,C)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){d.e(e)}finally{d.f()}}},P=function(e,n,o,t){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(t.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(t.currentTime())),"AD_POD:",n),null==o||o.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},N=function(e){var n=Math.floor(e/60),o=Math.floor(e%60);return"".concat(n,":").concat(o.toString().padStart(2,"0"))},h=function(){y&&clearInterval(y)},c=m.get(),v=s(n),y=null,v.one("loadeddata",(function(){y=setInterval((function(){c&&!v.paused()&&M(c)}),4e3)})),v.on("sourceset",(function(e){console.log(e,"sourceset")})),v.on("dispose",(function(){h()})),b=new Map,g=new Map,w=-1,k=null,S=(null===(o=document)||void 0===o||null===(t=o.getElementsByClassName("tvProviderImage"))||void 0===t?void 0:t[0])||null,j=(null==v||null===(l=v.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,E=(null==v||null===(r=v.controlBar)||void 0===r?void 0:r.getChild("seriesV2"))||null,I=(null==v||null===(i=v.el())||void 0===i||null===(a=i.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===a?void 0:a[0])||null,x=(null==v||null===(d=v.el())||void 0===d||null===(u=d.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===u?void 0:u[0])||null,L=!1,M=function(){var e=T(A.mark((function e(o){var t,l,r,i,a,d,u,c,v,m,f,y,h,T,M,_,O,D;return A.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new URL(o),k&&i.searchParams.append("nextToken",k),e.next=4,fetch(i.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:if(d=e.sent,u=d.avails,c=d.nextToken||null,k=c,v=[],m=s(n),f=m.controlBar.progressControl,y=f.seekBar.el(),null===(t=document)||void 0===t||t.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),u.map((function(e,n){var o,t;v.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(t=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===t?void 0:t[0])||[]})})),null!=v&&v.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",v),window.adsQueueList=v),console.log(v,"data"),v.forEach((function(e){var n=e.markerPositionInSeconds,o=e.ads,t=m.duration();if(!(n>t||Array.isArray(o)&&0==(null==o?void 0:o.length))){var l=n/t*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(l,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(l,"%"),r.style.pointerEvents="none",y.appendChild(r)}})),L||(T=null===(h=document.getElementsByClassName("ssai-ad-container"))||void 0===h?void 0:h[0])&&(T.style.display="none"),!L||!m._timeUpdateHandler){e.next=23;break}return e.abrupt("return");case 23:m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=B((function(){var e=m.currentTime();if(e!==w){w=e;for(var n=function(){var n=v[o],t=n.startTimeInSeconds,l=n.durationInSeconds,r=n.ads,i=t+l;if(e>=t-1.2&&e<=i+1.2){L=!!(e>=t&&e<=i&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>i&&b.set(t,!0),p.disable(),S&&S.classList.add("vjs-hidden"),I&&(I.style.pointerEvents="none",I.classList.add("vjs-hidden")),x&&(x.style.pointerEvents="none",x.classList.add("vjs-hidden")),j&&(j.el().style.pointerEvents="none",j.el().classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var a=e-t,s=0,d=0,u=0;u<r.length;u++){var c,m=null==r||null===(c=r[u])||void 0===c?void 0:c.durationInSeconds;if(a<s+m){d=u;break}s+=m}r[d];var y=Math.max(0,l-a),h=Math.round(y);M.style.display="block",D.textContent="".concat(d+1," of ").concat(r.length," • ").concat(N(h));var w=[];return null==r||r.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));w.push.apply(w,C(n))})),Array.isArray(r)&&0==(null==r?void 0:r.length)&&w.push(null==n?void 0:n.podSlotImpressionBeacon),V(e,n,w,d,o),"break"}g.delete(t)},o=0;o<v.length;o++){if("break"===n())break}L||(M.style.display="none",f.el().classList.remove("hide-progress-bar"),j&&(j.el().style.pointerEvents="auto",j.el().classList.remove("vjs-hidden")),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),S&&S.classList.remove("vjs-hidden"),I&&(I.style.pointerEvents="auto",I.classList.remove("vjs-hidden")),x&&(x.style.pointerEvents="auto",x.classList.remove("vjs-hidden")),p.enable())}}),1e3),m.on("timeupdate",m._timeUpdateHandler),null===(l=document)||void 0===l||null===(r=l.querySelectorAll(".ssai-ad-container"))||void 0===r||r.forEach((function(e){return null==e?void 0:e.remove()})),(M=document.createElement("div")).className="ssai-ad-container",(_=document.createElement("div")).className="sponsored-adbox",(O=document.createElement("div")).className="sponsored-text",O.textContent="Sponsored Ad",_.append(O),(D=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",M.append(_),M.append(D),m.el().appendChild(M);case 42:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),O=new Map,D=2.5;case 23:case"end":return e.stop()}}),e)}))),O.apply(this,arguments)}function D(e,d){s(e).addClass("skin_vlone"),M(e,d),function(e,s){var d,u,v,p,m,f,g,w,S,I,C,T,A,B,M,_=(null==s?void 0:s.liveVideo)||!1,N=(null==s||null===(d=s.res)||void 0===d||null===(u=d.video)||void 0===u?void 0:u.isSSAIEnabled)||!1,D=y(null==s?void 0:s.res,e)||{};D.src;var P=(null==s?void 0:s.skin_settings)||{};k(s),null!=P&&P.skipBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)&&n(e,"VL_ONE",x());(null!=P&&P.rewindBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)||1==(null==s?void 0:s.liveui))&&o(e,"VL_ONE",L());(null==s||null===(v=s.relatedVideos)||void 0===v||null===(p=v.content)||void 0===p?void 0:p.length)>0&&t(e,null==s?void 0:s.relatedVideos);null!=s&&null!==(m=s.series)&&void 0!==m&&m.enable&&l(e,s);(null==s||null===(f=s.streams)||void 0===f?void 0:f.length)>1&&r(e,null==s?void 0:s.streams);if(c(e,s),h(e,s),"MEDIA_TAILOR"==(null===(g=window)||void 0===g||null===(w=g.app_data)||void 0===w||null===(S=w.appcmsMain)||void 0===S||null===(I=S.adsConfig)||void 0===I?void 0:I.vodAdSticherProvider)&&null!==(C=window)&&void 0!==C&&null!==(T=C.app_data)&&void 0!==T&&null!==(A=T.appcmsMain)&&void 0!==A&&null!==(B=A.adsConfig)&&void 0!==B&&B.vodAdClientSideTracking&&N)if(_)!function(e){O.apply(this,arguments)}(e);else{var V,U=null;if(null!=s&&null!==(V=s.series)&&void 0!==V&&V.enable){var q,H,R,Q,F,G=null===(q=j())||void 0===q||null===(H=q.video)||void 0===H||null===(R=H.gist)||void 0===R?void 0:R.id,$=E(),z=(null==$?void 0:$.get(G))||{t:0,p:0},J=z.t,K=z.p;"function"==typeof(null===(Q=window)||void 0===Q||null===(F=Q.watchHistory)||void 0===F?void 0:F.cb)&&window.watchHistory.cb({watchedTime:J}),K<95&&(U=J)}else{var W=s.watchHistoryResumeTime;s.watchedPercentage<95&&(U=W)}b(e,U)}null!=s&&s.isDvrEnabled&&null!=s&&null!==(M=s.dvrConfig)&&void 0!==M&&M.enable&&(i(e,s),a(e,s))}(e,d),P(e,d)}var P=function(e,n){var o,t,l,r,i,a,d,u,c,v,p,m,f=s(e),y=(null==n?void 0:n.theme)||{},h=I.dom.$(".vjs-play-progress"),b=I.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");b&&(b.style.color="".concat(null===(o=window)||void 0===o||null===(t=o.app_data)||void 0===t||null===(l=t.appcmsMain)||void 0===l||null===(r=l.brand)||void 0===r||null===(i=r.cta)||void 0===i||null===(a=i.primary)||void 0===a?void 0:a.backgroundColor)),h&&(h.style.background="".concat(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(c=u.appcmsMain)||void 0===c||null===(v=c.brand)||void 0===v||null===(p=v.cta)||void 0===p||null===(m=p.primary)||void 0===m?void 0:m.backgroundColor));var g=f.getChild("BigPlayButton")||null;(null==y?void 0:y.progressBarColor)&&h&&(h.style.background=y.progressBarColor),(null==y?void 0:y.playButtonBackgroundColor)&&g&&(g.el().style.background=y.playButtonBackgroundColor),(null==y?void 0:y.playButtonColor)&&b&&(b.style.color=y.playButtonColor),(null==y?void 0:y.playButtonType)&&("square"==(null==y?void 0:y.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{D as initialiseSkin};
1
+ import{h as e,d as n,e as o,o as t,p as l,q as r,r as i,s as a}from"./features-d24c4813.js";import{g as s}from"./player_instance-34118a5b.js";import{a as d,i as u,b as c}from"./index-66fa5eb0.js";import{O as v,Q as p,R as m,S as f,c as y,N as h,T as b}from"./generic-cfba14b3.js";import"videojs-contrib-quality-menu";import{i as g,r as w}from"./index-69f16ca4.js";import{c as k}from"./helper-349e076f.js";import{c as S,a as j,b as E}from"./currentVideoInfo-a8a254c2.js";import I from"video.js";import C from"@babel/runtime/helpers/toConsumableArray";import T from"@babel/runtime/helpers/asyncToGenerator";import A from"@babel/runtime/regenerator";import"@babel/runtime/helpers/defineProperty";import"js-cookie";import{t as B}from"./skin-d5091b86.js";import"axios";import{c as x,d as L}from"./icons-37daa6b3.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./resolution-1c59b0f3.js";import"@babel/runtime/helpers/assertThisInitialized";import"./localisation-0bf399a1.js";import"./autoNextVideo-97842e84.js";import"./util-dd92c84e.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"./captions-f507e8ee.js";import"video.js/dist/video-js.min.css";function M(n,o){var t=s(n);t&&(t.on("loadeddata",(function(){var e,l,r,i,a,c=k(o),p=S();t.qualityLevels()&&t.qualityLevels().length&&function(e){var n=s(e);n&&(null==n||n.qualityMenu,n.qualityMenu({useResolutionLabels:!0}))}(n),!(null!=o&&null!==(e=o.series)&&void 0!==e&&e.enable||null!==(l=window)&&void 0!==l&&null!==(r=l.app_data)&&void 0!==r&&null!==(i=r.appcmsMain)&&void 0!==i&&null!==(a=i.features)&&void 0!==a&&a.auto_play)||null!=o&&o.liveVideo||d(n,o),null!=o&&o.liveVideo||v()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||u(n),c&&p&&p.length?g(n):w()})),t.one("play",(function(){var o,t,l,r;null!==(o=window)&&void 0!==o&&null!==(t=o.customData)&&void 0!==t&&t.iframeOverlayUrl&&e(n,null===(l=window)||void 0===l||null===(r=l.customData)||void 0===r?void 0:r.iframeOverlayUrl)})))}function _(e,n){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,n){if(e){if("string"==typeof e)return N(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?N(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){o&&(e=o);var t=0,l=function(){};return{s:l,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==o.return||o.return()}finally{if(a)throw r}}}}function N(e,n){(null==n||n>e.length)&&(n=e.length);for(var o=0,t=Array(n);o<n;o++)t[o]=e[o];return t}function O(){return O=T(A.mark((function e(n){var o,t,l,r,i,a,d,u,c,v,y,h,b,g,w,k,S,j,E,I,x,L,M,N,O,D,P,V;return A.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:V=function(e,o,t,l,r){var i=s(n);if(!i.seeking()){o.startTimeInSeconds,o.durationInSeconds,Math.floor(i.currentTime());var a,d=_(t);try{for(d.s();!(a=d.n()).done;){var u,c,v,p=a.value,m=p.eventType,y=p.beaconUrls,h=p.startTimeInSeconds,b=p.startTime,g=p.durationInSeconds,w=h||0,k=y,S=(null===(u=window)||void 0===u||null===(c=u.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.adEventHandler)||null,j="".concat(w,"_").concat(m),E=O.get("pod-".concat(r))||[];if(console.warn(e,w,"map:",m,"condition1:",e>=w,"map:",O),e>=w&&e<=w+D&&!E.includes(j)){E.push(j),O.set("pod-".concat(r),E);try{P(m,o,k,i)}catch(e){console.error("Error when calling triggerAdBeacon:",e,m,o)}if("function"==typeof S)try{var I,C={eventType:m,startTimeInSeconds:h,startTime:b,durationInSeconds:g,ad:null==o||null===(I=o.ads)||void 0===I?void 0:I[l],adIndex:l};S({adsData:C}),f(n,C)}catch(e){console.error("Error when calling ads callback:",e)}}}}catch(e){d.e(e)}finally{d.f()}}},P=function(e,n,o,t){console.warn("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(t.currentTime())),"AD_POD:",n),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",e,"Fired:".concat(Math.round(t.currentTime())),"AD_POD:",n),null==o||o.forEach((function(e){fetch(e,{mode:"no-cors"}).catch((function(n){console.warn("Beacon failed:",e,n)}))}))},N=function(e){var n=Math.floor(e/60),o=Math.floor(e%60);return"".concat(n,":").concat(o.toString().padStart(2,"0"))},h=function(){y&&clearInterval(y)},c=m.get(),v=s(n),y=null,v.one("loadeddata",(function(){y=setInterval((function(){c&&!v.paused()&&M(c)}),4e3)})),v.on("sourceset",(function(e){console.log(e,"sourceset")})),v.on("dispose",(function(){h()})),b=new Map,g=new Map,w=-1,k=null,S=(null===(o=document)||void 0===o||null===(t=o.getElementsByClassName("tvProviderImage"))||void 0===t?void 0:t[0])||null,j=(null==v||null===(l=v.controlBar)||void 0===l?void 0:l.getChild("videoSelector"))||null,E=(null==v||null===(r=v.controlBar)||void 0===r?void 0:r.getChild("seriesV2"))||null,I=(null==v||null===(i=v.el())||void 0===i||null===(a=i.getElementsByClassName("vjs-button vjs-rewind-button"))||void 0===a?void 0:a[0])||null,x=(null==v||null===(d=v.el())||void 0===d||null===(u=d.getElementsByClassName("vjs-button vjs-skip-button"))||void 0===u?void 0:u[0])||null,L=!1,M=function(){var e=T(A.mark((function e(o){var t,l,r,i,a,d,u,c,v,m,f,y,h,T,M,_,O,D;return A.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new URL(o),k&&i.searchParams.append("nextToken",k),e.next=4,fetch(i.toString(),{method:"GET"});case 4:return a=e.sent,e.next=7,a.json();case 7:if(d=e.sent,u=d.avails,c=d.nextToken||null,k=c,v=[],m=s(n),f=m.controlBar.progressControl,y=f.seekBar.el(),null===(t=document)||void 0===t||t.querySelectorAll(".vjs-seekbar-marker").forEach((function(e){return null==e?void 0:e.remove()})),u.map((function(e,n){var o,t;v.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds),podSlotImpressionBeacon:(null==e||null===(o=e.adBreakTrackingEvents)||void 0===o||null===(t=o.filter((function(e){return"breakStart"==(null==e?void 0:e.eventType)})))||void 0===t?void 0:t[0])||[]})})),null!=v&&v.length&&(console.log("%c SSAI AD PODS ","background: #bdf369; color: #000",v),window.adsQueueList=v),console.log(v,"data"),v.forEach((function(e){var n=e.markerPositionInSeconds,o=e.ads,t=m.duration();if(!(n>t||Array.isArray(o)&&0==(null==o?void 0:o.length))){var l=n/t*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(l,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(l,"%"),r.style.pointerEvents="none",y.appendChild(r)}})),L||(T=null===(h=document.getElementsByClassName("ssai-ad-container"))||void 0===h?void 0:h[0])&&(T.style.display="none"),!L||!m._timeUpdateHandler){e.next=23;break}return e.abrupt("return");case 23:m._timeUpdateHandler&&m.off("timeupdate",m._timeUpdateHandler),m._timeUpdateHandler=B((function(){var e=m.currentTime();if(e!==w){w=e;for(var n=function(){var n=v[o],t=n.startTimeInSeconds,l=n.durationInSeconds,r=n.ads,i=t+l;if(e>=t-1.2&&e<=i+1.2){L=!!(e>=t&&e<=i&&Array.isArray(r)&&(null==r?void 0:r.length)>0),e>i&&b.set(t,!0),p.disable(),S&&S.classList.add("vjs-hidden"),I&&(I.style.pointerEvents="none",I.classList.add("vjs-hidden")),x&&(x.style.pointerEvents="none",x.classList.add("vjs-hidden")),j&&(j.el().style.pointerEvents="none",j.el().classList.add("vjs-hidden")),E&&(E.el().style.pointerEvents="none",E.el().classList.add("vjs-hidden")),f.el().classList.add("hide-progress-bar");for(var a=e-t,s=0,d=0,u=0;u<r.length;u++){var c,m=null==r||null===(c=r[u])||void 0===c?void 0:c.durationInSeconds;if(a<s+m){d=u;break}s+=m}r[d];var y=Math.max(0,l-a),h=Math.round(y);M.style.display="block",D.textContent="".concat(d+1," of ").concat(r.length," • ").concat(N(h));var w=[];return null==r||r.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression","complete"].includes(e.eventType)}));w.push.apply(w,C(n))})),Array.isArray(r)&&0==(null==r?void 0:r.length)&&w.push(null==n?void 0:n.podSlotImpressionBeacon),V(e,n,w,d,o),"break"}g.delete(t)},o=0;o<v.length;o++){if("break"===n())break}L||(M.style.display="none",f.el().classList.remove("hide-progress-bar"),j&&(j.el().style.pointerEvents="auto",j.el().classList.remove("vjs-hidden")),E&&(E.el().style.pointerEvents="auto",E.el().classList.remove("vjs-hidden")),S&&S.classList.remove("vjs-hidden"),I&&(I.style.pointerEvents="auto",I.classList.remove("vjs-hidden")),x&&(x.style.pointerEvents="auto",x.classList.remove("vjs-hidden")),p.enable())}}),1e3),m.on("timeupdate",m._timeUpdateHandler),null===(l=document)||void 0===l||null===(r=l.querySelectorAll(".ssai-ad-container"))||void 0===r||r.forEach((function(e){return null==e?void 0:e.remove()})),(M=document.createElement("div")).className="ssai-ad-container",(_=document.createElement("div")).className="sponsored-adbox",(O=document.createElement("div")).className="sponsored-text",O.textContent="Sponsored Ad",_.append(O),(D=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",M.append(_),M.append(D),m.el().appendChild(M);case 42:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),O=new Map,D=2.5;case 23:case"end":return e.stop()}}),e)}))),O.apply(this,arguments)}function D(e,d){s(e).addClass("skin_vlone"),M(e,d),function(e,s){var d,u,v,p,m,f,g,w,S,I,C,T,A,B,M,_=(null==s?void 0:s.liveVideo)||!1,N=(null==s||null===(d=s.res)||void 0===d||null===(u=d.video)||void 0===u?void 0:u.isSSAIEnabled)||!1,D=y(null==s?void 0:s.res,e)||{};D.src;var P=(null==s?void 0:s.skin_settings)||{};k(s),null!=P&&P.skipBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)&&n(e,"VL_ONE",x());(null!=P&&P.rewindBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)||1==(null==s?void 0:s.liveui))&&o(e,"VL_ONE",L());(null==s||null===(v=s.relatedVideos)||void 0===v||null===(p=v.content)||void 0===p?void 0:p.length)>0&&t(e,null==s?void 0:s.relatedVideos);null!=s&&null!==(m=s.series)&&void 0!==m&&m.enable&&l(e,s);(null==s||null===(f=s.streams)||void 0===f?void 0:f.length)>1&&r(e,null==s?void 0:s.streams);if(c(e,s),h(e,s),"MEDIA_TAILOR"==(null===(g=window)||void 0===g||null===(w=g.app_data)||void 0===w||null===(S=w.appcmsMain)||void 0===S||null===(I=S.adsConfig)||void 0===I?void 0:I.vodAdSticherProvider)&&null!==(C=window)&&void 0!==C&&null!==(T=C.app_data)&&void 0!==T&&null!==(A=T.appcmsMain)&&void 0!==A&&null!==(B=A.adsConfig)&&void 0!==B&&B.vodAdClientSideTracking&&N)if(_)!function(e){O.apply(this,arguments)}(e);else{var V,U=null;if(null!=s&&null!==(V=s.series)&&void 0!==V&&V.enable){var q,H,R,Q,F,G=null===(q=j())||void 0===q||null===(H=q.video)||void 0===H||null===(R=H.gist)||void 0===R?void 0:R.id,$=E(),z=(null==$?void 0:$.get(G))||{t:0,p:0},J=z.t,K=z.p;"function"==typeof(null===(Q=window)||void 0===Q||null===(F=Q.watchHistory)||void 0===F?void 0:F.cb)&&window.watchHistory.cb({watchedTime:J}),K<95&&(U=J)}else{var W=s.watchHistoryResumeTime;s.watchedPercentage<95&&(U=W)}b(e,U)}null!=s&&s.isDvrEnabled&&null!=s&&null!==(M=s.dvrConfig)&&void 0!==M&&M.enable&&(i(e,s),a(e,s))}(e,d),P(e,d)}var P=function(e,n){var o,t,l,r,i,a,d,u,c,v,p,m,f=s(e),y=(null==n?void 0:n.theme)||{},h=I.dom.$(".vjs-play-progress"),b=I.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");b&&(b.style.color="".concat(null===(o=window)||void 0===o||null===(t=o.app_data)||void 0===t||null===(l=t.appcmsMain)||void 0===l||null===(r=l.brand)||void 0===r||null===(i=r.cta)||void 0===i||null===(a=i.primary)||void 0===a?void 0:a.backgroundColor)),h&&(h.style.background="".concat(null===(d=window)||void 0===d||null===(u=d.app_data)||void 0===u||null===(c=u.appcmsMain)||void 0===c||null===(v=c.brand)||void 0===v||null===(p=v.cta)||void 0===p||null===(m=p.primary)||void 0===m?void 0:m.backgroundColor));var g=f.getChild("BigPlayButton")||null;(null==y?void 0:y.progressBarColor)&&h&&(h.style.background=y.progressBarColor),(null==y?void 0:y.playButtonBackgroundColor)&&g&&(g.el().style.background=y.playButtonBackgroundColor),(null==y?void 0:y.playButtonColor)&&b&&(b.style.color=y.playButtonColor),(null==y?void 0:y.playButtonType)&&("square"==(null==y?void 0:y.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{D as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "2.0.152-backup",
3
+ "version": "2.0.153-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "types": "dist/@viewlift/player/esm/index.d.ts",
6
6
  "amdName": "_playerCore",
@@ -1 +0,0 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator");require("axios");var o=require("./generic-04e8a4ee.js"),r=require("./player_instance-fcf6a8fb.js"),i=require("video.js"),l=require("./util-13a95346.js"),a=require("./captions-dbc83a75.js"),u=require("./resolution-f9dcc1b4.js"),s=require("./skin-516012d7.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-31d70bec.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-a50a8ffc.js"),g=require("@babel/runtime/helpers/toConsumableArray"),m=function(e){return new Promise((function(n,t){if(y(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},y=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},h=function(e,n,t){var o=r.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var n=r.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var e=n(t.mark((function e(n){var l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(l=n.series)&&void 0!==l&&l.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(i),e.finish(13);case 16:(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==a||a.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==o.detectBrowser()?null==a||a.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),k=function(e,n){var t=r.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,r,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}}))};var S=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),m("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.js")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs-dash5.es-3854764f.js")}));case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),j=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){m("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:S,loadEMELibrary:O,loadMuxPlugin:I,loadDvrSeekbar:P,loadContribDash:T});function C(e){return E.apply(this,arguments)}function E(){return(E=n(t.mark((function e(n){var r;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(null==n?void 0:n.airplay)||!1,e.next=3,S();case 3:r&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return j})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,n){return x.apply(this,arguments)}function x(){return(x=n(t.mark((function e(n,r){var i,l,a,u,s,d,c,v,p,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=(null==r?void 0:r.contentType)||"video",v=null==r||null===(i=r[c])||void 0===i?void 0:i.drmEnabled,null==r||null===(l=r[c])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,p=(null==r||null===(u=r[c])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==o.detectBrowser()?O():"caliente"!=(null===(f=window)||void 0===f?void 0:f.siteName)?T():O():"Safari"!=o.detectBrowser()&&p?T():null,w(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function R(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function L(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?R(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):R(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var A=new Set,N=null,V=function(e,n,t){var r,i,l,a,u,s,d,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(r=e[p])||void 0===r?void 0:r.id)||"Null",v["c3.cm.contentType"]=F(e),v[null==t||null===(i=t.Constants)||void 0===i?void 0:i.IS_LIVE]=!(null==e||!e.linearchannel),v[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),v[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===o.getUserId()?"NULL":o.getUserId(),v["c3.cm.categoryType"]=H(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(s=e[p])&&void 0!==s&&null!==(d=s.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[t.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=U(e),v["c3.cm.genreList"]=M(e),v["c3.cm.genre"]=_(e),v["c3.cm.channel"]=B(e);var f=J(c.getCurrentSeries(),e);return v=L(L({},v),f)},_=function(e){var n,t,o,r=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[r])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},M=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},B=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},H=function(e){return(null==e?void 0:e.contentType)||"null"},U=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return r?"YES":"NO"},q=function(e,n){var t,o,r=(n||{}).epg;if(r&&null!=r&&r.enable&&null!=r&&r.programTitle)return r.programTitle;var i=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[i])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},F=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var W,G,J=function(e,n){var t,r,i,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var s=o.getSeasonNumber(),d=o.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(r=t.series)||void 0===r?void 0:r.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[s-1])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},K=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},z=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},X=function(){var e=n(t.mark((function e(n,o){var i,l,a,u,s,d,v,p,f,g;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},l=i.trackConvivaPlayerEvent,a=i.paymentHandler,u=i.tveProvider,s=i.enable,d=i.appName,v=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(p=r.getPlayer(n),"function"==typeof(f=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,f("getConvivaObject");case 10:if(g=e.sent){e.next=13;break}return e.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=K(t.keySystem);f("contentInfo",{DRMEnabled:o})}else f("contentInfo",{DRMEnabled:"None"})})),n||f("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var e,n;N&&N!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),A.clear(),N=p.currentSrc();var t=z(p.currentType()),r=c.getCurrentVideo(),i=V(r,p,g);i[null==g||null===(e=g.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",i[null==g||null===(n=g.Constants)||void 0===n?void 0:n.ASSET_NAME]=q(r,o),i.authToken=v||"NULL",i.streamType=t,i.D2CType=a||"NONE",i.subscriberType=u||(a?"D2C":"FREE"),i["c3.cm.affiliate"]=u||"NULL",Y.setData(i),f("contentInfo",i)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})})),p.on("play",(function(){A.has(p.currentSrc())||(A.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){A.has(p.currentSrc())&&A.delete(p.currentSrc()),f("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==A||A.clear(),f("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Y=(W={},{setData:function(e){W=L(L({},W),e)},getData:function(){return W}}),Q=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-c66f708d.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-e715e264.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-3d24dba4.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-54812f5e.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-71930b6b.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?Promise.resolve().then((function(){return require("./skin-fc1441ae.js")})).then((function(t){t.initialiseSkin(e,n)})):"news"==t&&Promise.resolve().then((function(){return require("./skin-a867a331.js")})).then((function(t){t.initialiseSkin(e,n)}))};function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Z(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):$(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var ee=[],ne=0,te=null;function oe(e,n,t){var r,i,l,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(r=n.watchHistory)||void 0===r||r.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(l=n.watchHistory)||void 0===l||l.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(e.currentTime()),m=s?100:Math.floor(c/v*100),y={};f?ie(y={completed:s,watchedTime:g,watchedPercentage:m},d,n.siteOwner):(y=Z(Z({videoId:G,watchedTime:g,watchedPercentage:m,doneWatching:s,profileId:d},te&&{seriesId:te}),p&&{originalObjectId:p}),o.saveWatchHistory(y).then((function(e){})).catch((function(e){}))),ne=c+t}function re(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function ie(n,t,o){var r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),i=re(r),l=(new Date).getTime(),a=c.getCurrentVideo(),u=(null==a?void 0:a.video)||{},s=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return Z(Z({},n),{},e({},t,u[t]))}),{}),d=i.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===G}));d<0?i.push(Z(Z({content:s},n),{},{addedDate:l,updateDate:l})):i[d]=Z(Z(Z({},i[d]),n),{},{updateDate:l}),localStorage.setItem("".concat(r),JSON.stringify(i))}function le(e,n,t){var o=re(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),r=[];return o&&Array.isArray(o)&&(r=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),r}var ae=!1,ue=function(e,n){var t,r,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(r=t.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!ae){var l=se(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,n);return a&&o.loadVideo(n,a),ae=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function se(e,n,t){if(Array.isArray(e))return e.map((function(e){return se(e,n,t)}));if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach((function(r){r===n&&void 0!==e[t]?o[r]=e[t]:r===t&&void 0!==e[n]?o[r]=e[n]:o[r]=se(e[r],n,t)})),o}return e}function de(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ce(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ce(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw i}}}}function ce(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function pe(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ve(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var fe=function(e,n,t,i){var l,u,s,d,p,f=i.res,g=i.sres,m=r.getPlayer(e),y=(null==f?void 0:f.contentType)||"video",b=(null==f||null===(l=f[y])||void 0===l?void 0:l.drmEnabled)||!1,w=(null==f||null===(u=f[y])||void 0===u||null===(s=u.streamingInfo)||void 0===s?void 0:s.isLiveStream)||!1,k=(null==f||null===(d=f[y])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(f),c.videoReplayTracker.set(f),m&&(m.on("loadstart",(function(){w?t.resolve({status:!0,msg:"Video Loaded",response:f}):t.resolve(pe({status:!0,msg:"Player Initialised"},g?{seriesResponse:g,response:f}:{response:f}))})),m.on("loadeddata",(function(){var t,i,l,u=a.getCaptions(e);if(null==u||u.map((function(n){return a.disableCaptions(e,n.id)})),k&&"Safari"===o.detectBrowser())try{var s;null==m||null===(s=m.liveTracker)||void 0===s||s.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&h(e,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(o.clearError(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,g=pe(pe({},n),f);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(te=null==n||null===(i=n.series)||void 0===i?void 0:i.id),ee=[],ne=0,G=t;var a=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,u=r.getPlayer(e);u&&(u.on("timeupdate",(function(){if(!u.seeking()){var e=Math.floor(u.currentTime());ee.includes(ne)||(e!=ne||e<a?e>ne&&(ne=e+a):(ee.push(e),oe(u,n,a)))}})),u.one("ended",(function(){oe(u,n,a,!0)})))}(e,g,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=n&&null!==(l=n.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var y,b,w,S,O,I,P=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),T=null==P?void 0:P.gist,j={env_key:null==n||null===(b=n.analytics)||void 0===b?void 0:b.muxKey,player_name:"vl-web-player",player_version:null===(w=window)||void 0===w?void 0:w.vl_player_version,video_id:null==T?void 0:T.id,video_title:null==T?void 0:T.title,video_series:null==P||null===(S=P.series)||void 0===S?void 0:S.title,video_stream_type:null!=P&&null!==(O=P.streamingInfo)&&void 0!==O&&O.isLiveStream?"live":"video",viewer_user_id:null==n||null===(I=n.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:j})}})),m.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];m.trigger("subtitlechanged",n)})),m.on("subtitlechanged",(function(e,n){var t,o,r,i,l,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(r=o.framework)||void 0===r||null===(i=r.CastContext)||void 0===i||null===(l=i.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(d=s.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var g,m=f.getMediaSession(),y=m.media.tracks.filter((function(e){return"TEXT"==e.type}));g=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),m.editTracksInfo(g)}})),m.tech_.on("retryplaylist",(function(){w&&ue(f,e)})),m.on("error",(function(){var n,r;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&w)?ue(f,e):(o.handleError(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==m||null===(r=m.error())||void 0===r?void 0:r.message)||"Some error occured",response:f}))})),m.one("play",(function(){var e,t,o,r,i;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable){var l,a,u,s=null===(l=c.getCurrentVideo())||void 0===l||null===(a=l.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=c.getSeriesWatchMap(),v=(null==d?void 0:d.get(s))||{t:0,p:0},p=v.t,f=v.p;p&&f<95&&setTimeout((function(){m.currentTime(p)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){m.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),m.on("volumechange",(function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),m.on("chromecastDisconnected",(function(){if(w){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}})),m.one("loadeddata",(function(){var e,n=(null==m||null===(e=m.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==v(m.dash)){var t,r,i,l=null==m||null===(t=m.dash)||void 0===t||null===(r=t.mediaPlayer)||void 0===r?void 0:r.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),u=de(n);try{for(u.s();!(i=u.n()).done;){var s=i.value;if(a&&(null==s?void 0:s.id)=="dash-audio-".concat(a.index)){s.enabled=!0;break}}}catch(e){u.e(e)}finally{u.f()}}else{var d,c=de(n);try{for(c.s();!(d=c.n()).done;){var p,f,g,y=d.value;if(("Chrome"==o.detectBrowser()||"Edge"==o.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!b))&&null!=y&&null!==(g=y.label)&&void 0!==g&&g.includes("5.1"))m.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}})))};function ge(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function me(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function ye(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(c.getCurrentEpgPrograms()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function he(e,n){var t=r.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var a=i.playLive,u=i.playFromBegining,s=i.programs;c.setCurrentEpgPrograms(s),t.on("loadeddata",(function(){f.checkDvrStartOverEnabled(n)?u?f.playFromBeginningHandler(t,n):a?f.playLiveOrResumeHandler(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,r=n.videoId,i=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,u=a.watchLive;a.resume;var s=a.startFromBegining,d=r;if(i&&null!=i&&i.enable){var c=JSON.parse(sessionStorage.getItem("epgConfig"));d="".concat(null==c?void 0:c.programId,"-").concat(null==c?void 0:c.channelId)}var v=!!f.getWatchedTime(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var g=f.getCurrentProgramThumbnail(n);g&&(p.style.backgroundImage="url(".concat(g,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.innerHTML=we(o,v),p.style.display="flex",e.el().appendChild(p),f.pauseAndHideControl(e),be("watch-live-resume-btn",u,(function(){f.showControl(e,p),f.playLiveOrResumeHandler(e,d)})),be("watch-begining-btn",s,(function(){f.showControl(e,p),f.playFromBeginningHandler(e,n)}))}(t,n),f.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):f.removeDvrStartOver(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),r=!1,i=e.seekable(),l=i.start(0),a=i.end(i.length-1)-l,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",(function(){r=!0})),e.on("seeked",(function(){r=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}f.saveWatchedTime(s,o),f.getProgramStartTime(e,n),f.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!r){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(f.saveWatchedTime(s,t),o=t,function(e,n){ye(n).forEach((function(t){var o=t.id,r=t.title,i=t.time,l=document.getElementById(o);if(l){var a=Math.min(i/n*100,99.5);l.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=ge(o,r,Math.min(i/n*100,99.5));u.appendChild(s)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function be(e,n,t){var o,r,i=document.getElementById(e);i&&(r=n,(o=i)&&(o.style.color="".concat((null==r?void 0:r.textColor)||"#000"),o.style.backgroundColor="".concat((null==r?void 0:r.backGroundColor)||"#DCF95B")),i.addEventListener("click",t))}function we(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,r=t.resume,i=t.startFromBegining,l=n?(null==r?void 0:r.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(l,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==i?void 0:i.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}function ke(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Se(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):ke(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Oe=function(l,u,d,c){var v,p,f,g,m,y,h,b,w,S,O,I,P,T,j,C,E,x,R,L,A,N,V,_,M,B,H,U,q,F,W,G,J,K,z,$,Z,ee,ne,te,oe=u.res,re=void 0===oe?null:oe,ie=u.sres,le=void 0===ie?null:ie,ae=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(v=re)||void 0===v?void 0:v.contentType)||"video",se=s.impolicy16x9(null===(p=re)||void 0===p||null===(f=p[ue])||void 0===f||null===(g=f.gist)||void 0===g?void 0:g.videoImageUrl)||s.impolicy16x9(null===(m=re)||void 0===m||null===(y=m[ue])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),de=(null===(w=re)||void 0===w||null===(S=w[ue])||void 0===S||null===(O=S.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,ce=(null===(I=re)||void 0===I||null===(P=I[ue])||void 0===P||null===(T=P.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,ve=(null===(j=re)||void 0===j||null===(C=j.ads)||void 0===C||null===(E=C.preRoll)||void 0===E||null===(x=E.adTags)||void 0===x||null===(R=x.web)||void 0===R?void 0:R.active)&&(null===(L=re)||void 0===L||null===(A=L.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(V=N.adTags)||void 0===V||null===(_=V.web)||void 0===_?void 0:_.url),pe=(null===(M=re=Se(Se({},re),{},{audioAssetSource:null==d?void 0:d.audioAssetSource}))||void 0===M||null===(B=M[ue])||void 0===B?void 0:B.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(H=window)||void 0===H||null===(U=H.app_data)||void 0===U||null===(q=U.appcmsMain)||void 0===q||null===(F=q.adsConfig)||void 0===F?void 0:F.vodAdSticherProvider)||!1,ge=(null==d?void 0:d.latency)||6,me=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var ye=(ne={enableSmoothSeeking:!0,controls:0!=(null==d?void 0:d.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==d?void 0:d.muted)||!1,autoplay:(null==d?void 0:d.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==me?void 0:me.pictureInPictureToggle)||!1},playbackRates:null!=me&&me.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:de},e(ne,"autoplay",null==d?void 0:d.autoplay),e(ne,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!ve),e(ne,"loop",(null==d?void 0:d.loop)||!1),e(ne,"audioPosterMode",null==d?void 0:d.audioPosterMode),e(ne,"html5",Se(Se({dash:Se(Se(Se({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(W=d.debugConfig)||void 0===W?void 0:W.enable)&&{debug:!0,logLevel:null!=d&&null!==(G=d.debugConfig)&&void 0!==G&&G.logLevel?null==d||null===(J=d.debugConfig)||void 0===J?void 0:J.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ge},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Se(Se({liveRangeSafeTimeDelta:ge,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==d||null===(K=d.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(z=null==d?void 0:d.enableLowInitialPlaylist)||void 0===z||z}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===($=d.debugConfig)||void 0===$?void 0:$.enable)||!1,nativeTextTracks:"Safari"==o.detectBrowser()},0==(null==d||null===(Z=d.customData)||void 0===Z?void 0:Z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(ee=d.customData)||void 0===ee?void 0:ee.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ne,"poster",se),e(ne,"techOrder",ae),e(ne,"chromecast",{requestCustomDataFn:function(e){var n,t,o=r.getPlayer(l),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,r,i,l,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var g,m,y,h,b,w,k,S;f.isDrmEnabled=!0;var O=(null==n||null===(g=n.keySystems)||void 0===g?void 0:g["com.widevine.alpha"])||null,I=(null==O?void 0:O.url)||(null==n||null===(m=n.keySystemOptions)||void 0===m||null===(y=m[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=I;var P=(null==O?void 0:O.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(b=n.keySystemOptions)||void 0===b||null===(w=b[0])||void 0===w||null===(k=w.options)||void 0===k||null===(S=k.httpRequestHeaders)||void 0===S?void 0:S["X-AxDRM-Message"]);f.licenseToken=P}var T=(null==e||null===(o=e[p])||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType)||"VIDEO";f.contentType=T;var j=null==e||null===(i=e[p])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;f.duration=j;var C=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=C;var E=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=E,f.subTitles=t,f.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(re,e,i);return Se(Se({},a),{},{convivaMetaData:Se({customerKey:(null==d||null===(n=d.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==d||null===(t=d.convivaConfig)||void 0===t?void 0:t.debug)||!1},Y.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,a,u=r.getPlayer(l),s=(null==u?void 0:u.currentSource())||{};!(null===(n=re)||void 0===n||null===(t=n[ue])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(a=s.src)&&void 0!==a&&a.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ne);if(!i.getPlayers()[l]){null!=d&&d.debugConfig&&null!=d&&null!==(te=d.debugConfig)&&void 0!==te&&te.enable&&i.log.level("debug");var be=i(l,ye,function(){var e=n(t.mark((function e(){var n,r,u,s,v,p,f,g,m,y,h,b,w,S,O,I,P,T,j,C,E,x;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(be),console.log(i.VERSION),console.log(i.getPlugins()),e.next=5,D(d,re);case 5:if(w=null===(n=re)||void 0===n||null===(r=n[ue])||void 0===r||null===(u=r.liveDetails)||void 0===u?void 0:u.startOverTime,ce&&c.resolve(Se({status:!0,msg:"Player Initialised"},le?{seriesResponse:le,response:re}:{response:re})),S={},de&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&he(l,Se(Se({},d),{},{isDvrEnabled:de})),o.inititateBeacon(l,null==d?void 0:d.analyticsCb,S),X(l,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),de&&k(l,w),!ve||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(l,ve,re),O=o.getSource(re,l),console.log(O),null!=d&&d.nearestClusterUrl&&(O=o.getUpdatedClusterSource(O,d.nearestClusterUrl)),!pe){e.next=21;break}return e.next=20,o.getSGAIEnabledSource(l,re);case 20:O=e.sent;case 21:O?o.loadVideo(l,O):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:re}),o.handleError(l,"Incompatible / Missing Source")),((null===(p=re)||void 0===p||null===(f=p[ue])||void 0===f||null===(g=f.contentDetails)||void 0===g||null===(m=g.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(y=re)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(x=(null===(P=re)||void 0===P||null===(T=P[ue])||void 0===T||null===(j=T.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null===(C=re)||void 0===C||null===(E=C[ue])||void 0===E?void 0:E.closedCaptions),I=x.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),a.addCaptions(l,I)),null!=d&&d.disableControls?o.disableControls(l):Q(l,Se(Se(Se({},d),ye),{},{liveVideo:ce,isDvrEnabled:de,res:re,sres:le})),fe(l,Se(Se(Se({},d),ye),{},{liveVideo:ce}),c,{res:re,sres:le});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},Ie={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Te(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Pe(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var je,Ce=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=Ee(e);Oe(r,{res:i},e,{resolve:t,reject:o})},Ee=function(e){var n,t,r,i,l,a,u,s,d=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,v=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,p=(null==e||null===(r=e.streamingInfo)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.url)||null,f=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,m=(null==e||null===(a=e.streamingInfo)||void 0===a?void 0:a.subtitles)||[],y=(null==e||null===(u=e.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,h=null==e?void 0:e.token,b=o.getDecodedToken(h),w=null==b?void 0:b.site;return Te(Te({id:null==Ie?void 0:Ie[w]},!v&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:v,streamingInfo:{videoAssets:Te(Te({},y&&{drmProvider:y}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==d?void 0:d.isDvrEnabled},gist:Te({},f&&{videoImageUrl:f}),contentDetails:Te({},(null==m?void 0:m.length)>0&&{closedCaptions:g(m)})},ads:{preRoll:{adTags:{web:Te(Te({},p&&{active:!0}),p&&{url:p})}}}})};function De(e,n){return xe.apply(this,arguments)}function xe(){return(xe=n(t.mark((function e(n,r){var i,l,a,u,s,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.resolve,l=r.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,o.getToken();case 6:d=e.sent,o.getVideoDetails(a,d).then((function(e){var t,r,v,p;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(r=t.video)||void 0===r||null===(v=r.gist)||void 0===v?void 0:v.contentType,c.setCurrentVideo(null==e?void 0:e.data);var f,g=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(p=n.watchHistory)&&void 0!==p&&p.enable&&!s)if((null===(f=n.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var m,y,h,b=le((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;g.contentType="video",Oe(u,{res:g},n,{resolve:i,reject:l})}else o.getVideoInfo(a,d).then((function(e){var t,o,r,i,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,g.contentType="video"})).catch((function(e){var n,t,o,r;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(r=o.watchHistory)||void 0===r||r.cb(e))})).finally((function(){Oe(u,{res:g},n,{resolve:i,reject:l})}));else Oe(u,{res:g},n,{resolve:i,reject:l})})).catch((function(e){o.initiateErrorHandling(e,u,l,a)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(e,n){return Le.apply(this,arguments)}function Le(){return(Le=n(t.mark((function e(n,r){var i,l,a,u,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.resolve,l=r.reject,e.next=3,o.getToken();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,o.getLinearChannelDetails(s,a).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Oe(u,{res:t},n,{resolve:i,reject:l})})).catch((function(e){o.initiateErrorHandling(e,u,l,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(e,n){return Ne.apply(this,arguments)}function Ne(){return(Ne=n(t.mark((function e(n,r){var i,l,a,u,s,d,v;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r.resolve,a=r.reject,e.next=3,o.getToken();case 3:u=e.sent,s=null==n?void 0:n.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==n||null===(i=n.series)||void 0===i?void 0:i.id,o.getSeriesDetails(v,u).then((function(e){var t,r,i,d=e.data,p=e.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(t=p[0])||void 0===t||null===(r=t.episodes)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.id);o.createSeriesWatchMap(v,u),o.getVideoDetails(f,u).then((function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(e.data),Oe(s,{res:null==e?void 0:e.data,sres:d},n,{resolve:l,reject:a})})).catch((function(e){o.initiateErrorHandling(e,s,a,videoId)}))})).catch((function(e){o.initiateErrorHandling(e,s,a)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _e(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ve(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}exports.VLPlayerCore=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var r=n(t.mark((function n(r,i){var l,a,u,c,v,p,f,g,y,h,b,w,k,S,O,I,P,T,j,E,D,x,R,L,A;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(k=(null==e?void 0:e.videoSourceUrl)||!1,S=null==e?void 0:e.asat,O=(null==e||null===(l=e.epg)||void 0===l?void 0:l.enable)||!1,I=null==e?void 0:e.videoId,P=(null==e||null===(a=e.series)||void 0===a?void 0:a.enable)||!1,T=(null==e?void 0:e.streamingInfo)||!1,window.videoId=I,j=null==e?void 0:e.token,!o.token_authentication_enabled(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),o.refreshTokenManager().set(null==e?void 0:e.refreshToken),j&&!o.isTokenExpired(j)){n.next=16;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:je=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(u=je)||void 0===u?void 0:u.site,window.siteId=null===(c=je)||void 0===c?void 0:c.siteId,e.isAnonymousUser=!(null===(v=je)||void 0===v||!v.anonymousId),e.siteOwner=(null===(p=je)||void 0===p?void 0:p.site)||null,e.userId=(null===(f=je)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(g=je)||void 0===g?void 0:g.userId),window.watchHistory=e.watchHistory||null,E=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(y=e.series)&&void 0!==y&&y.enable?null:null==e?void 0:e.chromecastReceiverId,D=(null==e||null===(h=e.analytics)||void 0===h?void 0:h.gaId)||null,(x=null==e?void 0:e.errors)&&(window.customErrors=x),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(b=e.customData)||void 0===b?void 0:b.localisation),o.baseUrlManager.set(e.apiBaseUrl),null!=e&&e.skin&&!s.isNotAValidSkin(e.skin)||(e.skin="VL_ONE"),n.next=35,C(e);case 35:D&&m("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then((function(){return o.runGtag(D)})).catch((function(e){})),(R=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(E)))&&R.addEventListener("contextmenu",(function(e){return e.preventDefault()})),k?(A={directPlaybackUrl:k,id:L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?o.getVideoDetails(L,j).then((function(n){var t=(null==n?void 0:n.data)||{};Oe(E,{res:_e(_e({},t),A)},e,{resolve:r,reject:i})})).catch((function(e){o.initiateErrorHandling(e,E,i,L)})):Oe(E,{res:A},e,{resolve:r,reject:i})):T?Ce(e,{resolve:r,reject:i}):P?Ae(e,{resolve:r,reject:i}):O?Re(e,{resolve:r,reject:i}):De(e,{resolve:r,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return r.apply(this,arguments)}}())},getRenditions:u.getRenditions,skip:o.skip,getPlayer:r.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,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:a.enableCaptions,disableCaptions:a.disableCaptions,getCaptions:a.getCaptions,playSelectedResolution:u.playSelectedResolution,getSource:o.getSource,setVolume:h,getVolume:b,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:o.getEntitlementData,adsQueuePointManager:o.adsQueuePointManager,getSsaiEvents:o.getSsaiEvents,playerEvents:l.playerEvents,onReplay:l.onReplay}},exports.initiateMarker=function(e){var n=r.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;me(),ye(l).forEach((function(e){var n=e.id,t=e.title,r=e.time,i=ge(n,t,Math.min(r/l*100,99.5));o.appendChild(i)}))}},exports.removeMarkers=me;
@@ -1 +0,0 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import"axios";import{d as o,g as i,a as r,b as l,s as a,c as s,l as u,e as c,h as d,f as v,i as f,j as p,k as m,m as g,n as y,o as b,p as h,q as w,r as k,t as O,u as I,v as S,w as j,x as T,y as P,z as D,A as E,B as C,C as x,D as R,E as A,F as L,G as N,H as _,I as M,J as V,K as B,L as U,M as H}from"./generic-cfba14b3.js";import{g as F}from"./player_instance-34118a5b.js";import q from"video.js";import{o as J,g as K,a as W,s as z,b as G,p as X,c as Y}from"./util-dd92c84e.js";import{g as Q,d as $,a as Z,e as ee}from"./captions-f507e8ee.js";import{g as ne,p as te}from"./resolution-1c59b0f3.js";import{i as oe,a as ie}from"./skin-d5091b86.js";import{s as re}from"./localisation-0bf399a1.js";import{g as le,a as ae,s as se,v as ue,b as ce,c as de,d as ve,e as fe,f as pe}from"./currentVideoInfo-a8a254c2.js";import me from"@babel/runtime/helpers/typeof";import{s as ge,w as ye}from"./icons-37daa6b3.js";import{c as be,p as he,a as we,h as ke,r as Oe,g as Ie,b as Se,d as je,s as Te,e as Pe,f as De}from"./helper-349e076f.js";import Ee from"@babel/runtime/helpers/toConsumableArray";var Ce=function(e){return new Promise((function(n,t){if(xe(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},xe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Re=function(e,n,t){var o=F(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Ae=function(e){var n=F(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Le=function(){var e=n(t.mark((function e(n){var i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=F(null==n?void 0:n.playerId),null!=n&&null!==(i=n.series)&&void 0!==i&&i.enable||null==n||!n.chromecastReceiverId){e.next=22;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,Ce("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(q),e.finish(13);case 16:(s=q.getTech("chromecast"))&&!s.prototype.seeking&&(s.prototype.seeking=function(){}),null!==(l=window)&&void 0!==l&&l.cast?null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==r||r.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=23;break;case 22:console.log("Chromecast plugin is not available");case 23:null!=n&&n.chromecastReceiverId&&null!=n&&n.airplay&&"Safari"==o()?null==r||r.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 24:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),Ne=function(e,n){var t=F(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=q.dom.getPointerPosition(a,n).x;q.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var _e=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Ce("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))]);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){q.getPlugin("eme")||q.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=function(){var e=n(t.mark((function e(){var n;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(q),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Be=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=n(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-08c7635e.js");case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),He=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Ce("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(q)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(q)}))},loadAdsLibrary:_e,loadEMELibrary:Me,loadMuxPlugin:Ve,loadDvrSeekbar:Be,loadContribDash:Ue});function Fe(e){return qe.apply(this,arguments)}function qe(){return(qe=n(t.mark((function e(n){var i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.airplay)||!1,e.next=3,_e();case 3:i&&"Safari"==o()&&Promise.resolve().then((function(){return He})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Je(e,n){return Ke.apply(this,arguments)}function Ke(){return(Ke=n(t.mark((function e(n,i){var r,l,a,s,u,c,d,v,f,p;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=(null==i?void 0:i.contentType)||"video",v=null==i||null===(r=i[d])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[d])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==n||n.showPositiveSeekbar,f=(null==i||null===(s=i[d])||void 0===s||null===(u=s.streamingInfo)||void 0===u||null===(c=u.videoAssets)||void 0===c?void 0:c.dash)||null,e.prev=5,e.next=8,Promise.allSettled([v?"Safari"==o()?Me():"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?Ue():Me():"Safari"!=o()&&f?Ue():null,Le(n)]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function We(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function ze(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?We(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):We(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Ge=new Set,Xe=null,Ye=function(e,n,t){var o,r,l,a,s,u,c,d={},v=(null==e?void 0:e.contentType)||"video";d["c3.cm.id"]=(null===(o=e[v])||void 0===o?void 0:o.id)||"Null",d["c3.cm.contentType"]=on(e),d[null==t||null===(r=t.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),d[null==t||null===(l=t.Constants)||void 0===l?void 0:l.STREAM_URL]=n.currentSrc(),d[null==t||null===(a=t.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===i()?"NULL":i(),d["c3.cm.categoryType"]=en(e),d["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),d.DRMEnabled=(null===(s=e[v])||void 0===s?void 0:s.drmEnabled)||"None",d.DAIStream=null!==(u=e[v])&&void 0!==u&&null!==(c=u.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[t.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=nn(e),d["c3.cm.genreList"]=$e(e),d["c3.cm.genre"]=Qe(e),d["c3.cm.channel"]=Ze(e);var f=an(le(),e);return d=ze(ze({},d),f)},Qe=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},$e=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},Ze=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},en=function(e){return(null==e?void 0:e.contentType)||"null"},nn=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},tn=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},on=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var rn,ln,an=function(e,n){var t,o,i,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=l(),d=r();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(o=t.series)||void 0===o?void 0:o.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(i=e[c-1])||void 0===i||null===(a=i.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},sn=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},un=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},cn=function(){var e=n(t.mark((function e(n,o){var i,r,l,a,s,u,c,d,v,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=i.appName,c=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=F(n),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready((function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=sn(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),d.on("loadstart",(function(){var e,n;Xe&&Xe!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Ge.clear(),Xe=d.currentSrc();var t=un(d.currentType()),i=ae(),r=Ye(i,d,f);r[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",r[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=tn(i,o),r.authToken=c||"NULL",r.streamType=t,r.D2CType=l||"NONE",r.subscriberType=a||(l?"D2C":"FREE"),r["c3.cm.affiliate"]=a||"NULL",dn.setData(r),v("contentInfo",r)})),d.on("loadedmetadata",(function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),d.on("play",(function(){Ge.has(d.currentSrc())||(Ge.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){Ge.has(d.currentSrc())&&Ge.delete(d.currentSrc()),v("playbackEnded")})),d.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})})),d.on("dispose",(function(){null==Ge||Ge.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),dn=(rn={},{setData:function(e){rn=ze(ze({},rn),e)},getData:function(){return rn}}),vn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-073a035c.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-c132e089.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-3c26aca1.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-4d0355f2.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-3e9a4739.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t?import("./skin-77258406.js").then((function(t){t.initialiseSkin(e,n)})):"news"==t&&import("./skin-5b67e925.js").then((function(t){t.initialiseSkin(e,n)}))};function fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function pn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):fn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var mn=[],gn=0,yn=null;function bn(e,n,t){var o,i,r,l,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var c=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,d=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var f=(null==n||null===(l=n.video)||void 0===l?void 0:l.originalObjectId)||null,p=(null==n||null===(s=n.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(e.currentTime()),g=u?100:Math.floor(d/v*100),y={};p?wn(y={completed:u,watchedTime:m,watchedPercentage:g},c,n.siteOwner):(y=pn(pn({videoId:ln,watchedTime:m,watchedPercentage:g,doneWatching:u,profileId:c},yn&&{seriesId:yn}),f&&{originalObjectId:f}),a(y).then((function(e){})).catch((function(e){}))),gn=d+t}function hn(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function wn(n,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=hn(i),l=(new Date).getTime(),a=ae(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(n,t){return pn(pn({},n),{},e({},t,s[t]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ln}));c<0?r.push(pn(pn({content:u},n),{},{addedDate:l,updateDate:l})):r[c]=pn(pn(pn({},r[c]),n),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function kn(e,n,t){var o=hn(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var On=!1,In=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!On){var r=Sn(e,"videoAssets","secondaryVideoAssets"),l=s(r,n);return l&&u(n,l),On=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Sn(e,n,t){if(Array.isArray(e))return e.map((function(e){return Sn(e,n,t)}));if(null!==e&&"object"===me(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=Sn(e[i],n,t)})),o}return e}function jn(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return Tn(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Tn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){a=!0,r=e},f:function(){try{l||null==t.return||t.return()}finally{if(a)throw r}}}}function Tn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function Pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Dn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Pn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Pn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var En=function(e,n,t,i){var r,l,a,s,u,v=i.res,f=i.sres,p=F(e),m=(null==v?void 0:v.contentType)||"video",g=(null==v||null===(r=v[m])||void 0===r?void 0:r.drmEnabled)||!1,y=(null==v||null===(l=v[m])||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==v||null===(s=v[m])||void 0===s||null===(u=s.liveDetails)||void 0===u?void 0:u.isDvrEnabled)||!1;se(v),ue.set(v),p&&(p.on("loadstart",(function(){y?t.resolve({status:!0,msg:"Video Loaded",response:v}):t.resolve(Dn({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:v}:{response:v}))})),p.on("loadeddata",(function(){var t,i,r,l=Q(e);if(null==l||l.map((function(n){return $(e,n.id)})),b&&"Safari"===o())try{var a;null==p||null===(a=p.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==p||!p.muted())&&Re(e,sessionStorage.getItem("volume")||"100");var s=ae();if(c(),null!=n&&n.watchHistory&&null!=n&&null!==(t=n.watchHistory)&&void 0!==t&&t.enable&&(!n.isAnonymousUser||null!=n&&null!==(i=n.watchHistory)&&void 0!==i&&i.saveOffline)){var u,d,f=Dn(Dn({},n),v);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(yn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),mn=[],gn=0,ln=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=F(e);a&&(a.on("timeupdate",(function(){if(!a.seeking()){var e=Math.floor(a.currentTime());mn.includes(gn)||(e!=gn||e<l?e>gn&&(gn=e+l):(mn.push(e),bn(a,n,l)))}})),a.one("ended",(function(){bn(a,n,l,!0)})))}(e,f,null==s||null===(u=s.video)||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.id)}if(null!=n&&null!==(r=n.analytics)&&void 0!==r&&r.muxKey&&null!=p&&p.mux){var m,g,y,h,w,k,O=(null===(m=ae())||void 0===m?void 0:m.video)||(null==v?void 0:v.video),I=null==O?void 0:O.gist,S={env_key:null==n||null===(g=n.analytics)||void 0===g?void 0:g.muxKey,player_name:"vl-web-player",player_version:null===(y=window)||void 0===y?void 0:y.vl_player_version,video_id:null==I?void 0:I.id,video_title:null==I?void 0:I.title,video_series:null==O||null===(h=O.series)||void 0===h?void 0:h.title,video_stream_type:null!=O&&null!==(w=O.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==n||null===(k=n.analytics)||void 0===k?void 0:k.userId};p.mux({debug:!1,data:S})}})),p.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];p.trigger("subtitlechanged",n)})),p.on("subtitlechanged",(function(e,n){var t,o,i,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===f){var m,g=p.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),p.tech_.on("retryplaylist",(function(){y&&In(v,e)})),p.on("error",(function(){var n,o;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&y)?In(v,e):(d(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),t.reject({status:!1,msg:(null==p||null===(o=p.error())||void 0===o?void 0:o.message)||"Some error occured",response:v}))})),p.one("play",(function(){var e,t,o,i,r;if(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(o=t.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable){var l,a,s,u=null===(l=ae())||void 0===l||null===(a=l.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.id,c=ce(),d=(null==c?void 0:c.get(u))||{t:0,p:0},v=d.t,f=d.p;v&&f<95&&setTimeout((function(){p.currentTime(v)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==n?void 0:n.watchHistoryResumeTime)}),0);if(null!=p&&p.dvrSeekbar)try{p.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}})),p.on("volumechange",(function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),p.on("chromecastDisconnected",(function(){if(y){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})),p.one("loadeddata",(function(){var e,n=(null==p||null===(e=p.audioTracks())||void 0===e?void 0:e.tracks_)||null;if(n)if(n.sort((function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0})),"object"==me(p.dash)){var t,i,r,l=null==p||null===(t=p.dash)||void 0===t||null===(i=t.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==l?void 0:l.find((function(e){var n;return null==e||null===(n=e.roles)||void 0===n?void 0:n.includes("main")})),s=jn(n);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(a&&(null==u?void 0:u.id)=="dash-audio-".concat(a.index)){u.enabled=!0;break}}}catch(e){s.e(e)}finally{s.f()}}else{var c,d=jn(n);try{for(d.s();!(c=d.n()).done;){var v,f,m,y=c.value;if(("Chrome"==o()||"Edge"==o()&&(null!==(v=navigator)&&void 0!==v&&null!==(f=v.userAgent)&&void 0!==f&&f.includes("Macintosh")||!g))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))p.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){d.e(e)}finally{d.f()}}})))};function Cn(e){var n=F(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),r=t.end(t.length-1)-i;Rn(),An(r).forEach((function(e){var n=e.id,t=e.title,i=e.time,l=xn(n,t,Math.min(i/r*100,99.5));o.appendChild(l)}))}}function xn(e,n,t){var o=document.createElement("div");return o.className="vjs-seekbar-program-marker",o.id=e,o.style.title=n,o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="4px",o.style.backgroundColor="#000000",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",o}function Rn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach((function(e){e.remove()}))}function An(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(de()||[]).filter((function(e){var o=new Date(e.formatted_startdate).getTime();return o>=t&&o<=n})).map((function(e){var n=new Date(e.formatted_startdate).getTime()-t;return{title:e.title,time:n/1e3,id:e.programme_id}}))}function Ln(e,n){var t=F(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,r=n.videoId;n.epg;var l=i.playLive,a=i.playFromBegining,s=i.programs;ve(s),t.on("loadeddata",(function(){be(n)?a?he(t,n):l?we(t,r):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,r=n.epg,l=o.buttonConfig,a=void 0===l?{}:l,s=a.watchLive;a.resume;var u=a.startFromBegining,c=i;if(r&&null!=r&&r.enable){var d=JSON.parse(sessionStorage.getItem("epgConfig"));c="".concat(null==d?void 0:d.programId,"-").concat(null==d?void 0:d.channelId)}var v=!!Ie(c),f=document.querySelector(".vjs-dvr-btn-overlay");f||((f=document.createElement("div")).className="vjs-dvr-btn-overlay");var p=Se(n);p&&(f.style.backgroundImage="url(".concat(p,")"),f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="cover");f.innerHTML=_n(o,v),f.style.display="flex",e.el().appendChild(f),je(e),Nn("watch-live-resume-btn",s,(function(){De(e,f),we(e,c)})),Nn("watch-begining-btn",u,(function(){De(e,f),he(e,n)}))}(t,n),ke({player:t,showWatchLive:!0,showStartOver:!0})):Oe(t)})),t.one("loadedmetadata",(function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.length-1)-l,s=JSON.parse(sessionStorage.getItem("epgConfig")),u=t,c=!0;if(s&&null!=s&&s.enable){var d;c=(null==n||null===(d=n.epg)||void 0===d?void 0:d.programId)===(null==s?void 0:s.programId),u=null==s?void 0:s.programId}e.on("seeking",(function(){i=!0})),e.on("seeked",(function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!c||sessionStorage.getItem("program_switched"))return;u="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}Te(u,o),Pe(e,n),ke({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})})),e.on("timeupdate",(function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!c||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");u="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(Te(u,t),o=t,function(e,n){An(n).forEach((function(t){var o=t.id,i=t.title,r=t.time,l=document.getElementById(o);if(l){var a=Math.min(r/n*100,99.5);l.style.left="".concat(a,"%")}else{var s=e.controlBar.progressControl.seekBar.el(),u=xn(o,i,Math.min(r/n*100,99.5));s.appendChild(u)}}))}(e,a))}}))}(t,n)}))}else console.warn("Player instance is required to initialize start over.")}function Nn(e,n,t){var o,i,r=document.getElementById(e);r&&(i=n,(o=r)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),r.addEventListener("click",t))}function _n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,r=t.startFromBegining,l=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(ye()," ").concat(l,"</button>"),s='<button id="watch-begining-btn">'.concat(ge()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(s,"</div>")}function Mn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Vn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Mn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var Bn=function(i,r,l,a){var c,y,b,h,w,k,O,I,S,j,T,P,D,E,C,x,R,A,L,N,_,M,V,B,U,H,J,K,W,z,G,X,Y,Q,$,ee,ne,te,ie,re,le=r.res,ae=void 0===le?null:le,se=r.sres,ue=void 0===se?null:se,ce=null!=l&&l.chromecastReceiverId?["chromecast","html5"]:["html5"],de=(null===(c=ae)||void 0===c?void 0:c.contentType)||"video",ve=oe(null===(y=ae)||void 0===y||null===(b=y[de])||void 0===b||null===(h=b.gist)||void 0===h?void 0:h.videoImageUrl)||oe(null===(w=ae)||void 0===w||null===(k=w[de])||void 0===k||null===(O=k.gist)||void 0===O||null===(I=O.imageGist)||void 0===I?void 0:I.r16x9),fe=(null===(S=ae)||void 0===S||null===(j=S[de])||void 0===j||null===(T=j.liveDetails)||void 0===T?void 0:T.isDvrEnabled)||!1,pe=(null===(P=ae)||void 0===P||null===(D=P[de])||void 0===D||null===(E=D.streamingInfo)||void 0===E?void 0:E.isLiveStream)||!1,me=(null===(C=ae)||void 0===C||null===(x=C.ads)||void 0===x||null===(R=x.preRoll)||void 0===R||null===(A=R.adTags)||void 0===A||null===(L=A.web)||void 0===L?void 0:L.active)&&(null===(N=ae)||void 0===N||null===(_=N.ads)||void 0===_||null===(M=_.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(B=V.web)||void 0===B?void 0:B.url),ge=(null===(U=ae=Vn(Vn({},ae),{},{audioAssetSource:null==l?void 0:l.audioAssetSource}))||void 0===U||null===(H=U[de])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null===(J=window)||void 0===J||null===(K=J.app_data)||void 0===K||null===(W=K.appcmsMain)||void 0===W||null===(z=W.adsConfig)||void 0===z?void 0:z.vodAdSticherProvider)||!1,ye=(null==l?void 0:l.latency)||6,be=(null==l?void 0:l.skin_settings)||{};null==l||l.dvrConfig;var he=(ie={enableSmoothSeeking:!0,controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==be?void 0:be.pictureInPictureToggle)||!1},playbackRates:null!=be&&be.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==l.skin,liveui:fe},e(ie,"autoplay",null==l?void 0:l.autoplay),e(ie,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!me),e(ie,"loop",(null==l?void 0:l.loop)||!1),e(ie,"audioPosterMode",null==l?void 0:l.audioPosterMode),e(ie,"html5",Vn(Vn({dash:Vn(Vn(Vn({},!q.browser.IS_SAFARI&&{useTTML:!0}),(null==l?void 0:l.debugConfig)&&(null==l||null===(G=l.debugConfig)||void 0===G?void 0:G.enable)&&{debug:!0,logLevel:null!=l&&null!==(X=l.debugConfig)&&void 0!==X&&X.logLevel?null==l||null===(Y=l.debugConfig)||void 0===Y?void 0:Y.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ye},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:{autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:Vn(Vn({liveRangeSafeTimeDelta:ye,useDevicePixelRatio:!0,experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==l||null===(Q=l.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===($=null==l?void 0:l.enableLowInitialPlaylist)||void 0===$||$}),debug:(null==l?void 0:l.debugConfig)&&(null==l||null===(ee=l.debugConfig)||void 0===ee?void 0:ee.enable)||!1,nativeTextTracks:"Safari"==o()},0==(null==l||null===(ne=l.customData)||void 0===ne?void 0:ne.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(te=l.customData)||void 0===te?void 0:te.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(ie,"poster",ve),e(ie,"techOrder",ce),e(ie,"chromecast",{requestCustomDataFn:function(e){var n,t,o=F(i),r=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind})),a=function(e,n,t){var o,i,r,l,a,s,u,c,d,v,f=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){var m,g,y,b,h,w,k,O;p.isDrmEnabled=!0;var I=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,S=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(b=y.options)||void 0===b?void 0:b.serverURL);p.licenseUrl=S;var j=(null==I?void 0:I.licenseHeaders["X-AxDRM-Message"])||(null==n||null===(h=n.keySystemOptions)||void 0===h||null===(w=h[0])||void 0===w||null===(k=w.options)||void 0===k||null===(O=k.httpRequestHeaders)||void 0===O?void 0:O["X-AxDRM-Message"]);p.licenseToken=j}var T=(null==e||null===(o=e[f])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=T;var P=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;p.duration=P;var D=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=D;var E=null==e||null===(u=e[f])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return p.mediaImage=E,p.subTitles=t,p.DVR=(null==e||null===(d=e[f])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(ae,e,r);return Vn(Vn({},a),{},{convivaMetaData:Vn({customerKey:(null==l||null===(n=l.convivaConfig)||void 0===n?void 0:n.customerKey)||null,debug:(null==l||null===(t=l.convivaConfig)||void 0===t?void 0:t.debug)||!1},dn.getData())})},modifyLoadRequestFn:function(e){var n,t,o,r,l,a=F(i),s=(null==a?void 0:a.currentSource())||{};!(null===(n=ae)||void 0===n||null===(t=n[de])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.is4K)&&1||null!=s&&s.src&&null!=s&&null!==(l=s.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),ie);if(!q.getPlayers()[i]){null!=l&&l.debugConfig&&null!=l&&null!==(re=l.debugConfig)&&void 0!==re&&re.enable&&q.log.level("debug");var we=q(i,he,function(){var e=n(t.mark((function e(){var n,o,r,c,y,b,h,w,k,O,I,S,j,T,P,D,E,C,x,R,A,L;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(we),console.log(q.VERSION),console.log(q.getPlugins()),e.next=5,Je(l,ae);case 5:if(j=null===(n=ae)||void 0===n||null===(o=n[de])||void 0===o||null===(r=o.liveDetails)||void 0===r?void 0:r.startOverTime,pe&&a.resolve(Vn({status:!0,msg:"Player Initialised"},ue?{seriesResponse:ue,response:ae}:{response:ae})),T={},fe&&null!=l&&null!==(c=l.dvrConfig)&&void 0!==c&&c.enable&&Ln(i,Vn(Vn({},l),{},{isDvrEnabled:fe})),f(i,null==l?void 0:l.analyticsCb,T),cn(i,l),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),fe&&Ne(i,j),!me||null!=l&&null!==(y=l.customData)&&void 0!==y&&y.disableAds||p(i,me,ae),P=s(ae,i),console.log(P),null!=l&&l.nearestClusterUrl&&(P=m(P,l.nearestClusterUrl)),!ge){e.next=21;break}return e.next=20,g(i,ae);case 20:P=e.sent;case 21:P?u(i,P):(a.reject({status:!1,msg:"Incompatible / Missing Source",response:ae}),d(i,"Incompatible / Missing Source")),((null===(b=ae)||void 0===b||null===(h=b[de])||void 0===h||null===(w=h.contentDetails)||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0||(null===(O=ae)||void 0===O||null===(I=O[de])||void 0===I||null===(S=I.closedCaptions)||void 0===S?void 0:S.length)>0)&&(L=(null===(E=ae)||void 0===E||null===(C=E[de])||void 0===C||null===(x=C.contentDetails)||void 0===x?void 0:x.closedCaptions)||(null===(R=ae)||void 0===R||null===(A=R[de])||void 0===A?void 0:A.closedCaptions),D=L.filter((function(e){return"VTT"===e.format||"WEBVTT"===e.format})),Z(i,D)),null!=l&&l.disableControls?v(i):vn(i,Vn(Vn(Vn({},l),he),{},{liveVideo:pe,isDvrEnabled:fe,res:ae,sres:ue})),En(i,Vn(Vn(Vn({},l),he),{},{liveVideo:pe}),a,{res:ae,sres:ue});case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())}},Un={spinco:"e8f2c1a7-5d94-4a1f-93ea-7c0b9186f1cd"};function Hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Fn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Hn(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Hn(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var qn,Jn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=Kn(e);Bn(i,{res:r},e,{resolve:t,reject:o})},Kn=function(e){var n,t,o,i,r,l,a,s,u=null==e?void 0:e.streamingInfo,c=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,d=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,v=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,f=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.posterUrl)||null,p=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.subtitles)||[],m=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(s=a.videoAssets)||void 0===s?void 0:s.drmProvider)||null,g=null==e?void 0:e.token,b=y(g),h=null==b?void 0:b.site;return Fn(Fn({id:null==Un?void 0:Un[h]},!d&&{directPlaybackUrl:null==c?void 0:c.url}),{},{video:{drmEnabled:d,streamingInfo:{videoAssets:Fn(Fn({},m&&{drmProvider:m}),{},{widevine:null==c?void 0:c.widevine,fairPlay:null==c?void 0:c.fairPlay,playReady:null==c?void 0:c.playReady})},liveDetails:{isDvrEnabled:null==u?void 0:u.isDvrEnabled},gist:Fn({},f&&{videoImageUrl:f}),contentDetails:Fn({},(null==p?void 0:p.length)>0&&{closedCaptions:Ee(p)})},ads:{preRoll:{adTags:{web:Fn(Fn({},v&&{active:!0}),v&&{url:v})}}}})};function Wn(e,n){return zn.apply(this,arguments)}function zn(){return(zn=n(t.mark((function e(n,o){var i,r,l,a,s,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,r=o.reject,l=null==n?void 0:n.videoId,a=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,k();case 6:u=e.sent,b(l,u).then((function(e){var t,o,c,d;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(c=o.gist)||void 0===c?void 0:c.contentType,se(null==e?void 0:e.data);var v,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(d=n.watchHistory)&&void 0!==d&&d.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var p,m,g,y=kn((null===(p=n.watchHistory)||void 0===p?void 0:p.profileId)||"",l,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",Bn(a,{res:f},n,{resolve:i,reject:r})}else h(l,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){Bn(a,{res:f},n,{resolve:i,reject:r})}));else Bn(a,{res:f},n,{resolve:i,reject:r})})).catch((function(e){w(e,a,r,l)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gn(e,n){return Xn.apply(this,arguments)}function Xn(){return(Xn=n(t.mark((function e(n,o){var i,r,l,a,s;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.resolve,r=o.reject,e.next=3,k();case 3:l=e.sent,a=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,O(s,l).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Bn(a,{res:t},n,{resolve:i,reject:r})})).catch((function(e){w(e,a,r,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yn(e,n){return Qn.apply(this,arguments)}function Qn(){return(Qn=n(t.mark((function e(n,o){var i,r,l,a,s,u,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.resolve,l=o.reject,e.next=3,k();case 3:a=e.sent,s=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,fe.set(parseInt(u)),c=null==n||null===(i=n.series)||void 0===i?void 0:i.id,I(c,a).then((function(e){var t,o,i,u=e.data,d=e.data.seasons;pe(d);var v=videoId||(null==d||null===(t=d[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.id);S(c,a),b(v,a).then((function(e){var t,o,i;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,se(e.data),Bn(s,{res:null==e?void 0:e.data,sres:u},n,{resolve:r,reject:l})})).catch((function(e){w(e,s,l,videoId)}))})).catch((function(e){w(e,s,l)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $n(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Zn(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$n(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):$n(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function et(){return{loadVideoInstantly:j,onTimeUpdate:J,getVideoDuration:K,onVideoEnded:W,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(t.mark((function n(o,i){var r,l,a,s,u,c,d,v,f,p,m,g,y,h,k,O,I,S,j,T,P,D,E,x,R;return t.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!C(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(y=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,k=(null==e||null===(r=e.epg)||void 0===r?void 0:r.enable)||!1,O=null==e?void 0:e.videoId,I=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=O,j=null==e?void 0:e.token,!V(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",j),B().set(null==e?void 0:e.refreshToken),j&&!U(j)){n.next=16;break}return i({status:!1,msg:"".concat(j?"Token is expired !":"Missing Authorization Token"),response:{token:j}}),n.abrupt("return");case 16:qn=JSON.parse(atob(j.split(".")[1]));case 17:return window.siteName=null===(a=qn)||void 0===a?void 0:a.site,window.siteId=null===(s=qn)||void 0===s?void 0:s.siteId,e.isAnonymousUser=!(null===(u=qn)||void 0===u||!u.anonymousId),e.siteOwner=(null===(c=qn)||void 0===c?void 0:c.site)||null,e.userId=(null===(d=qn)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(v=qn)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,T=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(f=e.series)&&void 0!==f&&f.enable?null:null==e?void 0:e.chromecastReceiverId,P=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(D=null==e?void 0:e.errors)&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,re(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),M.set(e.apiBaseUrl),null!=e&&e.skin&&!ie(e.skin)||(e.skin="VL_ONE"),n.next=35,Fe(e);case 35:P&&Ce("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return H(P)})).catch((function(e){})),(E=null===(g=document)||void 0===g?void 0:g.getElementById("".concat(T)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y?(R={directPlaybackUrl:y,id:x="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?b(x,j).then((function(n){var t=(null==n?void 0:n.data)||{};Bn(T,{res:Zn(Zn({},t),R)},e,{resolve:o,reject:i})})).catch((function(e){w(e,T,i,x)})):Bn(T,{res:R},e,{resolve:o,reject:i})):S?Jn(e,{resolve:o,reject:i}):I?Yn(e,{resolve:o,reject:i}):k?Gn(e,{resolve:o,reject:i}):Wn(e,{resolve:o,reject:i});case 39:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:ne,skip:T,getPlayer:F,play:P,pause:D,detectBrowser:o,rewind:E,loadVideo:u,seekToTimeStamp:z,isPlayerInitialised:C,load:x,authenticateLC:R,dispose:A,enableCaptions:ee,disableCaptions:$,getCaptions:Q,playSelectedResolution:te,getSource:s,setVolume:Re,getVolume:Ae,disableControls:v,setPlaybackSpeed:G,getEntitlementData:L,adsQueuePointManager:N,getSsaiEvents:_,playerEvents:X,onReplay:Y}}export{et as V,Cn as i,Rn as r};