@viewlift/player-backup 2.0.5-backup → 2.0.7-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/bundle.css +6 -6
- package/cjs/index.js +1 -1
- package/cjs/skin-176180ff.js +1 -0
- package/esm/bundle.css +6 -6
- package/esm/index.js +1 -1
- package/esm/skin-f686b20e.js +1 -0
- package/package.json +1 -1
- package/cjs/skin-5a8c6dbd.js +0 -1
- package/esm/skin-d380d535.js +0 -1
package/cjs/bundle.css
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
.video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
|
|
8
6
|
height: 0.7em;
|
|
9
7
|
position: absolute;
|
|
@@ -149,6 +147,8 @@
|
|
|
149
147
|
}
|
|
150
148
|
}
|
|
151
149
|
|
|
150
|
+
|
|
151
|
+
|
|
152
152
|
/* CSS for videojs-dvr-seekbar */
|
|
153
153
|
|
|
154
154
|
.video-js.vjs-dvr-seekbar {
|
|
@@ -392,6 +392,10 @@
|
|
|
392
392
|
|
|
393
393
|
|
|
394
394
|
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
395
399
|
.video-js .multicamera-parent.default{
|
|
396
400
|
height: 345px;
|
|
397
401
|
position: absolute;
|
|
@@ -470,10 +474,6 @@
|
|
|
470
474
|
align-content: baseline;
|
|
471
475
|
}
|
|
472
476
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
477
|
/* nextep */
|
|
478
478
|
.next-ep-preview{
|
|
479
479
|
position: absolute;
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-68f01105.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("./util-6edeeb8a.js"),l=require("./captions-fbd6fefb.js"),a=require("./renditions-b41243b6.js"),u=require("./resolution-719c85a4.js"),s=require("./skin-34fbc337.js"),c=require("./browser-77c57718.js"),d=require("./localisation-56e0a999.js"),v=require("@babel/runtime/helpers/typeof");require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p,f=function(e){return new Promise((function(n,t){if(m(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}}))},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(e,n,t){var r=s.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.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,"'")})},y=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var w=[],k=0,O=null;function S(n,t,r){var i,o,l,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var c=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,d=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var f=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,m=(null==t||null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(n.currentTime()),y=s?100:Math.floor(d/v*100),h={};m?j(h={completed:s,watchedTime:g,watchedPercentage:y},c,t.siteOwner):(h=b(b({videoId:p,watchedTime:g,watchedPercentage:y,doneWatching:s,profileId:c},O&&{seriesId:O}),f&&{originalObjectId:f}),e.saveWatchHistory(h).then((function(e){})).catch((function(e){}))),k=d+r}function P(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function j(t,r,i){var o=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(i),l=P(o),a=(new Date).getTime(),u=e.getCurrentVideo(),s=(null==u?void 0:u.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return b(b({},e),{},n({},t,s[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));d<0?l.push(b(b({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=b(b(b({},l[d]),t),{},{updateDate:a}),localStorage.setItem("".concat(o),JSON.stringify(l))}function T(e,n,t){var r=P(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var I=function(){var e=t(r.mark((function e(n){var t,o,l,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=s.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(i),e.finish(13);case 16:null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=n&&n.airplay&&"Safari"==c.detectBrowser()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),E=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,r,o,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}}))};var C=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),f("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)}}(),D=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=t(r.mark((function e(){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.js")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs_contrib_dash-1ee985c7.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)}}(),V=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:C,loadEMELibrary:D,loadMuxPlugin:x,loadDvrSeekbar:R,loadContribDash:N});function A(e){return L.apply(this,arguments)}function L(){return(L=t(r.mark((function e(n){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,C();case 3:t&&"Safari"==c.detectBrowser()&&Promise.resolve().then((function(){return V})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,n){return q.apply(this,arguments)}function q(){return(q=t(r.mark((function e(n,t){var i,o,l,a,u,s,d,v,p;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(null==t?void 0:t.contentType)||"video",d=null==t||null===(i=t[s])||void 0===i?void 0:i.drmEnabled,null==t||null===(o=t[s])||void 0===o||null===(l=o.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,v=(null==t||null===(a=t.video)||void 0===a?void 0:a.isSSAIEnabled)||!1,"Chrome"==c.detectBrowser()&&(v||null===(u=["dirtvision"])||void 0===u||u.includes(null==t?void 0:t.siteName)),e.prev=6,e.next=9,Promise.allSettled([d&&"Safari"==c.detectBrowser()?D():null,d&&"Chrome"==c.detectBrowser()&&"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?N():D(),I(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var M=new Set,U=null,F=function(n,t,r){var i,o,l,a,u,s,c,d={},v=(null==n?void 0:n.contentType)||"video";d["c3.cm.id"]=(null===(i=n[v])||void 0===i?void 0:i.id)||"Null",d["c3.cm.contentType"]=X(n),d[null==r||null===(o=r.Constants)||void 0===o?void 0:o.IS_LIVE]=!(null==n||!n.linearchannel),d[null==r||null===(l=r.Constants)||void 0===l?void 0:l.STREAM_URL]=t.currentSrc(),d[null==r||null===(a=r.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),d["c3.cm.categoryType"]=K(n),d["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),d.DRMEnabled=(null===(u=n[v])||void 0===u?void 0:u.drmEnabled)||"None",d.DAIStream=null!==(s=n[v])&&void 0!==s&&null!==(c=s.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[r.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=J(n),d["c3.cm.genreList"]=z(n),d["c3.cm.genre"]=W(n),d["c3.cm.channel"]=G(n);var p=Q(e.getCurrentSeries(),n);return d=B(B({},d),p)},W=function(e){var n,t,r,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===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},z=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},G=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"VOD":(null==e||null===(n=e[r])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},K=function(e){return(null==e?void 0:e.contentType)||"null"},J=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Y=function(e,n){var t,r,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[o])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},X=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Q=function(n,t){var r,i,o,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),c=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(o=n[s-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},Z=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},$=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ee=function(){var n=t(r.mark((function n(t,i){var o,l,a,u,c,d,v,p,f,m;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(null==i?void 0:i.convivaConfig)||{},l=o.trackConvivaPlayerEvent,a=o.paymentHandler,u=o.tveProvider,c=o.enable,d=o.appName,v=(i||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(p=s.getPlayer(t),"function"==typeof(f=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,f("getConvivaObject");case 10:if(m=n.sent){n.next=13;break}return n.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=Z(t.keySystem);f("contentInfo",{DRMEnabled:r})}else f("contentInfo",{DRMEnabled:"None"})})),n||f("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var n,t;U&&U!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),M.clear(),U=p.currentSrc();var r=$(p.currentType()),o=e.getCurrentVideo(),l=F(o,p,m);l[null==m||null===(n=m.Constants)||void 0===n?void 0:n.PLAYER_NAME]=d||"WEB",l[null==m||null===(t=m.Constants)||void 0===t?void 0:t.ASSET_NAME]=Y(o,i),l.authToken=v||"NULL",l.streamType=r,l.D2CType=a||"NONE",l.subscriberType=u||(a?"D2C":"FREE"),l["c3.cm.affiliate"]=u||"NULL",f("contentInfo",l)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})})),p.on("play",(function(){M.has(p.currentSrc())||(M.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){M.has(p.currentSrc())&&M.delete(p.currentSrc()),f("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==M||M.clear(),f("playbackEnded")}));case 20:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),ne=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-6f1f7bfc.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-1e4e2ede.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-3b1d7864.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-6d9e7f67.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-7d10cc61.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-5a8c6dbd.js")})).then((function(t){t.initialiseSkin(e,n)}))},te=!1,re=function(n,t){var r,i,o=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[o])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!te){var l=ie(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),te=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function ie(e,n,t){if(Array.isArray(e))return e.map((function(e){return ie(e,n,t)}));if(null!==e&&"object"===v(e)){var r={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=ie(e[i],n,t)})),r}return e}function oe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ae=function(n,t,r,i){var o,a,u,d,v=i.res,f=i.sres,m=s.getPlayer(n),y=(null==v?void 0:v.contentType)||"video",h=(null==v||null===(o=v[y])||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==v||null===(u=v[y])||void 0===u||null===(d=u.liveDetails)||void 0===d?void 0:d.isDvrEnabled)||!1;e.setCurrentVideo(v),m&&(m.on("loadstart",(function(){h?r.resolve({status:!0,msg:"Video Loaded",response:v}):r.resolve(le({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:v}:{response:v}))})),m.on("loadeddata",(function(){var r,i,o,a=l.getCaptions(n);if(null==a||a.map((function(e){return l.disableCaptions(n,e.id)})),b&&"Safari"===c.detectBrowser())try{var u;null==m||null===(u=m.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&g(n,sessionStorage.getItem("volume")||"100");var d=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var f,y,h=le(le({},t),v);!function(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(O=null==n||null===(i=n.series)||void 0===i?void 0:i.id),w=[],k=0,p=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=s.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());w.includes(k)||(e==k?(w.push(e),S(a,n,l)):e>k&&(k=e+l))})),a.one("ended",(function(){S(a,n,l,!0)})))}(n,h,null==d||null===(f=d.video)||void 0===f||null===(y=f.gist)||void 0===y?void 0:y.id)}if(null!=t&&null!==(o=t.analytics)&&void 0!==o&&o.muxKey&&null!=m&&m.mux){var P,j,T,I,E,C,D=(null===(P=e.getCurrentVideo())||void 0===P?void 0:P.video)||(null==v?void 0:v.video),x=null==D?void 0:D.gist,R={env_key:null==t||null===(j=t.analytics)||void 0===j?void 0:j.muxKey,player_name:"vl-web-player",player_version:null===(T=window)||void 0===T?void 0:T.vl_player_version,video_id:null==x?void 0:x.id,video_title:null==x?void 0:x.title,video_series:null==D||null===(I=D.series)||void 0===I?void 0:I.title,video_stream_type:null!=D&&null!==(E=D.streamingInfo)&&void 0!==E&&E.isLiveStream?"live":"video",viewer_user_id:null==t||null===(C=t.analytics)||void 0===C?void 0:C.userId};m.mux({debug:!1,data:R})}})),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,r,i,o,l,a,u,s,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(o=i.CastContext)||void 0===o||null===(l=o.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(c=s.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){h&&re(v,n)})),m.on("error",(function(){var t,i;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?re(v,n):(e.handleError(n,(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==m||null===(i=m.error())||void 0===i?void 0:i.message)||"Some error occured",response:v}))})),m.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r,i,o,l=null===(r=e.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=e.getSeriesWatchMap(),u=(null==a?void 0:a.get(l))||{t:0,p:0},s=u.t,c=u.p;s&&c<95&&setTimeout((function(){m.currentTime(s)}),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])}})))};function ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ce,de=function(o,a,u,d){var v,p,f,m,g,y,h,b,w,k,O,S,P,j,T,I,C,D,x,R,N,V,A,L,q,H,B,M,U,F,W,z,G=a.res,K=void 0===G?null:G,J=a.sres,Y=void 0===J?null:J,X=null!=u&&u.chromecastReceiverId?["chromecast","html5"]:["html5"],Q=(null===(v=K)||void 0===v?void 0:v.contentType)||"video",Z=s.impolicy16x9(null===(p=K)||void 0===p||null===(f=p[Q])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||s.impolicy16x9(null===(g=K)||void 0===g||null===(y=g[Q])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),$=(null===(w=K)||void 0===w||null===(k=w[Q])||void 0===k||null===(O=k.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,te=(null===(S=K)||void 0===S||null===(P=S[Q])||void 0===P||null===(j=P.streamingInfo)||void 0===j?void 0:j.isLiveStreafm)||!1,re=(null===(T=K)||void 0===T||null===(I=T.ads)||void 0===I||null===(C=I.preRoll)||void 0===C||null===(D=C.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(R=K)||void 0===R||null===(N=R.ads)||void 0===N||null===(V=N.preRoll)||void 0===V||null===(A=V.adTags)||void 0===A||null===(L=A.web)||void 0===L?void 0:L.url),ie=(null===(q=K=se(se({},K),{},{audioAssetSource:null==u?void 0:u.audioAssetSource}))||void 0===q||null===(H=q.video)||void 0===H?void 0:H.isSSAIEnabled)||!1;"Chrome"==c.detectBrowser()&&(ie||null===(B=["dirtvision"])||void 0===B||B.includes(null===(M=K)||void 0===M?void 0:M.siteName));var oe=(z={enableSmoothSeeking:!0,controls:0!=(null==u?void 0:u.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==u?void 0:u.muted)||!1,autoplay:(null==u?void 0:u.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==u.skin,liveui:$},n(z,"autoplay",null==u?void 0:u.autoplay),n(z,"normalizeAutoplay",(null==u?void 0:u.autoplay)&&!re),n(z,"loop",(null==u?void 0:u.loop)||!1),n(z,"audioPosterMode",null==u?void 0:u.audioPosterMode),n(z,"html5",se(se({dash:se(se({},!i.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:20},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{useDefaultABRRules:!0,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:se(se({liveRangeSafeTimeDelta:10,useDevicePixelRatio:!0,experimentalLLHLS:(null==u?void 0:u.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==u||null===(U=u.customData)||void 0===U?void 0:U.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),nativeTextTracks:!1},0==(null==u||null===(F=u.customData)||void 0===F?void 0:F.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==u||null===(W=u.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(z,"poster",Z),n(z,"techOrder",X),n(z,"chromecast",{requestCustomDataFn:function(e){var n=getPlayer(o),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var r,i,o,l,a,u,s,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var g=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,y=null==g?void 0:g.url;f.licenseUrl=y;var h=null==g?void 0:g.licenseHeaders["X-AxDRM-Message"];f.licenseToken=h}var b=(null==e||null===(r=e[p])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=b;var w=null==e||null===(o=e[p])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;f.duration=w;var k=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=k;var O=null==e||null===(s=e[p])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(K,e,t)}}),z);if(!i.getPlayers()[o])var le=i(o,oe,function(){var n=t(r.mark((function n(){var t,a,s,c,v,p,f,m,g,y,h,b,w,k,O,S,P,j,T,I;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(le),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,_(u,K);case 5:b=null===(t=K)||void 0===t||null===(a=t[Q])||void 0===a||null===(s=a.liveDetails)||void 0===s?void 0:s.startOverTime,te&&d.resolve(se({status:!0,msg:"Player Initialised"},Y?{seriesResponse:Y,response:K}:{response:K})),e.inititateBeacon(o,null==u?void 0:u.analyticsCb),ee(o,u),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),$&&E(o,b),!re||null!=u&&null!==(c=u.customData)&&void 0!==c&&c.disableAds||e.initialiseAdvertisement(o,re,K),w=e.getSource(K,o),console.log(w),null!=u&&u.nearestClusterUrl&&(w=e.getUpdatedClusterSource(w,u.nearestClusterUrl)),w?e.loadVideo(o,w):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:K}),e.handleError(o,"Incompatible / Missing Source")),((null===(v=K)||void 0===v||null===(p=v[Q])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(m=f.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(g=K)||void 0===g||null===(y=g[Q])||void 0===y||null===(h=y.closedCaptions)||void 0===h?void 0:h.length)>0)&&(I=(null===(O=K)||void 0===O||null===(S=O[Q])||void 0===S||null===(P=S.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(j=K)||void 0===j||null===(T=j[Q])||void 0===T?void 0:T.closedCaptions),k=I.filter((function(e){return"VTT"===e.format})),l.addCaptions(o,k)),null!=u&&u.disableControls?e.disableControls(o):ne(o,se(se(se({},u),oe),{},{liveVideo:te,isDvrEnabled:$,res:K,sres:Y})),ae(o,se(se(se({},u),oe),{},{liveVideo:te}),d,{res:K,sres:Y});case 19:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function ve(e,n){return pe.apply(this,arguments)}function pe(){return(pe=t(r.mark((function n(t,i){var o,l,a,u,s,c;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.resolve,l=i.reject,a=null==t?void 0:t.videoId,u=null==t?void 0:t.playerId,s=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:c=n.sent,e.getVideoDetails(a,c).then((function(n){var r,i,d,v;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(d=i.gist)||void 0===d?void 0:d.contentType,e.setCurrentVideo(null==n?void 0:n.data);var p,f=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(v=t.watchHistory)&&void 0!==v&&v.enable&&!s)if((null===(p=t.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,g,y,h=T((null===(m=t.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==t?void 0:t.siteOwner);if(h&&h.length)t.watchHistoryResumeTime=(null===(g=h[0])||void 0===g?void 0:g.watchedTime)||null,t.watchedPercentage=(null===(y=h[0])||void 0===y?void 0:y.watchedPercentage)||null;f.contentType="video",de(u,{res:f},t,{resolve:o,reject:l})}else e.getVideoInfo(a,c).then((function(e){var n,r,i,o,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,r,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(e))})).finally((function(){de(u,{res:f},t,{resolve:o,reject:l})}));else de(u,{res:f},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,u,l,a)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function fe(e,n){return me.apply(this,arguments)}function me(){return(me=t(r.mark((function n(t,i){var o,l,a,u,s;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.resolve,l=i.reject,n.next=3,e.getToken();case 3:a=n.sent,u=null==t?void 0:t.playerId,s=null==t?void 0:t.epg,e.getLinearChannelDetails(s,a).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==s?void 0:s.channelId,de(u,{res:n},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,u,l,videoId)}));case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function ge(e,n){return ye.apply(this,arguments)}function ye(){return(ye=t(r.mark((function n(t,i){var o,l,a,u,s,c,d;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(c)),d=null==t||null===(o=t.series)||void 0===o?void 0:o.id,e.getSeriesDetails(d,u).then((function(n){var r,i,o,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var p=videoId||(null==v||null===(r=v[0])||void 0===r||null===(i=r.episodes)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.id);e.createSeriesWatchMap(d,u),e.getVideoDetails(p,u).then((function(n){var r,i,o;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(n.data),de(s,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,s,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,s,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:o.onTimeUpdate,getVideoDuration:o.getVideoDuration,onVideoEnded:o.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(r.mark((function t(i,o){var l,a,u,c,v,p,m,g,y,h,b,w,k,O,S,P,j,T,I,E,C,D;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(b=(null==n?void 0:n.videoSourceUrl)||!1,w=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,S=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=O,P=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=16;break}if(sessionStorage.setItem("vlp_token",P),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),P&&!e.isTokenExpired(P)){t.next=15;break}return o({status:!1,msg:"".concat(P?"Token is expired !":"Missing Authorization Token"),response:{token:P}}),t.abrupt("return");case 15:ce=JSON.parse(atob(P.split(".")[1]));case 16:return n.isAnonymousUser=!(null===(u=ce)||void 0===u||!u.anonymousId),n.siteOwner=(null===(c=ce)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=ce)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(p=ce)||void 0===p?void 0:p.userId),window.watchHistory=n.watchHistory||null,j=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(m=n.series)&&void 0!==m&&m.enable?null:null==n?void 0:n.chromecastReceiverId,T=(null==n||null===(g=n.analytics)||void 0===g?void 0:g.gaId)||null,(I=null==n?void 0:n.errors)&&(window.customErrors=I),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(y=n.customData)||void 0===y?void 0:y.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!s.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=32,A(n);case 32:T&&f("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then((function(){return e.runGtag(T)})).catch((function(e){})),(E=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b?(D={directPlaybackUrl:b,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},w?e.getVideoDetails(C,P).then((function(e){var t=(null==e?void 0:e.data)||{};de(j,{res:be(be({},t),D)},n,{resolve:i,reject:o})})).catch((function(n){e.initiateErrorHandling(n,j,o,C)})):de(j,{res:D},n,{resolve:i,reject:o})):S?ge(n,{resolve:i,reject:o}):k?fe(n,{resolve:i,reject:o}):ve(n,{resolve:i,reject:o});case 36:case"end":return t.stop()}}),t)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:c.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:o.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:u.playSelectedResolution,getSource:e.getSource,setVolume:g,getVolume:y,disableControls:e.disableControls,setPlaybackSpeed:o.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-68f01105.js"),n=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),i=require("video.js"),o=require("./util-6edeeb8a.js"),l=require("./captions-fbd6fefb.js"),a=require("./renditions-b41243b6.js"),u=require("./resolution-719c85a4.js"),s=require("./skin-34fbc337.js"),c=require("./browser-77c57718.js"),d=require("./localisation-56e0a999.js"),v=require("@babel/runtime/helpers/typeof");require("axios"),require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p,f=function(e){return new Promise((function(n,t){if(m(e))t("".concat(e," is alread initialised"));else{var r=document.createElement("script");r.async=!0,r.src=e,r.onload=function(){n()},r.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(r)}}))},m=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},g=function(e,n,t){var r=s.getPlayer(e);if(r)if(n>=0&&n<=100){r.muted()&&r.muted(!1);var i=parseFloat(n)/100;r.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,"'")})},y=function(e){var n=s.getPlayer(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var w=[],k=0,O=null;function S(n,t,r){var i,o,l,a,u,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var c=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,d=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var f=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,m=(null==t||null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(n.currentTime()),y=s?100:Math.floor(d/v*100),h={};m?j(h={completed:s,watchedTime:g,watchedPercentage:y},c,t.siteOwner):(h=b(b({videoId:p,watchedTime:g,watchedPercentage:y,doneWatching:s,profileId:c},O&&{seriesId:O}),f&&{originalObjectId:f}),e.saveWatchHistory(h).then((function(e){})).catch((function(e){}))),k=d+r}function P(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function j(t,r,i){var o=r?"watchhistory-data-".concat(r):"watchhistory-data-guest-".concat(i),l=P(o),a=(new Date).getTime(),u=e.getCurrentVideo(),s=(null==u?void 0:u.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return b(b({},e),{},n({},t,s[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));d<0?l.push(b(b({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=b(b(b({},l[d]),t),{},{updateDate:a}),localStorage.setItem("".concat(o),JSON.stringify(l))}function T(e,n,t){var r=P(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return r&&Array.isArray(r)&&(i=r.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var I=function(){var e=t(r.mark((function e(n){var t,o,l,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=s.getPlayer(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.prev=5,e.next=8,f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,a.default(i),e.finish(13);case 16:null!==(l=window)&&void 0!==l&&l.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=n&&n.airplay&&"Safari"==c.detectBrowser()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),E=function(e,n){var t=s.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,r,o,l,a,u=this.el(),s=i.dom.getPointerPosition(u,n).x;i.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var c=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(o=r.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(c),c&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*s,v.seek()}}))};var C=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),f("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)}}(),D=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("utilising contrib eme"),e.next=3,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=t(r.mark((function e(){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("videojs-mux");case 3:if(!(n=e.sent)||"function"!=typeof n.register){e.next=7;break}return n.register(i),e.abrupt("return");case 7:console.log("Mux registration failed"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Failed to load Mux plugin:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./index-3f0e537b.js")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=t(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.resolve().then((function(){return require("./videojs_contrib_dash-1ee985c7.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)}}(),V=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){f("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(i)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(i)}))},loadAdsLibrary:C,loadEMELibrary:D,loadMuxPlugin:x,loadDvrSeekbar:R,loadContribDash:N});function A(e){return L.apply(this,arguments)}function L(){return(L=t(r.mark((function e(n){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,C();case 3:t&&"Safari"==c.detectBrowser()&&Promise.resolve().then((function(){return V})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e,n){return q.apply(this,arguments)}function q(){return(q=t(r.mark((function e(n,t){var i,o,l,a,u,s,d,v,p;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(null==t?void 0:t.contentType)||"video",d=null==t||null===(i=t[s])||void 0===i?void 0:i.drmEnabled,null==t||null===(o=t[s])||void 0===o||null===(l=o.liveDetails)||void 0===l||l.isDvrEnabled,null==n||n.showPositiveSeekbar,v=(null==t||null===(a=t.video)||void 0===a?void 0:a.isSSAIEnabled)||!1,"Chrome"==c.detectBrowser()&&(v||null===(u=["dirtvision"])||void 0===u||u.includes(null==t?void 0:t.siteName)),e.prev=6,e.next=9,Promise.allSettled([d?"Safari"==c.detectBrowser()?D():"caliente"!=(null===(p=window)||void 0===p?void 0:p.siteName)?N():D():null,I(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var B=new Set,U=null,F=function(n,t,r){var i,o,l,a,u,s,c,d={},v=(null==n?void 0:n.contentType)||"video";d["c3.cm.id"]=(null===(i=n[v])||void 0===i?void 0:i.id)||"Null",d["c3.cm.contentType"]=X(n),d[null==r||null===(o=r.Constants)||void 0===o?void 0:o.IS_LIVE]=!(null==n||!n.linearchannel),d[null==r||null===(l=r.Constants)||void 0===l?void 0:l.STREAM_URL]=t.currentSrc(),d[null==r||null===(a=r.Constants)||void 0===a?void 0:a.VIEWER_ID]="undefined"===e.getUserId()?"NULL":e.getUserId(),d["c3.cm.categoryType"]=K(n),d["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),d.DRMEnabled=(null===(u=n[v])||void 0===u?void 0:u.drmEnabled)||"None",d.DAIStream=null!==(s=n[v])&&void 0!==s&&null!==(c=s.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[r.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=J(n),d["c3.cm.genreList"]=z(n),d["c3.cm.genre"]=W(n),d["c3.cm.channel"]=G(n);var p=Q(e.getCurrentSeries(),n);return d=M(M({},d),p)},W=function(e){var n,t,r,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===(r=t.primaryCategory)||void 0===r?void 0:r.title)||"Null"},z=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},G=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video";return"video"===r?"VOD":(null==e||null===(n=e[r])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},K=function(e){return(null==e?void 0:e.contentType)||"null"},J=function(e){var n,t,r=(null==e?void 0:e.contentType)||"video",i=(null==e||null===(n=e[r])||void 0===n||null===(t=n.liveDetails)||void 0===t?void 0:t.isDvrEnabled)||!1;return i?"YES":"NO"},Y=function(e,n){var t,r,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var o=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[o])||void 0===t||null===(r=t.gist)||void 0===r?void 0:r.title)||"Null";return"".concat(l)},X=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Q=function(n,t){var r,i,o,l,a,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return u;var s=e.getSeasonNumber(),c=e.getEpisodeNumber();return u["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==s?void 0:s.toString())||"Null",u["c3.cm.showTitle"]=(null==n||null===(o=n[s-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",u["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",u},Z=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},$=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},ee=function(){var n=t(r.mark((function n(t,i){var o,l,a,u,c,d,v,p,f,m;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=(null==i?void 0:i.convivaConfig)||{},l=o.trackConvivaPlayerEvent,a=o.paymentHandler,u=o.tveProvider,c=o.enable,d=o.appName,v=(i||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(p=s.getPlayer(t),"function"==typeof(f=l)){n.next=8;break}return n.abrupt("return");case 8:return n.next=10,f("getConvivaObject");case 10:if(m=n.sent){n.next=13;break}return n.abrupt("return");case 13:p.ready((function(){var e=p.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var r=Z(t.keySystem);f("contentInfo",{DRMEnabled:r})}else f("contentInfo",{DRMEnabled:"None"})})),n||f("contentInfo",{DRMEnabled:"None"})})),p.on("loadstart",(function(){var n,t;U&&U!==p.currentSrc()&&f("playbackEnded"),f("setPlayer",p),B.clear(),U=p.currentSrc();var r=$(p.currentType()),o=e.getCurrentVideo(),l=F(o,p,m);l[null==m||null===(n=m.Constants)||void 0===n?void 0:n.PLAYER_NAME]=d||"WEB",l[null==m||null===(t=m.Constants)||void 0===t?void 0:t.ASSET_NAME]=Y(o,i),l.authToken=v||"NULL",l.streamType=r,l.D2CType=a||"NONE",l.subscriberType=u||(a?"D2C":"FREE"),l["c3.cm.affiliate"]=u||"NULL",f("contentInfo",l)})),p.on("loadedmetadata",(function(){var e,n=p.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),f("contentInfo",{screenResolution:e})})),p.on("play",(function(){B.has(p.currentSrc())||(B.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){B.has(p.currentSrc())&&B.delete(p.currentSrc()),f("playbackEnded")})),p.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&f("initAdSensor",{player:p,adsLoader:null==e?void 0:e.adsLoader})})),p.on("dispose",(function(){null==B||B.clear(),f("playbackEnded")}));case 20:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),ne=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-6f1f7bfc.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-1e4e2ede.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-3b1d7864.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-6d9e7f67.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-7d10cc61.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-176180ff.js")})).then((function(t){t.initialiseSkin(e,n)}))},te=!1,re=function(n,t){var r,i,o=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(r=n[o])||void 0===r||null===(i=r.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!te){var l=ie(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),te=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function ie(e,n,t){if(Array.isArray(e))return e.map((function(e){return ie(e,n,t)}));if(null!==e&&"object"===v(e)){var r={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?r[i]=e[t]:i===t&&void 0!==e[n]?r[i]=e[n]:r[i]=ie(e[i],n,t)})),r}return e}function oe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ae=function(n,t,r,i){var o,a,u,d,v=i.res,f=i.sres,m=s.getPlayer(n),y=(null==v?void 0:v.contentType)||"video",h=(null==v||null===(o=v[y])||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,b=(null==v||null===(u=v[y])||void 0===u||null===(d=u.liveDetails)||void 0===d?void 0:d.isDvrEnabled)||!1;e.setCurrentVideo(v),m&&(m.on("loadstart",(function(){h?r.resolve({status:!0,msg:"Video Loaded",response:v}):r.resolve(le({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:v}:{response:v}))})),m.on("loadeddata",(function(){var r,i,o,a=l.getCaptions(n);if(null==a||a.map((function(e){return l.disableCaptions(n,e.id)})),b&&"Safari"===c.detectBrowser())try{var u;null==m||null===(u=m.liveTracker)||void 0===u||u.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&g(n,sessionStorage.getItem("volume")||"100");var d=e.getCurrentVideo();if(e.clearError(),null!=t&&t.watchHistory&&null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.enable&&(!t.isAnonymousUser||null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.saveOffline)){var f,y,h=le(le({},t),v);!function(e,n,t){var r,i,o;null!=n&&n.series&&null!=n&&null!==(r=n.series)&&void 0!==r&&r.enable&&(O=null==n||null===(i=n.series)||void 0===i?void 0:i.id),w=[],k=0,p=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=s.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());w.includes(k)||(e==k?(w.push(e),S(a,n,l)):e>k&&(k=e+l))})),a.one("ended",(function(){S(a,n,l,!0)})))}(n,h,null==d||null===(f=d.video)||void 0===f||null===(y=f.gist)||void 0===y?void 0:y.id)}if(null!=t&&null!==(o=t.analytics)&&void 0!==o&&o.muxKey&&null!=m&&m.mux){var P,j,T,I,E,C,D=(null===(P=e.getCurrentVideo())||void 0===P?void 0:P.video)||(null==v?void 0:v.video),x=null==D?void 0:D.gist,R={env_key:null==t||null===(j=t.analytics)||void 0===j?void 0:j.muxKey,player_name:"vl-web-player",player_version:null===(T=window)||void 0===T?void 0:T.vl_player_version,video_id:null==x?void 0:x.id,video_title:null==x?void 0:x.title,video_series:null==D||null===(I=D.series)||void 0===I?void 0:I.title,video_stream_type:null!=D&&null!==(E=D.streamingInfo)&&void 0!==E&&E.isLiveStream?"live":"video",viewer_user_id:null==t||null===(C=t.analytics)||void 0===C?void 0:C.userId};m.mux({debug:!1,data:R})}})),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,r,i,o,l,a,u,s,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(r=t.cast)||void 0===r||null===(i=r.framework)||void 0===i||null===(o=i.CastContext)||void 0===o||null===(l=o.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(s=u.framework)||void 0===s||null===(c=s.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,g=f.getMediaSession(),y=g.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){h&&re(v,n)})),m.on("error",(function(){var t,i;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?re(v,n):(e.handleError(n,(null==m||null===(t=m.error())||void 0===t?void 0:t.message)||"Some error occured"),r.reject({status:!1,msg:(null==m||null===(i=m.error())||void 0===i?void 0:i.message)||"Some error occured",response:v}))})),m.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var r,i,o,l=null===(r=e.getCurrentVideo())||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=e.getSeriesWatchMap(),u=(null==a?void 0:a.get(l))||{t:0,p:0},s=u.t,c=u.p;s&&c<95&&setTimeout((function(){m.currentTime(s)}),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])}})))};function ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ce,de=function(o,a,u,d){var v,p,f,m,g,y,h,b,w,k,O,S,P,j,T,I,C,D,x,R,N,V,A,L,q,H,M,B,U,F,W,z,G=a.res,K=void 0===G?null:G,J=a.sres,Y=void 0===J?null:J,X=null!=u&&u.chromecastReceiverId?["chromecast","html5"]:["html5"],Q=(null===(v=K)||void 0===v?void 0:v.contentType)||"video",Z=s.impolicy16x9(null===(p=K)||void 0===p||null===(f=p[Q])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||s.impolicy16x9(null===(g=K)||void 0===g||null===(y=g[Q])||void 0===y||null===(h=y.gist)||void 0===h||null===(b=h.imageGist)||void 0===b?void 0:b.r16x9),$=(null===(w=K)||void 0===w||null===(k=w[Q])||void 0===k||null===(O=k.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,te=(null===(S=K)||void 0===S||null===(P=S[Q])||void 0===P||null===(j=P.streamingInfo)||void 0===j?void 0:j.isLiveStreafm)||!1,re=(null===(T=K)||void 0===T||null===(I=T.ads)||void 0===I||null===(C=I.preRoll)||void 0===C||null===(D=C.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(R=K)||void 0===R||null===(N=R.ads)||void 0===N||null===(V=N.preRoll)||void 0===V||null===(A=V.adTags)||void 0===A||null===(L=A.web)||void 0===L?void 0:L.url),ie=(null===(q=K=se(se({},K),{},{audioAssetSource:null==u?void 0:u.audioAssetSource}))||void 0===q||null===(H=q.video)||void 0===H?void 0:H.isSSAIEnabled)||!1;"Chrome"==c.detectBrowser()&&(ie||null===(M=["dirtvision"])||void 0===M||M.includes(null===(B=K)||void 0===B?void 0:B.siteName));var oe=(z={enableSmoothSeeking:!0,controls:0!=(null==u?void 0:u.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==u?void 0:u.muted)||!1,autoplay:(null==u?void 0:u.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==u.skin,liveui:$},n(z,"autoplay",null==u?void 0:u.autoplay),n(z,"normalizeAutoplay",(null==u?void 0:u.autoplay)&&!re),n(z,"loop",(null==u?void 0:u.loop)||!1),n(z,"audioPosterMode",null==u?void 0:u.audioPosterMode),n(z,"html5",se(se({dash:se(se({},!i.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:20},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{useDefaultABRRules:!0,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:se(se({liveRangeSafeTimeDelta:10,useDevicePixelRatio:!0,experimentalLLHLS:(null==u?void 0:u.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==u||null===(U=u.customData)||void 0===U?void 0:U.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),nativeTextTracks:!1},0==(null==u||null===(F=u.customData)||void 0===F?void 0:F.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==u||null===(W=u.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(z,"poster",Z),n(z,"techOrder",X),n(z,"chromecast",{requestCustomDataFn:function(e){var n=getPlayer(o),t=((null==n?void 0:n.textTracksJson_)||n.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var r,i,o,l,a,u,s,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var g=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,y=null==g?void 0:g.url;f.licenseUrl=y;var h=null==g?void 0:g.licenseHeaders["X-AxDRM-Message"];f.licenseToken=h}var b=(null==e||null===(r=e[p])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=b;var w=null==e||null===(o=e[p])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;f.duration=w;var k=null==e||null===(a=e[p])||void 0===a||null===(u=a.gist)||void 0===u?void 0:u.title;f.mediaTitle=k;var O=null==e||null===(s=e[p])||void 0===s||null===(c=s.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(K,e,t)}}),z);if(!i.getPlayers()[o])var le=i(o,oe,function(){var n=t(r.mark((function n(){var t,a,s,c,v,p,f,m,g,y,h,b,w,k,O,S,P,j,T,I;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(le),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,_(u,K);case 5:b=null===(t=K)||void 0===t||null===(a=t[Q])||void 0===a||null===(s=a.liveDetails)||void 0===s?void 0:s.startOverTime,te&&d.resolve(se({status:!0,msg:"Player Initialised"},Y?{seriesResponse:Y,response:K}:{response:K})),e.inititateBeacon(o,null==u?void 0:u.analyticsCb),ee(o,u),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),$&&E(o,b),!re||null!=u&&null!==(c=u.customData)&&void 0!==c&&c.disableAds||e.initialiseAdvertisement(o,re,K),w=e.getSource(K,o),console.log(w),null!=u&&u.nearestClusterUrl&&(w=e.getUpdatedClusterSource(w,u.nearestClusterUrl)),w?e.loadVideo(o,w):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:K}),e.handleError(o,"Incompatible / Missing Source")),((null===(v=K)||void 0===v||null===(p=v[Q])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(m=f.closedCaptions)||void 0===m?void 0:m.length)>0||(null===(g=K)||void 0===g||null===(y=g[Q])||void 0===y||null===(h=y.closedCaptions)||void 0===h?void 0:h.length)>0)&&(I=(null===(O=K)||void 0===O||null===(S=O[Q])||void 0===S||null===(P=S.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(j=K)||void 0===j||null===(T=j[Q])||void 0===T?void 0:T.closedCaptions),k=I.filter((function(e){return"VTT"===e.format})),l.addCaptions(o,k)),null!=u&&u.disableControls?e.disableControls(o):ne(o,se(se(se({},u),oe),{},{liveVideo:te,isDvrEnabled:$,res:K,sres:Y})),ae(o,se(se(se({},u),oe),{},{liveVideo:te}),d,{res:K,sres:Y});case 19:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function ve(e,n){return pe.apply(this,arguments)}function pe(){return(pe=t(r.mark((function n(t,i){var o,l,a,u,s,c;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.resolve,l=i.reject,a=null==t?void 0:t.videoId,u=null==t?void 0:t.playerId,s=!(null==t||!t.anonymousId),n.next=6,e.getToken();case 6:c=n.sent,e.getVideoDetails(a,c).then((function(n){var r,i,d,v;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(d=i.gist)||void 0===d?void 0:d.contentType,e.setCurrentVideo(null==n?void 0:n.data);var p,f=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(v=t.watchHistory)&&void 0!==v&&v.enable&&!s)if((null===(p=t.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,g,y,h=T((null===(m=t.watchHistory)||void 0===m?void 0:m.profileId)||"",a,null==t?void 0:t.siteOwner);if(h&&h.length)t.watchHistoryResumeTime=(null===(g=h[0])||void 0===g?void 0:g.watchedTime)||null,t.watchedPercentage=(null===(y=h[0])||void 0===y?void 0:y.watchedPercentage)||null;f.contentType="video",de(u,{res:f},t,{resolve:o,reject:l})}else e.getVideoInfo(a,c).then((function(e){var n,r,i,o,l,a;null!==(n=window)&&void 0!==n&&null!==(r=n.watchHistory)&&void 0!==r&&r.cb&&(null===(i=window)||void 0===i||null===(o=i.watchHistory)||void 0===o||o.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,t.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,r,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(r=window)||void 0===r||null===(i=r.watchHistory)||void 0===i||i.cb(e))})).finally((function(){de(u,{res:f},t,{resolve:o,reject:l})}));else de(u,{res:f},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,u,l,a)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function fe(e,n){return me.apply(this,arguments)}function me(){return(me=t(r.mark((function n(t,i){var o,l,a,u,s;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=i.resolve,l=i.reject,n.next=3,e.getToken();case 3:a=n.sent,u=null==t?void 0:t.playerId,s=null==t?void 0:t.epg,e.getLinearChannelDetails(s,a).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==s?void 0:s.channelId,de(u,{res:n},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,u,l,videoId)}));case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function ge(e,n){return ye.apply(this,arguments)}function ye(){return(ye=t(r.mark((function n(t,i){var o,l,a,u,s,c,d;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l=i.resolve,a=i.reject,n.next=3,e.getToken();case 3:u=n.sent,s=null==t?void 0:t.playerId,c=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(c)),d=null==t||null===(o=t.series)||void 0===o?void 0:o.id,e.getSeriesDetails(d,u).then((function(n){var r,i,o,c=n.data,v=n.data.seasons;e.setCurrentSeries(v);var p=videoId||(null==v||null===(r=v[0])||void 0===r||null===(i=r.episodes)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.id);e.createSeriesWatchMap(d,u),e.getVideoDetails(p,u).then((function(n){var r,i,o;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(i=r.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType,e.setCurrentVideo(n.data),de(s,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,s,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,s,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:o.onTimeUpdate,getVideoDuration:o.getVideoDuration,onVideoEnded:o.onVideoEnded,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var i=t(r.mark((function t(i,o){var l,a,u,c,v,p,m,g,y,h,b,w,k,O,S,P,j,T,I,E,C,D;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.isPlayerInitialised(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(b=(null==n?void 0:n.videoSourceUrl)||!1,w=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,O=null==n?void 0:n.videoId,S=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=O,P=null==n?void 0:n.token,!e.token_authentication_enabled(n)){t.next=16;break}if(sessionStorage.setItem("vlp_token",P),e.refreshTokenManager().set(null==n?void 0:n.refreshToken),P&&!e.isTokenExpired(P)){t.next=15;break}return o({status:!1,msg:"".concat(P?"Token is expired !":"Missing Authorization Token"),response:{token:P}}),t.abrupt("return");case 15:ce=JSON.parse(atob(P.split(".")[1]));case 16:return n.isAnonymousUser=!(null===(u=ce)||void 0===u||!u.anonymousId),n.siteOwner=(null===(c=ce)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=ce)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(p=ce)||void 0===p?void 0:p.userId),window.watchHistory=n.watchHistory||null,j=null==n?void 0:n.playerId,n.chromecastReceiverId=null!=n&&null!==(m=n.series)&&void 0!==m&&m.enable?null:null==n?void 0:n.chromecastReceiverId,T=(null==n||null===(g=n.analytics)||void 0===g?void 0:g.gaId)||null,(I=null==n?void 0:n.errors)&&(window.customErrors=I),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(y=n.customData)||void 0===y?void 0:y.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!s.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=32,A(n);case 32:T&&f("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then((function(){return e.runGtag(T)})).catch((function(e){})),(E=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b?(D={directPlaybackUrl:b,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},w?e.getVideoDetails(C,P).then((function(e){var t=(null==e?void 0:e.data)||{};de(j,{res:be(be({},t),D)},n,{resolve:i,reject:o})})).catch((function(n){e.initiateErrorHandling(n,j,o,C)})):de(j,{res:D},n,{resolve:i,reject:o})):S?ge(n,{resolve:i,reject:o}):k?fe(n,{resolve:i,reject:o}):ve(n,{resolve:i,reject:o});case 36:case"end":return t.stop()}}),t)})));return function(e,n){return i.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:s.getPlayer,play:e.play,pause:e.pause,detectBrowser:c.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:o.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:l.enableCaptions,disableCaptions:l.disableCaptions,getCaptions:l.getCaptions,playSelectedResolution:u.playSelectedResolution,getSource:e.getSource,setVolume:g,getVolume:y,disableControls:e.disableControls,setPlaybackSpeed:o.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./features-66e55751.js"),n=require("./skin-34fbc337.js"),r=require("./index-9e780f27.js"),t=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var o=require("video.js"),i=require("./keyboardShortcuts-0d0c3ff1.js"),a=require("./generic-68f01105.js"),l=require("@babel/runtime/helpers/toConsumableArray"),s=require("@babel/runtime/helpers/slicedToArray"),d=require("@babel/runtime/helpers/defineProperty"),u=require("@babel/runtime/helpers/asyncToGenerator"),c=require("@babel/runtime/regenerator"),v=require("./icons-1a3febef.js");require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./renditions-b41243b6.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-1a70d67c.js"),require("./util-6edeeb8a.js"),require("@babel/runtime/helpers/typeof"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./captions-fbd6fefb.js");function p(o,i){var a=n.getPlayer(o);a&&(a.on("loadeddata",(function(){var e,a,l,s,d;!function(e){var r=n.getPlayer(e);r&&(null==r||r.qualityMenu,r.qualityMenu({useResolutionLabels:!0}))}(o),!(null!=i&&null!==(e=i.series)&&void 0!==e&&e.enable||null!==(a=window)&&void 0!==a&&null!==(l=a.app_data)&&void 0!==l&&null!==(s=l.appcmsMain)&&void 0!==s&&null!==(d=s.features)&&void 0!==d&&d.auto_play)||null!=i&&i.liveVideo||r.addNextEpPreview(o,i),null!=i&&i.liveVideo||t.isMobile()||r.initiateTrickplay(o)})),a.one("play",(function(){var n,r,t,i;null!==(n=window)&&void 0!==n&&null!==(r=n.customData)&&void 0!==r&&r.iframeOverlayUrl&&e.addOutputtingOverlay(o,null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.iframeOverlayUrl)})))}function f(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return m(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw i}}}}function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function y(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function b(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){d(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function h(){return h=u(c.mark((function e(r,t){var o,d,p,m,y,h,g,S,k,j,w,q,I,O,T,M,P,C,x;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e,t,o){var i=n.getPlayer(r);Math.floor(i.currentTime());var a,l,s,d,u,c,v,p,m,y,b,h,g,S,k=f(t);try{for(k.s();!(a=k.n()).done;)l=void 0,s=void 0,d=void 0,u=void 0,c=void 0,v=void 0,p=void 0,m=void 0,y=void 0,b=void 0,h=void 0,g=void 0,S=void 0,c=a.value,v=c.eventType,p=c.beaconUrls,m=c.startTimeInSeconds,y=c.startTime,b=c.durationInSeconds,h=Math.round(m),g=p[0],S=(null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s||null===(d=s.ads)||void 0===d?void 0:d.adEventHandler)||null,h!=Math.round(i.currentTime())||C.has(y)||(C.set(y,!0),"function"==typeof S&&S({adsData:{eventType:v,startTimeInSeconds:m,startTime:y,durationInSeconds:b,ad:null==e||null===(u=e.ads)||void 0===u?void 0:u[o],adIndex:o}}),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",v,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",e),fetch(g))}catch(e){k.e(e)}finally{k.f()}},P=function(e){var n=Math.floor(e/60),r=Math.floor(e%60);return"".concat(n,":").concat(r.toString().padStart(2,"0"))},T=function(e){var n={},r=e.split("?")[1];if(!r)return n;var t,o=f(r.split("&"));try{for(o.s();!(t=o.n()).done;){var i=t.value.split("="),a=s(i,2),l=a[0],d=a[1];n[decodeURIComponent(l)]=decodeURIComponent(d||"")}}catch(e){o.e(e)}finally{o.f()}for(var u={},c=0,v=Object.entries(n);c<v.length;c++){var p=s(v[c],2),m=p[0],y=p[1];if(m.startsWith("ads."))u[m.replace(/^ads\./,"")]=y;else u[m]=y}return u},o=n.getPlayer(r),d=t.replace("dash","session").replace("master","session"),d=a.replaceMacros(d,r,{}),p=T(d),d=d.split("?")[0],e.next=10,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:b({},p)})});case 10:return m=e.sent,e.next=13,m.json();case 13:y=e.sent,h="https://"+new URL(d).hostname,g=y.trackingUrl,S=y.manifestUrl,k=h+g,j=h+S,console.log("%c TRACKING URL","background: #bdf369; color: #000",k),null!=t&&t.includes(".mpd")?(q=(null==o||null===(w=o.currentSource())||void 0===w?void 0:w.keySystemOptions)||null,a.loadVideo(r,{src:j,type:"application/x-mpegURL",keySystemOptions:q})):(O=(null==o||null===(I=o.currentSource())||void 0===I?void 0:I.keySystems)||null,a.loadVideo(r,{src:j,type:"application/x-mpegURL",keySystems:O})),o.one("loadeddata",(function(){M(k)})),M=function(){var e=u(c.mark((function e(t){var o,a,s,d,u,p,f,m,y,b,h,g,S,k,j,w,q;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return a=e.sent,e.next=5,a.json();case 5:s=e.sent,d=s.avails,u=[],p=n.getPlayer(r),f=p.controlBar.progressControl,m=f.seekBar.el(),d.map((function(e){var n;Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(n=e.ads)||void 0===n?void 0:n.length)>0&&u.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds)})})),u.forEach((function(e){var n=e.markerPositionInSeconds,r=p.duration();if(!(n>r)){var t=n/r*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",m.appendChild(o)}})),y=new Map,b=-1,p.on("timeupdate",n.throttle((function(){var e=Math.floor(p.currentTime());if(e!==b){b=e;for(var n=!1,r=function(){var r=o[t],a=r.startTimeInSeconds,s=r.durationInSeconds,d=r.ads,u=Math.floor(a+s);if(e>=a&&e<=u){n=!0,y.set(a,!0),i.keyboardManager.disable(),f.el().style.visibility="hidden";for(var c=e-a,v=0,p=0,m=0;m<d.length;m++){var b,g=null==d||null===(b=d[m])||void 0===b?void 0:b.durationInSeconds;if(c<v+g){p=m;break}v+=g}var S=d[p],k=c-v,j=Math.max(0,S.durationInSeconds-k),q=Math.round(j);h.style.display="block",w.textContent="".concat(p+1," of ").concat(d.length," • ").concat(P(q));var I=[];return d.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression"].includes(e.eventType)}));I.push.apply(I,l(n))})),x(r,I,p),"break"}},t=0,o=u;t<o.length;t++){if("break"===r())break}n||(h.style.display="none",f.el().style.visibility="visible",i.keyboardManager.enable())}}),1e3)),p.on("seeked",(function(){for(var e=null,n=0,r=u;n<r.length;n++){var t=r[n],o=null==p?void 0:p.currentTime(),i=t.startTimeInSeconds,a=t.durationInSeconds;o>Math.floor(i+a)&&!y.has(i)&&(e=i,y.set(i,!0))}e&&(p.currentTime(e),console.log("seeking back to",e),e=null)})),(h=document.createElement("div")).className="ssai-ad-container",(g=document.createElement("div")).className="sponsored-adbox",(S=document.createElement("div")).className="sponsored-text",S.textContent="Sponsored Ad",(k=document.createElement("div")).className="ad-info-icon",j=n.parseSvgString(v.InfoIcon()),k.appendChild(j),g.append(S),g.append(k),(w=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",(q=document.createElement("div")).className="ad-visit-advertiser",q.textContent="Visit Advertiser",(null===(o=document.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])&&(q.style.right="8.6rem"),h.append(g),h.append(w),h.append(q),p.el().appendChild(h);case 43:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),C=new Map;case 24:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}var g=function(){var e,n,r,t,i,a,l,s,d,u,c,v,p=o.dom.$(".vjs-play-progress"),f=o.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");f&&(f.style.color="".concat(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(r=n.appcmsMain)||void 0===r||null===(t=r.brand)||void 0===t||null===(i=t.cta)||void 0===i||null===(a=i.primary)||void 0===a?void 0:a.backgroundColor)),p&&(p.style.background="".concat(null===(l=window)||void 0===l||null===(s=l.app_data)||void 0===s||null===(d=s.appcmsMain)||void 0===d||null===(u=d.brand)||void 0===u||null===(c=u.cta)||void 0===c||null===(v=c.primary)||void 0===v?void 0:v.backgroundColor))};exports.initialiseSkin=function(t,o){n.getPlayer(t).addClass("skin_vlone"),p(t,o),function(n,t){var o,l,s,d,u,c,v=null==t||null===(o=t.res)||void 0===o||null===(l=o.video)||void 0===l?void 0:l.isSSAIEnabled,p=a.getSource(null==t?void 0:t.res,n),f=p.src;(null==t||null===(s=t.relatedVideos)||void 0===s||null===(d=s.content)||void 0===d?void 0:d.length)>0&&e.addVideoSelector(n,null==t?void 0:t.relatedVideos);null!=t&&null!==(u=t.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(n,t);(null==t||null===(c=t.streams)||void 0===c?void 0:c.length)>1&&e.addMulticamSelector(n,null==t?void 0:t.streams);r.addTVProviderImage(n,t),i.initialiseKeyboardEvents(n,t),v&&function(e,n){h.apply(this,arguments)}(n,f)}(t,o),g()};
|
package/esm/bundle.css
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
.video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
|
|
8
6
|
height: 0.7em;
|
|
9
7
|
position: absolute;
|
|
@@ -149,6 +147,8 @@
|
|
|
149
147
|
}
|
|
150
148
|
}
|
|
151
149
|
|
|
150
|
+
|
|
151
|
+
|
|
152
152
|
/* CSS for videojs-dvr-seekbar */
|
|
153
153
|
|
|
154
154
|
.video-js.vjs-dvr-seekbar {
|
|
@@ -392,6 +392,10 @@
|
|
|
392
392
|
|
|
393
393
|
|
|
394
394
|
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
395
399
|
.video-js .multicamera-parent.default{
|
|
396
400
|
height: 345px;
|
|
397
401
|
position: absolute;
|
|
@@ -470,10 +474,6 @@
|
|
|
470
474
|
align-content: baseline;
|
|
471
475
|
}
|
|
472
476
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
477
|
/* nextep */
|
|
478
478
|
.next-ep-preview{
|
|
479
479
|
position: absolute;
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import{s as e,g as n,a as t,b as o,c as i,d as r,e as l,l as a,f as s,h as u,i as c,j as d,k as v,m as p,n as f,o as m,p as y,q as h,r as g,t as b,u as w,v as k,w as O,x as j,y as S,z as T,A as I,B as P,C as D,D as x,E,F as C,G as R,H as N,I as A,J as L,K as _,L as V,M as H,N as M}from"./generic-35152f51.js";import B from"@babel/runtime/helpers/defineProperty";import U from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/regenerator";import z from"video.js";import{o as G,g as K,a as q,s as J,b as W}from"./util-1c8c0f16.js";import{g as Y,d as X,a as Q,e as Z}from"./captions-135a6d13.js";import{g as $}from"./renditions-aa307468.js";import{playSelectedResolution as ee}from"./resolution-e9c353f4.js";import{g as ne,i as te,a as oe}from"./skin-b8df984d.js";import{d as ie}from"./browser-d4613b36.js";import{s as re}from"./localisation-0bf399a1.js";import le from"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";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";var ae,se=function(e){return new Promise((function(n,t){if(ue(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)}}))},ue=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ce=function(e,n,t){var o=ne(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,"'")})},de=function(e){var n=ne(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ve(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ve(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var fe=[],me=0,ye=null;function he(n,t,o){var i,r,l,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var c=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,d=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var p=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==t||null===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(n.currentTime()),y=u?100:Math.floor(d/v*100),h={};f?be(h={completed:u,watchedTime:m,watchedPercentage:y},c,t.siteOwner):(h=pe(pe({videoId:ae,watchedTime:m,watchedPercentage:y,doneWatching:u,profileId:c},ye&&{seriesId:ye}),p&&{originalObjectId:p}),e(h).then((function(e){})).catch((function(e){}))),me=d+o}function ge(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function be(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=ge(i),l=(new Date).getTime(),a=n(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return pe(pe({},e),{},B({},n,s[n]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ae}));c<0?r.push(pe(pe({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=pe(pe(pe({},r[c]),e),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function we(e,n,t){var o=ge(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 ke=function(){var e=U(F.mark((function e(n){var t,o,i,r;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=ne(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return r=e.sent,e.prev=5,e.next=8,se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,r.default(z),e.finish(13);case 16:null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=n&&n.airplay&&"Safari"==ie()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),Oe=function(e,n){var t=ne(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var je=function(){var e=U(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),se("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)}}(),Se=function(){var e=U(F.mark((function e(){return F.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){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=U(F.mark((function e(){var n;return F.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(z),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)}}(),Ie=function(){var e=U(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),Pe=function(){var e=U(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs_contrib_dash-3e3eb724.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)}}(),De=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},loadAdsLibrary:je,loadEMELibrary:Se,loadMuxPlugin:Te,loadDvrSeekbar:Ie,loadContribDash:Pe});function xe(e){return Ee.apply(this,arguments)}function Ee(){return(Ee=U(F.mark((function e(n){var t;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,je();case 3:t&&"Safari"==ie()&&Promise.resolve().then((function(){return De})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(e,n){return Re.apply(this,arguments)}function Re(){return(Re=U(F.mark((function e(n,t){var o,i,r,l,a,s,u,c,d;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(null==t?void 0:t.contentType)||"video",u=null==t||null===(o=t[s])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[s])||void 0===i||null===(r=i.liveDetails)||void 0===r||r.isDvrEnabled,null==n||n.showPositiveSeekbar,c=(null==t||null===(l=t.video)||void 0===l?void 0:l.isSSAIEnabled)||!1,"Chrome"==ie()&&(c||null===(a=["dirtvision"])||void 0===a||a.includes(null==t?void 0:t.siteName)),e.prev=6,e.next=9,Promise.allSettled([u&&"Safari"==ie()?Se():null,u&&"Chrome"==ie()&&"caliente"!=(null===(d=window)||void 0===d?void 0:d.siteName)?Pe():Se(),ke(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function Ne(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ne(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Le=new Set,_e=null,Ve=function(e,n,o){var r,l,a,s,u,c,d,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(r=e[p])||void 0===r?void 0:r.id)||"Null",v["c3.cm.contentType"]=Ge(e),v[null==o||null===(l=o.Constants)||void 0===l?void 0:l.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===(s=o.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===t()?"NULL":t(),v["c3.cm.categoryType"]=Ue(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=e[p])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[o.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=Fe(e),v["c3.cm.genreList"]=Me(e),v["c3.cm.genre"]=He(e),v["c3.cm.channel"]=Be(e);var f=Ke(i(),e);return v=Ae(Ae({},v),f)},He=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"},Me=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"},Be=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Ue=function(e){return(null==e?void 0:e.contentType)||"null"},Fe=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"},ze=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},Ge=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Ke=function(e,n){var t,i,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=r(),d=o();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(i=t.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},qe=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"}},Je=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},We=function(){var e=U(F.mark((function e(t,o){var i,r,l,a,s,u,c,d,v,p;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=i.appName,c=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=ne(t),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready((function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=qe(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),d.on("loadstart",(function(){var e,t;_e&&_e!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Le.clear(),_e=d.currentSrc();var i=Je(d.currentType()),r=n(),s=Ve(r,d,p);s[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",s[null==p||null===(t=p.Constants)||void 0===t?void 0:t.ASSET_NAME]=ze(r,o),s.authToken=c||"NULL",s.streamType=i,s.D2CType=l||"NONE",s.subscriberType=a||(l?"D2C":"FREE"),s["c3.cm.affiliate"]=a||"NULL",v("contentInfo",s)})),d.on("loadedmetadata",(function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),d.on("play",(function(){Le.has(d.currentSrc())||(Le.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){Le.has(d.currentSrc())&&Le.delete(d.currentSrc()),v("playbackEnded")})),d.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})})),d.on("dispose",(function(){null==Le||Le.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Ye=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-47c2c547.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-b3918671.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-e2a48f27.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-69595ceb.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-f7b309f6.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-d380d535.js").then((function(t){t.initialiseSkin(e,n)}))},Xe=!1,Qe=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)&&!Xe){var r=Ze(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),Xe=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Ze(e,n,t){if(Array.isArray(e))return e.map((function(e){return Ze(e,n,t)}));if(null!==e&&"object"===le(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]=Ze(e[i],n,t)})),o}return e}function $e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function en(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$e(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var nn=function(e,t,o,i){var r,l,a,v,p=i.res,f=i.sres,m=ne(e),y=(null==p?void 0:p.contentType)||"video",h=(null==p||null===(r=p[y])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1,g=(null==p||null===(a=p[y])||void 0===a||null===(v=a.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;s(p),m&&(m.on("loadstart",(function(){h?o.resolve({status:!0,msg:"Video Loaded",response:p}):o.resolve(en({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))})),m.on("loadeddata",(function(){var o,i,r,l=Y(e);if(null==l||l.map((function(n){return X(e,n.id)})),g&&"Safari"===ie())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())&&ce(e,sessionStorage.getItem("volume")||"100");var s=n();if(u(),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,d,v=en(en({},t),p);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ye=null==n||null===(i=n.series)||void 0===i?void 0:i.id),fe=[],me=0,ae=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=ne(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());fe.includes(me)||(e==me?(fe.push(e),he(a,n,l)):e>me&&(me=e+l))})),a.one("ended",(function(){he(a,n,l,!0)})))}(e,v,null==s||null===(c=s.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=m&&m.mux){var f,y,h,b,w,k,O=(null===(f=n())||void 0===f?void 0:f.video)||(null==p?void 0:p.video),j=null==O?void 0:O.gist,S={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==j?void 0:j.id,video_title:null==j?void 0:j.title,video_series:null==O||null===(b=O.series)||void 0===b?void 0:b.title,video_stream_type:null!=O&&null!==(w=O.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==t||null===(k=t.analytics)||void 0===k?void 0:k.userId};m.mux({debug:!1,data:S})}})),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,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),h=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){h&&Qe(p,e)})),m.on("error",(function(){var n,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?Qe(p,e):(c(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.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;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,r,l=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=d(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){m.currentTime(u)}),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])}})))};function tn(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 on(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tn(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var rn,ln=function(e,n,t,o){var i,r,s,u,d,y,h,g,b,w,k,O,j,S,T,I,P,D,x,E,C,R,N,A,L,_,V,H,M,G,K,q,J=n.res,W=void 0===J?null:J,Y=n.sres,X=void 0===Y?null:Y,Z=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],$=(null===(i=W)||void 0===i?void 0:i.contentType)||"video",ee=te(null===(r=W)||void 0===r||null===(s=r[$])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||te(null===(d=W)||void 0===d||null===(y=d[$])||void 0===y||null===(h=y.gist)||void 0===h||null===(g=h.imageGist)||void 0===g?void 0:g.r16x9),ne=(null===(b=W)||void 0===b||null===(w=b[$])||void 0===w||null===(k=w.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,oe=(null===(O=W)||void 0===O||null===(j=O[$])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,re=(null===(T=W)||void 0===T||null===(I=T.ads)||void 0===I||null===(P=I.preRoll)||void 0===P||null===(D=P.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(E=W)||void 0===E||null===(C=E.ads)||void 0===C||null===(R=C.preRoll)||void 0===R||null===(N=R.adTags)||void 0===N||null===(A=N.web)||void 0===A?void 0:A.url),le=(null===(L=W=on(on({},W),{},{audioAssetSource:null==t?void 0:t.audioAssetSource}))||void 0===L||null===(_=L.video)||void 0===_?void 0:_.isSSAIEnabled)||!1;"Chrome"==ie()&&(le||null===(V=["dirtvision"])||void 0===V||V.includes(null===(H=W)||void 0===H?void 0:H.siteName));var ae=(q={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:ne},B(q,"autoplay",null==t?void 0:t.autoplay),B(q,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!re),B(q,"loop",(null==t?void 0:t.loop)||!1),B(q,"audioPosterMode",null==t?void 0:t.audioPosterMode),B(q,"html5",on(on({dash:on(on({},!z.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:20},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{useDefaultABRRules:!0,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:on(on({liveRangeSafeTimeDelta:10,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==t||null===(M=t.customData)||void 0===M?void 0:M.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),nativeTextTracks:!1},0==(null==t||null===(G=t.customData)||void 0===G?void 0:G.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(K=t.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),B(q,"poster",ee),B(q,"techOrder",Z),B(q,"chromecast",{requestCustomDataFn:function(n){var t=getPlayer(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,h=null==y?void 0:y.url;f.licenseUrl=h;var g=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=g}var b=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=b;var w=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=w;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(W,n,o)}}),q);if(!z.getPlayers()[e])var se=z(e,ae,function(){var n=U(F.mark((function n(){var i,r,s,u,d,y,h,g,b,w,k,O,j,S,T,I,P,D,x,E;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(se),console.log(z.VERSION),console.log(z.getPlugins()),n.next=5,Ce(t,W);case 5:O=null===(i=W)||void 0===i||null===(r=i[$])||void 0===r||null===(s=r.liveDetails)||void 0===s?void 0:s.startOverTime,oe&&o.resolve(on({status:!0,msg:"Player Initialised"},X?{seriesResponse:X,response:W}:{response:W})),v(e,null==t?void 0:t.analyticsCb),We(e,t),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),ne&&Oe(e,O),!re||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||p(e,re,W),j=l(W,e),console.log(j),null!=t&&t.nearestClusterUrl&&(j=f(j,t.nearestClusterUrl)),j?a(e,j):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:W}),c(e,"Incompatible / Missing Source")),((null===(d=W)||void 0===d||null===(y=d[$])||void 0===y||null===(h=y.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(b=W)||void 0===b||null===(w=b[$])||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0)&&(E=(null===(T=W)||void 0===T||null===(I=T[$])||void 0===I||null===(P=I.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(D=W)||void 0===D||null===(x=D[$])||void 0===x?void 0:x.closedCaptions),S=E.filter((function(e){return"VTT"===e.format})),Q(e,S)),null!=t&&t.disableControls?m(e):Ye(e,on(on(on({},t),ae),{},{liveVideo:oe,isDvrEnabled:ne,res:W,sres:X})),nn(e,on(on(on({},t),ae),{},{liveVideo:oe}),o,{res:W,sres:X});case 19:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function an(e,n){return sn.apply(this,arguments)}function sn(){return(sn=U(F.mark((function e(n,t){var o,i,r,l,a,u;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,r=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,b();case 6:u=e.sent,y(r,u).then((function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,s(null==e?void 0:e.data);var p,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,b=we((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=b[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",ln(l,{res:f},n,{resolve:o,reject:i})}else h(r,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){ln(l,{res:f},n,{resolve:o,reject:i})}));else ln(l,{res:f},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function un(e,n){return cn.apply(this,arguments)}function cn(){return(cn=U(F.mark((function e(n,t){var o,i,r,l,a;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,b();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,w(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,ln(l,{res:t},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dn(e,n){return vn.apply(this,arguments)}function vn(){return(vn=U(F.mark((function e(n,t){var o,i,r,l,a,u,c;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,r=t.reject,e.next=3,b();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,j.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,k(c,l).then((function(e){var t,o,u,d=e.data,v=e.data.seasons;S(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);O(c,l),y(p,l).then((function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,s(e.data),ln(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:r})})).catch((function(e){g(e,a,r,videoId)}))})).catch((function(e){g(e,a,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pn(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function mn(){return{loadVideoInstantly:T,onTimeUpdate:G,getVideoDuration:K,onVideoEnded:q,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=U(F.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,h,b,w,k,O,j,S,T,I,P;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!E(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(f=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,w=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=b,k=null==e?void 0:e.token,!_(e)){n.next=16;break}if(sessionStorage.setItem("vlp_token",k),V().set(null==e?void 0:e.refreshToken),k&&!H(k)){n.next=15;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 15:rn=JSON.parse(atob(k.split(".")[1]));case 16:return e.isAnonymousUser=!(null===(l=rn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=rn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=rn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=rn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,j=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(S=null==e?void 0:e.errors)&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,re(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),L.set(e.apiBaseUrl),null!=e&&e.skin&&!oe(e.skin)||(e.skin="VL_ONE"),n.next=32,xe(e);case 32:j&&se("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return M(j)})).catch((function(e){})),(T=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(O)))&&T.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(P={directPlaybackUrl:f,id:I="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?y(I,k).then((function(n){var i=(null==n?void 0:n.data)||{};ln(O,{res:fn(fn({},i),P)},e,{resolve:t,reject:o})})).catch((function(e){g(e,O,o,I)})):ln(O,{res:P},e,{resolve:t,reject:o})):w?dn(e,{resolve:t,reject:o}):h?un(e,{resolve:t,reject:o}):an(e,{resolve:t,reject:o});case 36:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:$,skip:I,getPlayer:ne,play:P,pause:D,detectBrowser:ie,rewind:x,loadVideo:a,seekToTimeStamp:J,isPlayerInitialised:E,load:C,authenticateLC:R,dispose:N,enableCaptions:Z,disableCaptions:X,getCaptions:Y,playSelectedResolution:ee,getSource:l,setVolume:ce,getVolume:de,disableControls:m,setPlaybackSpeed:W,getEntitlementData:A}}export{mn as default};
|
|
1
|
+
import"video.js/dist/video-js.min.css";import{s as e,g as n,a as t,b as o,c as i,d as r,e as l,l as a,f as s,h as u,i as c,j as d,k as v,m as p,n as f,o as m,p as y,q as h,r as g,t as b,u as w,v as k,w as O,x as j,y as S,z as T,A as I,B as P,C as D,D as x,E,F as C,G as R,H as N,I as A,J as L,K as _,L as V,M as H,N as M}from"./generic-35152f51.js";import B from"@babel/runtime/helpers/defineProperty";import U from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/regenerator";import z from"video.js";import{o as G,g as K,a as q,s as J,b as W}from"./util-1c8c0f16.js";import{g as Y,d as X,a as Q,e as Z}from"./captions-135a6d13.js";import{g as $}from"./renditions-aa307468.js";import{playSelectedResolution as ee}from"./resolution-e9c353f4.js";import{g as ne,i as te,a as oe}from"./skin-b8df984d.js";import{d as ie}from"./browser-d4613b36.js";import{s as re}from"./localisation-0bf399a1.js";import le from"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";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";var ae,se=function(e){return new Promise((function(n,t){if(ue(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)}}))},ue=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ce=function(e,n,t){var o=ne(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,"'")})},de=function(e){var n=ne(e);return n?parseInt(100*n.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ve(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ve(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var fe=[],me=0,ye=null;function he(n,t,o){var i,r,l,a,s,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==t||null===(i=t.watchHistory)||void 0===i||i.apiVersion;var c=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,d=Math.floor(n.currentTime()),v=Math.floor(n.duration());null==t||null===(l=t.watchHistory)||void 0===l||l.xapiKey;var p=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f=(null==t||null===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,m=Math.floor(n.currentTime()),y=u?100:Math.floor(d/v*100),h={};f?be(h={completed:u,watchedTime:m,watchedPercentage:y},c,t.siteOwner):(h=pe(pe({videoId:ae,watchedTime:m,watchedPercentage:y,doneWatching:u,profileId:c},ye&&{seriesId:ye}),p&&{originalObjectId:p}),e(h).then((function(e){})).catch((function(e){}))),me=d+o}function ge(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function be(e,t,o){var i=t?"watchhistory-data-".concat(t):"watchhistory-data-guest-".concat(o),r=ge(i),l=(new Date).getTime(),a=n(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return pe(pe({},e),{},B({},n,s[n]))}),{}),c=r.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===ae}));c<0?r.push(pe(pe({content:u},e),{},{addedDate:l,updateDate:l})):r[c]=pe(pe(pe({},r[c]),e),{},{updateDate:l}),localStorage.setItem("".concat(i),JSON.stringify(r))}function we(e,n,t){var o=ge(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 ke=function(){var e=U(F.mark((function e(n){var t,o,i,r;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=ne(null==n?void 0:n.playerId),null!=n&&null!==(t=n.series)&&void 0!==t&&t.enable||null==n||!n.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return r=e.sent,e.prev=5,e.next=8,se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,r.default(z),e.finish(13);case 16:null!==(i=window)&&void 0!==i&&i.cast?null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==n?void 0:n.chromecastReceiverId,addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=n&&n.airplay&&"Safari"==ie()?null==o||o.airPlay({addButtonToControlBar:"VL_ONE"==n.skin||"defaultV2"==n.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(n){return e.apply(this,arguments)}}(),Oe=function(e,n){var t=ne(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,r,l,a=this.el(),s=z.dom.getPointerPosition(a,n).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var d=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=d.h.media[0].liveSeekableRange.end;d.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,d.seek()}}))};var je=function(){var e=U(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([import("videojs-contrib-ads"),import("ima"),se("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)}}(),Se=function(){var e=U(F.mark((function e(){return F.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){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=U(F.mark((function e(){var n;return F.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(z),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)}}(),Ie=function(){var e=U(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./index-8e3eab6d.js");case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to load dvr seekbar");case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),Pe=function(){var e=U(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,import("./videojs_contrib_dash-3e3eb724.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)}}(),De=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){se("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},loadAdsLibrary:je,loadEMELibrary:Se,loadMuxPlugin:Te,loadDvrSeekbar:Ie,loadContribDash:Pe});function xe(e){return Ee.apply(this,arguments)}function Ee(){return(Ee=U(F.mark((function e(n){var t;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(null==n?void 0:n.airplay)||!1,e.next=3,je();case 3:t&&"Safari"==ie()&&Promise.resolve().then((function(){return De})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(e,n){return Re.apply(this,arguments)}function Re(){return(Re=U(F.mark((function e(n,t){var o,i,r,l,a,s,u,c,d;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(null==t?void 0:t.contentType)||"video",u=null==t||null===(o=t[s])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[s])||void 0===i||null===(r=i.liveDetails)||void 0===r||r.isDvrEnabled,null==n||n.showPositiveSeekbar,c=(null==t||null===(l=t.video)||void 0===l?void 0:l.isSSAIEnabled)||!1,"Chrome"==ie()&&(c||null===(a=["dirtvision"])||void 0===a||a.includes(null==t?void 0:t.siteName)),e.prev=6,e.next=9,Promise.allSettled([u?"Safari"==ie()?Se():"caliente"!=(null===(d=window)||void 0===d?void 0:d.siteName)?Pe():Se():null,ke(n)]);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.log("Error",e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])})))).apply(this,arguments)}function Ne(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ne(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Le=new Set,_e=null,Ve=function(e,n,o){var r,l,a,s,u,c,d,v={},p=(null==e?void 0:e.contentType)||"video";v["c3.cm.id"]=(null===(r=e[p])||void 0===r?void 0:r.id)||"Null",v["c3.cm.contentType"]=Ge(e),v[null==o||null===(l=o.Constants)||void 0===l?void 0:l.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===(s=o.Constants)||void 0===s?void 0:s.VIEWER_ID]="undefined"===t()?"NULL":t(),v["c3.cm.categoryType"]=Ue(e),v["m3.net.t"]=function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(!e)return"Unknown";if(e.type)switch(e.type){case"wifi":return"WiFi";case"ethernet":return"Ethernet";default:return e.type}switch(e.effectiveType){case"slow-2g":case"2g":return"2G";case"3g":return"3G";case"4g":return e.downlink>=20?"WiFi":"4G";default:return"Unknown"}}(),v.DRMEnabled=(null===(u=e[p])||void 0===u?void 0:u.drmEnabled)||"None",v.DAIStream=null!==(c=e[p])&&void 0!==c&&null!==(d=c.gist)&&void 0!==d&&d.isSSAIEnabled?"YES":"NO",v[o.Constants.DEFAULT_RESOURCE]="AKAMAI",v["c3.cm.brand"]="NULL",v.CDVREnabled=Fe(e),v["c3.cm.genreList"]=Me(e),v["c3.cm.genre"]=He(e),v["c3.cm.channel"]=Be(e);var f=Ke(i(),e);return v=Ae(Ae({},v),f)},He=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"},Me=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"},Be=function(e){var n,t,o=(null==e?void 0:e.contentType)||"video";return"video"===o?"VOD":(null==e||null===(n=e[o])||void 0===n||null===(t=n.channels[0])||void 0===t?void 0:t.title)||"NULL"},Ue=function(e){return(null==e?void 0:e.contentType)||"null"},Fe=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"},ze=function(e,n){var t,o,i=(n||{}).epg;if(i&&null!=i&&i.enable&&null!=i&&i.programTitle)return i.programTitle;var r=(null==e?void 0:e.contentType)||"video",l=(null==e||null===(t=e[r])||void 0===t||null===(o=t.gist)||void 0===o?void 0:o.title)||"Null";return"".concat(l)},Ge=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var Ke=function(e,n){var t,i,l,a,s,u={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!e||!n||null!=n&&n.linearchannel)return u;var c=r(),d=o();return u["c3.cm.seriesName"]=(null==n||null===(t=n.video)||void 0===t||null===(i=t.series)||void 0===i?void 0:i.title)||"Null",u["c3.cm.seasonNumber"]=(null==c?void 0:c.toString())||"Null",u["c3.cm.showTitle"]=(null==e||null===(l=e[c-1])||void 0===l||null===(a=l.episodes)||void 0===a||null===(s=a[d-1])||void 0===s?void 0:s.title)||"Null",u["c3.cm.episodeNumber"]=(null==d?void 0:d.toString())||"Null",u},qe=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"}},Je=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},We=function(){var e=U(F.mark((function e(t,o){var i,r,l,a,s,u,c,d,v,p;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==o?void 0:o.convivaConfig)||{},r=i.trackConvivaPlayerEvent,l=i.paymentHandler,a=i.tveProvider,s=i.enable,u=i.appName,c=(o||{}).token,s){e.next=4;break}return e.abrupt("return");case 4:if(d=ne(t),"function"==typeof(v=r)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,v("getConvivaObject");case 10:if(p=e.sent){e.next=13;break}return e.abrupt("return");case 13:d.ready((function(){var e=d.tech(!0),n=!1;e.on("keysessioncreated",(function(e){n=!0;var t=e.target;if(t&&t.keySystem){var o=qe(t.keySystem);v("contentInfo",{DRMEnabled:o})}else v("contentInfo",{DRMEnabled:"None"})})),n||v("contentInfo",{DRMEnabled:"None"})})),d.on("loadstart",(function(){var e,t;_e&&_e!==d.currentSrc()&&v("playbackEnded"),v("setPlayer",d),Le.clear(),_e=d.currentSrc();var i=Je(d.currentType()),r=n(),s=Ve(r,d,p);s[null==p||null===(e=p.Constants)||void 0===e?void 0:e.PLAYER_NAME]=u||"WEB",s[null==p||null===(t=p.Constants)||void 0===t?void 0:t.ASSET_NAME]=ze(r,o),s.authToken=c||"NULL",s.streamType=i,s.D2CType=l||"NONE",s.subscriberType=a||(l?"D2C":"FREE"),s["c3.cm.affiliate"]=a||"NULL",v("contentInfo",s)})),d.on("loadedmetadata",(function(){var e,n=d.videoHeight();e=n>=2160?"4K":n>=1440?"1440p":n>=1080?"1080p":n>=720?"720p":n>=480?"480p":"".concat(n,"p"),v("contentInfo",{screenResolution:e})})),d.on("play",(function(){Le.has(d.currentSrc())||(Le.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){Le.has(d.currentSrc())&&Le.delete(d.currentSrc()),v("playbackEnded")})),d.on("ads-loader",(function(e){e&&null!=e&&e.adsLoader&&v("initAdSensor",{player:d,adsLoader:null==e?void 0:e.adsLoader})})),d.on("dispose",(function(){null==Le||Le.clear(),v("playbackEnded")}));case 20:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Ye=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-47c2c547.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-b3918671.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-e2a48f27.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-69595ceb.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-f7b309f6.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-f686b20e.js").then((function(t){t.initialiseSkin(e,n)}))},Xe=!1,Qe=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)&&!Xe){var r=Ze(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),Xe=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Ze(e,n,t){if(Array.isArray(e))return e.map((function(e){return Ze(e,n,t)}));if(null!==e&&"object"===le(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]=Ze(e[i],n,t)})),o}return e}function $e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function en(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$e(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var nn=function(e,t,o,i){var r,l,a,v,p=i.res,f=i.sres,m=ne(e),y=(null==p?void 0:p.contentType)||"video",h=(null==p||null===(r=p[y])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1,g=(null==p||null===(a=p[y])||void 0===a||null===(v=a.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1;s(p),m&&(m.on("loadstart",(function(){h?o.resolve({status:!0,msg:"Video Loaded",response:p}):o.resolve(en({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))})),m.on("loadeddata",(function(){var o,i,r,l=Y(e);if(null==l||l.map((function(n){return X(e,n.id)})),g&&"Safari"===ie())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())&&ce(e,sessionStorage.getItem("volume")||"100");var s=n();if(u(),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,d,v=en(en({},t),p);!function(e,n,t){var o,i,r;null!=n&&n.series&&null!=n&&null!==(o=n.series)&&void 0!==o&&o.enable&&(ye=null==n||null===(i=n.series)||void 0===i?void 0:i.id),fe=[],me=0,ae=t;var l=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.interval)||30,a=ne(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());fe.includes(me)||(e==me?(fe.push(e),he(a,n,l)):e>me&&(me=e+l))})),a.one("ended",(function(){he(a,n,l,!0)})))}(e,v,null==s||null===(c=s.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.id)}if(null!=t&&null!==(r=t.analytics)&&void 0!==r&&r.muxKey&&null!=m&&m.mux){var f,y,h,b,w,k,O=(null===(f=n())||void 0===f?void 0:f.video)||(null==p?void 0:p.video),j=null==O?void 0:O.gist,S={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==j?void 0:j.id,video_title:null==j?void 0:j.title,video_series:null==O||null===(b=O.series)||void 0===b?void 0:b.title,video_stream_type:null!=O&&null!==(w=O.streamingInfo)&&void 0!==w&&w.isLiveStream?"live":"video",viewer_user_id:null==t||null===(k=t.analytics)||void 0===k?void 0:k.userId};m.mux({debug:!1,data:S})}})),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,r,l,a,s,u,c,d,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(c=u.CastContext)||void 0===c||null===(d=c.getInstance())||void 0===d?void 0:d.getCurrentSession();if(v&&"CONNECTED"===p){var m,y=f.getMediaSession(),h=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){h&&Qe(p,e)})),m.on("error",(function(){var n,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?Qe(p,e):(c(e,(null==m||null===(n=m.error())||void 0===n?void 0:n.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;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,i,r,l=null===(o=n())||void 0===o||null===(i=o.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=d(),s=(null==a?void 0:a.get(l))||{t:0,p:0},u=s.t,c=s.p;u&&c<95&&setTimeout((function(){m.currentTime(u)}),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])}})))};function tn(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 on(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tn(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var rn,ln=function(e,n,t,o){var i,r,s,u,d,y,h,g,b,w,k,O,j,S,T,I,P,D,x,E,C,R,N,A,L,_,V,H,M,G,K,q,J=n.res,W=void 0===J?null:J,Y=n.sres,X=void 0===Y?null:Y,Z=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],$=(null===(i=W)||void 0===i?void 0:i.contentType)||"video",ee=te(null===(r=W)||void 0===r||null===(s=r[$])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||te(null===(d=W)||void 0===d||null===(y=d[$])||void 0===y||null===(h=y.gist)||void 0===h||null===(g=h.imageGist)||void 0===g?void 0:g.r16x9),ne=(null===(b=W)||void 0===b||null===(w=b[$])||void 0===w||null===(k=w.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,oe=(null===(O=W)||void 0===O||null===(j=O[$])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,re=(null===(T=W)||void 0===T||null===(I=T.ads)||void 0===I||null===(P=I.preRoll)||void 0===P||null===(D=P.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(E=W)||void 0===E||null===(C=E.ads)||void 0===C||null===(R=C.preRoll)||void 0===R||null===(N=R.adTags)||void 0===N||null===(A=N.web)||void 0===A?void 0:A.url),le=(null===(L=W=on(on({},W),{},{audioAssetSource:null==t?void 0:t.audioAssetSource}))||void 0===L||null===(_=L.video)||void 0===_?void 0:_.isSSAIEnabled)||!1;"Chrome"==ie()&&(le||null===(V=["dirtvision"])||void 0===V||V.includes(null===(H=W)||void 0===H?void 0:H.siteName));var ae=(q={enableSmoothSeeking:!0,controls:0!=(null==t?void 0:t.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==t?void 0:t.muted)||!1,autoplay:(null==t?void 0:t.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==t.skin,liveui:ne},B(q,"autoplay",null==t?void 0:t.autoplay),B(q,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!re),B(q,"loop",(null==t?void 0:t.loop)||!1),B(q,"audioPosterMode",null==t?void 0:t.audioPosterMode),B(q,"html5",on(on({dash:on(on({},!z.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:20},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{useDefaultABRRules:!0,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},autoSwitchBitrate:{video:!0,audio:!0}}}}}),vhs:on(on({liveRangeSafeTimeDelta:10,useDevicePixelRatio:!0,experimentalLLHLS:(null==t?void 0:t.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==t||null===(M=t.customData)||void 0===M?void 0:M.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),nativeTextTracks:!1},0==(null==t||null===(G=t.customData)||void 0===G?void 0:G.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(K=t.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),B(q,"poster",ee),B(q,"techOrder",Z),B(q,"chromecast",{requestCustomDataFn:function(n){var t=getPlayer(e),o=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,r,l,a,s,u,c,d,v,p=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){var m;f.isDrmEnabled=!0;var y=(null==n||null===(m=n.keySystems)||void 0===m?void 0:m["com.widevine.alpha"])||null,h=null==y?void 0:y.url;f.licenseUrl=h;var g=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=g}var b=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=b;var w=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=w;var k=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=k;var O=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=O,f.subTitles=t,f.DVR=(null==e||null===(d=e[p])||void 0===d||null===(v=d.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(W,n,o)}}),q);if(!z.getPlayers()[e])var se=z(e,ae,function(){var n=U(F.mark((function n(){var i,r,s,u,d,y,h,g,b,w,k,O,j,S,T,I,P,D,x,E;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(se),console.log(z.VERSION),console.log(z.getPlugins()),n.next=5,Ce(t,W);case 5:O=null===(i=W)||void 0===i||null===(r=i[$])||void 0===r||null===(s=r.liveDetails)||void 0===s?void 0:s.startOverTime,oe&&o.resolve(on({status:!0,msg:"Player Initialised"},X?{seriesResponse:X,response:W}:{response:W})),v(e,null==t?void 0:t.analyticsCb),We(e,t),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),ne&&Oe(e,O),!re||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||p(e,re,W),j=l(W,e),console.log(j),null!=t&&t.nearestClusterUrl&&(j=f(j,t.nearestClusterUrl)),j?a(e,j):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:W}),c(e,"Incompatible / Missing Source")),((null===(d=W)||void 0===d||null===(y=d[$])||void 0===y||null===(h=y.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(b=W)||void 0===b||null===(w=b[$])||void 0===w||null===(k=w.closedCaptions)||void 0===k?void 0:k.length)>0)&&(E=(null===(T=W)||void 0===T||null===(I=T[$])||void 0===I||null===(P=I.contentDetails)||void 0===P?void 0:P.closedCaptions)||(null===(D=W)||void 0===D||null===(x=D[$])||void 0===x?void 0:x.closedCaptions),S=E.filter((function(e){return"VTT"===e.format})),Q(e,S)),null!=t&&t.disableControls?m(e):Ye(e,on(on(on({},t),ae),{},{liveVideo:oe,isDvrEnabled:ne,res:W,sres:X})),nn(e,on(on(on({},t),ae),{},{liveVideo:oe}),o,{res:W,sres:X});case 19:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function an(e,n){return sn.apply(this,arguments)}function sn(){return(sn=U(F.mark((function e(n,t){var o,i,r,l,a,u;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,r=null==n?void 0:n.videoId,l=null==n?void 0:n.playerId,a=!(null==n||!n.anonymousId),e.next=6,b();case 6:u=e.sent,y(r,u).then((function(e){var t,c,d,v;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(c=t.video)||void 0===c||null===(d=c.gist)||void 0===d?void 0:d.contentType,s(null==e?void 0:e.data);var p,f=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(v=n.watchHistory)&&void 0!==v&&v.enable&&!a)if((null===(p=n.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,b=we((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(b&&b.length)n.watchHistoryResumeTime=(null===(y=b[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=b[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",ln(l,{res:f},n,{resolve:o,reject:i})}else h(r,u).then((function(e){var t,o,i,r,l,a;null!==(t=window)&&void 0!==t&&null!==(o=t.watchHistory)&&void 0!==o&&o.cb&&(null===(i=window)||void 0===i||null===(r=i.watchHistory)||void 0===r||r.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(l=e.data)||void 0===l?void 0:l.watchedTime)||null,n.watchedPercentage=(null==e||null===(a=e.data)||void 0===a?void 0:a.watchedPercentage)||null,f.contentType="video"})).catch((function(e){var n,t,o,i;null!==(n=window)&&void 0!==n&&null!==(t=n.watchHistory)&&void 0!==t&&t.cb&&(null===(o=window)||void 0===o||null===(i=o.watchHistory)||void 0===i||i.cb(e))})).finally((function(){ln(l,{res:f},n,{resolve:o,reject:i})}));else ln(l,{res:f},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,r)}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function un(e,n){return cn.apply(this,arguments)}function cn(){return(cn=U(F.mark((function e(n,t){var o,i,r,l,a;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.resolve,i=t.reject,e.next=3,b();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,w(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,ln(l,{res:t},n,{resolve:o,reject:i})})).catch((function(e){g(e,l,i,videoId)}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dn(e,n){return vn.apply(this,arguments)}function vn(){return(vn=U(F.mark((function e(n,t){var o,i,r,l,a,u,c;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.resolve,r=t.reject,e.next=3,b();case 3:l=e.sent,a=null==n?void 0:n.playerId,u=sessionStorage.getItem("season-idx")||0,j.set(parseInt(u)),c=null==n||null===(o=n.series)||void 0===o?void 0:o.id,k(c,l).then((function(e){var t,o,u,d=e.data,v=e.data.seasons;S(v);var p=videoId||(null==v||null===(t=v[0])||void 0===t||null===(o=t.episodes)||void 0===o||null===(u=o[0])||void 0===u?void 0:u.id);O(c,l),y(p,l).then((function(e){var t,o,l;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(o=t.video)||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.contentType,s(e.data),ln(a,{res:null==e?void 0:e.data,sres:d},n,{resolve:i,reject:r})})).catch((function(e){g(e,a,r,videoId)}))})).catch((function(e){g(e,a,r)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pn(Object(t),!0).forEach((function(n){B(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function mn(){return{loadVideoInstantly:T,onTimeUpdate:G,getVideoDuration:K,onVideoEnded:q,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=U(F.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,h,b,w,k,O,j,S,T,I,P;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!E(null==e?void 0:e.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(f=(null==e?void 0:e.videoSourceUrl)||!1,m=null==e?void 0:e.asat,h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,w=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=b,k=null==e?void 0:e.token,!_(e)){n.next=16;break}if(sessionStorage.setItem("vlp_token",k),V().set(null==e?void 0:e.refreshToken),k&&!H(k)){n.next=15;break}return o({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}}),n.abrupt("return");case 15:rn=JSON.parse(atob(k.split(".")[1]));case 16:return e.isAnonymousUser=!(null===(l=rn)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=rn)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=rn)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=rn)||void 0===u?void 0:u.userId),window.watchHistory=e.watchHistory||null,O=null==e?void 0:e.playerId,e.chromecastReceiverId=null!=e&&null!==(c=e.series)&&void 0!==c&&c.enable?null:null==e?void 0:e.chromecastReceiverId,j=(null==e||null===(d=e.analytics)||void 0===d?void 0:d.gaId)||null,(S=null==e?void 0:e.errors)&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,re(null==e||null===(v=e.customData)||void 0===v?void 0:v.localisation),L.set(e.apiBaseUrl),null!=e&&e.skin&&!oe(e.skin)||(e.skin="VL_ONE"),n.next=32,xe(e);case 32:j&&se("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return M(j)})).catch((function(e){})),(T=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(O)))&&T.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f?(P={directPlaybackUrl:f,id:I="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?y(I,k).then((function(n){var i=(null==n?void 0:n.data)||{};ln(O,{res:fn(fn({},i),P)},e,{resolve:t,reject:o})})).catch((function(e){g(e,O,o,I)})):ln(O,{res:P},e,{resolve:t,reject:o})):w?dn(e,{resolve:t,reject:o}):h?un(e,{resolve:t,reject:o}):an(e,{resolve:t,reject:o});case 36:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:$,skip:I,getPlayer:ne,play:P,pause:D,detectBrowser:ie,rewind:x,loadVideo:a,seekToTimeStamp:J,isPlayerInitialised:E,load:C,authenticateLC:R,dispose:N,enableCaptions:Z,disableCaptions:X,getCaptions:Y,playSelectedResolution:ee,getSource:l,setVolume:ce,getVolume:de,disableControls:m,setPlaybackSpeed:W,getEntitlementData:A}}export{mn as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,o as n,p as t,q as o}from"./features-bf71fd6e.js";import{g as r,t as a,p as i}from"./skin-b8df984d.js";import{a as l,i as s,b as d}from"./index-00f19cbd.js";import{i as u}from"./browser-d4613b36.js";import"videojs-contrib-quality-menu";import c from"video.js";import{k as p,i as v}from"./keyboardShortcuts-5d743be0.js";import{l as m,R as f,e as y}from"./generic-35152f51.js";import b from"@babel/runtime/helpers/toConsumableArray";import h from"@babel/runtime/helpers/slicedToArray";import g from"@babel/runtime/helpers/defineProperty";import S from"@babel/runtime/helpers/asyncToGenerator";import j from"@babel/runtime/regenerator";import{I as k}from"./icons-3bd3bd8f.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./renditions-aa307468.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-b3f361d9.js";import"./util-1c8c0f16.js";import"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-135a6d13.js";function w(n,t){var o=r(n);o&&(o.on("loadeddata",(function(){var e,o,a,i,d;!function(e){var n=r(e);n&&(null==n||n.qualityMenu,n.qualityMenu({useResolutionLabels:!0}))}(n),!(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable||null!==(o=window)&&void 0!==o&&null!==(a=o.app_data)&&void 0!==a&&null!==(i=a.appcmsMain)&&void 0!==i&&null!==(d=i.features)&&void 0!==d&&d.auto_play)||null!=t&&t.liveVideo||l(n,t),null!=t&&t.liveVideo||u()||s(n)})),o.one("play",(function(){var t,o,r,a;null!==(t=window)&&void 0!==t&&null!==(o=t.customData)&&void 0!==o&&o.iframeOverlayUrl&&e(n,null===(r=window)||void 0===r||null===(a=r.customData)||void 0===a?void 0:a.iframeOverlayUrl)})))}function I(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 O(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)?O(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(l)throw a}}}}function O(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 T(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 C(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?T(Object(t),!0).forEach((function(n){g(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):T(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function x(){return x=S(j.mark((function e(n,t){var o,l,s,d,u,c,v,y,g,w,O,T,x,E,M,A,P,N,U;return j.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return U=function(e,t,o){var a=r(n);Math.floor(a.currentTime());var i,l,s,d,u,c,p,v,m,f,y,b,h,g,S=I(t);try{for(S.s();!(i=S.n()).done;)l=void 0,s=void 0,d=void 0,u=void 0,c=void 0,p=void 0,v=void 0,m=void 0,f=void 0,y=void 0,b=void 0,h=void 0,g=void 0,c=i.value,p=c.eventType,v=c.beaconUrls,m=c.startTimeInSeconds,f=c.startTime,y=c.durationInSeconds,b=Math.round(m),h=v[0],g=(null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s||null===(d=s.ads)||void 0===d?void 0:d.adEventHandler)||null,b!=Math.round(a.currentTime())||N.has(f)||(N.set(f,!0),"function"==typeof g&&g({adsData:{eventType:p,startTimeInSeconds:m,startTime:f,durationInSeconds:y,ad:null==e||null===(u=e.ads)||void 0===u?void 0:u[o],adIndex:o}}),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",p,"Fired:".concat(Math.round(a.currentTime())),"AD_POD:",e),fetch(h))}catch(e){S.e(e)}finally{S.f()}},P=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},M=function(e){var n={},t=e.split("?")[1];if(!t)return n;var o,r=I(t.split("&"));try{for(r.s();!(o=r.n()).done;){var a=o.value.split("="),i=h(a,2),l=i[0],s=i[1];n[decodeURIComponent(l)]=decodeURIComponent(s||"")}}catch(e){r.e(e)}finally{r.f()}for(var d={},u=0,c=Object.entries(n);u<c.length;u++){var p=h(c[u],2),v=p[0],m=p[1];if(v.startsWith("ads."))d[v.replace(/^ads\./,"")]=m;else d[v]=m}return d},o=r(n),l=t.replace("dash","session").replace("master","session"),l=f(l,n,{}),s=M(l),l=l.split("?")[0],e.next=10,fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:C({},s)})});case 10:return d=e.sent,e.next=13,d.json();case 13:u=e.sent,c="https://"+new URL(l).hostname,v=u.trackingUrl,y=u.manifestUrl,g=c+v,w=c+y,console.log("%c TRACKING URL","background: #bdf369; color: #000",g),null!=t&&t.includes(".mpd")?(T=(null==o||null===(O=o.currentSource())||void 0===O?void 0:O.keySystemOptions)||null,m(n,{src:w,type:"application/x-mpegURL",keySystemOptions:T})):(E=(null==o||null===(x=o.currentSource())||void 0===x?void 0:x.keySystems)||null,m(n,{src:w,type:"application/x-mpegURL",keySystems:E})),o.one("loadeddata",(function(){A(g)})),A=function(){var e=S(j.mark((function e(t){var o,l,s,d,u,c,v,m,f,y,h,g,S,w,I,O,T;return j.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return l=e.sent,e.next=5,l.json();case 5:s=e.sent,d=s.avails,u=[],c=r(n),v=c.controlBar.progressControl,m=v.seekBar.el(),d.map((function(e){var n;Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(n=e.ads)||void 0===n?void 0:n.length)>0&&u.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds)})})),u.forEach((function(e){var n=e.markerPositionInSeconds,t=c.duration();if(!(n>t)){var o=n/t*100,r=document.createElement("div");r.className="vjs-seekbar-marker",r.style.left="".concat(o,"%"),r.style.position="absolute",r.style.top="0",r.style.bottom="0",r.style.width="2px",r.style.backgroundColor="#fecc09",r.style.left="".concat(o,"%"),r.style.pointerEvents="none",m.appendChild(r)}})),f=new Map,y=-1,c.on("timeupdate",a((function(){var e=Math.floor(c.currentTime());if(e!==y){y=e;for(var n=!1,t=function(){var t=r[o],a=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,s=Math.floor(a+i);if(e>=a&&e<=s){n=!0,f.set(a,!0),p.disable(),v.el().style.visibility="hidden";for(var d=e-a,u=0,c=0,m=0;m<l.length;m++){var y,g=null==l||null===(y=l[m])||void 0===y?void 0:y.durationInSeconds;if(d<u+g){c=m;break}u+=g}var S=l[c],j=d-u,k=Math.max(0,S.durationInSeconds-j),w=Math.round(k);h.style.display="block",O.textContent="".concat(c+1," of ").concat(l.length," • ").concat(P(w));var I=[];return l.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression"].includes(e.eventType)}));I.push.apply(I,b(n))})),U(t,I,c),"break"}},o=0,r=u;o<r.length;o++){if("break"===t())break}n||(h.style.display="none",v.el().style.visibility="visible",p.enable())}}),1e3)),c.on("seeked",(function(){for(var e=null,n=0,t=u;n<t.length;n++){var o=t[n],r=null==c?void 0:c.currentTime(),a=o.startTimeInSeconds,i=o.durationInSeconds;r>Math.floor(a+i)&&!f.has(a)&&(e=a,f.set(a,!0))}e&&(c.currentTime(e),console.log("seeking back to",e),e=null)})),(h=document.createElement("div")).className="ssai-ad-container",(g=document.createElement("div")).className="sponsored-adbox",(S=document.createElement("div")).className="sponsored-text",S.textContent="Sponsored Ad",(w=document.createElement("div")).className="ad-info-icon",I=i(k()),w.appendChild(I),g.append(S),g.append(w),(O=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",(T=document.createElement("div")).className="ad-visit-advertiser",T.textContent="Visit Advertiser",(null===(o=document.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])&&(T.style.right="8.6rem"),h.append(g),h.append(O),h.append(T),c.el().appendChild(h);case 43:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),N=new Map;case 24:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}function E(e,a){r(e).addClass("skin_vlone"),w(e,a),function(e,r){var a,i,l,s,u,c,p=null==r||null===(a=r.res)||void 0===a||null===(i=a.video)||void 0===i?void 0:i.isSSAIEnabled,m=y(null==r?void 0:r.res,e),f=m.src;(null==r||null===(l=r.relatedVideos)||void 0===l||null===(s=l.content)||void 0===s?void 0:s.length)>0&&n(e,null==r?void 0:r.relatedVideos);null!=r&&null!==(u=r.series)&&void 0!==u&&u.enable&&t(e,r);(null==r||null===(c=r.streams)||void 0===c?void 0:c.length)>1&&o(e,null==r?void 0:r.streams);d(e,r),v(e,r),p&&function(e,n){x.apply(this,arguments)}(e,f)}(e,a),M()}var M=function(){var e,n,t,o,r,a,i,l,s,d,u,p,v=c.dom.$(".vjs-play-progress"),m=c.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");m&&(m.style.color="".concat(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(t=n.appcmsMain)||void 0===t||null===(o=t.brand)||void 0===o||null===(r=o.cta)||void 0===r||null===(a=r.primary)||void 0===a?void 0:a.backgroundColor)),v&&(v.style.background="".concat(null===(i=window)||void 0===i||null===(l=i.app_data)||void 0===l||null===(s=l.appcmsMain)||void 0===s||null===(d=s.brand)||void 0===d||null===(u=d.cta)||void 0===u||null===(p=u.primary)||void 0===p?void 0:p.backgroundColor))};export{E as initialiseSkin};
|
package/package.json
CHANGED
package/cjs/skin-5a8c6dbd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./features-66e55751.js"),n=require("./skin-34fbc337.js"),r=require("./index-9e780f27.js"),t=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var o=require("video.js"),i=require("./keyboardShortcuts-0d0c3ff1.js"),a=require("./generic-68f01105.js"),l=require("@babel/runtime/helpers/toConsumableArray"),s=require("@babel/runtime/helpers/slicedToArray"),d=require("@babel/runtime/helpers/defineProperty"),u=require("@babel/runtime/helpers/asyncToGenerator"),c=require("@babel/runtime/regenerator"),v=require("./icons-1a3febef.js");require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./renditions-b41243b6.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-1a70d67c.js"),require("./util-6edeeb8a.js"),require("@babel/runtime/helpers/typeof"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./captions-fbd6fefb.js");function p(o,i){var a=n.getPlayer(o);a&&(a.on("loadeddata",(function(){var e,a,l,s,d;!function(e){var r=n.getPlayer(e);r&&(null==r||r.qualityMenu({useResolutionLabels:!0}))}(o),!(null!=i&&null!==(e=i.series)&&void 0!==e&&e.enable||null!==(a=window)&&void 0!==a&&null!==(l=a.app_data)&&void 0!==l&&null!==(s=l.appcmsMain)&&void 0!==s&&null!==(d=s.features)&&void 0!==d&&d.auto_play)||null!=i&&i.liveVideo||r.addNextEpPreview(o,i),null!=i&&i.liveVideo||t.isMobile()||r.initiateTrickplay(o)})),a.one("play",(function(){var n,r,t,i;null!==(n=window)&&void 0!==n&&null!==(r=n.customData)&&void 0!==r&&r.iframeOverlayUrl&&e.addOutputtingOverlay(o,null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i?void 0:i.iframeOverlayUrl)})))}function f(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return m(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw i}}}}function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function y(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function b(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?y(Object(r),!0).forEach((function(n){d(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function h(){return h=u(c.mark((function e(r,t){var o,d,p,m,y,h,g,S,k,j,w,q,I,O,T,M,P,C,x;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e,t,o){var i=n.getPlayer(r);Math.floor(i.currentTime());var a,l,s,d,u,c,v,p,m,y,b,h,g,S,k=f(t);try{for(k.s();!(a=k.n()).done;)l=void 0,s=void 0,d=void 0,u=void 0,c=void 0,v=void 0,p=void 0,m=void 0,y=void 0,b=void 0,h=void 0,g=void 0,S=void 0,c=a.value,v=c.eventType,p=c.beaconUrls,m=c.startTimeInSeconds,y=c.startTime,b=c.durationInSeconds,h=Math.round(m),g=p[0],S=(null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s||null===(d=s.ads)||void 0===d?void 0:d.adEventHandler)||null,h!=Math.round(i.currentTime())||C.has(y)||(C.set(y,!0),S({adsData:{eventType:v,startTimeInSeconds:m,startTime:y,durationInSeconds:b,ad:null==e||null===(u=e.ads)||void 0===u?void 0:u[o],adIndex:o}}),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",v,"Fired:".concat(Math.round(i.currentTime())),"AD_POD:",e),fetch(g))}catch(e){k.e(e)}finally{k.f()}},P=function(e){var n=Math.floor(e/60),r=Math.floor(e%60);return"".concat(n,":").concat(r.toString().padStart(2,"0"))},T=function(e){var n={},r=e.split("?")[1];if(!r)return n;var t,o=f(r.split("&"));try{for(o.s();!(t=o.n()).done;){var i=t.value.split("="),a=s(i,2),l=a[0],d=a[1];n[decodeURIComponent(l)]=decodeURIComponent(d||"")}}catch(e){o.e(e)}finally{o.f()}for(var u={},c=0,v=Object.entries(n);c<v.length;c++){var p=s(v[c],2),m=p[0],y=p[1];if(m.startsWith("ads."))u[m.replace(/^ads\./,"")]=y;else u[m]=y}return u},o=n.getPlayer(r),d=t.replace("dash","session").replace("master","session"),d=a.replaceMacros(d,r,{}),p=T(d),d=d.split("?")[0],e.next=10,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:b({},p)})});case 10:return m=e.sent,e.next=13,m.json();case 13:y=e.sent,h="https://"+new URL(d).hostname,g=y.trackingUrl,S=y.manifestUrl,k=h+g,j=h+S,console.log("%c TRACKING URL","background: #bdf369; color: #000",k),null!=t&&t.includes(".mpd")?(q=(null==o||null===(w=o.currentSource())||void 0===w?void 0:w.keySystemOptions)||null,a.loadVideo(r,{src:j,type:"application/x-mpegURL",keySystemOptions:q})):(O=(null==o||null===(I=o.currentSource())||void 0===I?void 0:I.keySystems)||null,a.loadVideo(r,{src:j,type:"application/x-mpegURL",keySystems:O})),o.one("loadeddata",(function(){M(k)})),M=function(){var e=u(c.mark((function e(t){var o,a,s,d,u,p,f,m,y,b,h,g,S,k,j,w,q;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return a=e.sent,e.next=5,a.json();case 5:s=e.sent,d=s.avails,u=[],p=n.getPlayer(r),f=p.controlBar.progressControl,m=f.seekBar.el(),d.map((function(e){var n;Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(n=e.ads)||void 0===n?void 0:n.length)>0&&u.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds)})})),u.forEach((function(e){var n=e.markerPositionInSeconds,r=p.duration();if(!(n>r)){var t=n/r*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(t,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(t,"%"),o.style.pointerEvents="none",m.appendChild(o)}})),y=new Map,b=-1,p.on("timeupdate",n.throttle((function(){var e=Math.floor(p.currentTime());if(e!==b){b=e;for(var n=!1,r=function(){var r=o[t],a=r.startTimeInSeconds,s=r.durationInSeconds,d=r.ads,u=Math.floor(a+s);if(e>=a&&e<=u){n=!0,y.set(a,!0),i.keyboardManager.disable(),f.el().style.visibility="hidden";for(var c=e-a,v=0,p=0,m=0;m<d.length;m++){var b,g=null==d||null===(b=d[m])||void 0===b?void 0:b.durationInSeconds;if(c<v+g){p=m;break}v+=g}var S=d[p],k=c-v,j=Math.max(0,S.durationInSeconds-k),q=Math.round(j);h.style.display="block",w.textContent="".concat(p+1," of ").concat(d.length," • ").concat(P(q));var I=[];return d.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression"].includes(e.eventType)}));I.push.apply(I,l(n))})),x(r,I,p),"break"}},t=0,o=u;t<o.length;t++){if("break"===r())break}n||(h.style.display="none",f.el().style.visibility="visible",i.keyboardManager.enable())}}),1e3)),p.on("seeked",(function(){for(var e=null,n=0,r=u;n<r.length;n++){var t=r[n],o=null==p?void 0:p.currentTime(),i=t.startTimeInSeconds,a=t.durationInSeconds;o>Math.floor(i+a)&&!y.has(i)&&(e=i,y.set(i,!0))}e&&(p.currentTime(e),console.log("seeking back to",e),e=null)})),(h=document.createElement("div")).className="ssai-ad-container",(g=document.createElement("div")).className="sponsored-adbox",(S=document.createElement("div")).className="sponsored-text",S.textContent="Sponsored Ad",(k=document.createElement("div")).className="ad-info-icon",j=n.parseSvgString(v.InfoIcon()),k.appendChild(j),g.append(S),g.append(k),(w=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",(q=document.createElement("div")).className="ad-visit-advertiser",q.textContent="Visit Advertiser",(null===(o=document.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])&&(q.style.right="8.6rem"),h.append(g),h.append(w),h.append(q),p.el().appendChild(h);case 43:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),C=new Map;case 24:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}var g=function(){var e,n,r,t,i,a,l,s,d,u,c,v,p=o.dom.$(".vjs-play-progress"),f=o.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");f&&(f.style.color="".concat(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(r=n.appcmsMain)||void 0===r||null===(t=r.brand)||void 0===t||null===(i=t.cta)||void 0===i||null===(a=i.primary)||void 0===a?void 0:a.backgroundColor)),p&&(p.style.background="".concat(null===(l=window)||void 0===l||null===(s=l.app_data)||void 0===s||null===(d=s.appcmsMain)||void 0===d||null===(u=d.brand)||void 0===u||null===(c=u.cta)||void 0===c||null===(v=c.primary)||void 0===v?void 0:v.backgroundColor))};exports.initialiseSkin=function(t,o){n.getPlayer(t).addClass("skin_vlone"),p(t,o),function(n,t){var o,l,s,d,u,c,v=null==t||null===(o=t.res)||void 0===o||null===(l=o.video)||void 0===l?void 0:l.isSSAIEnabled,p=a.getSource(null==t?void 0:t.res,n),f=p.src;(null==t||null===(s=t.relatedVideos)||void 0===s||null===(d=s.content)||void 0===d?void 0:d.length)>0&&e.addVideoSelector(n,null==t?void 0:t.relatedVideos);null!=t&&null!==(u=t.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(n,t);(null==t||null===(c=t.streams)||void 0===c?void 0:c.length)>1&&e.addMulticamSelector(n,null==t?void 0:t.streams);r.addTVProviderImage(n,t),i.initialiseKeyboardEvents(n,t),v&&function(e,n){h.apply(this,arguments)}(n,f)}(t,o),g()};
|
package/esm/skin-d380d535.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,o as n,p as t,q as r}from"./features-bf71fd6e.js";import{g as o,t as a,p as i}from"./skin-b8df984d.js";import{a as l,i as s,b as d}from"./index-00f19cbd.js";import{i as u}from"./browser-d4613b36.js";import"videojs-contrib-quality-menu";import c from"video.js";import{k as p,i as v}from"./keyboardShortcuts-5d743be0.js";import{l as m,R as f,e as y}from"./generic-35152f51.js";import b from"@babel/runtime/helpers/toConsumableArray";import h from"@babel/runtime/helpers/slicedToArray";import g from"@babel/runtime/helpers/defineProperty";import S from"@babel/runtime/helpers/asyncToGenerator";import j from"@babel/runtime/regenerator";import{I as k}from"./icons-3bd3bd8f.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./renditions-aa307468.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-b3f361d9.js";import"./util-1c8c0f16.js";import"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-135a6d13.js";function w(n,t){var r=o(n);r&&(r.on("loadeddata",(function(){var e,r,a,i,d;!function(e){var n=o(e);n&&(null==n||n.qualityMenu({useResolutionLabels:!0}))}(n),!(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable||null!==(r=window)&&void 0!==r&&null!==(a=r.app_data)&&void 0!==a&&null!==(i=a.appcmsMain)&&void 0!==i&&null!==(d=i.features)&&void 0!==d&&d.auto_play)||null!=t&&t.liveVideo||l(n,t),null!=t&&t.liveVideo||u()||s(n)})),r.one("play",(function(){var t,r,o,a;null!==(t=window)&&void 0!==t&&null!==(r=t.customData)&&void 0!==r&&r.iframeOverlayUrl&&e(n,null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.iframeOverlayUrl)})))}function I(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 O(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)?O(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 a,i=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(l)throw a}}}}function O(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function T(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function C(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?T(Object(t),!0).forEach((function(n){g(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):T(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function x(){return x=S(j.mark((function e(n,t){var r,l,s,d,u,c,v,y,g,w,O,T,x,E,M,A,P,N,U;return j.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return U=function(e,t,r){var a=o(n);Math.floor(a.currentTime());var i,l,s,d,u,c,p,v,m,f,y,b,h,g,S=I(t);try{for(S.s();!(i=S.n()).done;)l=void 0,s=void 0,d=void 0,u=void 0,c=void 0,p=void 0,v=void 0,m=void 0,f=void 0,y=void 0,b=void 0,h=void 0,g=void 0,c=i.value,p=c.eventType,v=c.beaconUrls,m=c.startTimeInSeconds,f=c.startTime,y=c.durationInSeconds,b=Math.round(m),h=v[0],g=(null===(l=window)||void 0===l||null===(s=l.customData)||void 0===s||null===(d=s.ads)||void 0===d?void 0:d.adEventHandler)||null,b!=Math.round(a.currentTime())||N.has(f)||(N.set(f,!0),g({adsData:{eventType:p,startTimeInSeconds:m,startTime:f,durationInSeconds:y,ad:null==e||null===(u=e.ads)||void 0===u?void 0:u[r],adIndex:r}}),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",p,"Fired:".concat(Math.round(a.currentTime())),"AD_POD:",e),fetch(h))}catch(e){S.e(e)}finally{S.f()}},P=function(e){var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},M=function(e){var n={},t=e.split("?")[1];if(!t)return n;var r,o=I(t.split("&"));try{for(o.s();!(r=o.n()).done;){var a=r.value.split("="),i=h(a,2),l=i[0],s=i[1];n[decodeURIComponent(l)]=decodeURIComponent(s||"")}}catch(e){o.e(e)}finally{o.f()}for(var d={},u=0,c=Object.entries(n);u<c.length;u++){var p=h(c[u],2),v=p[0],m=p[1];if(v.startsWith("ads."))d[v.replace(/^ads\./,"")]=m;else d[v]=m}return d},r=o(n),l=t.replace("dash","session").replace("master","session"),l=f(l,n,{}),s=M(l),l=l.split("?")[0],e.next=10,fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:C({},s)})});case 10:return d=e.sent,e.next=13,d.json();case 13:u=e.sent,c="https://"+new URL(l).hostname,v=u.trackingUrl,y=u.manifestUrl,g=c+v,w=c+y,console.log("%c TRACKING URL","background: #bdf369; color: #000",g),null!=t&&t.includes(".mpd")?(T=(null==r||null===(O=r.currentSource())||void 0===O?void 0:O.keySystemOptions)||null,m(n,{src:w,type:"application/x-mpegURL",keySystemOptions:T})):(E=(null==r||null===(x=r.currentSource())||void 0===x?void 0:x.keySystems)||null,m(n,{src:w,type:"application/x-mpegURL",keySystems:E})),r.one("loadeddata",(function(){A(g)})),A=function(){var e=S(j.mark((function e(t){var r,l,s,d,u,c,v,m,f,y,h,g,S,w,I,O,T;return j.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return l=e.sent,e.next=5,l.json();case 5:s=e.sent,d=s.avails,u=[],c=o(n),v=c.controlBar.progressControl,m=v.seekBar.el(),d.map((function(e){var n;Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(n=e.ads)||void 0===n?void 0:n.length)>0&&u.push({ads:null==e?void 0:e.ads,durationInSeconds:null==e?void 0:e.durationInSeconds,startTimeInSeconds:null==e?void 0:e.startTimeInSeconds,markerPositionInSeconds:Math.floor(null==e?void 0:e.startTimeInSeconds)})})),u.forEach((function(e){var n=e.markerPositionInSeconds,t=c.duration();if(!(n>t)){var r=n/t*100,o=document.createElement("div");o.className="vjs-seekbar-marker",o.style.left="".concat(r,"%"),o.style.position="absolute",o.style.top="0",o.style.bottom="0",o.style.width="2px",o.style.backgroundColor="#fecc09",o.style.left="".concat(r,"%"),o.style.pointerEvents="none",m.appendChild(o)}})),f=new Map,y=-1,c.on("timeupdate",a((function(){var e=Math.floor(c.currentTime());if(e!==y){y=e;for(var n=!1,t=function(){var t=o[r],a=t.startTimeInSeconds,i=t.durationInSeconds,l=t.ads,s=Math.floor(a+i);if(e>=a&&e<=s){n=!0,f.set(a,!0),p.disable(),v.el().style.visibility="hidden";for(var d=e-a,u=0,c=0,m=0;m<l.length;m++){var y,g=null==l||null===(y=l[m])||void 0===y?void 0:y.durationInSeconds;if(d<u+g){c=m;break}u+=g}var S=l[c],j=d-u,k=Math.max(0,S.durationInSeconds-j),w=Math.round(k);h.style.display="block",O.textContent="".concat(c+1," of ").concat(l.length," • ").concat(P(w));var I=[];return l.forEach((function(e){var n=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression"].includes(e.eventType)}));I.push.apply(I,b(n))})),U(t,I,c),"break"}},r=0,o=u;r<o.length;r++){if("break"===t())break}n||(h.style.display="none",v.el().style.visibility="visible",p.enable())}}),1e3)),c.on("seeked",(function(){for(var e=null,n=0,t=u;n<t.length;n++){var r=t[n],o=null==c?void 0:c.currentTime(),a=r.startTimeInSeconds,i=r.durationInSeconds;o>Math.floor(a+i)&&!f.has(a)&&(e=a,f.set(a,!0))}e&&(c.currentTime(e),console.log("seeking back to",e),e=null)})),(h=document.createElement("div")).className="ssai-ad-container",(g=document.createElement("div")).className="sponsored-adbox",(S=document.createElement("div")).className="sponsored-text",S.textContent="Sponsored Ad",(w=document.createElement("div")).className="ad-info-icon",I=i(k()),w.appendChild(I),g.append(S),g.append(w),(O=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",(T=document.createElement("div")).className="ad-visit-advertiser",T.textContent="Visit Advertiser",(null===(r=document.getElementsByClassName("tvProviderImage"))||void 0===r?void 0:r[0])&&(T.style.right="8.6rem"),h.append(g),h.append(O),h.append(T),c.el().appendChild(h);case 43:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),N=new Map;case 24:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}function E(e,a){o(e).addClass("skin_vlone"),w(e,a),function(e,o){var a,i,l,s,u,c,p=null==o||null===(a=o.res)||void 0===a||null===(i=a.video)||void 0===i?void 0:i.isSSAIEnabled,m=y(null==o?void 0:o.res,e),f=m.src;(null==o||null===(l=o.relatedVideos)||void 0===l||null===(s=l.content)||void 0===s?void 0:s.length)>0&&n(e,null==o?void 0:o.relatedVideos);null!=o&&null!==(u=o.series)&&void 0!==u&&u.enable&&t(e,o);(null==o||null===(c=o.streams)||void 0===c?void 0:c.length)>1&&r(e,null==o?void 0:o.streams);d(e,o),v(e,o),p&&function(e,n){x.apply(this,arguments)}(e,f)}(e,a),M()}var M=function(){var e,n,t,r,o,a,i,l,s,d,u,p,v=c.dom.$(".vjs-play-progress"),m=c.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");m&&(m.style.color="".concat(null===(e=window)||void 0===e||null===(n=e.app_data)||void 0===n||null===(t=n.appcmsMain)||void 0===t||null===(r=t.brand)||void 0===r||null===(o=r.cta)||void 0===o||null===(a=o.primary)||void 0===a?void 0:a.backgroundColor)),v&&(v.style.background="".concat(null===(i=window)||void 0===i||null===(l=i.app_data)||void 0===l||null===(s=l.appcmsMain)||void 0===s||null===(d=s.brand)||void 0===d||null===(u=d.cta)||void 0===u||null===(p=u.primary)||void 0===p?void 0:p.backgroundColor))};export{E as initialiseSkin};
|