@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.
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import{d as e,c as n,g as t,a as o,b as i,s as l,e as r,l as a,i as u,f as s,h as d,j as c,k as v,m as p,n as f,o as m,p as g,q as y,r as h,t as b,u as w,v as k,w as I,x as S,y as O,z as j,A as D,B as T,C as E,D as P,E as C,F as x,G as A,H as R,I as N,J as L,K as M,L as _,M as B,N as V,O as F,P as U}from"./generic-307cf701.js";import H from"@babel/runtime/helpers/defineProperty";import G from"@babel/runtime/helpers/asyncToGenerator";import K from"@babel/runtime/regenerator";import q from"video.js";import{o as J,g as W,a as Y,s as z,b as X,p as Q,c as $}from"./util-e30d090e.js";import{g as Z,d as ee,a as ne,e as te}from"./captions-78bd2908.js";import{g as oe,p as ie}from"./resolution-62be852a.js";import{i as le,a as re}from"./skin-65765793.js";import{g as ae}from"./player_instance-34118a5b.js";import{g as ue,s as se}from"./localisation-0bf399a1.js";import{g as de,a as ce,s as ve,v as pe,b as fe,c as me,d as ge,e as ye,f as he}from"./currentVideoInfo-0b234e55.js";import be from"@babel/runtime/helpers/typeof";import{s as we,w as ke}from"./icons-37daa6b3.js";import{c as Ie,p as Se,a as Oe,h as je,r as De,g as Te,b as Ee,d as Pe,s as Ce,e as xe,f as Ae}from"./helper-d52dff3c.js";import Re from"@babel/runtime/helpers/toConsumableArray";import Ne from"@babel/runtime/helpers/slicedToArray";var Le=function(e){return new Promise(function(n,t){if(Me(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)}})},Me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},_e=function(e,n,t){var o=ae(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,"'")})},Be=function(e){var n=ae(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Ve=function(){var n=G(K.mark(function n(t){var o,i,l,r,a;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=ae(null==t?void 0:t.playerId),null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,Le("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!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(q),(a=q.getTech("chromecast"))&&!a.prototype.seeking&&(a.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.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()?null==l||l.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)}}(),Fe=function(e,n){var t=ae(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,r,a=this.el(),u=q.dom.getPointerPosition(a,n).x;q.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=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;if(console.log(s),s&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*u,c.seek()}})};var Ue=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Le("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)}}(),He=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then(function(e){n.set(e)});case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ge=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){q.getPlugin("eme")||q.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=G(K.mark(function e(){var n;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(q),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-6ecf4a3a.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)}}(),Je=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-20c85b48.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)}}(),We=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){Le("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(q)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(q)})},loadAdsLibrary:Ue,loadEMELibrary:Ge,loadMuxPlugin:Ke,loadDvrSeekbar:qe,loadContribDash:Je,loadComscorePlugin:He});function Ye(e){return ze.apply(this,arguments)}function ze(){return(ze=G(K.mark(function n(t){var o,i,l;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o=(null==t?void 0:t.airplay)||!1,n.next=3,Ue();case 3:o&&"Safari"==e()?Promise.resolve().then(function(){return We}).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 Xe(e){return Qe.apply(this,arguments)}function Qe(){return(Qe=G(K.mark(function e(n){var t,o,i,l,r,a;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=ae(n.playerId),e.next=3,He();case 3:a.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.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===(r=n.comscore)||void 0===r?void 0:r.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $e(e,n){return Ze.apply(this,arguments)}function Ze(){return(Ze=G(K.mark(function n(t,o){var i,l,r,a,u,s,d,c,v,p,f,m,g,y;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return v=(null==o?void 0:o.contentType)||"video",p=null==o||null===(i=o[v])||void 0===i?void 0:i.drmEnabled,null==o||null===(l=o[v])||void 0===l||null===(r=l.liveDetails)||void 0===r||r.isDvrEnabled,null==t||t.showPositiveSeekbar,f=(null==o||null===(a=o[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==t||null===(d=t.comscore)||void 0===d?void 0:d.enable)||!1,g=!(null==t||null===(c=t.analytics)||void 0===c||!c.muxKey),n.prev=7,n.next=10,Promise.allSettled([p?"Safari"==e()?Ge():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?Je():Ge():"Safari"!=e()&&f?Je():null,m?Xe(t):null,g?Ke():null,Ve(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 en(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 nn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?en(Object(t),!0).forEach(function(n){H(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):en(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var tn=new Set,on=null,ln=function(e,n,o,i){var l,r,a,u,s,d,c,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(l=e[p])||void 0===l?void 0:l.id)||"Null",v["c3.cm.contentType"]=vn(e),v[null==o||null===(r=o.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),v[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===t()?"NULL":t(),v["c3.cm.categoryType"]=sn(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=e[p])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[o.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=dn(e),v["c3.cm.genreList"]=an(e),v["c3.cm.genre"]=rn(e),v["c3.cm.channel"]=un(e,i);var f=mn(de(),e);return v=nn(nn({},v),f)},rn=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"},an=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"},un=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"},sn=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"},dn=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"},cn=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)},vn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var pn,fn,mn=function(e,n){var t,l,r,a,u,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var d=i(),c=o();return s["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(l=t.series)||void 0===l?void 0:l.title)||"Null",s["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(r=e[d-1])||void 0===r||null===(a=r.episodes)||void 0===a||null===(u=a[c-1])||void 0===u?void 0:u.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},gn=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"}},yn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},hn=function(){var e=G(K.mark(function e(n,t){var o,i,l,r,a,u,s,d,c,v,p,f;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},i=o.trackConvivaPlayerEvent,l=o.paymentHandler,r=o.tveProvider,a=o.enable,u=o.appName,d=(s=t||{}).token,c=s.epg,a){e.next=4;break}return e.abrupt("return");case 4:if(v=ae(n),"function"==typeof(p=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,p("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:v.ready(function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=gn(t.keySystem);p("contentInfo",{DRMEnabled:o})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),v.on("loadstart",function(){var e,n;on&&on!==v.currentSrc()&&p("playbackEnded"),p("setPlayer",v),tn.clear(),on=v.currentSrc();var o=yn(v.currentType()),i=ce(),a=ln(i,v,f,c);a[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",a[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=cn(i,t),a.authToken=d||"NULL",a.streamType=o,a.D2CType=l||"NONE",a.subscriberType=r?"MVPD":"FREE"!==l?"D2C":"FREE",a["c3.cm.affiliate"]=r||"NULL",bn.setData(a),p("contentInfo",a)}),v.on("loadedmetadata",function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),v.on("play",function(){tn.has(v.currentSrc())||(tn.add(v.currentSrc()),p("playbackStarted",null))}),v.on("ended",function(){tn.has(v.currentSrc())&&tn.delete(v.currentSrc()),p("playbackEnded")}),v.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})}),v.on("dispose",function(){null==tn||tn.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),bn=(pn={},{setData:function(e){pn=nn(nn({},pn),e)},getData:function(){return pn}}),wn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-aa7dd324.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-9f9c1ff4.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-feb5f134.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-e4fd3381.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-977073db.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-76caf837.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-5a5d4f1b.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-31a0882a.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&import("./skin-831a579b.js").then(function(t){t.initialiseSkin(e,n)})};function kn(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 In(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?kn(Object(t),!0).forEach(function(n){H(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Sn=[],On=0,jn=null;function Dn(){console.log("Cleaning up watch history data"),fn=null,Sn=[],On=0,jn=null}function Tn(e,n,t){var o,i,r,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,m=Math.floor(e.currentTime()),g=s?100:Math.floor(c/v*100),y={};f?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=En(o),l=(new Date).getTime(),r=ce(),a=(null==r?void 0:r.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return In(In({},e),{},H({},n,a[n]))},{}),s=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===fn});s<0?i.push(In(In({content:u},e),{},{addedDate:l,updateDate:l})):i[s]=In(In(In({},i[s]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(i))}(y={completed:s,watchedTime:m,watchedPercentage:g},d,n.siteOwner):(y=In(In({videoId:fn,watchedTime:m,watchedPercentage:g,doneWatching:s,profileId:d},jn&&{seriesId:jn}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),On=c+t}function En(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pn(e,n,t){var o=En(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 Cn=!1,xn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!Cn){var l=An(e,"videoAssets","secondaryVideoAssets"),u=r(l,n);return u&&a(n,u),Cn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function An(e,n,t){if(Array.isArray(e))return e.map(function(e){return An(e,n,t)});if(null!==e&&"object"===be(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]=An(e[i],n,t)}),o}return e}function Rn(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 Nn(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)?Nn(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 Nn(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 Ln(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 Mn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ln(Object(t),!0).forEach(function(n){H(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ln(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var _n=function(n,t,o,i){var l,r,a,c,v,p=i.res,f=i.sres,m=ae(n),g=(null==p?void 0:p.contentType)||"video",y=(null==p||null===(l=p[g])||void 0===l?void 0:l.drmEnabled)||!1,h=(null==p||null===(r=p[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==p||null===(c=p[g])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;ve(p),pe.set(p),m&&(m.on("loadstart",function(){h?o.resolve({status:!0,msg:"Video Loaded",response:p}):o.resolve(Mn({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))}),m.on("loadeddata",function(){var o,i,l,r=Z(n);if(null==r||r.map(function(e){return ee(n,e.id)}),b&&"Safari"===e())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&_e(n,sessionStorage.getItem("volume")||"100");var d=ce();if(u(t),s(),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 c,v,f=Mn(Mn({},t),p);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(jn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),Sn=[],On=0,fn=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=ae(e);a&&(a.on("dispose",Dn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Sn.includes(On)||(e!=On||e<r?e>On&&(On=e+r):(Sn.push(e),Tn(a,n,r)))}}),a.one("ended",function(){Tn(a,n,r,!0)}))}(n,f,null==d||null===(c=d.video)||void 0===c||null===(v=c.gist)||void 0===v?void 0:v.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var g,y,h,w,k,I,S=(null===(g=ce())||void 0===g?void 0:g.video)||(null==p?void 0:p.video),O=null==S?void 0:S.gist,j={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(h=window)||void 0===h?void 0:h.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==S||null===(w=S.series)||void 0===w?void 0:w.title,video_stream_type:null!=S&&null!==(k=S.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==t||null===(I=t.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:j})}}),m.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,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,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)}}),m.tech_.on("retryplaylist",function(){h&&xn(p,n)}),m.on("error",function(){var e,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?xn(p,n):(d(n,(null==m||null===(e=m.error())||void 0===e?void 0:e.message)||"Some error occured"),o.reject({status:!1,msg:(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured",response:p}))}),m.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=ce())||void 0===r||null===(a=r.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=fe(),c=(null==d?void 0:d.get(s))||{t:0,p:0},v=c.t,p=c.p;v&&p<95&&setTimeout(function(){m.currentTime(v)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(h){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var n,t=(null==m||null===(n=m.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"==be(m.dash)){var o,i,l,r=null==m||null===(o=m.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=Rn(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=Rn(t);try{for(c.s();!(d=c.n()).done;){var v,p,f,g=d.value;if(("Chrome"==e()||"Edge"==e()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!y))&&null!=g&&null!==(f=g.label)&&void 0!==f&&f.includes("5.1"))m.audioTracks().removeTrack(g);else{if("main"==g.kind){g.enabled=!0;break}g.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function Bn(e){var n=ae(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;Fn(),Un(l).forEach(function(e){var n=e.id,t=e.title,i=e.time,r=Vn(n,t,Math.min(i/l*100,99.5));o.appendChild(r)})}}function Vn(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 Fn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function Un(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(me()||[]).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 Hn(e,n){var t=ae(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;ge(u),t.on("loadeddata",function(){Ie(n)?a?Se(t,n):r?Oe(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=!!Te(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Ee(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.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(ke()," ").concat(r,"</button>"),u='<button id="watch-begining-btn">'.concat(we()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}(o,v),p.style.display="flex",e.el().appendChild(p),Pe(e),Gn("watch-live-resume-btn",u,function(){Ae(e,p),Oe(e,d)}),Gn("watch-begining-btn",s,function(){Ae(e,p),Se(e,n)})}(t,n),je({player:t,showWatchLive:!0,showStartOver:!0})):De(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)}Ce(s,o),xe(e,n),je({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&&(Ce(s,t),o=t,function(e,n){Un(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=Vn(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 Gn(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 Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function qn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach(function(n){H(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Jn=function(n,t,o,i){var l,u,s,g,y,h,b,w,k,I,S,O,j,D,T,E,P,C,x,A,R,N,L,M,_,B,V,F,U,J,W,Y,z,X,Q,$,Z,ee=t.res,te=void 0===ee?null:ee,oe=t.sres,ie=void 0===oe?null:oe,re=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(l=te)||void 0===l?void 0:l.contentType)||"video",se=le(null===(u=te)||void 0===u||null===(s=u[ue])||void 0===s||null===(g=s.gist)||void 0===g?void 0:g.videoImageUrl)||le(null===(y=te)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.gist)||void 0===b||null===(w=b.imageGist)||void 0===w?void 0:w.r16x9),de=(null===(k=te)||void 0===k||null===(I=k[ue])||void 0===I||null===(S=I.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ce=(null===(O=te)||void 0===O||null===(j=O[ue])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,ve=(null===(T=te)||void 0===T||null===(E=T.ads)||void 0===E||null===(P=E.preRoll)||void 0===P||null===(C=P.adTags)||void 0===C||null===(x=C.web)||void 0===x?void 0:x.active)&&(null===(A=te)||void 0===A||null===(R=A.ads)||void 0===R||null===(N=R.preRoll)||void 0===N||null===(L=N.adTags)||void 0===L||null===(M=L.web)||void 0===M?void 0:M.url);te=qn(qn({},te),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var pe=(null==o||null===(_=o.customData)||void 0===_?void 0:_.ads)||{},fe=(null===(B=te)||void 0===B||null===(V=B[ue])||void 0===V?void 0:V.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==pe?void 0:pe.vodAdSticherProvider)||!1,me=(null==o?void 0:o.latency)||6,ge=(null==o?void 0:o.skin_settings)||{};null==o||o.dvrConfig;var ye=($={enableSmoothSeeking:!0,controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ge?void 0:ge.pictureInPictureToggle)||!1},playbackRates:null!=ge&&ge.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==o.skin,liveui:de},H($,"autoplay",null==o?void 0:o.autoplay),H($,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!ve),H($,"loop",(null==o?void 0:o.loop)||!1),H($,"audioPosterMode",null==o?void 0:o.audioPosterMode),H($,"html5",qn(qn({dash:qn(qn(qn({},!q.browser.IS_SAFARI&&{useTTML:!0}),(null==o?void 0:o.debugConfig)&&(null==o||null===(F=o.debugConfig)||void 0===F?void 0:F.enable)&&{debug:!0,logLevel:null!=o&&null!==(U=o.debugConfig)&&void 0!==U&&U.logLevel?null==o||null===(J=o.debugConfig)||void 0===J?void 0:J.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:me},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:qn(qn({},(null==o?void 0:o.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==o?void 0:o.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0}})}}}),vhs:qn(qn(qn({},(null==o?void 0:o.initialBandwidth)&&{bandwidth:o.initialBandwidth}),{},{liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==o||null===(W=o.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(Y=null==o?void 0:o.enableLowInitialPlaylist)||void 0===Y||Y}),debug:(null==o?void 0:o.debugConfig)&&(null==o||null===(z=o.debugConfig)||void 0===z?void 0:z.enable)||!1,nativeTextTracks:"Safari"==e()},0==(null==o||null===(X=o.customData)||void 0===X?void 0:X.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),H($,"poster",se),H($,"techOrder",re),H($,"chromecast",{requestCustomDataFn:function(e){var t,i,l=ae(n),r=((null==l?void 0:l.textTracksJson_)||l.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,i,l,r,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,I;f.isDrmEnabled=!0;var S=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,O=(null==S?void 0:S.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 j=(null==S?void 0:S.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===(I=k.httpRequestHeaders)||void 0===I?void 0:I["X-AxDRM-Message"]);f.licenseToken=j}var D=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=D;var T=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=T;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 P=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=P,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}(te,e,r);return qn(qn({},a),{},{convivaMetaData:qn({customerKey:(null==o||null===(t=o.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==o||null===(i=o.convivaConfig)||void 0===i?void 0:i.debug)||!1},bn.getData())})},modifyLoadRequestFn:function(e){var t,o,i,l,r,a=ae(n),u=(null==a?void 0:a.currentSource())||{};!(null===(t=te)||void 0===t||null===(o=t[ue])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.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}}),$);if(!q.getPlayers()[n]){null!=o&&o.debugConfig&&null!=o&&null!==(Z=o.debugConfig)&&void 0!==Z&&Z.enable&&q.log.level("debug");var he=q(n,ye,function(){var e=G(K.mark(function e(){var t,l,u,s,g,y,h,b,w,k,I,S,O,j,D,T,E,P,C,x,A;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(he),console.log(q.VERSION),console.log(q.getPlugins()),e.next=5,$e(o,te);case 5:if(O=null===(t=te)||void 0===t||null===(l=t[ue])||void 0===l||null===(u=l.liveDetails)||void 0===u?void 0:u.startOverTime,ce&&i.resolve(qn({status:!0,msg:"Player Initialised"},ie?{seriesResponse:ie,response:te}:{response:te})),de&&null!=o&&null!==(s=o.dvrConfig)&&void 0!==s&&s.enable&&Hn(n,qn(qn({},o),{},{isDvrEnabled:de})),v(n,null==o?void 0:o.analyticsCb,null==o?void 0:o.customData),hn(n,o),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),de&&Fe(n,O),!ve||null!=o&&null!==(g=o.customData)&&void 0!==g&&g.disableAds||p(n,ve,te),j=r(te,n),console.log(j),null!=o&&o.nearestClusterUrl&&(j=f(j,o.nearestClusterUrl)),!fe){e.next=21;break}return e.next=20,m(n,te);case 20:j=e.sent;case 21:j?a(n,j):(i.reject({status:!1,msg:"Incompatible / Missing Source",response:te}),d(n,"Incompatible / Missing Source")),((null===(y=te)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.contentDetails)||void 0===b||null===(w=b.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(k=te)||void 0===k||null===(I=k[ue])||void 0===I||null===(S=I.closedCaptions)||void 0===S?void 0:S.length)>0)&&(A=(null===(T=te)||void 0===T||null===(E=T[ue])||void 0===E||null===(P=E.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(C=te)||void 0===C||null===(x=C[ue])||void 0===x?void 0:x.closedCaptions),D=A.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),ne(n,D)),null!=o&&o.disableControls?c(n):wn(n,qn(qn(qn({},o),ye),{},{liveVideo:ce,isDvrEnabled:de,res:te,sres:ie})),_n(n,qn(qn(qn({},o),ye),{},{liveVideo:ce}),i,{res:te,sres:ie});case 25:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}};function Wn(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 Yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wn(Object(t),!0).forEach(function(n){H(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var zn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Xn(e);Jn(i,{res:l},e,{resolve:t,reject:o})},Xn=function(e){var n,t,o,i,l,r,a,u,s,d,c,v=null==e?void 0:e.streamingInfo,p=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,f=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,m=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,y=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,h=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],b=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,w=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],k=(null==e||null===(d=e.customData)||void 0===d||null===(c=d.ads)||void 0===c?void 0:c.isSSAIEnabled)||!1,I=null==e?void 0:e.token,S=g(I);null==S||S.site;var O=null==S?void 0:S.siteId;return Yn(Yn({id:"".concat(O,"_external")},!f&&{directPlaybackUrl:null==p?void 0:p.url}),{},{video:Yn(Yn({drmEnabled:f,streamingInfo:Yn({videoAssets:Yn(Yn({},b&&{drmProvider:b}),{},{widevine:null==p?void 0:p.widevine,fairPlay:null==p?void 0:p.fairPlay,playReady:null==p?void 0:p.playReady})},(null==v?void 0:v.isDvrEnabled)&&{isLiveStream:!0})},k&&{isSSAIEnabled:k}),{},{metadata:w,liveDetails:{isDvrEnabled:null==v?void 0:v.isDvrEnabled},gist:Yn({},y&&{videoImageUrl:y}),contentDetails:Yn({},(null==h?void 0:h.length)>0&&{closedCaptions:Re(h)})}),ads:{preRoll:{adTags:{web:Yn(Yn({},m&&{active:!0}),m&&{url:m})}}}})},Qn=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)]},$n=function(e){var n,t=Ne(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),console.log("Time left:",n)};function Zn(e,n,t,o){if(e){var i=function(){var i=e-Date.now();if(i/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var r=Qn(i,e);null==n||n([].concat(Re(r),[o]))};i();var l=setInterval(i,1e3);return l}}var et,nt=function(e,n,t){var o,i,l,r,a,u,s,d,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,f=Date.now(),m=null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,g=f-(null==n||null===(s=n.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.scheduleEndDate);if(f-m<0?c=ue("eventNotStarted")||p||"Game starts in":(g>0||"VIDEO_NOT_EXISTS"==v)&&(c=ue("eventEnded")||p||"Game has ended"),document.getElementsByClassName("error-container")[0]){var y=document.getElementsByClassName("error-message")[0];y&&(y.textContent="".concat(c));var h=document.getElementsByClassName("error-timer-message")[0];h&&Zn(Math.abs(m),$n,t,h)}else{var b=document.getElementById(e).parentElement;if(b){var w=document.createElement("div");w.className="error-container";var k=document.createElement("div");k.className="error-message";var I=document.createElement("div");I.className="error-timer-message",k.textContent="".concat(c),w.appendChild(k),w.appendChild(I),b.append(w),Zn(Math.abs(m),$n,t,I)}}};function tt(e,n){return ot.apply(this,arguments)}function ot(){return(ot=G(K.mark(function e(n,t){var o,i,l,r,a,u,s,d,c;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,w();case 6:d=e.sent,c=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),y(a,d,c).then(function(e){var t,o,i,c;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,ve(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(c=n.watchHistory)&&void 0!==c&&c.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=Pn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",a,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Jn(u,{res:p},n,{resolve:l,reject:r})}else h(a,d).then(function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.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)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Jn(u,{res:p},n,{resolve:l,reject:r})});else Jn(u,{res:p},n,{resolve:l,reject:r})}).catch(function(e){var t,o,i=(null==n||null===(t=n.event)||void 0===t?void 0:t.honourScheduleTime)||!1,l=(null==n||null===(o=n.event)||void 0===o?void 0:o.onCountdownComplete)||null;i&&nt(u,e,l),b(e,u,r,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function it(e,n){return lt.apply(this,arguments)}function lt(){return(lt=G(K.mark(function e(n,t){var o,i,l,r,a,u,s,d;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,e.next=3,w();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,d=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),k(s,a,d).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Jn(u,{res:t},n,{resolve:l,reject:r})}).catch(function(e){b(e,u,r,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function rt(e,n){return at.apply(this,arguments)}function at(){return(at=G(K.mark(function e(n,t){var o,i,l,r,a,u,s;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,w();case 3:r=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,ye.set(parseInt(u)),s=null==n||null===(o=n.series)||void 0===o?void 0:o.id,I(s,r).then(function(e){var t,o,u,d=e.data,c=e.data.seasons;he(c);var v=videoId||(null==c||null===(t=c[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);S(s,r),y(v,r).then(function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,ve(e.data),Jn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:l})}).catch(function(e){b(e,a,l,videoId)})}).catch(function(e){b(e,a,l)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ut(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 st(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ut(Object(t),!0).forEach(function(n){H(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ut(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function dt(){return{loadVideoInstantly:O,onTimeUpdate:J,getVideoDuration:W,onVideoEnded:Y,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=G(K.mark(function n(t,o){var i,l,r,a,u,s,d,c,v,p,f,m,g,h,w,k,I,S,O,j,D,T,E,C,x;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!P(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(g=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,w=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,k=null==e?void 0:e.videoId,I=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=k,O=null==e?void 0:e.token,!B(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",O),V().set(null==e?void 0:e.refreshToken),O&&!F(O)){n.next=16;break}return o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}}),n.abrupt("return");case 16:et=JSON.parse(atob(O.split(".")[1]));case 17:return window.siteName=null===(r=et)||void 0===r?void 0:r.site,window.siteId=null===(a=et)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=et)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=et)||void 0===s?void 0:s.site)||null,e.userId=(null===(d=et)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=et)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,j=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(v=e.series)&&void 0!==v&&v.enable?null:null==e?void 0:e.chromecastReceiverId,D=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(T=null==e?void 0:e.errors)&&(window.customErrors=T),window.customData=null==e?void 0:e.customData,se(null==e||null===(f=e.customData)||void 0===f?void 0:f.localisation),_.set(e.apiBaseUrl),null!=e&&e.skin&&!re(e.skin)||(e.skin="VL_ONE"),n.next=35,Ye(e);case 35:D&&Le("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then(function(){return U(D)}).catch(function(e){}),(E=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(j)))&&E.addEventListener("contextmenu",function(e){return e.preventDefault()}),g?(x={directPlaybackUrl:g,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?y(C,O).then(function(n){var i=(null==n?void 0:n.data)||{};Jn(j,{res:st(st({},i),x)},e,{resolve:t,reject:o})}).catch(function(e){b(e,j,o,C)}):Jn(j,{res:x},e,{resolve:t,reject:o})):S?zn(e,{resolve:t,reject:o}):I?rt(e,{resolve:t,reject:o}):w?it(e,{resolve:t,reject:o}):tt(e,{resolve:t,reject:o});case 39:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:j,getPlayer:ae,play:D,pause:T,detectBrowser:e,rewind:E,loadVideo:a,seekToTimeStamp:z,isPlayerInitialised:P,load:C,authenticateLC:x,dispose:A,enableCaptions:te,disableCaptions:ee,getCaptions:Z,playSelectedResolution:ie,getSource:r,setVolume:_e,getVolume:Be,disableControls:c,setPlaybackSpeed:X,getEntitlementData:R,adsQueuePointManager:N,getSsaiEvents:L,playerEvents:Q,onReplay:$,isBehindLive:M}}export{dt as V,Bn as i,Fn as r};
1
+ import"video.js/dist/video-js.min.css";import{d as e,c as n,g as t,a as o,b as i,s as l,e as r,l as a,i as u,f as s,h as d,j as c,k as v,m as p,n as f,o as m,p as g,q as y,r as h,t as b,u as w,v as k,w as I,x as S,y as O,z as j,A as D,B as T,C as E,D as P,E as C,F as x,G as A,H as R,I as N,J as L,K as M,L as _,M as B,N as V,O as F,P as H}from"./generic-307cf701.js";import U from"@babel/runtime/helpers/defineProperty";import G from"@babel/runtime/helpers/asyncToGenerator";import K from"@babel/runtime/regenerator";import q from"video.js";import{o as J,g as W,a as Y,s as z,b as X,p as Q,c as $}from"./util-e30d090e.js";import{g as Z,d as ee,a as ne,e as te}from"./captions-78bd2908.js";import{g as oe,p as ie}from"./resolution-62be852a.js";import{i as le,a as re}from"./skin-65765793.js";import{g as ae}from"./player_instance-34118a5b.js";import{g as ue,s as se}from"./localisation-0bf399a1.js";import{g as de,a as ce,s as ve,v as pe,b as fe,c as me,d as ge,e as ye,f as he}from"./currentVideoInfo-0b234e55.js";import be from"@babel/runtime/helpers/typeof";import{s as we,w as ke}from"./icons-37daa6b3.js";import{c as Ie,p as Se,a as Oe,h as je,r as De,g as Te,b as Ee,d as Pe,s as Ce,e as xe,f as Ae}from"./helper-d52dff3c.js";import Re from"@babel/runtime/helpers/toConsumableArray";import Ne from"@babel/runtime/helpers/slicedToArray";var Le=function(e){return new Promise(function(n,t){if(Me(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)}})},Me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},_e=function(e,n,t){var o=ae(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,"'")})},Be=function(e){var n=ae(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")},Ve=function(){var n=G(K.mark(function n(t){var o,i,l,r,a;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=ae(null==t?void 0:t.playerId),null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable||!(null!=t&&t.chromecastReceiverId||null!=t&&t.airplay)){n.next=10;break}return n.prev=2,n.next=5,Le("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!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=13,import("@silvermine/videojs-chromecast");case 13:n.sent.default(q),(a=q.getTech("chromecast"))&&!a.prototype.seeking&&(a.prototype.seeking=function(){}),null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.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()?null==l||l.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)}}(),Fe=function(e,n){var t=ae(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",function(n){var t,o,i,l,r,a=this.el(),u=q.dom.getPointerPosition(a,n).x;q.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var s=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=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;if(console.log(s),s&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*u,c.seek()}})};var He=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),Le("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)}}(),Ue=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("@viewlift/comscore/index.js").then(function(e){n.set(e)});case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ge=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then(function(e){q.getPlugin("eme")||q.registerPlugin("eme",e.default)});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=G(K.mark(function e(){var n;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(q),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-6ecf4a3a.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)}}(),Je=function(){var e=G(K.mark(function e(){return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs-dash5.es-20c85b48.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)}}(),We=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then(function(e){Le("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then(function(){e.default(q)}).catch(function(e){console.log(e)})})},importAirplay:function(){import("@silvermine/videojs-airplay").then(function(e){e.default(q)})},loadAdsLibrary:He,loadEMELibrary:Ge,loadMuxPlugin:Ke,loadDvrSeekbar:qe,loadContribDash:Je,loadComscorePlugin:Ue});function Ye(e){return ze.apply(this,arguments)}function ze(){return(ze=G(K.mark(function n(t){var o,i,l;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o=(null==t?void 0:t.airplay)||!1,n.next=3,He();case 3:o&&"Safari"==e()?Promise.resolve().then(function(){return We}).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 Xe(e){return Qe.apply(this,arguments)}function Qe(){return(Qe=G(K.mark(function e(n){var t,o,i,l,r,a;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=ae(n.playerId),e.next=3,Ue();case 3:a.comscore({publisherId:null==n||null===(t=n.comscore)||void 0===t?void 0:t.publishedId,endpoint:null==n||null===(o=n.comscore)||void 0===o?void 0:o.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===(r=n.comscore)||void 0===r?void 0:r.debug)||!1});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $e(e,n){return Ze.apply(this,arguments)}function Ze(){return(Ze=G(K.mark(function n(t,o){var i,l,r,a,u,s,d,c,v,p,f,m,g,y;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return v=(null==o?void 0:o.contentType)||"video",p=null==o||null===(i=o[v])||void 0===i?void 0:i.drmEnabled,null==o||null===(l=o[v])||void 0===l||null===(r=l.liveDetails)||void 0===r||r.isDvrEnabled,null==t||t.showPositiveSeekbar,f=(null==o||null===(a=o[v])||void 0===a||null===(u=a.streamingInfo)||void 0===u||null===(s=u.videoAssets)||void 0===s?void 0:s.dash)||null,m=(null==t||null===(d=t.comscore)||void 0===d?void 0:d.enable)||!1,g=!(null==t||null===(c=t.analytics)||void 0===c||!c.muxKey),n.prev=7,n.next=10,Promise.allSettled([p?"Safari"==e()?Ge():"caliente"!=(null===(y=window)||void 0===y?void 0:y.siteName)?Je():Ge():"Safari"!=e()&&f?Je():null,m?Xe(t):null,g?Ke():null,Ve(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 en(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 nn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?en(Object(t),!0).forEach(function(n){U(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):en(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var tn=new Set,on=null,ln=function(e,n,o,i){var l,r,a,u,s,d,c,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(l=e[p])||void 0===l?void 0:l.id)||"Null",v["c3.cm.contentType"]=vn(e),v[null==o||null===(r=o.Constants)||void 0===r?void 0:r.IS_LIVE]=!(null==e||!e.linearchannel),v[null==o||null===(a=o.Constants)||void 0===a?void 0:a.STREAM_URL]=n.currentSrc(),v[null==o||null===(u=o.Constants)||void 0===u?void 0:u.VIEWER_ID]="undefined"===t()?"NULL":t(),v["c3.cm.categoryType"]=sn(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(s=e[p])||void 0===s?void 0:s.drmEnabled)||"None",v.DAIStream=null!==(d=e[p])&&void 0!==d&&null!==(c=d.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",v[o.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=dn(e),v["c3.cm.genreList"]=an(e),v["c3.cm.genre"]=rn(e),v["c3.cm.channel"]=un(e,i);var f=mn(de(),e);return v=nn(nn({},v),f)},rn=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"},an=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"},un=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"},sn=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"},dn=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"},cn=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)},vn=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var pn,fn,mn=function(e,n){var t,l,r,a,u,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return s;var d=i(),c=o();return s["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(l=t.series)||void 0===l?void 0:l.title)||"Null",s["c3.cm.seasonNumber"]=(null==d?void 0:d.toString())||"Null",s["c3.cm.showTitle"]=(null==e||null===(r=e[d-1])||void 0===r||null===(a=r.episodes)||void 0===a||null===(u=a[c-1])||void 0===u?void 0:u.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},gn=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"}},yn=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},hn=function(){var e=G(K.mark(function e(n,t){var o,i,l,r,a,u,s,d,c,v,p,f;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(null==t?void 0:t.convivaConfig)||{},i=o.trackConvivaPlayerEvent,l=o.paymentHandler,r=o.tveProvider,a=o.enable,u=o.appName,d=(s=t||{}).token,c=s.epg,a){e.next=4;break}return e.abrupt("return");case 4:if(v=ae(n),"function"==typeof(p=i)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,p("getConvivaObject");case 10:if(f=e.sent){e.next=13;break}return e.abrupt("return");case 13:v.ready(function(){var e=v.tech(!0),n=!1;e.on("keysessioncreated",function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=gn(t.keySystem);p("contentInfo",{DRMEnabled:o})}else p("contentInfo",{DRMEnabled:"None"})}),n||p("contentInfo",{DRMEnabled:"None"})}),v.on("loadstart",function(){var e,n;on&&on!==v.currentSrc()&&p("playbackEnded"),p("setPlayer",v),tn.clear(),on=v.currentSrc();var o=yn(v.currentType()),i=ce(),a=ln(i,v,f,c);a[null==f||null===(e=f.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",a[null==f||null===(n=f.Constants)||void 0===n?void 0:n.ASSET_NAME]=cn(i,t),a.authToken=d||"NULL",a.streamType=o,a.D2CType=l||"NONE",a.subscriberType=r?"MVPD":"FREE"!==l?"D2C":"FREE",a["c3.cm.affiliate"]=r||"NULL",bn.setData(a),p("contentInfo",a)}),v.on("loadedmetadata",function(){var e,n=v.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),p("contentInfo",{screenResolution:e})}),v.on("play",function(){tn.has(v.currentSrc())||(tn.add(v.currentSrc()),p("playbackStarted",null))}),v.on("ended",function(){tn.has(v.currentSrc())&&tn.delete(v.currentSrc()),p("playbackEnded")}),v.on("ads-loader",function(e){e&&null!=e&&e.adsLoader&&p("initAdSensor",{player:v,adsLoader:null==e?void 0:e.adsLoader})}),v.on("dispose",function(){null==tn||tn.clear(),p("playbackEnded")});case 20:case"end":return e.stop()}},e)}));return function(n,t){return e.apply(this,arguments)}}(),bn=(pn={},{setData:function(e){pn=nn(nn({},pn),e)},getData:function(){return pn}}),wn=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-aa7dd324.js").then(function(t){t.initialiseSkin(e,n)}):"carousel"==t?import("./skin-9f9c1ff4.js").then(function(n){n.initaliseSkin(e)}):"defaultV2"==t?import("./skin-feb5f134.js").then(function(t){t.initialiseSkin(e,n)}):"multiplayer"==t?import("./skin-e4fd3381.js").then(function(t){t.initialiseSkin(e,n)}):"minimalist"==t?import("./skin-977073db.js").then(function(t){t.initaliseSkin(e,n)}):"VL_ONE"==t?import("./skin-e5082af0.js").then(function(t){t.initialiseSkin(e,n)}):"news"==t?import("./skin-5a5d4f1b.js").then(function(t){t.initialiseSkin(e,n)}):"news_live"==t?import("./skin-31a0882a.js").then(function(t){t.initialiseSkin(e,n)}):"mini"==t&&import("./skin-831a579b.js").then(function(t){t.initialiseSkin(e,n)})};function kn(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 In(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?kn(Object(t),!0).forEach(function(n){U(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Sn=[],On=0,jn=null;function Dn(){console.log("Cleaning up watch history data"),fn=null,Sn=[],On=0,jn=null}function Tn(e,n,t){var o,i,r,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==n||null===(o=n.watchHistory)||void 0===o||o.apiVersion;var d=null==n||null===(i=n.watchHistory)||void 0===i?void 0:i.profileId,c=Math.floor(e.currentTime()),v=Math.floor(e.duration());null==n||null===(r=n.watchHistory)||void 0===r||r.xapiKey;var p=(null==n||null===(a=n.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,m=Math.floor(e.currentTime()),g=s?100:Math.floor(c/v*100),y={};f?function(e,n,t){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),i=En(o),l=(new Date).getTime(),r=ce(),a=(null==r?void 0:r.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce(function(e,n){return In(In({},e),{},U({},n,a[n]))},{}),s=i.findIndex(function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===fn});s<0?i.push(In(In({content:u},e),{},{addedDate:l,updateDate:l})):i[s]=In(In(In({},i[s]),e),{},{updateDate:l});localStorage.setItem("".concat(o),JSON.stringify(i))}(y={completed:s,watchedTime:m,watchedPercentage:g},d,n.siteOwner):(y=In(In({videoId:fn,watchedTime:m,watchedPercentage:g,doneWatching:s,profileId:d},jn&&{seriesId:jn}),p&&{originalObjectId:p}),l(y).then(function(e){}).catch(function(e){})),On=c+t}function En(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function Pn(e,n,t){var o=En(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 Cn=!1,xn=function(e,n){var t,o,i=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[i])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!Cn){var l=An(e,"videoAssets","secondaryVideoAssets"),u=r(l,n);return u&&a(n,u),Cn=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function An(e,n,t){if(Array.isArray(e))return e.map(function(e){return An(e,n,t)});if(null!==e&&"object"===be(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]=An(e[i],n,t)}),o}return e}function Rn(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 Nn(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)?Nn(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 Nn(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 Ln(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 Mn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ln(Object(t),!0).forEach(function(n){U(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ln(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var _n=function(n,t,o,i){var l,r,a,c,v,p=i.res,f=i.sres,m=ae(n),g=(null==p?void 0:p.contentType)||"video",y=(null==p||null===(l=p[g])||void 0===l?void 0:l.drmEnabled)||!1,h=(null==p||null===(r=p[g])||void 0===r||null===(a=r.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==p||null===(c=p[g])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;ve(p),pe.set(p),m&&(m.on("loadstart",function(){h?o.resolve({status:!0,msg:"Video Loaded",response:p}):o.resolve(Mn({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))}),m.on("loadeddata",function(){var o,i,l,r=Z(n);if(null==r||r.map(function(e){return ee(n,e.id)}),b&&"Safari"===e())try{var a;null==m||null===(a=m.liveTracker)||void 0===a||a.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&_e(n,sessionStorage.getItem("volume")||"100");var d=ce();if(u(t),s(),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 c,v,f=Mn(Mn({},t),p);!function(e,n,t){var o,i,l;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(jn=null==n||null===(i=n.series)||void 0===i?void 0:i.id),Sn=[],On=0,fn=t;var r=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.interval)||30,a=ae(e);a&&(a.on("dispose",Dn),a.on("timeupdate",function(){if(!a.seeking()){var e=Math.floor(a.currentTime());Sn.includes(On)||(e!=On||e<r?e>On&&(On=e+r):(Sn.push(e),Tn(a,n,r)))}}),a.one("ended",function(){Tn(a,n,r,!0)}))}(n,f,null==d||null===(c=d.video)||void 0===c||null===(v=c.gist)||void 0===v?void 0:v.id)}if(null!=t&&null!==(l=t.analytics)&&void 0!==l&&l.muxKey&&null!=m&&m.mux){var g,y,h,w,k,I,S=(null===(g=ce())||void 0===g?void 0:g.video)||(null==p?void 0:p.video),O=null==S?void 0:S.gist,j={env_key:null==t||null===(y=t.analytics)||void 0===y?void 0:y.muxKey,player_name:"vl-web-player",player_version:null===(h=window)||void 0===h?void 0:h.vl_player_version,video_id:null==O?void 0:O.id,video_title:null==O?void 0:O.title,video_series:null==S||null===(w=S.series)||void 0===w?void 0:w.title,video_stream_type:null!=S&&null!==(k=S.streamingInfo)&&void 0!==k&&k.isLiveStream?"live":"video",viewer_user_id:null==t||null===(I=t.analytics)||void 0===I?void 0:I.userId};m.mux({debug:!1,data:j})}}),m.textTracks().on("change",function(e){var n=this.tracks_.filter(function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0})[0];m.trigger("subtitlechanged",n)}),m.on("subtitlechanged",function(e,n){var t,o,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,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)}}),m.tech_.on("retryplaylist",function(){h&&xn(p,n)}),m.on("error",function(){var e,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?xn(p,n):(d(n,(null==m||null===(e=m.error())||void 0===e?void 0:e.message)||"Some error occured"),o.reject({status:!1,msg:(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured",response:p}))}),m.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=ce())||void 0===r||null===(a=r.video)||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.id,d=fe(),c=(null==d?void 0:d.get(s))||{t:0,p:0},v=c.t,p=c.p;v&&p<95&&setTimeout(function(){m.currentTime(v)},0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout(function(){m.currentTime(null==t?void 0:t.watchHistoryResumeTime)},0);if(null!=m&&m.dvrSeekbar)try{m.dvrSeekbar()}catch(e){console.error("Error while initilizing dvr seekbar")}}}),m.on("volumechange",function(){var e=100*m.volume().toFixed(2);m.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}),m.on("chromecastDisconnected",function(){if(h){m.currentSource();for(var e=m.textTracks(),n=e.length-1;n>=0;n--)m.removeRemoteTextTrack(e[n])}}),m.one("loadeddata",function(){var n,t=(null==m||null===(n=m.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"==be(m.dash)){var o,i,l,r=null==m||null===(o=m.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=Rn(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=Rn(t);try{for(c.s();!(d=c.n()).done;){var v,p,f,g=d.value;if(("Chrome"==e()||"Edge"==e()&&(null!==(v=navigator)&&void 0!==v&&null!==(p=v.userAgent)&&void 0!==p&&p.includes("Macintosh")||!y))&&null!=g&&null!==(f=g.label)&&void 0!==f&&f.includes("5.1"))m.audioTracks().removeTrack(g);else{if("main"==g.kind){g.enabled=!0;break}g.enabled=!1}}}catch(e){c.e(e)}finally{c.f()}}}))};function Bn(e){var n=ae(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;Fn(),Hn(l).forEach(function(e){var n=e.id,t=e.title,i=e.time,r=Vn(n,t,Math.min(i/l*100,99.5));o.appendChild(r)})}}function Vn(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 Fn(){document.querySelectorAll(".vjs-seekbar-program-marker").forEach(function(e){e.remove()})}function Hn(e){var n=(new Date).getTime(),t=new Date(n-1e3*e).getTime();return(me()||[]).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 Un(e,n){var t=ae(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;ge(u),t.on("loadeddata",function(){Ie(n)?a?Se(t,n):r?Oe(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=!!Te(d),p=document.querySelector(".vjs-dvr-btn-overlay");p||((p=document.createElement("div")).className="vjs-dvr-btn-overlay");var f=Ee(n);f&&(p.style.backgroundImage="url(".concat(f,")"),p.style.backgroundPosition="center center",p.style.backgroundRepeat="no-repeat",p.style.backgroundSize="cover");p.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(ke()," ").concat(r,"</button>"),u='<button id="watch-begining-btn">'.concat(we()," ").concat((null==l?void 0:l.text)||"Start From Beginning","</button>");return'<div class="dvr-button">'.concat(a," ").concat(u,"</div>")}(o,v),p.style.display="flex",e.el().appendChild(p),Pe(e),Gn("watch-live-resume-btn",u,function(){Ae(e,p),Oe(e,d)}),Gn("watch-begining-btn",s,function(){Ae(e,p),Se(e,n)})}(t,n),je({player:t,showWatchLive:!0,showStartOver:!0})):De(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)}Ce(s,o),xe(e,n),je({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&&(Ce(s,t),o=t,function(e,n){Hn(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=Vn(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 Gn(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 Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function qn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach(function(n){U(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var Jn=function(n,t,o,i){var l,u,s,g,y,h,b,w,k,I,S,O,j,D,T,E,P,C,x,A,R,N,L,M,_,B,V,F,H,J,W,Y,z,X,Q,$,Z,ee=t.res,te=void 0===ee?null:ee,oe=t.sres,ie=void 0===oe?null:oe,re=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],ue=(null===(l=te)||void 0===l?void 0:l.contentType)||"video",se=le(null===(u=te)||void 0===u||null===(s=u[ue])||void 0===s||null===(g=s.gist)||void 0===g?void 0:g.videoImageUrl)||le(null===(y=te)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.gist)||void 0===b||null===(w=b.imageGist)||void 0===w?void 0:w.r16x9),de=(null===(k=te)||void 0===k||null===(I=k[ue])||void 0===I||null===(S=I.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ce=(null===(O=te)||void 0===O||null===(j=O[ue])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,ve=(null===(T=te)||void 0===T||null===(E=T.ads)||void 0===E||null===(P=E.preRoll)||void 0===P||null===(C=P.adTags)||void 0===C||null===(x=C.web)||void 0===x?void 0:x.active)&&(null===(A=te)||void 0===A||null===(R=A.ads)||void 0===R||null===(N=R.preRoll)||void 0===N||null===(L=N.adTags)||void 0===L||null===(M=L.web)||void 0===M?void 0:M.url);te=qn(qn({},te),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var pe=(null==o||null===(_=o.customData)||void 0===_?void 0:_.ads)||{},fe=(null===(B=te)||void 0===B||null===(V=B[ue])||void 0===V?void 0:V.isSSAIEnabled)&&"MEDIA_TAILOR"==(null==pe?void 0:pe.vodAdSticherProvider)||!1,me=(null==o?void 0:o.latency)||6,ge=(null==o?void 0:o.skin_settings)||{};null==o||o.dvrConfig;var ye=($={enableSmoothSeeking:!0,controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:(null==ge?void 0:ge.pictureInPictureToggle)||!1},playbackRates:null!=ge&&ge.playbackRates?[.5,1,1.5,2]:[],muteToggle:"multiplayer"==o.skin,liveui:de},U($,"autoplay",null==o?void 0:o.autoplay),U($,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!ve),U($,"loop",(null==o?void 0:o.loop)||!1),U($,"audioPosterMode",null==o?void 0:o.audioPosterMode),U($,"html5",qn(qn({dash:qn(qn(qn({},!q.browser.IS_SAFARI&&{useTTML:!0}),(null==o?void 0:o.debugConfig)&&(null==o||null===(F=o.debugConfig)||void 0===F?void 0:F.enable)&&{debug:!0,logLevel:null!=o&&null!==(H=o.debugConfig)&&void 0!==H&&H.logLevel?null==o||null===(J=o.debugConfig)||void 0===J?void 0:J.logLevel:"DEBUG"}),{},{updateSettings:{streaming:{delay:{liveDelay:me},text:{defaultEnabled:!1},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},gaps:{enableStallFix:!0,stallSeek:3},abr:qn(qn({},(null==o?void 0:o.initialBandwidth)&&{initialBitrate:{audio:-1,video:(null==o?void 0:o.initialBandwidth)/1e3}}),{},{autoSwitchBitrate:{video:!0,audio:!0},additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!1,droppedFramesRule:!0}})}}}),vhs:qn(qn(qn({},(null==o?void 0:o.initialBandwidth)&&{bandwidth:o.initialBandwidth}),{},{liveRangeSafeTimeDelta:me,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==o||null===(W=o.customData)||void 0===W?void 0:W.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:null===(Y=null==o?void 0:o.enableLowInitialPlaylist)||void 0===Y||Y}),debug:(null==o?void 0:o.debugConfig)&&(null==o||null===(z=o.debugConfig)||void 0===z?void 0:z.enable)||!1,nativeTextTracks:"Safari"==e()},0==(null==o||null===(X=o.customData)||void 0===X?void 0:X.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),U($,"poster",se),U($,"techOrder",re),U($,"chromecast",{requestCustomDataFn:function(e){var t,i,l=ae(n),r=((null==l?void 0:l.textTracksJson_)||l.textTracks().tracks_).filter(function(e){return"captions"==e.kind||"subtitles"==e.kind}),a=function(e,n,t){var o,i,l,r,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,I;f.isDrmEnabled=!0;var S=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,O=(null==S?void 0:S.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 j=(null==S?void 0:S.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===(I=k.httpRequestHeaders)||void 0===I?void 0:I["X-AxDRM-Message"]);f.licenseToken=j}var D=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=D;var T=null==e||null===(l=e[p])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;f.duration=T;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 P=null==e||null===(s=e[p])||void 0===s||null===(d=s.gist)||void 0===d?void 0:d.videoImageUrl;return f.mediaImage=P,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}(te,e,r);return qn(qn({},a),{},{convivaMetaData:qn({customerKey:(null==o||null===(t=o.convivaConfig)||void 0===t?void 0:t.customerKey)||null,debug:(null==o||null===(i=o.convivaConfig)||void 0===i?void 0:i.debug)||!1},bn.getData())})},modifyLoadRequestFn:function(e){var t,o,i,l,r,a=ae(n),u=(null==a?void 0:a.currentSource())||{};!(null===(t=te)||void 0===t||null===(o=t[ue])||void 0===o||null===(i=o.streamingInfo)||void 0===i||null===(l=i.videoAssets)||void 0===l?void 0:l.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}}),$);if(!q.getPlayers()[n]){null!=o&&o.debugConfig&&null!=o&&null!==(Z=o.debugConfig)&&void 0!==Z&&Z.enable&&q.log.level("debug");var he=q(n,ye,function(){var e=G(K.mark(function e(){var t,l,u,s,g,y,h,b,w,k,I,S,O,j,D,T,E,P,C,x,A;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(he),console.log(q.VERSION),console.log(q.getPlugins()),e.next=5,$e(o,te);case 5:if(O=null===(t=te)||void 0===t||null===(l=t[ue])||void 0===l||null===(u=l.liveDetails)||void 0===u?void 0:u.startOverTime,ce&&i.resolve(qn({status:!0,msg:"Player Initialised"},ie?{seriesResponse:ie,response:te}:{response:te})),de&&null!=o&&null!==(s=o.dvrConfig)&&void 0!==s&&s.enable&&Un(n,qn(qn({},o),{},{isDvrEnabled:de})),v(n,null==o?void 0:o.analyticsCb,null==o?void 0:o.customData),hn(n,o),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),de&&Fe(n,O),!ve||null!=o&&null!==(g=o.customData)&&void 0!==g&&g.disableAds||p(n,ve,te),j=r(te,n),console.log(j),null!=o&&o.nearestClusterUrl&&(j=f(j,o.nearestClusterUrl)),!fe){e.next=21;break}return e.next=20,m(n,te);case 20:j=e.sent;case 21:j?a(n,j):(i.reject({status:!1,msg:"Incompatible / Missing Source",response:te}),d(n,"Incompatible / Missing Source")),((null===(y=te)||void 0===y||null===(h=y[ue])||void 0===h||null===(b=h.contentDetails)||void 0===b||null===(w=b.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(k=te)||void 0===k||null===(I=k[ue])||void 0===I||null===(S=I.closedCaptions)||void 0===S?void 0:S.length)>0)&&(A=(null===(T=te)||void 0===T||null===(E=T[ue])||void 0===E||null===(P=E.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(C=te)||void 0===C||null===(x=C[ue])||void 0===x?void 0:x.closedCaptions),D=A.filter(function(e){return"VTT"===e.format||"WEBVTT"===e.format}),ne(n,D)),null!=o&&o.disableControls?c(n):wn(n,qn(qn(qn({},o),ye),{},{liveVideo:ce,isDvrEnabled:de,res:te,sres:ie})),_n(n,qn(qn(qn({},o),ye),{},{liveVideo:ce}),i,{res:te,sres:ie});case 25:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}())}};function Wn(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 Yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wn(Object(t),!0).forEach(function(n){U(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var zn=function(e,n){var t=n.resolve,o=n.reject,i=null==e?void 0:e.playerId,l=Xn(e);Jn(i,{res:l},e,{resolve:t,reject:o})},Xn=function(e){var n,t,o,i,l,r,a,u,s,d,c,v=null==e?void 0:e.streamingInfo,p=null==e||null===(n=e.streamingInfo)||void 0===n?void 0:n.videoAssets,f=(null==e||null===(t=e.streamingInfo)||void 0===t?void 0:t.isDrmEnabled)||null,m=(null==e||null===(o=e.streamingInfo)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.url)||null,y=(null==e||null===(l=e.streamingInfo)||void 0===l?void 0:l.posterUrl)||null,h=(null==e||null===(r=e.streamingInfo)||void 0===r?void 0:r.subtitles)||[],b=(null==e||null===(a=e.streamingInfo)||void 0===a||null===(u=a.videoAssets)||void 0===u?void 0:u.drmProvider)||null,w=(null==e||null===(s=e.streamingInfo)||void 0===s?void 0:s.macroMap)||[],k=(null==e||null===(d=e.customData)||void 0===d||null===(c=d.ads)||void 0===c?void 0:c.isSSAIEnabled)||!1,I=null==e?void 0:e.token,S=g(I);null==S||S.site;var O=null==S?void 0:S.siteId;return Yn(Yn({id:"".concat(O,"_external")},!f&&{directPlaybackUrl:null==p?void 0:p.url}),{},{video:Yn(Yn({drmEnabled:f,streamingInfo:Yn({videoAssets:Yn(Yn({},b&&{drmProvider:b}),{},{widevine:null==p?void 0:p.widevine,fairPlay:null==p?void 0:p.fairPlay,playReady:null==p?void 0:p.playReady})},(null==v?void 0:v.isDvrEnabled)&&{isLiveStream:!0})},k&&{isSSAIEnabled:k}),{},{metadata:w,liveDetails:{isDvrEnabled:null==v?void 0:v.isDvrEnabled},gist:Yn({},y&&{videoImageUrl:y}),contentDetails:Yn({},(null==h?void 0:h.length)>0&&{closedCaptions:Re(h)})}),ads:{preRoll:{adTags:{web:Yn(Yn({},m&&{active:!0}),m&&{url:m})}}}})},Qn=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)]},$n=function(e){var n,t=Ne(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),console.log("Time left:",n)};function Zn(e,n,t,o){if(e){var i=function(){var i=e-Date.now();if(i/1e3<=0)return clearInterval(l),null==n||n([0,0,0,0,0,0,0,o]),void(null==t||t());var r=Qn(i,e);null==n||n([].concat(Re(r),[o]))};i();var l=setInterval(i,1e3);return l}}var et,nt=function(e,n,t){var o,i,l,r,a,u,s,d,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,f=Date.now(),m=null==n||null===(a=n.response)||void 0===a||null===(u=a.data)||void 0===u?void 0:u.scheduleStartDate,g=f-(null==n||null===(s=n.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.scheduleEndDate);if(f-m<0?c=ue("eventNotStarted")||p||"Game starts in":(g>0||"VIDEO_NOT_EXISTS"==v)&&(c=ue("eventEnded")||p||"Game has ended"),document.getElementsByClassName("error-container")[0]){var y=document.getElementsByClassName("error-message")[0];y&&(y.textContent="".concat(c));var h=document.getElementsByClassName("error-timer-message")[0];h&&Zn(Math.abs(m),$n,t,h)}else{var b=document.getElementById(e).parentElement;if(b){var w=document.createElement("div");w.className="error-container";var k=document.createElement("div");k.className="error-message";var I=document.createElement("div");I.className="error-timer-message",k.textContent="".concat(c),w.appendChild(k),w.appendChild(I),b.append(w),Zn(Math.abs(m),$n,t,I)}}};function tt(e,n){return ot.apply(this,arguments)}function ot(){return(ot=G(K.mark(function e(n,t){var o,i,l,r,a,u,s,d,c;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,a=null==n?void 0:n.videoId,u=null==n?void 0:n.playerId,s=!(null==n||!n.anonymousId),e.next=6,w();case 6:d=e.sent,c=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),y(a,d,c).then(function(e){var t,o,i,c;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType,ve(null==e?void 0:e.data);var v,p=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(c=n.watchHistory)&&void 0!==c&&c.enable&&!s)if((null===(v=n.watchHistory)||void 0===v?void 0:v.saveOffline)||!1){var f,m,g,y=Pn((null===(f=n.watchHistory)||void 0===f?void 0:f.profileId)||"",a,null==n?void 0:n.siteOwner);if(y&&y.length)n.watchHistoryResumeTime=(null===(m=y[0])||void 0===m?void 0:m.watchedTime)||null,n.watchedPercentage=(null===(g=y[0])||void 0===g?void 0:g.watchedPercentage)||null;p.contentType="video",Jn(u,{res:p},n,{resolve:l,reject:r})}else h(a,d).then(function(e){var t,o,i,l,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.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)),n.watchHistoryResumeTime=(null==e||null===(r=e.data)||void 0===r?void 0:r.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,p.contentType="video"}).catch(function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))}).finally(function(){Jn(u,{res:p},n,{resolve:l,reject:r})});else Jn(u,{res:p},n,{resolve:l,reject:r})}).catch(function(e){var t,o,i=(null==n||null===(t=n.event)||void 0===t?void 0:t.showScheduleTimer)||!1,l=(null==n||null===(o=n.event)||void 0===o?void 0:o.onCountdownComplete)||null;i&&nt(u,e,l),b(e,u,r,a)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function it(e,n){return lt.apply(this,arguments)}function lt(){return(lt=G(K.mark(function e(n,t){var o,i,l,r,a,u,s,d;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=t.resolve,r=t.reject,e.next=3,w();case 3:a=e.sent,u=null==n?void 0:n.playerId,s=null==n?void 0:n.epg,d=!1===(null==n||null===(o=n.customData)||void 0===o||null===(i=o.ads)||void 0===i?void 0:i.isSSAIEnabled),k(s,a,d).then(function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==s?void 0:s.channelId,Jn(u,{res:t},n,{resolve:l,reject:r})}).catch(function(e){b(e,u,r,videoId)});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function rt(e,n){return at.apply(this,arguments)}function at(){return(at=G(K.mark(function e(n,t){var o,i,l,r,a,u,s;return K.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,l=t.reject,e.next=3,w();case 3:r=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,ye.set(parseInt(u)),s=null==n||null===(o=n.series)||void 0===o?void 0:o.id,I(s,r).then(function(e){var t,o,u,d=e.data,c=e.data.seasons;he(c);var v=videoId||(null==c||null===(t=c[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);S(s,r),y(v,r).then(function(e){var t,o,r;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.contentType,ve(e.data),Jn(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:l})}).catch(function(e){b(e,a,l,videoId)})}).catch(function(e){b(e,a,l)});case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ut(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 st(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ut(Object(t),!0).forEach(function(n){U(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ut(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function dt(){return{loadVideoInstantly:O,onTimeUpdate:J,getVideoDuration:W,onVideoEnded:Y,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=G(K.mark(function n(t,o){var i,l,r,a,u,s,d,c,v,p,f,m,g,h,w,k,I,S,O,j,D,T,E,C,x;return K.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!P(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(g=(null==e?void 0:e.videoSourceUrl)||!1,h=null==e?void 0:e.asat,w=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,k=null==e?void 0:e.videoId,I=(null==e||null===(l=e.series)||void 0===l?void 0:l.enable)||!1,S=(null==e?void 0:e.streamingInfo)||!1,window.videoId=k,O=null==e?void 0:e.token,!B(e)){n.next=17;break}if(sessionStorage.setItem("vlp_token",O),V().set(null==e?void 0:e.refreshToken),O&&!F(O)){n.next=16;break}return o({status:!1,msg:"".concat(O?"Token is expired !":"Missing Authorization Token"),response:{token:O}}),n.abrupt("return");case 16:et=JSON.parse(atob(O.split(".")[1]));case 17:return window.siteName=null===(r=et)||void 0===r?void 0:r.site,window.siteId=null===(a=et)||void 0===a?void 0:a.siteId,e.isAnonymousUser=!(null===(u=et)||void 0===u||!u.anonymousId),e.siteOwner=(null===(s=et)||void 0===s?void 0:s.site)||null,e.userId=(null===(d=et)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=et)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,j=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(v=e.series)&&void 0!==v&&v.enable?null:null==e?void 0:e.chromecastReceiverId,D=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,(T=null==e?void 0:e.errors)&&(window.customErrors=T),window.customData=null==e?void 0:e.customData,se(null==e||null===(f=e.customData)||void 0===f?void 0:f.localisation),_.set(e.apiBaseUrl),null!=e&&e.skin&&!re(e.skin)||(e.skin="VL_ONE"),n.next=35,Ye(e);case 35:D&&Le("https://www.googletagmanager.com/gtag/js?id=".concat(D)).then(function(){return H(D)}).catch(function(e){}),(E=null===(m=document)||void 0===m?void 0:m.getElementById("".concat(j)))&&E.addEventListener("contextmenu",function(e){return e.preventDefault()}),g?(x={directPlaybackUrl:g,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},h?y(C,O).then(function(n){var i=(null==n?void 0:n.data)||{};Jn(j,{res:st(st({},i),x)},e,{resolve:t,reject:o})}).catch(function(e){b(e,j,o,C)}):Jn(j,{res:x},e,{resolve:t,reject:o})):S?zn(e,{resolve:t,reject:o}):I?rt(e,{resolve:t,reject:o}):w?it(e,{resolve:t,reject:o}):tt(e,{resolve:t,reject:o});case 39:case"end":return n.stop()}},n)}));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:oe,skip:j,getPlayer:ae,play:D,pause:T,detectBrowser:e,rewind:E,loadVideo:a,seekToTimeStamp:z,isPlayerInitialised:P,load:C,authenticateLC:x,dispose:A,enableCaptions:te,disableCaptions:ee,getCaptions:Z,playSelectedResolution:ie,getSource:r,setVolume:_e,getVolume:Be,disableControls:c,setPlaybackSpeed:X,getEntitlementData:R,adsQueuePointManager:N,getSsaiEvents:L,playerEvents:Q,onReplay:$,isBehindLive:M}}export{dt as V,Bn as i,Fn as r};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import"./generic-307cf701.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-69dba67d.js";import"./util-e30d090e.js";import"./captions-78bd2908.js";import"./resolution-62be852a.js";import"./skin-65765793.js";import"./localisation-0bf399a1.js";import"./player_instance-34118a5b.js";import"axios";import"js-cookie";import"./currentVideoInfo-0b234e55.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"./icons-37daa6b3.js";import"./helper-d52dff3c.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
1
+ import"video.js/dist/video-js.min.css";import"./generic-307cf701.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"video.js";export{V as default}from"./index-5ea757fb.js";import"./util-e30d090e.js";import"./captions-78bd2908.js";import"./resolution-62be852a.js";import"./skin-65765793.js";import"./localisation-0bf399a1.js";import"./player_instance-34118a5b.js";import"axios";import"js-cookie";import"./currentVideoInfo-0b234e55.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/slicedToArray";import"@viewlift/comscore/index.js";import"./icons-37daa6b3.js";import"./helper-d52dff3c.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";
@@ -1 +1 @@
1
- import{h as l,d as e,e as o,o as i,p as n,q as t,r,s as a}from"./features-3f26ef6e.js";import{g as u}from"./player_instance-34118a5b.js";import{a as s,b as d}from"./index-a78e7ae8.js";import{i as v}from"./index-93f13388.js";import{S as c,e as m,R as p,U as b,V as h}from"./generic-307cf701.js";import"videojs-contrib-quality-menu";import{i as f,r as y}from"./index-69dba67d.js";import{c as g}from"./helper-d52dff3c.js";import{c as j,a as w,b as C}from"./currentVideoInfo-0b234e55.js";import k from"video.js";import{c as T,d as B}from"./icons-37daa6b3.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./resolution-62be852a.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-65765793.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-07e6c2d6.js";import"./util-e30d090e.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"./captions-78bd2908.js";import"@viewlift/comscore/index.js";import"video.js/dist/video-js.min.css";function L(e,o){var i=u(e);i&&(i.on("loadeddata",function(){var l,n,t,r,a,d=g(o),m=j();i.qualityLevels()&&i.qualityLevels().length&&function(l){var e=u(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e),!(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable||null!==(n=window)&&void 0!==n&&null!==(t=n.app_data)&&void 0!==t&&null!==(r=t.appcmsMain)&&void 0!==r&&null!==(a=r.features)&&void 0!==a&&a.auto_play)||null!=o&&o.liveVideo||s(e,o),null!=o&&o.liveVideo||c()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||v(e),d&&m&&m.length?f(e):y()}),i.one("play",function(){var o,i,n,t;null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)}))}function V(l,s){u(l).addClass("skin_vlone"),L(l,s),function(l,s){var v,c,f,y,j,k,L,V,E,M=u(l),q=(null==s?void 0:s.liveVideo)||!1,x=(null==s||null===(v=s.res)||void 0===v?void 0:v.contentType)||"video",_=(null==s||null===(c=s.res)||void 0===c||null===(f=c[x])||void 0===f?void 0:f.isSSAIEnabled)||!1,A=m(null==s?void 0:s.res,l)||{};A.src;var D=(null==s?void 0:s.skin_settings)||{},I=(null==s||null===(y=s.customData)||void 0===y?void 0:y.ads)||{};if(g(s),q&&!(null!=s&&s.liveui)){var R,S,O=(null==M||null===(R=M.controlBar)||void 0===R||null===(S=R.getChild("LiveDisplay"))||void 0===S?void 0:S.el())||null;O&&(O.onclick=function(){try{var l;null==M||null===(l=M.liveTracker)||void 0===l||l.seekToLiveEdge()}catch(l){console.log(l,"Cannot seek to LE")}})}null!=D&&D.skipBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)&&e(l,"VL_ONE",T());(null!=D&&D.rewindBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)||1==(null==s?void 0:s.liveui))&&o(l,"VL_ONE",B());(null==s||null===(j=s.relatedVideos)||void 0===j||null===(k=j.content)||void 0===k?void 0:k.length)>0&&i(l,null==s?void 0:s.relatedVideos);null!=s&&null!==(L=s.series)&&void 0!==L&&L.enable&&n(l,s);(null==s||null===(V=s.streams)||void 0===V?void 0:V.length)>1&&t(l,null==s?void 0:s.streams);if(d(l,s),p(l,s),"MEDIA_TAILOR"==(null==I?void 0:I.vodAdSticherProvider)&&null!=I&&I.vodAdClientSideTracking&&_)if(q)b(l);else{var P,H=null;if(null!=s&&null!==(P=s.series)&&void 0!==P&&P.enable){var N,U,$,z,G,J=null===(N=w())||void 0===N||null===(U=N.video)||void 0===U||null===($=U.gist)||void 0===$?void 0:$.id,K=C(),Y=(null==K?void 0:K.get(J))||{t:0,p:0},F=Y.t,Q=Y.p;"function"==typeof(null===(z=window)||void 0===z||null===(G=z.watchHistory)||void 0===G?void 0:G.cb)&&window.watchHistory.cb({watchedTime:F}),Q<95&&(H=F)}else{var W=s.watchHistoryResumeTime;s.watchedPercentage<95&&(H=W)}h(l,H)}null!=s&&s.isDvrEnabled&&null!=s&&null!==(E=s.dvrConfig)&&void 0!==E&&E.enable&&(r(l,s),a(l,s))}(l,s),E(l,s),function(l){var e,o,i,n=u(l),t=null;if(!n)return;var r=n.controlBar.getChild("VolumePanel"),a=null===(e=r.getChild("MuteToggle"))||void 0===e?void 0:e.el(),s=null==r||null===(o=r.el())||void 0===o?void 0:o.querySelector(".vjs-volume-bar"),d=null==r||null===(i=r.el())||void 0===i?void 0:i.querySelector(".vjs-volume-level");if(!r||!s||!d)return;function v(l){l.preventDefault(),t&&(clearTimeout(t),t=null),m(p(l.touches[0]))}function c(l){l.preventDefault(),m(p(l.changedTouches[0])),t=setTimeout(function(){r.el().classList.remove("vjs-hover")},2e3)}function m(l){var e=Math.min(Math.max(l,0),100);d.style.height=e+"%",s.setAttribute("aria-valuenow",e),s.setAttribute("aria-valuetext",e+"%"),n.volume(e/100)}function p(l){var e=s.getBoundingClientRect(),o=l.clientY-e.top,i=e.height;return 100-Math.min(Math.max(o/i*100,0),100)}a.addEventListener("touchend",function(){null!=r&&r.el()&&(r.el().classList.toggle("vjs-hover"),n.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout(function(){r.el().classList.remove("vjs-hover")},2e3))}),s.addEventListener("touchmove",v,{passive:!1}),s.addEventListener("touchstart",v,{passive:!1}),s.addEventListener("touchend",c,{passive:!1})}(l)}var E=function(l,e){var o,i,n,t,r,a,s,d,v,c,m,p,b=u(l),h=(null==e?void 0:e.theme)||{},f=k.dom.$(".vjs-play-progress"),y=k.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");y&&(y.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(n=i.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(r=t.cta)||void 0===r||null===(a=r.primary)||void 0===a?void 0:a.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(c=v.brand)||void 0===c||null===(m=c.cta)||void 0===m||null===(p=m.primary)||void 0===p?void 0:p.backgroundColor));var g=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&f&&(f.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&g&&(g.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&y&&(y.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{V as initialiseSkin};
1
+ import{h as l,d as e,e as o,o as i,p as n,q as t,r,s as a}from"./features-3f26ef6e.js";import{g as u}from"./player_instance-34118a5b.js";import{a as s,b as d}from"./index-a78e7ae8.js";import{i as v}from"./index-93f13388.js";import{S as c,e as m,R as p,U as b,V as h}from"./generic-307cf701.js";import"videojs-contrib-quality-menu";import{i as f,r as y}from"./index-5ea757fb.js";import{c as g}from"./helper-d52dff3c.js";import{c as j,a as w,b as C}from"./currentVideoInfo-0b234e55.js";import k from"video.js";import{c as T,d as B}from"./icons-37daa6b3.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./resolution-62be852a.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/assertThisInitialized";import"./skin-65765793.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-07e6c2d6.js";import"./util-e30d090e.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"@babel/runtime/helpers/slicedToArray";import"axios";import"js-cookie";import"./captions-78bd2908.js";import"@viewlift/comscore/index.js";import"video.js/dist/video-js.min.css";function L(e,o){var i=u(e);i&&(i.on("loadeddata",function(){var l,n,t,r,a,d=g(o),m=j();i.qualityLevels()&&i.qualityLevels().length&&function(l){var e=u(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e),!(null!=o&&null!==(l=o.series)&&void 0!==l&&l.enable||null!==(n=window)&&void 0!==n&&null!==(t=n.app_data)&&void 0!==t&&null!==(r=t.appcmsMain)&&void 0!==r&&null!==(a=r.features)&&void 0!==a&&a.auto_play)||null!=o&&o.liveVideo||s(e,o),null!=o&&o.liveVideo||c()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===siteId||"cea398b9-09ab-4331-958f-8c3d6a356b88"===siteId||v(e),d&&m&&m.length?f(e):y()}),i.one("play",function(){var o,i,n,t;null!==(o=window)&&void 0!==o&&null!==(i=o.customData)&&void 0!==i&&i.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)}))}function V(l,s){u(l).addClass("skin_vlone"),L(l,s),function(l,s){var v,c,f,y,j,k,L,V,E,M=u(l),q=(null==s?void 0:s.liveVideo)||!1,x=(null==s||null===(v=s.res)||void 0===v?void 0:v.contentType)||"video",_=(null==s||null===(c=s.res)||void 0===c||null===(f=c[x])||void 0===f?void 0:f.isSSAIEnabled)||!1,A=m(null==s?void 0:s.res,l)||{};A.src;var D=(null==s?void 0:s.skin_settings)||{},I=(null==s||null===(y=s.customData)||void 0===y?void 0:y.ads)||{};if(g(s),q&&!(null!=s&&s.liveui)){var R,S,O=(null==M||null===(R=M.controlBar)||void 0===R||null===(S=R.getChild("LiveDisplay"))||void 0===S?void 0:S.el())||null;O&&(O.onclick=function(){try{var l;null==M||null===(l=M.liveTracker)||void 0===l||l.seekToLiveEdge()}catch(l){console.log(l,"Cannot seek to LE")}})}null!=D&&D.skipBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)&&e(l,"VL_ONE",T());(null!=D&&D.rewindBtn&&0==(null==s?void 0:s.liveVideo)&&0==(null==s?void 0:s.liveui)||1==(null==s?void 0:s.liveui))&&o(l,"VL_ONE",B());(null==s||null===(j=s.relatedVideos)||void 0===j||null===(k=j.content)||void 0===k?void 0:k.length)>0&&i(l,null==s?void 0:s.relatedVideos);null!=s&&null!==(L=s.series)&&void 0!==L&&L.enable&&n(l,s);(null==s||null===(V=s.streams)||void 0===V?void 0:V.length)>1&&t(l,null==s?void 0:s.streams);if(d(l,s),p(l,s),"MEDIA_TAILOR"==(null==I?void 0:I.vodAdSticherProvider)&&null!=I&&I.vodAdClientSideTracking&&_)if(q)b(l);else{var P,H=null;if(null!=s&&null!==(P=s.series)&&void 0!==P&&P.enable){var N,U,$,z,G,J=null===(N=w())||void 0===N||null===(U=N.video)||void 0===U||null===($=U.gist)||void 0===$?void 0:$.id,K=C(),Y=(null==K?void 0:K.get(J))||{t:0,p:0},F=Y.t,Q=Y.p;"function"==typeof(null===(z=window)||void 0===z||null===(G=z.watchHistory)||void 0===G?void 0:G.cb)&&window.watchHistory.cb({watchedTime:F}),Q<95&&(H=F)}else{var W=s.watchHistoryResumeTime;s.watchedPercentage<95&&(H=W)}h(l,H)}null!=s&&s.isDvrEnabled&&null!=s&&null!==(E=s.dvrConfig)&&void 0!==E&&E.enable&&(r(l,s),a(l,s))}(l,s),E(l,s),function(l){var e,o,i,n=u(l),t=null;if(!n)return;var r=n.controlBar.getChild("VolumePanel"),a=null===(e=r.getChild("MuteToggle"))||void 0===e?void 0:e.el(),s=null==r||null===(o=r.el())||void 0===o?void 0:o.querySelector(".vjs-volume-bar"),d=null==r||null===(i=r.el())||void 0===i?void 0:i.querySelector(".vjs-volume-level");if(!r||!s||!d)return;function v(l){l.preventDefault(),t&&(clearTimeout(t),t=null),m(p(l.touches[0]))}function c(l){l.preventDefault(),m(p(l.changedTouches[0])),t=setTimeout(function(){r.el().classList.remove("vjs-hover")},2e3)}function m(l){var e=Math.min(Math.max(l,0),100);d.style.height=e+"%",s.setAttribute("aria-valuenow",e),s.setAttribute("aria-valuetext",e+"%"),n.volume(e/100)}function p(l){var e=s.getBoundingClientRect(),o=l.clientY-e.top,i=e.height;return 100-Math.min(Math.max(o/i*100,0),100)}a.addEventListener("touchend",function(){null!=r&&r.el()&&(r.el().classList.toggle("vjs-hover"),n.muted(!1),t&&(clearTimeout(t),t=null),t=setTimeout(function(){r.el().classList.remove("vjs-hover")},2e3))}),s.addEventListener("touchmove",v,{passive:!1}),s.addEventListener("touchstart",v,{passive:!1}),s.addEventListener("touchend",c,{passive:!1})}(l)}var E=function(l,e){var o,i,n,t,r,a,s,d,v,c,m,p,b=u(l),h=(null==e?void 0:e.theme)||{},f=k.dom.$(".vjs-play-progress"),y=k.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");y&&(y.style.color="".concat(null===(o=window)||void 0===o||null===(i=o.app_data)||void 0===i||null===(n=i.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(r=t.cta)||void 0===r||null===(a=r.primary)||void 0===a?void 0:a.backgroundColor)),f&&(f.style.background="".concat(null===(s=window)||void 0===s||null===(d=s.app_data)||void 0===d||null===(v=d.appcmsMain)||void 0===v||null===(c=v.brand)||void 0===c||null===(m=c.cta)||void 0===m||null===(p=m.primary)||void 0===p?void 0:p.backgroundColor));var g=b.getChild("BigPlayButton")||null;(null==h?void 0:h.progressBarColor)&&f&&(f.style.background=h.progressBarColor),(null==h?void 0:h.playButtonBackgroundColor)&&g&&(g.el().style.background=h.playButtonBackgroundColor),(null==h?void 0:h.playButtonColor)&&y&&(y.style.color=h.playButtonColor),(null==h?void 0:h.playButtonType)&&("square"==(null==h?void 0:h.playButtonType)?g.el().style.borderRadius=".3em":g.el().style.borderRadius="1.3em")};export{V as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "2.0.204-backup",
3
+ "version": "2.0.206-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "types": "dist/@viewlift/player/esm/index.d.ts",
6
6
  "amdName": "_playerCore",