@viewlift/player-backup 2.0.257-backup → 2.0.258-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 +861 -861
- package/cjs/index-e5d7c072.js +1 -0
- package/cjs/index.js +1 -1
- package/cjs/skin-bac14ade.js +1 -0
- package/esm/bundle.css +861 -861
- package/esm/index-62e1ef44.js +1 -0
- package/esm/index.js +1 -1
- package/esm/skin-1629e49c.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-939a3e97.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),o=require("@babel/runtime/regenerator"),i=require("video.js"),l=require("./util-4769ed5b.js"),r=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"),m=require("./helper-dbf2fb22.js"),f=require("@babel/runtime/helpers/toConsumableArray"),g=require("@babel/runtime/helpers/slicedToArray"),h=require("@viewlift/sse"),y=function(e){return new Promise(function(n,t){if(b(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)}})},b=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},w=function(e,n,t){var o=s.getPlayer(e);if(o)if(n>=0&&n<=100){o.muted()&&o.muted(!1);var i=parseFloat(n)/100;o.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(n,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},k=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},S=function(){var n=t(o.mark(function n(t){var l,r,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!==(l=t.series)&&void 0!==l&&l.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!==(r=t.series)&&void 0!==r&&r.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(i),(d=i.getTech("chromecast"))&&!d.prototype.seeking&&(d.prototype.seeking=function(){}),null!==(u=window)&&void 0!==u&&u.cast?null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==a||a.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==a||a.airPlay({addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}},n,null,[[2,7]])}));return function(e){return n.apply(this,arguments)}}(),I=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,l,r,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(l=o.framework)||void 0===l||null===(r=l.CastContext)||void 0===r||null===(a=r.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 E=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)}}(),T=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)}}(),D=function(){var e=t(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=t(o.mark(function e(){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),O=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-84cce26a.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)}}(),P=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-75637b78.js")});case 3:console.log("utilising contrib dash"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("Failed to load contrib dash plugin");case 9:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),j=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){y("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(i)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(i)})},loadAdsLibrary:E,loadEMELibrary:D,loadMuxPlugin:C,loadDvrSeekbar:O,loadContribDash:P,loadComscorePlugin:T});function x(e){return L.apply(this,arguments)}function L(){return(L=t(o.mark(function n(t){var i,l,r;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=(null==t?void 0:t.airplay)||!1,n.next=3,E();case 3:i&&"Safari"==e.detectBrowser()?Promise.resolve().then(function(){return j}).then(function(e){e.importAirplay()}):(r=(null===(l=document)||void 0===l?void 0:l.getElementById(null==t?void 0:t.playerId))||null)&&r.setAttribute("x-webkit-airplay","deny");case 4:case"end":return n.stop()}},n)}))).apply(this,arguments)}function A(e){return N.apply(this,arguments)}function N(){return(N=t(o.mark(function e(n){var t,i,l,r,a,u,d,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c=s.getPlayer(n.playerId),e.next=3,T();case 3:c.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(i=n.comscore)||void 0===i?void 0:i.endpoint,applicationName:(null==n||null===(l=n.comscore)||void 0===l?void 0:l.applicationName)||(null===(r=window)||void 0===r?void 0:r.siteName)||null,implementationId:null==n||null===(a=n.comscore)||void 0===a?void 0:a.implementationId,projectId:null==n||null===(u=n.comscore)||void 0===u?void 0:u.projectId,debug:(null==n||null===(d=n.comscore)||void 0===d?void 0:d.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function R(e,n){return M.apply(this,arguments)}function M(){return(M=t(o.mark(function n(t,i){var l,r,a,u,s,d,c,v,p,m,f,g,h,y;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=(null==i?void 0:i.contentType)||"video",m=null==i||null===(l=i[p])||void 0===l?void 0:l.drmEnabled,null==i||null===(r=i[p])||void 0===r||null===(a=r.liveDetails)||void 0===a||a.isDvrEnabled,null==t||t.showPositiveSeekbar,f=(null==i||null===(u=i[p])||void 0===u||null===(s=u.streamingInfo)||void 0===s||null===(d=s.videoAssets)||void 0===d?void 0:d.dash)||null,g=(null==t||null===(c=t.comscore)||void 0===c?void 0:c.enable)||!1,h=!(null==t||null===(v=t.analytics)||void 0===v||!v.muxKey),n.prev=7,n.next=10,Promise.allSettled([m?"Safari"==e.detectBrowser()?D():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?P():D():"Safari"!=e.detectBrowser()&&f?P():null,g?A(t):null,h?C():null,S(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 B(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?B(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):B(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var _=new Set,H=null,U=function(n,t,o,i){var l,r,a,u,s,d,v,p={},m=(null==n?void 0:n.contentType)||"video";p["c3.cm.id"]=(null===(l=n[m])||void 0===l?void 0:l.id)||"Null",p["c3.cm.contentType"]=J(n),p[null==o||null===(r=o.Constants)||void 0===r?void 0:r.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[m])||void 0===s?void 0:s.drmEnabled)||"None",p.DAIStream=null!==(d=n[m])&&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=K(n),p["c3.cm.genreList"]=F(n),p["c3.cm.genre"]=q(n),p["c3.cm.channel"]=G(n,i);var f=Q(c.getCurrentSeries(),n);return p=V(V({},p),f)},q=function(e){var n,t,o,i=(null==e?void 0:e.contentType)||"video";return(null==e||null===(n=e[i])||void 0===n||null===(t=n.gist)||void 0===t||null===(o=t.primaryCategory)||void 0===o?void 0:o.title)||"Null"},F=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"},G=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";return"video"===i?"VOD":(null===(o=((null==e||null===(t=e[i])||void 0===t?void 0:t.channels)||[]).find(function(e){return(null==e?void 0:e.id)===(null==n?void 0:n.channelId)}))||void 0===o?void 0:o.title)||"NULL"},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"},K=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[o])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Y=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var l=(null==e?void 0:e.contentType)||"video",r=(null==e||null===(t=e[l])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(r)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var z,X,Q=function(n,t){var o,i,l,r,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),d=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(o=t.video)||void 0===o||null===(i=o.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(l=n[s-1])||void 0===l||null===(r=l.episodes)||void 0===r||null===(a=r[d-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},$=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Z=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ee=function(){var e=t(o.mark(function e(n,t){var i,l,r,a,u,d,v,p,m,f,g,h;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==t?void 0:t.convivaConfig)||{},l=i.trackConvivaPlayerEvent,r=i.paymentHandler,a=i.tveProvider,u=i.enable,d=i.appName,p=(v=t||{}).token,m=v.epg,u){e.next=4;break}return e.abrupt("return");case 4:if(f=s.getPlayer(n),"function"==typeof(g=l)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,g("getConvivaObject");case 10:if(h=e.sent){e.next=13;break}return e.abrupt("return");case 13:f.ready(function(){var e=f.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=$(t.keySystem);g("contentInfo",{DRMEnabled:o})}else g("contentInfo",{DRMEnabled:"None"})}),n||g("contentInfo",{DRMEnabled:"None"})}),f.on("loadstart",function(){var e,n;H&&H!==f.currentSrc()&&g("playbackEnded"),g("setPlayer",f),_.clear(),H=f.currentSrc();var o=Z(f.currentType()),i=c.getCurrentVideo(),l=U(i,f,h,m);l[null==h||null===(e=h.Constants)||void 0===e?void 0:e.PLAYER_NAME]=d||"WEB",l[null==h||null===(n=h.Constants)||void 0===n?void 0:n.ASSET_NAME]=Y(i,t),l.authToken=p||"NULL",l.streamType=o,l.D2CType=r||"NONE",l.subscriberType=a?"MVPD":"FREE"!==r?"D2C":"FREE",l["c3.cm.affiliate"]=a||"NULL",ne.setData(l),g("contentInfo",l)}),f.on("loadedmetadata",function(){var e,n=f.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),g("contentInfo",{screenResolution:e})}),f.on("play",function(){_.has(f.currentSrc())||(_.add(f.currentSrc()),g("playbackStarted",null))}),f.on("ended",function(){_.has(f.currentSrc())&&_.delete(f.currentSrc()),g("playbackEnded")}),f.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&g("initAdSensor",{player:f,adsLoader:null==e?void 0:e.adsLoader})}),f.on("dispose",function(){null==_||_.clear(),g("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),ne=(z={},{setData:function(e){z=V(V({},z),e)},getData:function(){return z}}),te=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then(function(){return require("./skin-5e4b3ad1.js")}).then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?Promise.resolve().then(function(){return require("./skin-ab226d57.js")}).then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?Promise.resolve().then(function(){return require("./skin-02df14d4.js")}).then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?Promise.resolve().then(function(){return require("./skin-eac05283.js")}).then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?Promise.resolve().then(function(){return require("./skin-98b66c5d.js")}).then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?Promise.resolve().then(function(){return require("./skin-bac14ade.js")}).then(function(t){t.initialiseSkin(e,n)}):"news"==t?Promise.resolve().then(function(){return require("./skin-334830ee.js")}).then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?Promise.resolve().then(function(){return require("./skin-6e922e32.js")}).then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&Promise.resolve().then(function(){return require("./skin-af838b06.js")}).then(function(t){t.initialiseSkin(e,n)})};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 ie(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 le=[],re=0,ae=null;function ue(){console.log("Cleaning up watch history data"),X=null,le=[],re=0,ae=null}function se(t,o,i){var l,r,a,u,s,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==o||null===(l=o.watchHistory)||void 0===l||l.apiVersion;var v=null==o||null===(r=o.watchHistory)||void 0===r?void 0:r.profileId,p=Math.floor(t.currentTime()),m=Math.floor(t.duration());null==o||null===(a=o.watchHistory)||void 0===a||a.xapiKey;var f=(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,h=Math.floor(t.currentTime()),y=d?100:Math.floor(p/m*100),b={};g?function(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),l=de(i),r=(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 ie(ie({},e),{},n({},t,u[t]))},{}),d=l.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===X});d<0?l.push(ie(ie({content:s},e),{},{addedDate:r,updateDate:r})):l[d]=ie(ie(ie({},l[d]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(b={completed:d,watchedTime:h,watchedPercentage:y},v,o.siteOwner):(b=ie(ie({videoId:X,watchedTime:h,watchedPercentage:y,doneWatching:d,profileId:v},ae&&{seriesId:ae}),f&&{originalObjectId:f}),e.saveWatchHistory(b).then(function(e){}).catch(function(e){})),re=p+i}function de(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function ce(e,n,t){var o=de(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter(function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n})),i}var ve=!1,pe=function(n,t){var o,i,l=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(o=n[l])||void 0===o||null===(i=o.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!ve){var r=me(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(r,t);return a&&e.loadVideo(t,a),ve=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function me(e,n,t){if(Array.isArray(e))return e.map(function(e){return me(e,n,t)});if(null!==e&&"object"===v(e)){var o={};return Object.keys(e).forEach(function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=me(e[i],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 ge(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)?ge(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,l=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw l}}}}function ge(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 he(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?he(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):he(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}var be=function(n,t,o,i){var l,a,u,d,p,m=i.res,f=i.sres,g=s.getPlayer(n),h=(null==m?void 0:m.contentType)||"video",y=(null==m||null===(l=m[h])||void 0===l?void 0:l.drmEnabled)||!1,b=(null==m||null===(a=m[h])||void 0===a||null===(u=a.streamingInfo)||void 0===u?void 0:u.isLiveStream)||!1,k=(null==m||null===(d=m[h])||void 0===d||null===(p=d.liveDetails)||void 0===p?void 0:p.isDvrEnabled)||!1;c.setCurrentVideo(m),c.videoReplayTracker.set(m),g&&(g.on("loadstart",function(){b?o.resolve({status:!0,msg:"Video Loaded",response:m}):o.resolve(ye({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:m}:{response:m}))}),g.on("loadeddata",function(){var o,i,l,a=r.getCaptions(n);if(null==a||a.map(function(e){return r.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())&&w(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!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var v,p,f=ye(ye({},t),m);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ae=null==n||null===(i=n.series)||void 0===i?void 0:i.id),le=[],re=0,X=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=s.getPlayer(e);a&&(a.on("dispose",ue),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());le.includes(re)||(e!=re||e<r?e>re&&(re=e+r):(le.push(e),se(a,n,r)))}}),a.one("ended",function(){se(a,n,r,!0)}))}(n,f,null==d||null===(v=d.video)||void 0===v||null===(p=v.gist)||void 0===p?void 0:p.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=g&&g.mux){var h,y,b,S,I,E,T=(null===(h=c.getCurrentVideo())||void 0===h?void 0:h.video)||(null==m?void 0:m.video),D=null==T?void 0:T.gist,C={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(b=window)||void 0===b?void 0:b.vl_player_version,video_id:null==D?void 0:D.id,video_title:null==D?void 0:D.title,video_series:null==T||null===(S=T.series)||void 0===S?void 0:S.title,video_stream_type:null!=T&&null!==(I=T.streamingInfo)&&void 0!==I&&I.isLiveStream?"live":"video",viewer_user_id:null==t||null===(E=t.analytics)||void 0===E?void 0:E.userId};g.mux({debug:!1,data:C})}}),g.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];g.trigger("subtitlechanged",n)}),g.on("subtitlechanged",function(e,n){var t,o,i,l,r,a,u,s,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,m=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 f,g=m.getMediaSession(),h=g.media.tracks.filter(function(e){return"TEXT"==e.type});f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}}),g.tech_.on("retryplaylist",function(){b&&pe(m,n)}),g.on("error",function(){var t,i;(console.log("ERROR",g.error(),g.error().code),4===g.error().code&&b)?pe(m,n):(e.handleError(n,(null==g||null===(t=g.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==g||null===(i=g.error())||void 0===i?void 0:i.message)||"Some error occured",response:m}))}),g.one("play",function(){var e,n,o,i,l;if(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(i=o.adsConfig)||void 0===i||!i.vodAdClientSideTracking){if(null!=t&&null!==(l=t.series)&&void 0!==l&&l.enable){var r,a,u,s=null===(r=c.getCurrentVideo())||void 0===r||null===(a=r.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,m=v.p;p&&m<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(b){g.currentSource();for(var e=g.textTracks(),n=e.length-1;n>=0;n--)g.removeRemoteTextTrack(e[n])}}),g.one("loadeddata",function(){var n,t=(null==g||null===(n=g.audioTracks())||void 0===n?void 0:n.tracks_)||null;if(t)if(t.sort(function(e,n){var t=(e.language||e.language||"").toUpperCase(),o=(n.language||n.label||"").toUpperCase();return t<o?-1:t>o?1:0}),"object"==v(g.dash)){var o,i,l,r=null==g||null===(o=g.dash)||void 0===o||null===(i=o.mediaPlayer)||void 0===i?void 0:i.getTracksFor("audio"),a=null==r?void 0:r.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();!(l=u.n()).done;){var s=l.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,m,f,h=d.value;if(("Chrome"==e.detectBrowser()||"Edge"==e.detectBrowser()&&(null!==(p=navigator)&&void 0!==p&&null!==(m=p.userAgent)&&void 0!==m&&m.includes("Macintosh")||!y))&&null!=h&&null!==(f=h.label)&&void 0!==f&&f.includes("5.1"))g.audioTracks().removeTrack(h);else{if("main"==h.kind){h.enabled=!0;break}h.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function we(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 ke(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function Se(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 Ie(e,n){var t=s.getPlayer(e);if(t){var o=n.dvrConfig,i=void 0===o?{}:o,l=n.videoId;n.epg;var r=i.playLive,a=i.playFromBegining,u=i.programs;c.setCurrentEpgPrograms(u),t.on("loadeddata",function(){m.checkDvrStartOverEnabled(n)?a?m.playFromBeginningHandler(t,n):r?m.playLiveOrResumeHandler(t,l):(!function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.dvrConfig,o=void 0===t?{}:t,i=n.videoId,l=n.epg,r=o.buttonConfig,a=void 0===r?{}:r,u=a.watchLive;a.resume;var s=a.startFromBegining,d=i;if(l&&null!=l&&l.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=!!m.getWatchedTime(d),f=document.querySelector(".vjs-dvr-btn-overlay");f||((f=document.createElement("div")).className="vjs-dvr-btn-overlay");var g=m.getCurrentProgramThumbnail(n);g&&(f.style.backgroundImage="url(".concat(g,")"),f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="cover");f.innerHTML=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(null==e?void 0:e.buttonConfig)||{},o=t.watchLive,i=t.resume,l=t.startFromBegining,r=n?(null==i?void 0:i.text)||"Resume":(null==o?void 0:o.text)||"Watch Live",a='<button id="watch-live-resume-btn">'.concat(p.watchLiveIcon2()," ").concat(r,"</button>"),u='<button id="watch-begining-btn">'.concat(p.startLiveIcon()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}(o,v),f.style.display="flex",e.el().appendChild(f),m.pauseAndHideControl(e),Ee("watch-live-resume-btn",u,function(){m.showControl(e,f),m.playLiveOrResumeHandler(e,d)}),Ee("watch-begining-btn",s,function(){m.showControl(e,f),m.playFromBeginningHandler(e,n)})}(t,n),m.handleLiveStartOverBtn({player:t,showWatchLive:!0,showStartOver:!0})):m.removeDvrStartOver(t)}),t.one("loadedmetadata",function(){sessionStorage.setItem("program_switched",!0),function(e,n){var t=n.videoId,o=e.currentTime(),i=!1,l=e.seekable(),r=l.start(0),a=l.end(l.length-1)-r,u=JSON.parse(sessionStorage.getItem("epgConfig")),s=t,d=!0;if(u&&null!=u&&u.enable){var c;d=(null==n||null===(c=n.epg)||void 0===c?void 0:c.programId)===(null==u?void 0:u.programId),s=null==u?void 0:u.programId}e.on("seeking",function(){i=!0}),e.on("seeked",function(){i=!1,o=e.currentTime();var t=JSON.parse(sessionStorage.getItem("epgConfig"));if(t&&null!=t&&t.enable){if(!d||sessionStorage.getItem("program_switched"))return;s="".concat(null==t?void 0:t.programId,"-").concat(null==t?void 0:t.channelId)}m.saveWatchedTime(s,o),m.getProgramStartTime(e,n),m.handleLiveStartOverBtn({player:e,showWatchLive:e.seekable().end(0)-e.currentTime()>5,showStartOver:!0})}),e.on("timeupdate",function(){if(!i){var n=JSON.parse(sessionStorage.getItem("epgConfig"));if(n&&null!=n&&n.enable){if(!d||sessionStorage.getItem("program_switched")&&!e.currentTime())return;if(sessionStorage.getItem("program_switched")&&e.currentTime())return void sessionStorage.removeItem("program_switched");s="".concat(null==n?void 0:n.programId,"-").concat(null==n?void 0:n.channelId)}var t=e.currentTime();Math.abs(t-o)>=20&&(m.saveWatchedTime(s,t),o=t,function(e,n){Se(n).forEach(function(t){var o=t.id,i=t.title,l=t.time,r=document.getElementById(o);if(r){var a=Math.min(l/n*100,99.5);r.style.left="".concat(a,"%")}else{var u=e.controlBar.progressControl.seekBar.el(),s=we(o,i,Math.min(l/n*100,99.5));u.appendChild(s)}})}(e,a))}})}(t,n)})}else console.warn("Player instance is required to initialize start over.")}function Ee(e,n,t){var o,i,l=document.getElementById(e);l&&(i=n,(o=l)&&(o.style.color="".concat((null==i?void 0:i.textColor)||"#000"),o.style.backgroundColor="".concat((null==i?void 0:i.backGroundColor)||"#DCF95B")),l.addEventListener("click",t))}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 De(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 Ce=function(l,a,d,c){var v,p,m,f,g,h,y,b,w,k,S,E,T,D,C,O,P,j,x,L,A,N,M,B,V,_,H,U,q,F,G,W,K,Y,J,z,X,Q=a.res,$=void 0===Q?null:Q,Z=a.sres,oe=void 0===Z?null:Z,ie=null!=d&&d.chromecastReceiverId?["chromecast","html5"]:["html5"],le=(null===(v=$)||void 0===v?void 0:v.contentType)||"video",re=u.impolicy16x9(null===(p=$)||void 0===p||null===(m=p[le])||void 0===m||null===(f=m.gist)||void 0===f?void 0:f.videoImageUrl)||u.impolicy16x9(null===(g=$)||void 0===g||null===(h=g[le])||void 0===h||null===(y=h.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),ae=(null===(w=$)||void 0===w||null===(k=w[le])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ue=(null===(E=$)||void 0===E||null===(T=E[le])||void 0===T||null===(D=T.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,se=(null===(C=$)||void 0===C||null===(O=C.ads)||void 0===O||null===(P=O.preRoll)||void 0===P||null===(j=P.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===(B=M.web)||void 0===B?void 0:B.url);$=De(De({},$),{},{audioAssetSource:null==d?void 0:d.audioAssetSource});var de=(null==d||null===(V=d.customData)||void 0===V?void 0:V.ads)||{},ce=(null===(_=$)||void 0===_||null===(H=_[le])||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 me=(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",De(De({dash:De(De(De({},!i.browser.IS_SAFARI&&{useTTML:!0}),(null==d?void 0:d.debugConfig)&&(null==d||null===(U=d.debugConfig)||void 0===U?void 0:U.enable)&&{debug:!0,logLevel:null!=d&&null!==(q=d.debugConfig)&&void 0!==q&&q.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:De(De({},(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:!0,droppedFramesRule:!0}})}}}),vhs:De(De(De({},(null==d?void 0:d.initialBandwidth)&&{bandwidth:d.initialBandwidth}),{},{liveRangeSafeTimeDelta:ve,useDevicePixelRatio:!0,experimentalLLHLS:(null==d?void 0:d.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:null==d||!d.initialBandwidth},(null==d||null===(G=d.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null!==(W=null==d?void 0:d.enableLowInitialPlaylist)&&void 0!==W&&W}),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",re),n(z,"techOrder",ie),n(z,"chromecast",{requestCustomDataFn:function(e){var n,t,o=s.getPlayer(l),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),r=function(e,n,t){var o,i,l,r,a,u,s,d,c,v,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var f,g,h,y,b,w,k,S;m.isDrmEnabled=!0;var I=(null==n||null===(f=n.keySystems)||void 0===f?void 0:f["com.widevine.alpha"])||null,E=(null==I?void 0:I.url)||(null==n||null===(g=n.keySystemOptions)||void 0===g||null===(h=g[0])||void 0===h||null===(y=h.options)||void 0===y?void 0:y.serverURL);m.licenseUrl=E;var T=(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"]);m.licenseToken=T}var D=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=D;var C=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;m.duration=C;var O=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;m.mediaTitle=O;var P=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=P,m.subTitles=t,m.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}($,e,i);return De(De({},r),{},{convivaMetaData:De({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},ne.getData())})},modifyLoadRequestFn:function(e){var n,t,o,i,r,a=s.getPlayer(l),u=(null==a?void 0:a.currentSource())||{};!(null===(n=$)||void 0===n||null===(t=n[le])||void 0===t||null===(o=t.streamingInfo)||void 0===o||null===(i=o.videoAssets)||void 0===i?void 0:i.is4K)&&1||null!=u&&u.src&&null!=u&&null!==(r=u.src)&&void 0!==r&&r.includes(".m3u8")&&(e.media.hlsSegmentFormat="fmp4",e.media.hlsVideoSegmentFormat="fmp4");return e}}),z);if(!i.getPlayers()[l]){null!=d&&d.debugConfig&&null!=d&&null!==(X=d.debugConfig)&&void 0!==X&&X.enable&&i.log.level("debug");var fe=i(l,me,function(){var n=t(o.mark(function n(){var t,a,u,s,v,p,m,f,g,h,y,b,w,k,S,E,T,D,C,O,P;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(fe),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,R(d,$);case 5:if(w=null===(t=$)||void 0===t||null===(a=t[le])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ue&&c.resolve(De({status:!0,msg:"Player Initialised"},oe?{seriesResponse:oe,response:$}:{response:$})),ae&&null!=d&&null!==(s=d.dvrConfig)&&void 0!==s&&s.enable&&Ie(l,De(De({},d),{},{isDvrEnabled:ae})),e.inititateBeacon(l,null==d?void 0:d.analyticsCb,null==d?void 0:d.analyticsEventParams),ee(l,d),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),ae&&I(l,w),!se||null!=d&&null!==(v=d.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(l,se,$),k=e.getSource($,l),console.log(k),null!=d&&d.nearestClusterUrl&&(k=e.getUpdatedClusterSource(k,d.nearestClusterUrl)),!ce){n.next=21;break}return n.next=20,e.getSGAIEnabledSource(l,$);case 20:k=n.sent;case 21:k?e.loadVideo(l,k):(c.reject({status:!1,msg:"Incompatible / Missing Source",response:$}),e.handleError(l,"Incompatible / Missing Source")),((null===(p=$)||void 0===p||null===(m=p[le])||void 0===m||null===(f=m.contentDetails)||void 0===f||null===(g=f.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=$)||void 0===h||null===(y=h[le])||void 0===y||null===(b=y.closedCaptions)||void 0===b?void 0:b.length)>0)&&(P=(null===(E=$)||void 0===E||null===(T=E[le])||void 0===T||null===(D=T.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=$)||void 0===C||null===(O=C[le])||void 0===O?void 0:O.closedCaptions),S=P.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),r.addCaptions(l,S)),null!=d&&d.disableControls?e.disableControls(l):te(l,De(De(De({},d),me),{},{liveVideo:ue,isDvrEnabled:ae,res:$,sres:oe})),be(l,De(De(De({},d),me),{},{liveVideo:ue}),c,{res:$,sres:oe});case 25:case"end":return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}())}};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 je,xe=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Le(e);Ce(i,{res:l},e,{resolve:t,reject:o})},Le=function(n){var t,o,i,l,r,a,u,s,d,c,v,p,m,g=null==n?void 0:n.streamingInfo,h=null==n||null===(t=n.streamingInfo)||void 0===t?void 0:t.videoAssets,y=(null==n||null===(o=n.streamingInfo)||void 0===o?void 0:o.isDrmEnabled)||null,b=(null==n||null===(i=n.streamingInfo)||void 0===i||null===(l=i.ads)||void 0===l?void 0:l.url)||null,w=(null==n||null===(r=n.streamingInfo)||void 0===r?void 0:r.posterUrl)||null,k=(null==n||null===(a=n.streamingInfo)||void 0===a?void 0:a.subtitles)||[],S=(null==n||null===(u=n.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.drmProvider)||null,I=(null==n||null===(d=n.streamingInfo)||void 0===d?void 0:d.macroMap)||[],E=(null==n||null===(c=n.customData)||void 0===c||null===(v=c.ads)||void 0===v?void 0:v.isSSAIEnabled)||!1,T=null==n?void 0:n.token,D=e.getDecodedToken(T);null==D||D.site;var C=null==D?void 0:D.siteId,O=(null==n||null===(p=n.customData)||void 0===p||null===(m=p.comscore)||void 0===m?void 0:m.video)||null,P=Pe(Pe({id:"".concat(C,"_external")},!y&&{directPlaybackUrl:null==h?void 0:h.url}),{},{video:Pe(Pe(Pe(Pe(Pe({drmEnabled:y,streamingInfo:Pe(Pe({videoAssets:Pe(Pe({},S&&{drmProvider:S}),{},{widevine:null==h?void 0:h.widevine,fairPlay:null==h?void 0:h.fairPlay,playReady:null==h?void 0:h.playReady})},(null==g?void 0:g.isDvrEnabled)&&{isLiveStream:!0}),(null==O?void 0:O.isLiveStream)&&{isLiveStream:null==O?void 0:O.isLiveStream})},E&&{isSSAIEnabled:E}),{},{metadata:I,liveDetails:{isDvrEnabled:null==g?void 0:g.isDvrEnabled},gist:Pe(Pe(Pe({},w&&{videoImageUrl:w}),(null==O?void 0:O.videoId)&&{id:null==O?void 0:O.videoId}),(null==O?void 0:O.videoTitle)&&{title:null==O?void 0:O.videoTitle}),contentDetails:Pe({},(null==k?void 0:k.length)>0&&{closedCaptions:f(k)})},(null==O?void 0:O.runtime)&&{runtime:null==O?void 0:O.runtime}),(null==O?void 0:O.publishDate)&&{publishDate:null==O?void 0:O.publishDate}),(null==O?void 0:O.platform)&&{platform:null==O?void 0:O.platform}),(null==O?void 0:O.series)&&{series:null==O?void 0:O.series}),ads:{preRoll:{adTags:{web:Pe(Pe({},b&&{active:!0}),b&&{url:b})}}}});return O&&(null!=O&&O.isDvrEnabled&&(P.video.liveDetails=Pe(Pe({},P.video.liveDetails),{},{isDvrEnabled:null==O?void 0:O.isDvrEnabled})),null!=O&&O.metadata&&(P.video.metadata=[].concat(f(P.video.metadata),f(null==O?void 0:O.metadata)))),P},Ae=null,Ne=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)),i=o>0&&t>4?o:0,l=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[l>0&&i>0?l:0,i,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],i=t[1],l=t[2],r=t[3],a=t[4],u=t[5],s=t[6],d=t[7];n=o>=1?" ".concat(o," Year"):i>=1?" ".concat(i," month"):l>=1?" ".concat(l," week"):r>=1?" ".concat(r," 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)},Me=(je={scheduleStartTimeMs:0,scheduleEndTimeMs:0},{get:function(){return je},set:function(e){je={scheduleStartTimeMs:null==e?void 0:e.startDateTime,scheduleEndTimeMs:null==e?void 0:e.endDateTime}}});function Be(e,n,t,o){if(e){var i=function(){var e,i,r=null===(e=Me.get())||void 0===e?void 0:e.scheduleStartTimeMs,a=null===(i=Me.get())||void 0===i?void 0:i.scheduleEndTimeMs,u=Date.now();if(u-a>0){var s=document.getElementsByClassName("error-message")[0];return s&&(s.textContent=d.getLocalisation("eventEnded")||"Game has ended",o.textContent=""),clearInterval(l),void(null==t||t())}var c=r-u;if(c/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var v=Ne(c,r);null==n||n([].concat(f(v),[o]))};i();var l=setInterval(i,1e3);return l}}var Ve=function(e,n,t){var o,i,l,r,a,u,s,c,v=null==n||null===(o=n.response)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.errorCode,p=(null==n||null===(l=n.response)||void 0===l||null===(r=l.data)||void 0===r?void 0:r.errorMessage)||(null==n?void 0:n.message)||null;Me.set({startDateTime:null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,endDateTime:null==n||null===(s=n.response)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.scheduleEndDate}),function(e,n,t,o){var i,l,r=Date.now(),a=null===(i=Me.get())||void 0===i?void 0:i.scheduleStartTimeMs,u=null===(l=Me.get())||void 0===l?void 0:l.scheduleEndTimeMs,s=function(e,n,t,o){var i;e<0?i=d.getLocalisation("eventNotStarted")||o||"Game starts in":(n>0||"VIDEO_NOT_EXISTS"==t)&&(i=d.getLocalisation("eventEnded")||o||"Game has ended");return i||o}(r-a,r-u,n,t);if(document.getElementsByClassName("error-container")[0]){var c=document.getElementsByClassName("error-message")[0];c&&(c.textContent="".concat(s));var v=document.getElementsByClassName("error-timer-message")[0];v&&Be(Math.abs(a),Re,o,v)}else{var p=document.getElementById(e).parentElement;if(p){var m=document.createElement("div");m.className="error-container";var f=document.createElement("div");f.className="error-message";var g=document.createElement("div");g.className="error-timer-message",f.textContent="".concat(s),m.appendChild(f),m.appendChild(g),p.append(m),Be(Math.abs(a),Re,o,g)}}}(e,v,p,t)};function _e(n,t){var o=t.scheduleEndDate,i=t.scheduleStartDate;Me.set({startDateTime:i,endDateTime:o}),Ae&&clearInterval(Ae),Ae=setInterval(function(){var t,o=Date.now(),i=null===(t=Me.get())||void 0===t?void 0:t.scheduleEndTimeMs;if(console.log("scheduleEndTimeMs",i),i&&o>i){var l;console.log("Game ended");var r=s.getPlayer(n);if(e.isPlayerInitialised(n)&&r){var a;r.dispose(),console.log("Player disposed");var u=null===(a=document.getElementsByClassName("vl-container"))||void 0===a?void 0:a[0],c=document.createElement("video");c.id=n,c.className="video-js",c.style.width="100%",c.style.height="100%",u&&u.appendChild(c)}var v=d.getLocalisation("eventEnded")||"Game has ended",p=null===(l=document.getElementsByClassName("error-container"))||void 0===l?void 0:l[0];if(p){var m=p.querySelector(".error-message");m&&(m.textContent=v)}else{var f=document.getElementById(n),g=null==f?void 0:f.parentElement;if(g){(p=document.createElement("div")).className="error-container";var h=document.createElement("div");h.className="error-message",h.textContent=v,p.appendChild(h),g.append(p)}}clearInterval(Ae)}},1e3)}function He(e,n){return Ue.apply(this,arguments)}function Ue(){return(Ue=t(o.mark(function n(t,i){var l,r,a,u,s,d,v,p,m;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,s=null==t?void 0:t.videoId,d=null==t?void 0:t.playerId,v=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:p=n.sent,m=!1===(null==t||null===(l=t.customData)||void 0===l||null===(r=l.ads)||void 0===r?void 0:r.isSSAIEnabled),e.getVideoDetails(s,p,m).then(function(n){var o,i,l,r,m,f,g,h,y,b;window.contentType=null==n||null===(o=n.data)||void 0===o||null===(i=o.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.contentType,c.setCurrentVideo(null==n?void 0:n.data);var w=null==n||null===(r=n.data)||void 0===r||null===(m=r.video)||void 0===m||null===(f=m.gist)||void 0===f?void 0:f.scheduleEndDate,k=null==n||null===(g=n.data)||void 0===g||null===(h=g.video)||void 0===h||null===(y=h.gist)||void 0===y?void 0:y.scheduleStartDate;_e(d,{scheduleEndDate:w,scheduleStartDate:k});var S,I=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(b=t.watchHistory)&&void 0!==b&&b.enable&&!v)if((null===(S=t.watchHistory)||void 0===S?void 0:S.saveOffline)||!1){var E,T,D,C=ce((null===(E=t.watchHistory)||void 0===E?void 0:E.profileId)||"",s,null==t?void 0:t.siteOwner);if(C&&C.length)t.watchHistoryResumeTime=(null===(T=C[0])||void 0===T?void 0:T.watchedTime)||null,t.watchedPercentage=(null===(D=C[0])||void 0===D?void 0:D.watchedPercentage)||null;I.contentType="video",Ce(d,{res:I},t,{resolve:a,reject:u})}else e.getVideoInfo(s,p).then(function(e){var n,o,i,l,r,a;null!==(n=window)&&void 0!==n&&null!==(o=n.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(l=i.watchHistory)||void 0===l||l.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,I.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Ce(d,{res:I},t,{resolve:a,reject:u})});else Ce(d,{res:I},t,{resolve:a,reject:u})}).catch(function(n){var o,i,l=(null==t||null===(o=t.event)||void 0===o?void 0:o.showScheduleTimer)||!1,r=(null==t||null===(i=t.event)||void 0===i?void 0:i.onCountdownComplete)||null;l&&Ve(d,n,r),e.initiateErrorHandling(n,d,u,s)});case 9:case"end":return n.stop()}},n)}))).apply(this,arguments)}function qe(e,n){return Fe.apply(this,arguments)}function Fe(){return(Fe=t(o.mark(function n(t,i){var l,r,a,u,s,d,c,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=i.resolve,u=i.reject,n.next=3,e.getToken();case 3:s=n.sent,d=null==t?void 0:t.playerId,c=null==t?void 0:t.epg,v=!1===(null==t||null===(l=t.customData)||void 0===l||null===(r=l.ads)||void 0===r?void 0:r.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,Ce(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 Ge(e,n){return We.apply(this,arguments)}function We(){return(We=t(o.mark(function n(t,i){var l,r,a,u,s,d,v;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return r=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,d=sessionStorage.getItem("season-idx")||0,c.seasonIdxManager.set(parseInt(d)),v=null==t||null===(l=t.series)||void 0===l?void 0:l.id,e.getSeriesDetails(v,u).then(function(n){var o,i,l,d=n.data,p=n.data.seasons;c.setCurrentSeries(p);var m=videoId||(null==p||null===(o=p[0])||void 0===o||null===(i=o.episodes)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.id);e.createSeriesWatchMap(v,u),e.getVideoDetails(m,u).then(function(e){var n,o,i;window.contentType=null==e||null===(n=e.data)||void 0===n||null===(o=n.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,c.setCurrentVideo(e.data),Ce(s,{res:null==e?void 0:e.data,sres:d},t,{resolve:r,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)}var Ke,Ye=function(n){var t=n.site,o=n.sseBaseUrl,i=n.sseEndpoint;return h.createSSETransport({site:t,sseBaseUrl:o,getToken:e.getToken,sseEndpoint:i,onOpen:function(e){var n=e.userId,t=e.endpoint;console.log("SSE Connected:",n,t)},onMessage:function(e){var n,t,o,i,l,r,a,u,s,d;console.log("SSE Message:",e);var v=null===(n=c.getCurrentVideo())||void 0===n||null===(t=n.video)||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.id;if((!v||v===(null==e||null===(i=e.payload)||void 0===i?void 0:i.id))&&"GAME_STATE_CHANGE"===(null==e?void 0:e.notificationType)){var p=1e3*(null==e||null===(l=e.payload)||void 0===l||null===(r=l.states)||void 0===r||null===(a=r.live)||void 0===a?void 0:a.startDateTime),m=1e3*(null==e||null===(u=e.payload)||void 0===u||null===(s=u.states)||void 0===s||null===(d=s.end)||void 0===d?void 0:d.endDateTime);p&&m&&(console.log("Setting schedule timer",p,m),Me.set({startDateTime:p,endDateTime:m}))}},onReconnectAttempt:function(e){console.log("Reconnect attempt:",e)},onHeartbeatTimeout:function(e){var n=e.elapsed;console.warn("Heartbeat timeout after:",n)},onTokenInvalid:function(e){console.error("Invalid token:",e),window.location.href="/login"},onError:function(e,n){console.error("SSE Error:",e,n)},onClose:function(){console.log("SSE Closed")}})},Je=function(e){var n=e.enable,t=e.site,o=e.sseBaseUrl,i=e.sseEndpoint;if(n){var l=Ye({site:t,sseBaseUrl:o,sseEndpoint:i});return l._sseBaseUrl=o,l._site=t,l._sseEndpoint=i,l}};function ze(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 Xe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ze(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}exports.VLPlayerCore=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(o.mark(function t(i,l){var r,a,s,c,v,p,m,f,g,h,b,w,k,S,I,E,T,D,C,O,P,j,L,A,N,R,M,B,V,_;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(T=(null==n?void 0:n.videoSourceUrl)||!1,D=null==n?void 0:n.asat,C=(null==n||null===(r=n.epg)||void 0===r?void 0:r.enable)||!1,O=null==n?void 0:n.videoId,P=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,j=(null==n?void 0:n.streamingInfo)||!1,window.videoId=O,L=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=17;break}if(sessionStorage.setItem("vlp_token",L),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),L&&!e.isTokenExpired(L)){t.next=16;break}return l({status:!1,msg:"".concat(L?"Token is expired !":"Missing Authorization Token"),response:{token:L}}),t.abrupt("return");case 16:Ke=JSON.parse(atob(L.split(".")[1]));case 17:return window.siteName=null===(s=Ke)||void 0===s?void 0:s.site,window.siteId=null===(c=Ke)||void 0===c?void 0:c.siteId,n.isAnonymousUser=!(null===(v=Ke)||void 0===v||!v.anonymousId),n.siteOwner=(null===(p=Ke)||void 0===p?void 0:p.site)||null,n.userId=(null===(m=Ke)||void 0===m?void 0:m.userId)||null,window.sessionStorage.setItem("uid",null===(f=Ke)||void 0===f?void 0:f.userId),window.watchHistory=n.watchHistory||null,A=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,N=(null==n||null===(h=n.analytics)||void 0===h?void 0:h.gaId)||null,(R=null==n?void 0:n.errors)&&(window.customErrors=R),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,x(n);case 35:N&&y("https://www.googletagmanager.com/gtag/js?id=".concat(N)).then(function(){return e.runGtag(N)}).catch(function(e){}),(M=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(A)))&&M.addEventListener("contextmenu",function(e){return e.preventDefault()}),(B=Je({enable:null==n||null===(k=n.sse)||void 0===k?void 0:k.enable,site:null==n||null===(S=n.sse)||void 0===S?void 0:S.siteName,sseBaseUrl:null==n||null===(I=n.sse)||void 0===I?void 0:I.sseBaseUrl,sseEndpoint:null==n||null===(E=n.sse)||void 0===E?void 0:E.sseEndpoint}))&&!B.isConnectionActive()&&B.connect(),T?(_={directPlaybackUrl:T,id:V="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},D?e.getVideoDetails(V,L).then(function(e){var t=(null==e?void 0:e.data)||{};Ce(A,{res:Xe(Xe({},t),_)},n,{resolve:i,reject:l})}).catch(function(n){e.initiateErrorHandling(n,A,l,V)}):Ce(A,{res:_},n,{resolve:i,reject:l})):j?xe(n,{resolve:i,reject:l}):P?Ge(n,{resolve:i,reject:l}):C?qe(n,{resolve:i,reject:l}):He(n,{resolve:i,reject:l});case 41:case"end":return t.stop()}},t)}));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:r.enableCaptions,disableCaptions:r.disableCaptions,getCaptions:r.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:e.getSource,setVolume:w,getVolume:k,disableControls:e.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:e.getEntitlementData,adsQueuePointManager:e.adsQueuePointManager,getSsaiEvents:e.getSsaiEvents,playerEvents:l.playerEvents,onReplay:l.onReplay,isBehindLive:e.isBehindLive}},exports.initiateMarker=function(e){var n=s.getPlayer(e),t=n.seekable(),o=n.controlBar.progressControl.seekBar.el();if(t&&t.length>0){var i=t.start(0),l=t.end(t.length-1)-i;ke(),Se(l).forEach(function(e){var n=e.id,t=e.title,i=e.time,r=we(n,t,Math.min(i/l*100,99.5));o.appendChild(r)})}},exports.removeMarkers=ke;
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css"),require("./generic-939a3e97.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-939a3e97.js"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("video.js");var e=require("./index-e5d7c072.js");require("./util-4769ed5b.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("md5"),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("@viewlift/sse"),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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./features-258a9a64.js"),l=require("./player_instance-fcf6a8fb.js"),i=require("./index-e4393a77.js"),r=require("./index-c51fccda.js"),n=require("./generic-939a3e97.js");require("videojs-contrib-quality-menu");var o=require("./index-e5d7c072.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-cb31894f.js"),require("./util-4769ed5b.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("@babel/runtime/helpers/slicedToArray"),require("axios"),require("md5"),require("js-cookie"),require("./captions-68e263dd.js"),require("@viewlift/comscore/index.js"),require("video.js/dist/video-js.min.css"),require("@viewlift/sse");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)};
|