@viewlift/player-backup 2.0.200-backup → 2.0.202-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.
@@ -0,0 +1 @@
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-6b6ff7a7.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),i=require("video.js"),r=require("./util-ac4cdcec.js"),l=require("./captions-68e263dd.js"),a=require("./resolution-9c4872ec.js"),u=require("./skin-eeec7a85.js"),s=require("./player_instance-fcf6a8fb.js"),d=require("./localisation-56e0a999.js"),c=require("./currentVideoInfo-5802821b.js"),v=require("@babel/runtime/helpers/typeof"),p=require("./icons-2609dbe4.js"),f=require("./helper-dbf2fb22.js"),m=require("@babel/runtime/helpers/toConsumableArray"),g=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=s.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=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},w=function(){var n=t(o.mark(function n(t){var r,l,a,u,d;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a=s.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,g("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),console.log("Error",n.t0);case 10:if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(i),(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==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==a||a.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}},n,null,[[2,7]])}));return function(e){return n.apply(this,arguments)}}(),k=function(e,n){var t=s.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=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),g("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)}}(),I=function(){var n=t(o.mark(function n(){return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,import("@viewlift/comscore/index.js").then(function(n){e.comscoreInstanceManager.set(n)});case 2:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),O=function(){var e=t(o.mark(function e(){return o.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)}}(),P=function(){var e=t(o.mark(function e(){var n;return o.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)}}(),j=function(){var e=t(o.mark(function e(){return o.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-96485ab1.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=t(o.mark(function e(){return o.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-d676214f.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)}}(),C=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){g("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:P,loadDvrSeekbar:j,loadContribDash:T,loadComscorePlugin:I});function E(e){return D.apply(this,arguments)}function D(){return(D=t(o.mark(function n(t){var i,r,l;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=(null==t?void 0:t.airplay)||!1,n.next=3,S();case 3:i&&"Safari"==e.detectBrowser()?Promise.resolve().then(function(){return C}).then(function(e){e.importAirplay()}):(l=(null===(r=document)||void 0===r?void 0:r.getElementById(null==t?void 0:t.playerId))||null)&&l.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function x(e){return L.apply(this,arguments)}function L(){return(L=t(o.mark(function e(n){var t,i,r,l,a,u;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=s.getPlayer(n.playerId),e.next=3,I();case 3:u.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,implementationId:null==n||null===(r=n.comscore)||void 0===r?void 0:r.implementationId,projectId:null==n||null===(l=n.comscore)||void 0===l?void 0:l.projectId,debug:(null==n||null===(a=n.comscore)||void 0===a?void 0:a.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function R(e,n){return A.apply(this,arguments)}function A(){return(A=t(o.mark(function n(t,i){var r,l,a,u,s,d,c,v,p,f,m,g,y,h;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=(null==i?void 0:i.contentType)||"video",f=null==i||null===(r=i[p])||void 0===r?void 0:r.drmEnabled,null==i||null===(l=i[p])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,m=(null==i||null===(u=i[p])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,g=(null==t||null===(c=t.comscore)||void 0===c?void 0:c.enable)||!1,y=!(null==t||null===(v=t.analytics)||void 0===v||!v.muxKey),n.prev=7,n.next=10,Promise.allSettled([f?"Safari"==e.detectBrowser()?O():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?T():O():"Safari"!=e.detectBrowser()&&m?T():null,g?x(t):null,y?P():null,w(t)]);case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(7),console.log("Error",n.t0);case 15:case"end":return n.stop()}},n,null,[[7,12]])}))).apply(this,arguments)}function V(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 N(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?V(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):V(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var B=new Set,_=null,M=function(n,t,o,i){var r,l,a,u,s,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p["c3.cm.id"]=(null===(r=n[f])||void 0===r?void 0:r.id)||"Null",p["c3.cm.contentType"]=K(n),p[null==o||null===(l=o.Constants)||void 0===l?void 0:l.IS_LIVE]=!(null==n||!n.linearchannel),p[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=t.currentSrc(),p[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),p["c3.cm.categoryType"]=F(n),p["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"}}(),p.DRMEnabled=(null===(s=n[f])||void 0===s?void 0:s.drmEnabled)||"None",p.DAIStream=null!==(d=n[f])&&void 0!==d&&null!==(v=d.gist)&&void 0!==v&&v.isSSAIEnabled?"YES":"NO",p[o.Constants.DEFAULT_RESOURCE]="AKAMAI",p["c3.cm.brand"]="NULL",p.CDVREnabled=W(n),p["c3.cm.genreList"]=q(n),p["c3.cm.genre"]=H(n),p["c3.cm.channel"]=U(n,i);var m=X(c.getCurrentSeries(),n);return p=N(N({},p),m)},H=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"},q=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"},U=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===o?void 0:o.title)||"NULL"},F=function(e){var n,t;return null!=e&&e.linearchannel?"Linear Channel":null!=e&&null!==(n=e.video)&&void 0!==n&&null!==(t=n.streamingInfo)&&void 0!==t&&t.isLiveStream?"Live Event":"VOD"},W=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"},G=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)},K=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var J,z,X=function(n,t){var o,i,r,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(o=t.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(r=n[s-1])||void 0===r||null===(l=r.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},Y=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"}},Q=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},$=function(){var e=t(o.mark(function e(n,t){var i,r,l,a,u,d,v,p,f,m,g,y;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==t?void 0:t.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,u=i.enable,d=i.appName,p=(v=t||{}).token,f=v.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(m=s.getPlayer(n),"function"==typeof(g=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,g("getConvivaObject");case 10:if(y=e.sent){e.next=13;break}return e.abrupt("return");case 13:m.ready(function(){var e=m.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=Y(t.keySystem);g("contentInfo",{DRMEnabled:o})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),m.on("loadstart",function(){var e,n;_&&_!==m.currentSrc()&&g("playbackEnded"),g("setPlayer",m),B.clear(),_=m.currentSrc();var o=Q(m.currentType()),i=c.getCurrentVideo(),r=M(i,m,y,f);r[null==y||null===(e=y.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",r[null==y||null===(n=y.Constants)||void 0===n?void 0:n.ASSET_NAME]=G(i,t),r.authToken=p||"NULL",r.streamType=o,r.D2CType=l||"NONE",r.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",r["c3.cm.affiliate"]=a||"NULL",Z.setData(r),g("contentInfo",r)}),m.on("loadedmetadata",function(){var e,n=m.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),m.on("play",function(){B.has(m.currentSrc())||(B.add(m.currentSrc()),g("playbackStarted",null))}),m.on("ended",function(){B.has(m.currentSrc())&&B.delete(m.currentSrc()),g("playbackEnded")}),m.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:m,adsLoader:null==e?void 0:e.adsLoader})}),m.on("dispose",function(){null==B||B.clear(),g("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),Z=(J={},{setData:function(e){J=N(N({},J),e)},getData:function(){return J}}),ee=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-dcec0b88.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-f3fe196e.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-eca48b86.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-e80fa829.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-43f75fd5.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-b4b58b28.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-a7db5cc3.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-d1fd17f5.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&Promise.resolve().then(function(){return require("./skin-ef24cd98.js")}).then(function(t){t.initialiseSkin(e,n)})};function ne(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(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ne(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var oe=[],ie=0,re=null;function le(){console.log("Cleaning up watch history data"),z=null,oe=[],ie=0,re=null}function ae(t,o,i){var r,l,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(r=o.watchHistory)||void 0===r||r.apiVersion;var v=null==o||null===(l=o.watchHistory)||void 0===l?void 0:l.profileId,p=Math.floor(t.currentTime()),f=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var m=(null==o||null===(u=o.video)||void 0===u?void 0:u.originalObjectId)||null,g=(null==o||null===(s=o.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,y=Math.floor(t.currentTime()),h=d?100:Math.floor(p/f*100),b={};g?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=ue(i),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(e,t){return te(te({},e),{},n({},t,u[t]))},{}),d=r.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===z});d<0?r.push(te(te({content:s},e),{},{addedDate:l,updateDate:l})):r[d]=te(te(te({},r[d]),e),{},{updateDate:l});localStorage.setItem("".concat(i),JSON.stringify(r))}(b={completed:d,watchedTime:y,watchedPercentage:h},v,o.siteOwner):(b=te(te({videoId:z,watchedTime:y,watchedPercentage:h,doneWatching:d,profileId:v},re&&{seriesId:re}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then(function(e){}).catch(function(e){})),ie=p+i}function ue(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function se(e,n,t){var o=ue(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 de=!1,ce=function(n,t){var o,i,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[r])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!de){var l=ve(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),de=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function ve(e,n,t){if(Array.isArray(e))return e.map(function(e){return ve(e,n,t)});if(null!==e&&"object"===v(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]=ve(e[i],n,t)}),o}return e}function pe(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 fe(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)?fe(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 fe(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 me(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 ge(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?me(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):me(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var ye=function(n,t,o,i){var r,a,u,d,p,f=i.res,m=i.sres,g=s.getPlayer(n),y=(null==f?void 0:f.contentType)||"video",b=(null==f||null===(r=f[y])||void 0===r?void 0:r.drmEnabled)||!1,w=(null==f||null===(a=f[y])||void 0===a||null===(u=a.streamingInfo)||void 0===u?void 0:u.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),g&&(g.on("loadstart",function(){w?o.resolve({status:!0,msg:"Video Loaded",response:f}):o.resolve(ge({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:f}:{response:f}))}),g.on("loadeddata",function(){var o,i,r,a=l.getCaptions(n);if(null==a||a.map(function(e){return l.disableCaptions(n,e.id)}),k&&"Safari"===e.detectBrowser())try{var u;null==g||null===(u=g.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==g||!g.muted())&&h(n,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t,f),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,m=ge(ge({},t),f);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(re=null==n||null===(i=n.series)||void 0===i?void 0:i.id),oe=[],ie=0,z=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=s.getPlayer(e);a&&(a.on("dispose",le),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());oe.includes(ie)||(e!=ie||e<l?e>ie&&(ie=e+l):(oe.push(e),ae(a,n,l)))}}),a.one("ended",function(){ae(a,n,l,!0)}))}(n,m,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=g&&g.mux){var y,b,w,S,I,O,P=(null===(y=c.getCurrentVideo())||void 0===y?void 0:y.video)||(null==f?void 0:f.video),j=null==P?void 0:P.gist,T={env_key:null==t||null===(b=t.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==j?void 0:j.id,video_title:null==j?void 0:j.title,video_series:null==P||null===(S=P.series)||void 0===S?void 0:S.title,video_stream_type:null!=P&&null!==(I=P.streamingInfo)&&void 0!==I&&I.isLiveStream?"live":"video",viewer_user_id:null==t||null===(O=t.analytics)||void 0===O?void 0:O.userId};g.mux({debug:!1,data:T})}}),g.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];g.trigger("subtitlechanged",n)}),g.on("subtitlechanged",function(e,n){var t,o,i,r,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===(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===(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 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)}}),g.tech_.on("retryplaylist",function(){w&&ce(f,n)}),g.on("error",function(){var t,i;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&w)?ce(f,n):(e.handleError(n,(null==g||null===(t=g.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==g||null===(i=g.error())||void 0===i?void 0:i.message)||"Some error occured",response:f}))}),g.one("play",function(){var e,n,o,i,r;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(r=t.series)&&void 0!==r&&r.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(){g.currentTime(p)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){g.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=g&&g.dvrSeekbar)try{g.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),g.on("volumechange",function(){var e=100*g.volume().toFixed(2);g.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),g.on("chromecastDisconnected",function(){if(w){g.currentSource();for(var e=g.textTracks(),n=e.length-1;n>=0;n--)g.removeRemoteTextTrack(e[n])}}),g.one("loadeddata",function(){var n,t=(null==g||null===(n=g.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.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(g.dash)){var o,i,r,l=null==g||null===(o=g.dash)||void 0===o||null===(i=o.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")}),u=pe(t);try{for(u.s();!(r=u.n()).done;){var s=r.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=pe(t);try{for(c.s();!(d=c.n()).done;){var p,f,m,y=d.value;if(("Chrome"==e.detectBrowser()||"Edge"==e.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(f=p.userAgent)&&void 0!==f&&f.includes("Macintosh")||!b))&&null!=y&&null!==(m=y.label)&&void 0!==m&&m.includes("5.1"))g.audioTracks().removeTrack(y);else{if("main"==y.kind){y.enabled=!0;break}y.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function he(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 be(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function we(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 ke(e,n){var t=s.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,r=n.videoId;n.epg;var l=i.playLive,a=i.playFromBegining,u=i.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",function(){f.checkDvrStartOverEnabled(n)?a?f.playFromBeginningHandler(t,n):l?f.playLiveOrResumeHandler(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,u=a.watchLive;a.resume;var s=a.startFromBegining,d=i;if(r&&null!=r&&r.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),m=document.querySelector(".vjs-dvr-btn-overlay");m||((m=document.createElement("div")).className="vjs-dvr-btn-overlay");var g=f.getCurrentProgramThumbnail(n);g&&(m.style.backgroundImage="url(".concat(g,")"),m.style.backgroundPosition="center center",m.style.backgroundRepeat="no-repeat",m.style.backgroundSize="cover");m.innerHTML=function(){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(p.watchLiveIcon2()," ").concat(l,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==r?void 0:r.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}(o,v),m.style.display="flex",e.el().appendChild(m),f.pauseAndHideControl(e),Se("watch-live-resume-btn",u,function(){f.showControl(e,m),f.playLiveOrResumeHandler(e,d)}),Se("watch-begining-btn",s,function(){f.showControl(e,m),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(),i=!1,r=e.seekable(),l=r.start(0),a=r.end(r.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(){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(!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(!i){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){we(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 u=e.controlBar.progressControl.seekBar.el(),s=he(o,i,Math.min(r/n*100,99.5));u.appendChild(s)}})}(e,a))}})}(t,n)})}else console.warn("Player instance is required to initialize start over.")}function Se(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 Ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function Oe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ie(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Pe=function(r,a,d,c){var v,p,f,m,g,y,h,b,w,S,I,O,P,j,T,C,E,D,x,L,A,V,N,B,_,M,H,q,U,F,W,G,K,J,z,X,Y,Q=a.res,ne=void 0===Q?null:Q,te=a.sres,oe=void 0===te?null:te,ie=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],re=(null===(v=ne)||void 0===v?void 0:v.contentType)||"video",le=u.impolicy16x9(null===(p=ne)||void 0===p||null===(f=p[re])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(g=ne)||void 0===g||null===(y=g[re])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),ae=(null===(w=ne)||void 0===w||null===(S=w[re])||void 0===S||null===(I=S.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ue=(null===(O=ne)||void 0===O||null===(P=O[re])||void 0===P||null===(j=P.streamingInfo)||void 0===j?void 0:j.isLiveStream)||!1,se=(null===(T=ne)||void 0===T||null===(C=T.ads)||void 0===C||null===(E=C.preRoll)||void 0===E||null===(D=E.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(L=ne)||void 0===L||null===(A=L.ads)||void 0===A||null===(V=A.preRoll)||void 0===V||null===(N=V.adTags)||void 0===N||null===(B=N.web)||void 0===B?void 0:B.url);ne=Oe(Oe({},ne),{},{audioAssetSource:null==d?void 0:d.audioAssetSource});var de=(null==d||null===(_=d.customData)||void 0===_?void 0:_.ads)||{},ce=(null===(M=ne)||void 0===M||null===(H=M[re])||void 0===H?void 0:H.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==de?void 0:de.vodAdSticherProvider)||!1,ve=(null==d?void 0:d.latency)||6,pe=(null==d?void 0:d.skin_settings)||{};null==d||d.dvrConfig;var fe=(X={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==pe?void 0:pe.pictureInPictureToggle)||!1},playbackRates:null!=pe&&pe.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==d.skin,liveui:ae},n(X,"autoplay",null==d?void 0:d.autoplay),n(X,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!se),n(X,"loop",(null==d?void 0:d.loop)||!1),n(X,"audioPosterMode",null==d?void 0:d.audioPosterMode),n(X,"html5",Oe(Oe({dash:Oe(Oe(Oe({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(q=d.debugConfig)||void 0===q?void 0:q.enable)&&{debug:!0,logLevel:null!=d&&null!==(U=d.debugConfig)&&void 0!==U&&U.logLevel?null==d||null===(F=d.debugConfig)||void 0===F?void 0:F.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:ve},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:Oe(Oe({},(null==d?void 0:d.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==d?void 0:d.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Oe(Oe(Oe({},(null==d?void 0:d.initialBandwidth)&&{bandwidth:d.initialBandwidth}),{},{liveRangeSafeTimeDelta:ve,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==d||null===(W=d.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(G=null==d?void 0:d.enableLowInitialPlaylist)||void 0===G||G}),debug:(null==d?void 0:d.debugConfig)&&(null==d||null===(K=d.debugConfig)||void 0===K?void 0:K.enable)||!1,nativeTextTracks:"Safari"==e.detectBrowser()},0==(null==d||null===(J=d.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(z=d.customData)||void 0===z?void 0:z.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(X,"poster",le),n(X,"techOrder",ie),n(X,"chromecast",{requestCustomDataFn:function(e){var n,t,o=s.getPlayer(r),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),l=function(e,n,t){var o,i,r,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 m,g,y,h,b,w,k,S;f.isDrmEnabled=!0;var I=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,O=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(y=g[0])||void 0===y||null===(h=y.options)||void 0===h?void 0:h.serverURL);f.licenseUrl=O;var P=(null==I?void 0:I.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 j=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=j;var T=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=T;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}(ne,e,i);return Oe(Oe({},l),{},{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},Z.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,l,a=s.getPlayer(r),u=(null==a?void 0:a.currentSource())||{};!(null===(n=ne)||void 0===n||null===(t=n[re])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(l=u.src)&&void 0!==l&&l.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),X);if(!i.getPlayers()[r]){null!=d&&d.debugConfig&&null!=d&&null!==(Y=d.debugConfig)&&void 0!==Y&&Y.enable&&i.log.level("debug");var me=i(r,fe,function(){var n=t(o.mark(function n(){var t,a,u,s,v,p,f,m,g,y,h,b,w,S,I,O,P,j,T,C,E;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(me),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,R(d,ne);case 5:if(w=null===(t=ne)||void 0===t||null===(a=t[re])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ue&&c.resolve(Oe({status:!0,msg:"Player Initialised"},oe?{seriesResponse:oe,response:ne}:{response:ne})),ae&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&ke(r,Oe(Oe({},d),{},{isDvrEnabled:ae})),e.inititateBeacon(r,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),$(r,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),ae&&k(r,w),!se||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(r,se,ne),S=e.getSource(ne,r),console.log(S),null!=d&&d.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,d.nearestClusterUrl)),!ce){n.next=21;break}return n.next=20,e.getSGAIEnabledSource(r,ne);case 20:S=n.sent;case 21:S?e.loadVideo(r,S):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:ne}),e.handleError(r,"Incompatible / Missing Source")),((null===(p=ne)||void 0===p||null===(f=p[re])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=ne)||void 0===y||null===(h=y[re])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(E=(null===(O=ne)||void 0===O||null===(P=O[re])||void 0===P||null===(j=P.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null===(T=ne)||void 0===T||null===(C=T[re])||void 0===C?void 0:C.closedCaptions),I=E.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),l.addCaptions(r,I)),null!=d&&d.disableControls?e.disableControls(r):ee(r,Oe(Oe(Oe({},d),fe),{},{liveVideo:ue,isDvrEnabled:ae,res:ne,sres:oe})),ye(r,Oe(Oe(Oe({},d),fe),{},{liveVideo:ue}),c,{res:ne,sres:oe});case 25:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function je(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(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?je(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):je(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Ce,Ee=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,r=De(e);Pe(i,{res:r},e,{resolve:t,reject:o})},De=function(n){var t,o,i,r,l,a,u,s,d,c,v,p=null==n?void 0:n.streamingInfo,f=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,g=(null==n||null===(o=n.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,y=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(r=i.ads)||void 0===r?void 0:r.url)||null,h=(null==n||null===(l=n.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,b=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],w=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,k=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],S=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,I=null==n?void 0:n.token,O=e.getDecodedToken(I);null==O||O.site;var P=null==O?void 0:O.siteId;return Te(Te({id:"".concat(P,"_external")},!g&&{directPlaybackUrl:null==f?void 0:f.url}),{},{video:Te(Te({drmEnabled:g,streamingInfo:Te({videoAssets:Te(Te({},w&&{drmProvider:w}),{},{widevine:null==f?void 0:f.widevine,fairPlay:null==f?void 0:f.fairPlay,playReady:null==f?void 0:f.playReady})},(null==p?void 0:p.isDvrEnabled)&&{isLiveStream:!0})},S&&{isSSAIEnabled:S}),{},{metadata:k,liveDetails:{isDvrEnabled:null==p?void 0:p.isDvrEnabled},gist:Te({},h&&{videoImageUrl:h}),contentDetails:Te({},(null==b?void 0:b.length)>0&&{closedCaptions:m(b)})}),ads:{preRoll:{adTags:{web:Te(Te({},y&&{active:!0}),y&&{url:y})}}}})};function xe(e,n){return Le.apply(this,arguments)}function Le(){return(Le=t(o.mark(function n(t,i){var r,l,a,u,s,d,v,p,f;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,v=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:p=n.sent,f=!1===(null==t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,p,f).then(function(n){var o,i,r,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(null==n?void 0:n.data);var f,m=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.enable&&!v)if((null===(f=t.watchHistory)||void 0===f?void 0:f.saveOffline)||!1){var g,y,h,b=se((null===(g=t.watchHistory)||void 0===g?void 0:g.profileId)||"",s,null==t?void 0:t.siteOwner);if(b&&b.length)t.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(h=b[0])||void 0===h?void 0:h.watchedPercentage)||null;m.contentType="video",Pe(d,{res:m},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then(function(e){var n,o,i,r,l,a;null!==(n=window)&&void 0!==n&&null!==(o=n.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)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,m.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(){Pe(d,{res:m},t,{resolve:a,reject:u})});else Pe(d,{res:m},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Re(e,n){return Ae.apply(this,arguments)}function Ae(){return(Ae=t(o.mark(function n(t,i){var r,l,a,u,s,d,c,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(r=t.customData)||void 0===r||null===(l=r.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getLinearChannelDetails(c,s,v).then(function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==c?void 0:c.channelId,Pe(d,{res:n},t,{resolve:a,reject:u})}).catch(function(n){e.initiateErrorHandling(n,d,u,videoId)});case 8:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Ve(e,n){return Ne.apply(this,arguments)}function Ne(){return(Ne=t(o.mark(function n(t,i){var r,l,a,u,s,d,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==t||null===(r=t.series)||void 0===r?void 0:r.id,e.getSeriesDetails(v,u).then(function(n){var o,i,r,d=n.data,p=n.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(o=p[0])||void 0===o||null===(i=o.episodes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.id);e.createSeriesWatchMap(v,u),e.getVideoDetails(f,u).then(function(e){var n,o,i;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(o=n.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Pe(s,{res:null==e?void 0:e.data,sres:d},t,{resolve:l,reject:a})}).catch(function(n){e.initiateErrorHandling(n,s,a,videoId)})}).catch(function(n){e.initiateErrorHandling(n,s,a)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Be(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(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Be(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:r.onTimeUpdate,getVideoDuration:r.getVideoDuration,onVideoEnded:r.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(o.mark(function t(i,r){var l,a,s,c,v,p,f,m,y,h,b,w,k,S,I,O,P,j,T,C,D,x,L,R,A;return o.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(k=(null==n?void 0:n.videoSourceUrl)||!1,S=null==n?void 0:n.asat,I=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,P=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,j=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,T=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",T),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),T&&!e.isTokenExpired(T)){t.next=16;break}return r({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),t.abrupt("return");case 16:Ce=JSON.parse(atob(T.split(".")[1]));case 17:return window.siteName=null===(s=Ce)||void 0===s?void 0:s.site,window.siteId=null===(c=Ce)||void 0===c?void 0:c.siteId,n.isAnonymousUser=!(null===(v=Ce)||void 0===v||!v.anonymousId),n.siteOwner=(null===(p=Ce)||void 0===p?void 0:p.site)||null,n.userId=(null===(f=Ce)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(m=Ce)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,C=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(y=n.series)&&void 0!==y&&y.enable?null:null==n?void 0:n.chromecastReceiverId,D=(null==n||null===(h=n.analytics)||void 0===h?void 0:h.gaId)||null,(x=null==n?void 0:n.errors)&&(window.customErrors=x),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(b=n.customData)||void 0===b?void 0:b.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=35,E(n);case 35:D&&g("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then(function(){return e.runGtag(D)}).catch(function(e){}),(L=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(C)))&&L.addEventListener("contextmenu",function(e){return e.preventDefault()}),k?(A={directPlaybackUrl:k,id:R="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?e.getVideoDetails(R,T).then(function(e){var t=(null==e?void 0:e.data)||{};Pe(C,{res:_e(_e({},t),A)},n,{resolve:i,reject:r})}).catch(function(n){e.initiateErrorHandling(n,C,r,R)}):Pe(C,{res:A},n,{resolve:i,reject:r})):j?Ee(n,{resolve:i,reject:r}):P?Ve(n,{resolve:i,reject:r}):I?Re(n,{resolve:i,reject:r}):xe(n,{resolve:i,reject:r});case 39:case"end":return t.stop()}},t)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:r.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:e.getSource,setVolume:h,getVolume:b,disableControls:e.disableControls,setPlaybackSpeed:r.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:e.adsQueuePointManager,getSsaiEvents:e.getSsaiEvents,playerEvents:r.playerEvents,onReplay:r.onReplay,isBehindLive:e.isBehindLive}},exports.initiateMarker=function(e){var n=s.getPlayer(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;be(),we(r).forEach(function(e){var n=e.id,t=e.title,i=e.time,l=he(n,t,Math.min(i/r*100,99.5));o.appendChild(l)})}},exports.removeMarkers=be;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css"),require("./generic-6b6ff7a7.js"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js");var e=require("./index-dfe6d734.js");require("./util-ac4cdcec.js"),require("./captions-68e263dd.js"),require("./resolution-9c4872ec.js"),require("./skin-eeec7a85.js"),require("./localisation-56e0a999.js"),require("./player_instance-fcf6a8fb.js"),require("axios"),require("js-cookie"),require("./currentVideoInfo-5802821b.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("./icons-2609dbe4.js"),require("./helper-dbf2fb22.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("./generic-6b6ff7a7.js"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js");var e=require("./index-20d3ba56.js");require("./util-ac4cdcec.js"),require("./captions-68e263dd.js"),require("./resolution-9c4872ec.js"),require("./skin-eeec7a85.js"),require("./localisation-56e0a999.js"),require("./player_instance-fcf6a8fb.js"),require("axios"),require("js-cookie"),require("./currentVideoInfo-5802821b.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/slicedToArray"),require("@viewlift/comscore/index.js"),require("./icons-2609dbe4.js"),require("./helper-dbf2fb22.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-5c9d7665.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-8fecb085.js"),r=require("./index-f53862fe.js"),n=require("./generic-6b6ff7a7.js");require("videojs-contrib-quality-menu");var o=require("./index-dfe6d734.js"),t=require("./helper-dbf2fb22.js"),u=require("./currentVideoInfo-5802821b.js"),a=require("video.js"),d=require("./icons-2609dbe4.js");require("@babel/runtime/helpers/defineProperty"),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-9c4872ec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/assertThisInitialized"),require("./skin-eeec7a85.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-a10c4797.js"),require("./util-ac4cdcec.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/slicedToArray"),require("axios"),require("js-cookie"),require("./captions-68e263dd.js"),require("@viewlift/comscore/index.js"),require("video.js/dist/video-js.min.css");function s(a,d){var s=l.getPlayer(a);s&&(s.on("loadeddata",function(){var e,v,c,p,m,g=t.checkDvrStartOverEnabled(d),b=u.getCurrentEpgPrograms();s.qualityLevels()&&s.qualityLevels().length&&function(e){var i=l.getPlayer(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(a),!(null!=d&&null!==(e=d.series)&&void 0!==e&&e.enable||null!==(v=window)&&void 0!==v&&null!==(c=v.app_data)&&void 0!==c&&null!==(p=c.appcmsMain)&&void 0!==p&&null!==(m=p.features)&&void 0!==m&&m.auto_play)||null!=d&&d.liveVideo||i.addNextEpPreview(a,d),null!=d&&d.liveVideo||n.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||r.initiateTrickplay(a),g&&b&&b.length?o.initiateMarker(a):o.removeMarkers()}),s.one("play",function(){var l,i,r,n;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(a,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)}))}var v=function(e,i){var r,n,o,t,u,d,s,v,c,p,m,g,b=l.getPlayer(e),h=(null==i?void 0:i.theme)||{},y=a.dom.$(".vjs-play-progress"),q=a.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");q&&(q.style.color="".concat(null===(r=window)||void 0===r||null===(n=r.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(t=o.brand)||void 0===t||null===(u=t.cta)||void 0===u||null===(d=u.primary)||void 0===d?void 0:d.backgroundColor)),y&&(y.style.background="".concat(null===(s=window)||void 0===s||null===(v=s.app_data)||void 0===v||null===(c=v.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(m=p.cta)||void 0===m||null===(g=m.primary)||void 0===g?void 0:g.backgroundColor));var f=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&y&&(y.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&f&&(f.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&q&&(q.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?f.el().style.borderRadius=".3em":f.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(r,o){l.getPlayer(r).addClass("skin_vlone"),s(r,o),function(r,o){var a,s,v,c,p,m,g,b,h,y=l.getPlayer(r),q=(null==o?void 0:o.liveVideo)||!1,f=(null==o||null===(a=o.res)||void 0===a?void 0:a.contentType)||"video",j=(null==o||null===(s=o.res)||void 0===s||null===(v=s[f])||void 0===v?void 0:v.isSSAIEnabled)||!1,k=n.getSource(null==o?void 0:o.res,r)||{};k.src;var w=(null==o?void 0:o.skin_settings)||{},C=(null==o||null===(c=o.customData)||void 0===c?void 0:c.ads)||{};if(t.checkDvrStartOverEnabled(o),q&&!(null!=o&&o.liveui)){var B,S,T=(null==y||null===(B=y.controlBar)||void 0===B||null===(S=B.getChild("LiveDisplay"))||void 0===S?void 0:S.el())||null;T&&(T.onclick=function(){try{var e;null==y||null===(e=y.liveTracker)||void 0===e||e.seekToLiveEdge()}catch(e){console.log(e,"Cannot seek to LE")}})}null!=w&&w.skipBtn&&0==(null==o?void 0:o.liveVideo)&&0==(null==o?void 0:o.liveui)&&e.addSkipButton(r,"VL_ONE",d.SkipSvgV2());(null!=w&&w.rewindBtn&&0==(null==o?void 0:o.liveVideo)&&0==(null==o?void 0:o.liveui)||1==(null==o?void 0:o.liveui))&&e.addRewindButton(r,"VL_ONE",d.RewindSvgV2());(null==o||null===(p=o.relatedVideos)||void 0===p||null===(m=p.content)||void 0===m?void 0:m.length)>0&&e.addVideoSelector(r,null==o?void 0:o.relatedVideos);null!=o&&null!==(g=o.series)&&void 0!==g&&g.enable&&e.addSeriesSelectorV2(r,o);(null==o||null===(b=o.streams)||void 0===b?void 0:b.length)>1&&e.addMulticamSelector(r,null==o?void 0:o.streams);if(i.addTVProviderImage(r,o),n.initialiseKeyboardEvents(r,o),"MEDIA_TAILOR"==(null==C?void 0:C.vodAdSticherProvider)&&null!=C&&C.vodAdClientSideTracking&&j)if(q)n.setupAdvertisementMarkersForLinear(r);else{var L,M=null;if(null!=o&&null!==(L=o.series)&&void 0!==L&&L.enable){var V,E,P,x,A,D=null===(V=u.getCurrentVideo())||void 0===V||null===(E=V.video)||void 0===E||null===(P=E.gist)||void 0===P?void 0:P.id,O=u.getSeriesWatchMap(),_=(null==O?void 0:O.get(D))||{t:0,p:0},I=_.t,R=_.p;"function"==typeof(null===(x=window)||void 0===x||null===(A=x.watchHistory)||void 0===A?void 0:A.cb)&&window.watchHistory.cb({watchedTime:I}),R<95&&(M=I)}else{var N=o.watchHistoryResumeTime;o.watchedPercentage<95&&(M=N)}n.setupAdvertisementMarkers(r,M)}null!=o&&o.isDvrEnabled&&null!=o&&null!==(h=o.dvrConfig)&&void 0!==h&&h.enable&&(e.addStartFromBeginningButton(r,o),e.addWatchLiveButton(r,o))}(r,o),v(r,o),function(e){var i,r,n,o=l.getPlayer(e),t=null;if(!o)return;var u=o.controlBar.getChild("VolumePanel"),a=null===(i=u.getChild("MuteToggle"))||void 0===i?void 0:i.el(),d=null==u||null===(r=u.el())||void 0===r?void 0:r.querySelector(".vjs-volume-bar"),s=null==u||null===(n=u.el())||void 0===n?void 0:n.querySelector(".vjs-volume-level");if(!u||!d||!s)return;function v(e){e.preventDefault(),t&&(clearTimeout(t),t=null),p(m(e.touches[0]))}function c(e){e.preventDefault(),p(m(e.changedTouches[0])),t=setTimeout(function(){u.el().classList.remove("vjs-hover")},2e3)}function p(e){var l=Math.min(Math.max(e,0),100);s.style.height=l+"%",d.setAttribute("aria-valuenow",l),d.setAttribute("aria-valuetext",l+"%"),o.volume(l/100)}function m(e){var l=d.getBoundingClientRect(),i=e.clientY-l.top,r=l.height;return 100-Math.min(Math.max(i/r*100,0),100)}a.addEventListener("touchend",function(){null!=u&&u.el()&&(u.el().classList.toggle("vjs-hover"),o.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout(function(){u.el().classList.remove("vjs-hover")},2e3))}),d.addEventListener("touchmove",v,{passive:!1}),d.addEventListener("touchstart",v,{passive:!1}),d.addEventListener("touchend",c,{passive:!1})}(r)};
1
+ "use strict";var e=require("./features-5c9d7665.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-8fecb085.js"),r=require("./index-f53862fe.js"),n=require("./generic-6b6ff7a7.js");require("videojs-contrib-quality-menu");var o=require("./index-20d3ba56.js"),t=require("./helper-dbf2fb22.js"),u=require("./currentVideoInfo-5802821b.js"),a=require("video.js"),d=require("./icons-2609dbe4.js");require("@babel/runtime/helpers/defineProperty"),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-9c4872ec.js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/assertThisInitialized"),require("./skin-eeec7a85.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-a10c4797.js"),require("./util-ac4cdcec.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/slicedToArray"),require("axios"),require("js-cookie"),require("./captions-68e263dd.js"),require("@viewlift/comscore/index.js"),require("video.js/dist/video-js.min.css");function s(a,d){var s=l.getPlayer(a);s&&(s.on("loadeddata",function(){var e,v,c,p,m,g=t.checkDvrStartOverEnabled(d),b=u.getCurrentEpgPrograms();s.qualityLevels()&&s.qualityLevels().length&&function(e){var i=l.getPlayer(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(a),!(null!=d&&null!==(e=d.series)&&void 0!==e&&e.enable||null!==(v=window)&&void 0!==v&&null!==(c=v.app_data)&&void 0!==c&&null!==(p=c.appcmsMain)&&void 0!==p&&null!==(m=p.features)&&void 0!==m&&m.auto_play)||null!=d&&d.liveVideo||i.addNextEpPreview(a,d),null!=d&&d.liveVideo||n.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||r.initiateTrickplay(a),g&&b&&b.length?o.initiateMarker(a):o.removeMarkers()}),s.one("play",function(){var l,i,r,n;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(a,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)}))}var v=function(e,i){var r,n,o,t,u,d,s,v,c,p,m,g,b=l.getPlayer(e),h=(null==i?void 0:i.theme)||{},y=a.dom.$(".vjs-play-progress"),q=a.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");q&&(q.style.color="".concat(null===(r=window)||void 0===r||null===(n=r.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(t=o.brand)||void 0===t||null===(u=t.cta)||void 0===u||null===(d=u.primary)||void 0===d?void 0:d.backgroundColor)),y&&(y.style.background="".concat(null===(s=window)||void 0===s||null===(v=s.app_data)||void 0===v||null===(c=v.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(m=p.cta)||void 0===m||null===(g=m.primary)||void 0===g?void 0:g.backgroundColor));var f=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&y&&(y.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&f&&(f.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&q&&(q.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?f.el().style.borderRadius=".3em":f.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(r,o){l.getPlayer(r).addClass("skin_vlone"),s(r,o),function(r,o){var a,s,v,c,p,m,g,b,h,y=l.getPlayer(r),q=(null==o?void 0:o.liveVideo)||!1,f=(null==o||null===(a=o.res)||void 0===a?void 0:a.contentType)||"video",j=(null==o||null===(s=o.res)||void 0===s||null===(v=s[f])||void 0===v?void 0:v.isSSAIEnabled)||!1,k=n.getSource(null==o?void 0:o.res,r)||{};k.src;var w=(null==o?void 0:o.skin_settings)||{},C=(null==o||null===(c=o.customData)||void 0===c?void 0:c.ads)||{};if(t.checkDvrStartOverEnabled(o),q&&!(null!=o&&o.liveui)){var B,S,T=(null==y||null===(B=y.controlBar)||void 0===B||null===(S=B.getChild("LiveDisplay"))||void 0===S?void 0:S.el())||null;T&&(T.onclick=function(){try{var e;null==y||null===(e=y.liveTracker)||void 0===e||e.seekToLiveEdge()}catch(e){console.log(e,"Cannot seek to LE")}})}null!=w&&w.skipBtn&&0==(null==o?void 0:o.liveVideo)&&0==(null==o?void 0:o.liveui)&&e.addSkipButton(r,"VL_ONE",d.SkipSvgV2());(null!=w&&w.rewindBtn&&0==(null==o?void 0:o.liveVideo)&&0==(null==o?void 0:o.liveui)||1==(null==o?void 0:o.liveui))&&e.addRewindButton(r,"VL_ONE",d.RewindSvgV2());(null==o||null===(p=o.relatedVideos)||void 0===p||null===(m=p.content)||void 0===m?void 0:m.length)>0&&e.addVideoSelector(r,null==o?void 0:o.relatedVideos);null!=o&&null!==(g=o.series)&&void 0!==g&&g.enable&&e.addSeriesSelectorV2(r,o);(null==o||null===(b=o.streams)||void 0===b?void 0:b.length)>1&&e.addMulticamSelector(r,null==o?void 0:o.streams);if(i.addTVProviderImage(r,o),n.initialiseKeyboardEvents(r,o),"MEDIA_TAILOR"==(null==C?void 0:C.vodAdSticherProvider)&&null!=C&&C.vodAdClientSideTracking&&j)if(q)n.setupAdvertisementMarkersForLinear(r);else{var L,M=null;if(null!=o&&null!==(L=o.series)&&void 0!==L&&L.enable){var V,E,P,x,A,D=null===(V=u.getCurrentVideo())||void 0===V||null===(E=V.video)||void 0===E||null===(P=E.gist)||void 0===P?void 0:P.id,O=u.getSeriesWatchMap(),_=(null==O?void 0:O.get(D))||{t:0,p:0},I=_.t,R=_.p;"function"==typeof(null===(x=window)||void 0===x||null===(A=x.watchHistory)||void 0===A?void 0:A.cb)&&window.watchHistory.cb({watchedTime:I}),R<95&&(M=I)}else{var N=o.watchHistoryResumeTime;o.watchedPercentage<95&&(M=N)}n.setupAdvertisementMarkers(r,M)}null!=o&&o.isDvrEnabled&&null!=o&&null!==(h=o.dvrConfig)&&void 0!==h&&h.enable&&(e.addStartFromBeginningButton(r,o),e.addWatchLiveButton(r,o))}(r,o),v(r,o),function(e){var i,r,n,o=l.getPlayer(e),t=null;if(!o)return;var u=o.controlBar.getChild("VolumePanel"),a=null===(i=u.getChild("MuteToggle"))||void 0===i?void 0:i.el(),d=null==u||null===(r=u.el())||void 0===r?void 0:r.querySelector(".vjs-volume-bar"),s=null==u||null===(n=u.el())||void 0===n?void 0:n.querySelector(".vjs-volume-level");if(!u||!d||!s)return;function v(e){e.preventDefault(),t&&(clearTimeout(t),t=null),p(m(e.touches[0]))}function c(e){e.preventDefault(),p(m(e.changedTouches[0])),t=setTimeout(function(){u.el().classList.remove("vjs-hover")},2e3)}function p(e){var l=Math.min(Math.max(e,0),100);s.style.height=l+"%",d.setAttribute("aria-valuenow",l),d.setAttribute("aria-valuetext",l+"%"),o.volume(l/100)}function m(e){var l=d.getBoundingClientRect(),i=e.clientY-l.top,r=l.height;return 100-Math.min(Math.max(i/r*100,0),100)}a.addEventListener("touchend",function(){null!=u&&u.el()&&(u.el().classList.toggle("vjs-hover"),o.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout(function(){u.el().classList.remove("vjs-hover")},2e3))}),d.addEventListener("touchmove",v,{passive:!1}),d.addEventListener("touchstart",v,{passive:!1}),d.addEventListener("touchend",c,{passive:!1})}(r)};