@viewlift/player-backup 2.0.204-backup → 2.0.206-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 +262 -262
- package/cjs/{index-c30e866b.js → index-a792959a.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/{skin-7444cf90.js → skin-26de3085.js} +1 -1
- package/esm/bundle.css +262 -262
- package/esm/{index-69dba67d.js → index-5ea757fb.js} +1 -1
- package/esm/index.js +1 -1
- package/esm/{skin-76caf837.js → skin-e5082af0.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-923160fd.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),r=require("video.js"),i=require("./util-4c4c0ff1.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=require("@babel/runtime/helpers/slicedToArray"),y=function(e){return new Promise(function(n,t){if(h(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)}})},h=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},b=function(e,n,t){var o=s.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var r=parseFloat(n)/100;o.volume(r),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,"'")})},w=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},k=function(){var n=t(o.mark(function n(t){var i,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!==(i=t.series)&&void 0!==i&&i.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,y("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(r),(d=r.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)}}(),S=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,a,u=this.el(),s=r.dom.getPointerPosition(u,n).x;r.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===(i=o.framework)||void 0===i||null===(l=i.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 I=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"),y("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 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)}}(),P=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){r.getPlugin("eme")||r.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),T=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(r),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)}}(),D=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)}}(),E=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-4bac123d.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){y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(r)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(r)})},loadAdsLibrary:I,loadEMELibrary:P,loadMuxPlugin:T,loadDvrSeekbar:D,loadContribDash:E,loadComscorePlugin:O});function j(e){return x.apply(this,arguments)}function x(){return(x=t(o.mark(function n(t){var r,i,l;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=(null==t?void 0:t.airplay)||!1,n.next=3,I();case 3:r&&"Safari"==e.detectBrowser()?Promise.resolve().then(function(){return C}).then(function(e){e.importAirplay()}):(l=(null===(i=document)||void 0===i?void 0:i.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 L(e){return A.apply(this,arguments)}function A(){return(A=t(o.mark(function e(n){var t,r,i,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,O();case 3:u.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(r=n.comscore)||void 0===r?void 0:r.endpoint,implementationId:null==n||null===(i=n.comscore)||void 0===i?void 0:i.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 N.apply(this,arguments)}function N(){return(N=t(o.mark(function n(t,r){var i,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==r?void 0:r.contentType)||"video",f=null==r||null===(i=r[p])||void 0===i?void 0:i.drmEnabled,null==r||null===(l=r[p])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,m=(null==r||null===(u=r[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()?P():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?E():P():"Safari"!=e.detectBrowser()&&m?E():null,g?L(t):null,y?T():null,k(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 M(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 V(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?M(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):M(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var B=new Set,_=null,H=function(n,t,o,r){var i,l,a,u,s,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p["c3.cm.id"]=(null===(i=n[f])||void 0===i?void 0:i.id)||"Null",p["c3.cm.contentType"]=Y(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"]=W(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=G(n),p["c3.cm.genreList"]=U(n),p["c3.cm.genre"]=q(n),p["c3.cm.channel"]=F(n,r);var m=X(c.getCurrentSeries(),n);return p=V(V({},p),m)},q=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"},U=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"},F=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"VOD":(null===(o=((null==e||null===(t=e[r])||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"},W=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"},G=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"},K=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)},Y=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var J,z,X=function(n,t){var o,r,i,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===(r=o.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==n||null===(i=n[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},Q=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"}},$=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Z=function(){var e=t(o.mark(function e(n,t){var r,i,l,a,u,d,v,p,f,m,g,y;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==t?void 0:t.convivaConfig)||{},i=r.trackConvivaPlayerEvent,l=r.paymentHandler,a=r.tveProvider,u=r.enable,d=r.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=i)){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=Q(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=$(m.currentType()),r=c.getCurrentVideo(),i=H(r,m,y,f);i[null==y||null===(e=y.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",i[null==y||null===(n=y.Constants)||void 0===n?void 0:n.ASSET_NAME]=K(r,t),i.authToken=p||"NULL",i.streamType=o,i.D2CType=l||"NONE",i.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",i["c3.cm.affiliate"]=a||"NULL",ee.setData(i),g("contentInfo",i)}),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)}}(),ee=(J={},{setData:function(e){J=V(V({},J),e)},getData:function(){return J}}),ne=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-db33fcff.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-2ba328a4.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-d5d4ccea.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-5435286d.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-d0a9df1c.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-7444cf90.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-90aa6c9c.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-c06ff1c8.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&Promise.resolve().then(function(){return require("./skin-0bf9fb6b.js")}).then(function(t){t.initialiseSkin(e,n)})};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 oe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?te(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):te(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var re=[],ie=0,le=null;function ae(){console.log("Cleaning up watch history data"),z=null,re=[],ie=0,le=null}function ue(t,o,r){var i,l,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(i=o.watchHistory)||void 0===i||i.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 r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),i=se(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(e,t){return oe(oe({},e),{},n({},t,u[t]))},{}),d=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===z});d<0?i.push(oe(oe({content:s},e),{},{addedDate:l,updateDate:l})):i[d]=oe(oe(oe({},i[d]),e),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(i))}(b={completed:d,watchedTime:y,watchedPercentage:h},v,o.siteOwner):(b=oe(oe({videoId:z,watchedTime:y,watchedPercentage:h,doneWatching:d,profileId:v},le&&{seriesId:le}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then(function(e){}).catch(function(e){})),ie=p+r}function se(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function de(e,n,t){var o=se(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 ce=!1,ve=function(n,t){var o,r,i=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[i])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!ce){var l=pe(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ce=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function pe(e,n,t){if(Array.isArray(e))return e.map(function(e){return pe(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]=pe(e[r],n,t)}),o}return e}function fe(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 me(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)?me(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 me(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 ge(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 ye(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ge(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var he=function(n,t,o,r){var i,a,u,d,p,f=r.res,m=r.sres,g=s.getPlayer(n),y=(null==f?void 0:f.contentType)||"video",h=(null==f||null===(i=f[y])||void 0===i?void 0:i.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(ye({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:f}:{response:f}))}),g.on("loadeddata",function(){var o,r,i,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())&&b(n,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var v,p,m=ye(ye({},t),f);!function(e,n,t){var o,r,i;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(le=null==n||null===(r=n.series)||void 0===r?void 0:r.id),re=[],ie=0,z=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=s.getPlayer(e);a&&(a.on("dispose",ae),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());re.includes(ie)||(e!=ie||e<l?e>ie&&(ie=e+l):(re.push(e),ue(a,n,l)))}}),a.one("ended",function(){ue(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!==(i=t.analytics)&&void 0!==i&&i.muxKey&&null!=g&&g.mux){var y,h,w,S,I,O,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,D={env_key:null==t||null===(h=t.analytics)||void 0===h?void 0:h.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!==(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:D})}}),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,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 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&&ve(f,n)}),g.on("error",function(){var t,r;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&w)?ve(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===(r=g.error())||void 0===r?void 0:r.message)||"Some error occured",response:f}))}),g.one("play",function(){var e,n,o,r,i;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=t&&null!==(i=t.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(){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,r,i,l=null==g||null===(o=g.dash)||void 0===o||null===(r=o.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=fe(t);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=fe(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")||!h))&&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 be(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 we(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function ke(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 Se(e,n){var t=s.getPlayer(e);if(t){var o=n.dvrConfig,r=void 0===o?{}:o,i=n.videoId;n.epg;var l=r.playLive,a=r.playFromBegining,u=r.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",function(){f.checkDvrStartOverEnabled(n)?a?f.playFromBeginningHandler(t,n):l?f.playLiveOrResumeHandler(t,i):(!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),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,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>")}(o,v),m.style.display="flex",e.el().appendChild(m),f.pauseAndHideControl(e),Ie("watch-live-resume-btn",u,function(){f.showControl(e,m),f.playLiveOrResumeHandler(e,d)}),Ie("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(),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){ke(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=be(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 Ie(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 Oe(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(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Oe(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Te=function(i,a,d,c){var v,p,f,m,g,y,h,b,w,k,I,O,P,T,D,E,C,j,x,L,A,N,M,V,B,_,H,q,U,F,W,G,K,Y,J,z,X,Q=a.res,$=void 0===Q?null:Q,te=a.sres,oe=void 0===te?null:te,re=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],ie=(null===(v=$)||void 0===v?void 0:v.contentType)||"video",le=u.impolicy16x9(null===(p=$)||void 0===p||null===(f=p[ie])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(g=$)||void 0===g||null===(y=g[ie])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),ae=(null===(w=$)||void 0===w||null===(k=w[ie])||void 0===k||null===(I=k.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ue=(null===(O=$)||void 0===O||null===(P=O[ie])||void 0===P||null===(T=P.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,se=(null===(D=$)||void 0===D||null===(E=D.ads)||void 0===E||null===(C=E.preRoll)||void 0===C||null===(j=C.adTags)||void 0===j||null===(x=j.web)||void 0===x?void 0:x.active)&&(null===(L=$)||void 0===L||null===(A=L.ads)||void 0===A||null===(N=A.preRoll)||void 0===N||null===(M=N.adTags)||void 0===M||null===(V=M.web)||void 0===V?void 0:V.url);$=Pe(Pe({},$),{},{audioAssetSource:null==d?void 0:d.audioAssetSource});var de=(null==d||null===(B=d.customData)||void 0===B?void 0:B.ads)||{},ce=(null===(_=$)||void 0===_||null===(H=_[ie])||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=(z={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(z,"autoplay",null==d?void 0:d.autoplay),n(z,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!se),n(z,"loop",(null==d?void 0:d.loop)||!1),n(z,"audioPosterMode",null==d?void 0:d.audioPosterMode),n(z,"html5",Pe(Pe({dash:Pe(Pe(Pe({},!r.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:Pe(Pe({},(null==d?void 0:d.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==d?void 0:d.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:Pe(Pe(Pe({},(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===(Y=d.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(J=d.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(z,"poster",le),n(z,"techOrder",re),n(z,"chromecast",{requestCustomDataFn:function(e){var n,t,o=s.getPlayer(i),r=((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,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 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 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 D=null==e||null===(i=e[p])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;f.duration=D;var E=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=E;var C=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=C,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}($,e,r);return Pe(Pe({},l),{},{convivaMetaData:Pe({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},ee.getData())})},modifyLoadRequestFn:function(e){var n,t,o,r,l,a=s.getPlayer(i),u=(null==a?void 0:a.currentSource())||{};!(null===(n=$)||void 0===n||null===(t=n[ie])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.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}}),z);if(!r.getPlayers()[i]){null!=d&&d.debugConfig&&null!=d&&null!==(X=d.debugConfig)&&void 0!==X&&X.enable&&r.log.level("debug");var me=r(i,fe,function(){var n=t(o.mark(function n(){var t,a,u,s,v,p,f,m,g,y,h,b,w,k,I,O,P,T,D,E,C;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(me),console.log(r.VERSION),console.log(r.getPlugins()),n.next=5,R(d,$);case 5:if(w=null===(t=$)||void 0===t||null===(a=t[ie])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ue&&c.resolve(Pe({status:!0,msg:"Player Initialised"},oe?{seriesResponse:oe,response:$}:{response:$})),ae&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&Se(i,Pe(Pe({},d),{},{isDvrEnabled:ae})),e.inititateBeacon(i,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),Z(i,d),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),ae&&S(i,w),!se||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(i,se,$),k=e.getSource($,i),console.log(k),null!=d&&d.nearestClusterUrl&&(k=e.getUpdatedClusterSource(k,d.nearestClusterUrl)),!ce){n.next=21;break}return n.next=20,e.getSGAIEnabledSource(i,$);case 20:k=n.sent;case 21:k?e.loadVideo(i,k):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:$}),e.handleError(i,"Incompatible / Missing Source")),((null===(p=$)||void 0===p||null===(f=p[ie])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=$)||void 0===y||null===(h=y[ie])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(C=(null===(O=$)||void 0===O||null===(P=O[ie])||void 0===P||null===(T=P.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null===(D=$)||void 0===D||null===(E=D[ie])||void 0===E?void 0:E.closedCaptions),I=C.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),l.addCaptions(i,I)),null!=d&&d.disableControls?e.disableControls(i):ne(i,Pe(Pe(Pe({},d),fe),{},{liveVideo:ue,isDvrEnabled:ae,res:$,sres:oe})),he(i,Pe(Pe(Pe({},d),fe),{},{liveVideo:ue}),c,{res:$,sres:oe});case 25:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function De(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 Ee(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?De(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):De(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Ce=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=je(e);Te(r,{res:i},e,{resolve:t,reject:o})},je=function(n){var t,o,r,i,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===(r=n.streamingInfo)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.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 Ee(Ee({id:"".concat(P,"_external")},!g&&{directPlaybackUrl:null==f?void 0:f.url}),{},{video:Ee(Ee({drmEnabled:g,streamingInfo:Ee({videoAssets:Ee(Ee({},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:Ee({},h&&{videoImageUrl:h}),contentDetails:Ee({},(null==b?void 0:b.length)>0&&{closedCaptions:m(b)})}),ads:{preRoll:{adTags:{web:Ee(Ee({},y&&{active:!0}),y&&{url:y})}}}})},xe=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),o=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),r=o>0&&t>4?o:0,i=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),o=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(o-=1),o<0&&(t-=1),t}(new Date,new Date(n));return[i>0&&r>0?i:0,r,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},Le=function(e){var n,t=g(e,8),o=t[0],r=t[1],i=t[2],l=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):r>=1?" ".concat(r," month"):i>=1?" ".concat(i," week"):l>=1?" ".concat(l," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n),console.log("Time left:",n)};function Ae(e,n,t,o){if(e){var r=function(){var r=e-Date.now();if(r/1e3<=0)return clearInterval(i),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var l=xe(r,e);null==n||n([].concat(m(l),[o]))};r();var i=setInterval(r,1e3);return i}}var Re,Ne=function(e,n,t){var o,r,i,l,a,u,s,c,v,p=null==n||null===(o=n.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,f=(null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null,m=Date.now(),g=null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,y=m-(null==n||null===(s=n.response)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.scheduleEndDate);if(m-g<0?v=d.getLocalisation("eventNotStarted")||f||"Game starts in":(y>0||"VIDEO_NOT_EXISTS"==p)&&(v=d.getLocalisation("eventEnded")||f||"Game has ended"),document.getElementsByClassName("error-container")[0]){var h=document.getElementsByClassName("error-message")[0];h&&(h.textContent="".concat(v));var b=document.getElementsByClassName("error-timer-message")[0];b&&Ae(Math.abs(g),Le,t,b)}else{var w=document.getElementById(e).parentElement;if(w){var k=document.createElement("div");k.className="error-container";var S=document.createElement("div");S.className="error-message";var I=document.createElement("div");I.className="error-timer-message",S.textContent="".concat(v),k.appendChild(S),k.appendChild(I),w.append(k),Ae(Math.abs(g),Le,t,I)}}};function Me(e,n){return Ve.apply(this,arguments)}function Ve(){return(Ve=t(o.mark(function n(t,r){var i,l,a,u,s,d,v,p,f;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=r.resolve,u=r.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===(i=t.customData)||void 0===i||null===(l=i.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,p,f).then(function(n){var o,r,i,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.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=de((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",Te(d,{res:m},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then(function(e){var n,o,r,i,l,a;null!==(n=window)&&void 0!==n&&null!==(o=n.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)),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,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(){Te(d,{res:m},t,{resolve:a,reject:u})});else Te(d,{res:m},t,{resolve:a,reject:u})}).catch(function(n){var o,r,i=(null==t||null===(o=t.event)||void 0===o?void 0:o.honourScheduleTime)||!1,l=(null==t||null===(r=t.event)||void 0===r?void 0:r.onCountdownComplete)||null;i&&Ne(d,n,l),e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Be(e,n){return _e.apply(this,arguments)}function _e(){return(_e=t(o.mark(function n(t,r){var i,l,a,u,s,d,c,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=r.resolve,u=r.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===(i=t.customData)||void 0===i||null===(l=i.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,Te(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 He(e,n){return qe.apply(this,arguments)}function qe(){return(qe=t(o.mark(function n(t,r){var i,l,a,u,s,d,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=r.resolve,a=r.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===(i=t.series)||void 0===i?void 0:i.id,e.getSeriesDetails(v,u).then(function(n){var o,r,i,d=n.data,p=n.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(o=p[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.id);e.createSeriesWatchMap(v,u),e.getVideoDetails(f,u).then(function(e){var n,o,r;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(o=n.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(e.data),Te(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 Ue(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(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ue(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:i.onTimeUpdate,getVideoDuration:i.getVideoDuration,onVideoEnded:i.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var r=t(o.mark(function t(r,i){var l,a,s,c,v,p,f,m,g,h,b,w,k,S,I,O,P,T,D,E,C,x,L,A,R;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,T=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,D=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",D),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),D&&!e.isTokenExpired(D)){t.next=16;break}return i({status:!1,msg:"".concat(D?"Token is expired !":"Missing Authorization Token"),response:{token:D}}),t.abrupt("return");case 16:Re=JSON.parse(atob(D.split(".")[1]));case 17:return window.siteName=null===(s=Re)||void 0===s?void 0:s.site,window.siteId=null===(c=Re)||void 0===c?void 0:c.siteId,n.isAnonymousUser=!(null===(v=Re)||void 0===v||!v.anonymousId),n.siteOwner=(null===(p=Re)||void 0===p?void 0:p.site)||null,n.userId=(null===(f=Re)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(m=Re)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,E=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,C=(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,j(n);case 35:C&&y("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then(function(){return e.runGtag(C)}).catch(function(e){}),(L=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(E)))&&L.addEventListener("contextmenu",function(e){return e.preventDefault()}),k?(R={directPlaybackUrl:k,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},S?e.getVideoDetails(A,D).then(function(e){var t=(null==e?void 0:e.data)||{};Te(E,{res:Fe(Fe({},t),R)},n,{resolve:r,reject:i})}).catch(function(n){e.initiateErrorHandling(n,E,i,A)}):Te(E,{res:R},n,{resolve:r,reject:i})):T?Ce(n,{resolve:r,reject:i}):P?He(n,{resolve:r,reject:i}):I?Be(n,{resolve:r,reject:i}):Me(n,{resolve:r,reject:i});case 39:case"end":return t.stop()}},t)}));return function(e,n){return r.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:i.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:b,getVolume:w,disableControls:e.disableControls,setPlaybackSpeed:i.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:e.adsQueuePointManager,getSsaiEvents:e.getSsaiEvents,playerEvents:i.playerEvents,onReplay:i.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 r=t.start(0),i=t.end(t.length-1)-r;we(),ke(i).forEach(function(e){var n=e.id,t=e.title,r=e.time,l=be(n,t,Math.min(r/i*100,99.5));o.appendChild(l)})}},exports.removeMarkers=we;
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-923160fd.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),r=require("video.js"),i=require("./util-4c4c0ff1.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=require("@babel/runtime/helpers/slicedToArray"),y=function(e){return new Promise(function(n,t){if(h(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)}})},h=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},b=function(e,n,t){var o=s.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var r=parseFloat(n)/100;o.volume(r),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,"'")})},w=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},k=function(){var n=t(o.mark(function n(t){var i,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!==(i=t.series)&&void 0!==i&&i.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,y("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(r),(d=r.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)}}(),S=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,a,u=this.el(),s=r.dom.getPointerPosition(u,n).x;r.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===(i=o.framework)||void 0===i||null===(l=i.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 I=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"),y("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 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)}}(),P=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){r.getPlugin("eme")||r.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),T=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(r),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)}}(),D=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)}}(),E=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-4bac123d.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){y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(r)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(r)})},loadAdsLibrary:I,loadEMELibrary:P,loadMuxPlugin:T,loadDvrSeekbar:D,loadContribDash:E,loadComscorePlugin:O});function j(e){return x.apply(this,arguments)}function x(){return(x=t(o.mark(function n(t){var r,i,l;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=(null==t?void 0:t.airplay)||!1,n.next=3,I();case 3:r&&"Safari"==e.detectBrowser()?Promise.resolve().then(function(){return C}).then(function(e){e.importAirplay()}):(l=(null===(i=document)||void 0===i?void 0:i.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 R(e){return L.apply(this,arguments)}function L(){return(L=t(o.mark(function e(n){var t,r,i,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,O();case 3:u.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(r=n.comscore)||void 0===r?void 0:r.endpoint,implementationId:null==n||null===(i=n.comscore)||void 0===i?void 0:i.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 A(e,n){return N.apply(this,arguments)}function N(){return(N=t(o.mark(function n(t,r){var i,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==r?void 0:r.contentType)||"video",f=null==r||null===(i=r[p])||void 0===i?void 0:i.drmEnabled,null==r||null===(l=r[p])||void 0===l||null===(a=l.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,m=(null==r||null===(u=r[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()?P():"caliente"!=(null===(h=window)||void 0===h?void 0:h.siteName)?E():P():"Safari"!=e.detectBrowser()&&m?E():null,g?R(t):null,y?T():null,k(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 M(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 V(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?M(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):M(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var B=new Set,_=null,H=function(n,t,o,r){var i,l,a,u,s,d,v,p={},f=(null==n?void 0:n.contentType)||"video";p["c3.cm.id"]=(null===(i=n[f])||void 0===i?void 0:i.id)||"Null",p["c3.cm.contentType"]=Y(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"]=W(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=G(n),p["c3.cm.genreList"]=U(n),p["c3.cm.genre"]=q(n),p["c3.cm.channel"]=F(n,r);var m=X(c.getCurrentSeries(),n);return p=V(V({},p),m)},q=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"},U=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"},F=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"VOD":(null===(o=((null==e||null===(t=e[r])||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"},W=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"},G=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"},K=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)},Y=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var J,z,X=function(n,t){var o,r,i,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===(r=o.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==n||null===(i=n[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},Q=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"}},$=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Z=function(){var e=t(o.mark(function e(n,t){var r,i,l,a,u,d,v,p,f,m,g,y;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null==t?void 0:t.convivaConfig)||{},i=r.trackConvivaPlayerEvent,l=r.paymentHandler,a=r.tveProvider,u=r.enable,d=r.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=i)){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=Q(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=$(m.currentType()),r=c.getCurrentVideo(),i=H(r,m,y,f);i[null==y||null===(e=y.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",i[null==y||null===(n=y.Constants)||void 0===n?void 0:n.ASSET_NAME]=K(r,t),i.authToken=p||"NULL",i.streamType=o,i.D2CType=l||"NONE",i.subscriberType=a?"MVPD":"FREE"!==l?"D2C":"FREE",i["c3.cm.affiliate"]=a||"NULL",ee.setData(i),g("contentInfo",i)}),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)}}(),ee=(J={},{setData:function(e){J=V(V({},J),e)},getData:function(){return J}}),ne=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-db33fcff.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-2ba328a4.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-d5d4ccea.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-5435286d.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-d0a9df1c.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-26de3085.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-90aa6c9c.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-c06ff1c8.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&Promise.resolve().then(function(){return require("./skin-0bf9fb6b.js")}).then(function(t){t.initialiseSkin(e,n)})};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 oe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?te(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):te(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var re=[],ie=0,le=null;function ae(){console.log("Cleaning up watch history data"),z=null,re=[],ie=0,le=null}function ue(t,o,r){var i,l,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(i=o.watchHistory)||void 0===i||i.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 r=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),i=se(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(e,t){return oe(oe({},e),{},n({},t,u[t]))},{}),d=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===z});d<0?i.push(oe(oe({content:s},e),{},{addedDate:l,updateDate:l})):i[d]=oe(oe(oe({},i[d]),e),{},{updateDate:l});localStorage.setItem("".concat(r),JSON.stringify(i))}(b={completed:d,watchedTime:y,watchedPercentage:h},v,o.siteOwner):(b=oe(oe({videoId:z,watchedTime:y,watchedPercentage:h,doneWatching:d,profileId:v},le&&{seriesId:le}),m&&{originalObjectId:m}),e.saveWatchHistory(b).then(function(e){}).catch(function(e){})),ie=p+r}function se(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function de(e,n,t){var o=se(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 ce=!1,ve=function(n,t){var o,r,i=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[i])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.secondaryVideoAssets)||null)&&!ce){var l=pe(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ce=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function pe(e,n,t){if(Array.isArray(e))return e.map(function(e){return pe(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]=pe(e[r],n,t)}),o}return e}function fe(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 me(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)?me(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 me(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 ge(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 ye(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ge(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var he=function(n,t,o,r){var i,a,u,d,p,f=r.res,m=r.sres,g=s.getPlayer(n),y=(null==f?void 0:f.contentType)||"video",h=(null==f||null===(i=f[y])||void 0===i?void 0:i.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(ye({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:f}:{response:f}))}),g.on("loadeddata",function(){var o,r,i,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())&&b(n,sessionStorage.getItem("volume")||"100");var d=c.getCurrentVideo();if(e.initialiseComscoreStreamingTracking(t),e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.enable&&(!t.isAnonymousUser||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var v,p,m=ye(ye({},t),f);!function(e,n,t){var o,r,i;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(le=null==n||null===(r=n.series)||void 0===r?void 0:r.id),re=[],ie=0,z=t;var l=(null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.interval)||30,a=s.getPlayer(e);a&&(a.on("dispose",ae),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());re.includes(ie)||(e!=ie||e<l?e>ie&&(ie=e+l):(re.push(e),ue(a,n,l)))}}),a.one("ended",function(){ue(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!==(i=t.analytics)&&void 0!==i&&i.muxKey&&null!=g&&g.mux){var y,h,w,S,I,O,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,D={env_key:null==t||null===(h=t.analytics)||void 0===h?void 0:h.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!==(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:D})}}),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,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 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&&ve(f,n)}),g.on("error",function(){var t,r;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&w)?ve(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===(r=g.error())||void 0===r?void 0:r.message)||"Some error occured",response:f}))}),g.one("play",function(){var e,n,o,r,i;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(r=o.adsConfig)||void 0===r||!r.vodAdClientSideTracking){if(null!=t&&null!==(i=t.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(){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,r,i,l=null==g||null===(o=g.dash)||void 0===o||null===(r=o.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=fe(t);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=fe(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")||!h))&&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 be(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 we(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function ke(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 Se(e,n){var t=s.getPlayer(e);if(t){var o=n.dvrConfig,r=void 0===o?{}:o,i=n.videoId;n.epg;var l=r.playLive,a=r.playFromBegining,u=r.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",function(){f.checkDvrStartOverEnabled(n)?a?f.playFromBeginningHandler(t,n):l?f.playLiveOrResumeHandler(t,i):(!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),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,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>")}(o,v),m.style.display="flex",e.el().appendChild(m),f.pauseAndHideControl(e),Ie("watch-live-resume-btn",u,function(){f.showControl(e,m),f.playLiveOrResumeHandler(e,d)}),Ie("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(),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){ke(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=be(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 Ie(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 Oe(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(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Oe(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Te=function(i,a,d,c){var v,p,f,m,g,y,h,b,w,k,I,O,P,T,D,E,C,j,x,R,L,N,M,V,B,_,H,q,U,F,W,G,K,Y,J,z,X,Q=a.res,$=void 0===Q?null:Q,te=a.sres,oe=void 0===te?null:te,re=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],ie=(null===(v=$)||void 0===v?void 0:v.contentType)||"video",le=u.impolicy16x9(null===(p=$)||void 0===p||null===(f=p[ie])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(g=$)||void 0===g||null===(y=g[ie])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),ae=(null===(w=$)||void 0===w||null===(k=w[ie])||void 0===k||null===(I=k.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,ue=(null===(O=$)||void 0===O||null===(P=O[ie])||void 0===P||null===(T=P.streamingInfo)||void 0===T?void 0:T.isLiveStream)||!1,se=(null===(D=$)||void 0===D||null===(E=D.ads)||void 0===E||null===(C=E.preRoll)||void 0===C||null===(j=C.adTags)||void 0===j||null===(x=j.web)||void 0===x?void 0:x.active)&&(null===(R=$)||void 0===R||null===(L=R.ads)||void 0===L||null===(N=L.preRoll)||void 0===N||null===(M=N.adTags)||void 0===M||null===(V=M.web)||void 0===V?void 0:V.url);$=Pe(Pe({},$),{},{audioAssetSource:null==d?void 0:d.audioAssetSource});var de=(null==d||null===(B=d.customData)||void 0===B?void 0:B.ads)||{},ce=(null===(_=$)||void 0===_||null===(H=_[ie])||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=(z={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(z,"autoplay",null==d?void 0:d.autoplay),n(z,"normalizeAutoplay",(null==d?void 0:d.autoplay)&&!se),n(z,"loop",(null==d?void 0:d.loop)||!1),n(z,"audioPosterMode",null==d?void 0:d.audioPosterMode),n(z,"html5",Pe(Pe({dash:Pe(Pe(Pe({},!r.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:Pe(Pe({},(null==d?void 0:d.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==d?void 0:d.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0},additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!1,droppedFramesRule:!0}})}}}),vhs:Pe(Pe(Pe({},(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===(Y=d.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==d||null===(J=d.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(z,"poster",le),n(z,"techOrder",re),n(z,"chromecast",{requestCustomDataFn:function(e){var n,t,o=s.getPlayer(i),r=((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,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 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 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 D=null==e||null===(i=e[p])||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.runtime;f.duration=D;var E=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=E;var C=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=C,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}($,e,r);return Pe(Pe({},l),{},{convivaMetaData:Pe({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},ee.getData())})},modifyLoadRequestFn:function(e){var n,t,o,r,l,a=s.getPlayer(i),u=(null==a?void 0:a.currentSource())||{};!(null===(n=$)||void 0===n||null===(t=n[ie])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(r=o.videoAssets)||void 0===r?void 0:r.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}}),z);if(!r.getPlayers()[i]){null!=d&&d.debugConfig&&null!=d&&null!==(X=d.debugConfig)&&void 0!==X&&X.enable&&r.log.level("debug");var me=r(i,fe,function(){var n=t(o.mark(function n(){var t,a,u,s,v,p,f,m,g,y,h,b,w,k,I,O,P,T,D,E,C;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(me),console.log(r.VERSION),console.log(r.getPlugins()),n.next=5,A(d,$);case 5:if(w=null===(t=$)||void 0===t||null===(a=t[ie])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ue&&c.resolve(Pe({status:!0,msg:"Player Initialised"},oe?{seriesResponse:oe,response:$}:{response:$})),ae&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&Se(i,Pe(Pe({},d),{},{isDvrEnabled:ae})),e.inititateBeacon(i,null==d?void 0:d.analyticsCb,null==d?void 0:d.customData),Z(i,d),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),ae&&S(i,w),!se||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(i,se,$),k=e.getSource($,i),console.log(k),null!=d&&d.nearestClusterUrl&&(k=e.getUpdatedClusterSource(k,d.nearestClusterUrl)),!ce){n.next=21;break}return n.next=20,e.getSGAIEnabledSource(i,$);case 20:k=n.sent;case 21:k?e.loadVideo(i,k):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:$}),e.handleError(i,"Incompatible / Missing Source")),((null===(p=$)||void 0===p||null===(f=p[ie])||void 0===f||null===(m=f.contentDetails)||void 0===m||null===(g=m.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=$)||void 0===y||null===(h=y[ie])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(C=(null===(O=$)||void 0===O||null===(P=O[ie])||void 0===P||null===(T=P.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null===(D=$)||void 0===D||null===(E=D[ie])||void 0===E?void 0:E.closedCaptions),I=C.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),l.addCaptions(i,I)),null!=d&&d.disableControls?e.disableControls(i):ne(i,Pe(Pe(Pe({},d),fe),{},{liveVideo:ue,isDvrEnabled:ae,res:$,sres:oe})),he(i,Pe(Pe(Pe({},d),fe),{},{liveVideo:ue}),c,{res:$,sres:oe});case 25:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};function De(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 Ee(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?De(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):De(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var Ce=function(e,n){var t=n.resolve,o=n.reject,r=null==e?void 0:e.playerId,i=je(e);Te(r,{res:i},e,{resolve:t,reject:o})},je=function(n){var t,o,r,i,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===(r=n.streamingInfo)||void 0===r||null===(i=r.ads)||void 0===i?void 0:i.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 Ee(Ee({id:"".concat(P,"_external")},!g&&{directPlaybackUrl:null==f?void 0:f.url}),{},{video:Ee(Ee({drmEnabled:g,streamingInfo:Ee({videoAssets:Ee(Ee({},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:Ee({},h&&{videoImageUrl:h}),contentDetails:Ee({},(null==b?void 0:b.length)>0&&{closedCaptions:m(b)})}),ads:{preRoll:{adTags:{web:Ee(Ee({},y&&{active:!0}),y&&{url:y})}}}})},xe=function(e,n){(new Date).getMonth(),new Date(n).getMonth(),(new Date).getFullYear(),new Date(n).getFullYear();var t=Math.floor(e/6048e5),o=function(e,n){var t;return t=12*(n.getFullYear()-e.getFullYear()),t-=e.getMonth(),(t+=n.getMonth())<=0?0:t}(new Date,new Date(n)),r=o>0&&t>4?o:0,i=function(e,n){var t=new Date(n).getFullYear()-new Date(e).getFullYear(),o=new Date(n).getMonth()-new Date(e).getMonth();return new Date(n).getDay()-new Date(e).getDay()<0&&(o-=1),o<0&&(t-=1),t}(new Date,new Date(n));return[i>0&&r>0?i:0,r,t,Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)]},Re=function(e){var n,t=g(e,8),o=t[0],r=t[1],i=t[2],l=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):r>=1?" ".concat(r," month"):i>=1?" ".concat(i," week"):l>=1?" ".concat(l," day"):a<24&&a>=12?" ".concat(a," hour"):a>0?"".concat(a," hours ").concat(u," minutes ").concat(s," seconds"):u>0?"".concat(u," minutes ").concat(s," seconds"):"".concat(s," seconds"),d.textContent="".concat(n),console.log("Time left:",n)};function Le(e,n,t,o){if(e){var r=function(){var r=e-Date.now();if(r/1e3<=0)return clearInterval(i),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var l=xe(r,e);null==n||n([].concat(m(l),[o]))};r();var i=setInterval(r,1e3);return i}}var Ae,Ne=function(e,n,t){var o,r,i,l,a,u,s,c,v,p=null==n||null===(o=n.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.errorCode,f=(null==n||null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.errorMessage)||(null==n?void 0:n.message)||null,m=Date.now(),g=null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,y=m-(null==n||null===(s=n.response)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.scheduleEndDate);if(m-g<0?v=d.getLocalisation("eventNotStarted")||f||"Game starts in":(y>0||"VIDEO_NOT_EXISTS"==p)&&(v=d.getLocalisation("eventEnded")||f||"Game has ended"),document.getElementsByClassName("error-container")[0]){var h=document.getElementsByClassName("error-message")[0];h&&(h.textContent="".concat(v));var b=document.getElementsByClassName("error-timer-message")[0];b&&Le(Math.abs(g),Re,t,b)}else{var w=document.getElementById(e).parentElement;if(w){var k=document.createElement("div");k.className="error-container";var S=document.createElement("div");S.className="error-message";var I=document.createElement("div");I.className="error-timer-message",S.textContent="".concat(v),k.appendChild(S),k.appendChild(I),w.append(k),Le(Math.abs(g),Re,t,I)}}};function Me(e,n){return Ve.apply(this,arguments)}function Ve(){return(Ve=t(o.mark(function n(t,r){var i,l,a,u,s,d,v,p,f;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=r.resolve,u=r.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===(i=t.customData)||void 0===i||null===(l=i.ads)||void 0===l?void 0:l.isSSAIEnabled),e.getVideoDetails(s,p,f).then(function(n){var o,r,i,l;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(r=o.video)||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.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=de((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",Te(d,{res:m},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then(function(e){var n,o,r,i,l,a;null!==(n=window)&&void 0!==n&&null!==(o=n.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)),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,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(){Te(d,{res:m},t,{resolve:a,reject:u})});else Te(d,{res:m},t,{resolve:a,reject:u})}).catch(function(n){var o,r,i=(null==t||null===(o=t.event)||void 0===o?void 0:o.showScheduleTimer)||!1,l=(null==t||null===(r=t.event)||void 0===r?void 0:r.onCountdownComplete)||null;i&&Ne(d,n,l),e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function Be(e,n){return _e.apply(this,arguments)}function _e(){return(_e=t(o.mark(function n(t,r){var i,l,a,u,s,d,c,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=r.resolve,u=r.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===(i=t.customData)||void 0===i||null===(l=i.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,Te(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 He(e,n){return qe.apply(this,arguments)}function qe(){return(qe=t(o.mark(function n(t,r){var i,l,a,u,s,d,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=r.resolve,a=r.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===(i=t.series)||void 0===i?void 0:i.id,e.getSeriesDetails(v,u).then(function(n){var o,r,i,d=n.data,p=n.data.seasons;c.setCurrentSeries(p);var f=videoId||(null==p||null===(o=p[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.id);e.createSeriesWatchMap(v,u),e.getVideoDetails(f,u).then(function(e){var n,o,r;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(o=n.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,c.setCurrentVideo(e.data),Te(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 Ue(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(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ue(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:i.onTimeUpdate,getVideoDuration:i.getVideoDuration,onVideoEnded:i.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var r=t(o.mark(function t(r,i){var l,a,s,c,v,p,f,m,g,h,b,w,k,S,I,O,P,T,D,E,C,x,R,L,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,T=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,D=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",D),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),D&&!e.isTokenExpired(D)){t.next=16;break}return i({status:!1,msg:"".concat(D?"Token is expired !":"Missing Authorization Token"),response:{token:D}}),t.abrupt("return");case 16:Ae=JSON.parse(atob(D.split(".")[1]));case 17:return window.siteName=null===(s=Ae)||void 0===s?void 0:s.site,window.siteId=null===(c=Ae)||void 0===c?void 0:c.siteId,n.isAnonymousUser=!(null===(v=Ae)||void 0===v||!v.anonymousId),n.siteOwner=(null===(p=Ae)||void 0===p?void 0:p.site)||null,n.userId=(null===(f=Ae)||void 0===f?void 0:f.userId)||null,window.sessionStorage.setItem("uid",null===(m=Ae)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,E=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(g=n.series)&&void 0!==g&&g.enable?null:null==n?void 0:n.chromecastReceiverId,C=(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,j(n);case 35:C&&y("https://www.googletagmanager.com/gtag/js?id=".concat(C)).then(function(){return e.runGtag(C)}).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?e.getVideoDetails(L,D).then(function(e){var t=(null==e?void 0:e.data)||{};Te(E,{res:Fe(Fe({},t),A)},n,{resolve:r,reject:i})}).catch(function(n){e.initiateErrorHandling(n,E,i,L)}):Te(E,{res:A},n,{resolve:r,reject:i})):T?Ce(n,{resolve:r,reject:i}):P?He(n,{resolve:r,reject:i}):I?Be(n,{resolve:r,reject:i}):Me(n,{resolve:r,reject:i});case 39:case"end":return t.stop()}},t)}));return function(e,n){return r.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:i.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:b,getVolume:w,disableControls:e.disableControls,setPlaybackSpeed:i.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:e.adsQueuePointManager,getSsaiEvents:e.getSsaiEvents,playerEvents:i.playerEvents,onReplay:i.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 r=t.start(0),i=t.end(t.length-1)-r;we(),ke(i).forEach(function(e){var n=e.id,t=e.title,r=e.time,l=be(n,t,Math.min(r/i*100,99.5));o.appendChild(l)})}},exports.removeMarkers=we;
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css"),require("./generic-923160fd.js"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js");var e=require("./index-
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css"),require("./generic-923160fd.js"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js");var e=require("./index-a792959a.js");require("./util-4c4c0ff1.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-7878533f.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-153b7203.js"),r=require("./index-8a9c25bb.js"),n=require("./generic-923160fd.js");require("videojs-contrib-quality-menu");var o=require("./index-
|
|
1
|
+
"use strict";var e=require("./features-7878533f.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-153b7203.js"),r=require("./index-8a9c25bb.js"),n=require("./generic-923160fd.js");require("videojs-contrib-quality-menu");var o=require("./index-a792959a.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-ea81b1f4.js"),require("./util-4c4c0ff1.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)};
|