@viewlift/player-backup 1.0.198-backup → 1.0.199-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 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 {
@@ -393,6 +393,8 @@
393
393
 
394
394
 
395
395
 
396
+
397
+
396
398
  .video-js .multicamera-parent.default{
397
399
  height: 345px;
398
400
  position: absolute;
@@ -472,8 +474,6 @@
472
474
  }
473
475
 
474
476
 
475
-
476
-
477
477
  /* nextep */
478
478
  .next-ep-preview{
479
479
  position: absolute;
@@ -534,6 +534,38 @@
534
534
  margin-left: 8px;
535
535
  }
536
536
  }
537
+ /* a wrapper element that tracks the mouse vertically */
538
+ .vjs-thumbnail-holder {
539
+ position: absolute;
540
+ left: -1000px;
541
+ }
542
+
543
+ /* the thumbnail image itself */
544
+ .vjs-thumbnail {
545
+ position: absolute;
546
+ left: 0;
547
+ bottom: 1.3em;
548
+ opacity: 0;
549
+ transition: opacity .2s ease;
550
+ -webkit-transition: opacity .2s ease;
551
+ -moz-transition: opacity .2s ease;
552
+ -mz-transition: opacity .2s ease;
553
+ }
554
+
555
+ /* fade in the thumbnail when hovering over the progress bar */
556
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
557
+ .vjs-progress-control:hover .vjs-thumbnail,
558
+ .vjs-progress-control.fake-active .vjs-thumbnail,
559
+ .vjs-progress-control:active .vjs-thumbnail {
560
+ opacity: 1;
561
+ }
562
+
563
+ /* ... but hide the thumbnail when hovering directly over it */
564
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
565
+ .vjs-progress-control:active .vjs-thumbnail:active {
566
+ opacity: 0;
567
+ }
568
+
537
569
  .video-js.vjs-quality-menu {
538
570
  display: block;
539
571
  }
@@ -604,38 +636,6 @@
604
636
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
605
637
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
606
638
  }
607
- /* a wrapper element that tracks the mouse vertically */
608
- .vjs-thumbnail-holder {
609
- position: absolute;
610
- left: -1000px;
611
- }
612
-
613
- /* the thumbnail image itself */
614
- .vjs-thumbnail {
615
- position: absolute;
616
- left: 0;
617
- bottom: 1.3em;
618
- opacity: 0;
619
- transition: opacity .2s ease;
620
- -webkit-transition: opacity .2s ease;
621
- -moz-transition: opacity .2s ease;
622
- -mz-transition: opacity .2s ease;
623
- }
624
-
625
- /* fade in the thumbnail when hovering over the progress bar */
626
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
627
- .vjs-progress-control:hover .vjs-thumbnail,
628
- .vjs-progress-control.fake-active .vjs-thumbnail,
629
- .vjs-progress-control:active .vjs-thumbnail {
630
- opacity: 1;
631
- }
632
-
633
- /* ... but hide the thumbnail when hovering directly over it */
634
- .vjs-progress-control:hover .vjs-thumbnail:hover,
635
- .vjs-progress-control:active .vjs-thumbnail:active {
636
- opacity: 0;
637
- }
638
-
639
639
  .vjs-poster {
640
640
  display: inline-block;
641
641
  vertical-align: middle;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-2cdbd5ac.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-f9e729be.js"),s=require("./resolution-719c85a4.js"),u=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},y=function(e,n,t){var r=u.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,"'")})},g=function(e){var n=u.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 w(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=[],k=0,S=null;function O(n,t,r){var i,o,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===(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===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,y=Math.floor(n.currentTime()),g=u?100:Math.floor(d/v*100),h={};m?j(h={completed:u,watchedTime:y,watchedPercentage:g},c,t.siteOwner):(h=w(w({videoId:p,watchedTime:y,watchedPercentage:g,doneWatching:u,profileId:c},S&&{seriesId:S}),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(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return w(w({},e),{},n({},t,u[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));d<0?l.push(w(w({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=w(w(w({},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 E=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=u.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)}}(),I=function(e,n){var t=u.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,r,o,l,a,s=this.el(),u=i.dom.getPointerPosition(s,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*u,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 e.next=2,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 2: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)}}(),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});function N(e){return A.apply(this,arguments)}function A(){return(A=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 L.apply(this,arguments)}function L(){return(L=t(r.mark((function e(n,t){var i,o,l,a,s,u,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(null==t?void 0:t.contentType)||"video",u=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,d="Chrome"==c.detectBrowser()&&(null==t||null===(a=t.video)||void 0===a?void 0:a.isSSAIEnabled),e.prev=5,e.next=8,Promise.allSettled([u?D():null,E(n),d?f("https://cdn.dashjs.org/v5.0.0/modern/umd/dash.all.min.js"):null]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function q(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?q(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var H=new Set,U=null,B=function(n,t,r){var i,o,l,a,s,u,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"]=J(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"]=G(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===(s=n[v])||void 0===s?void 0:s.drmEnabled)||"None",d.DAIStream=null!==(u=n[v])&&void 0!==u&&null!==(c=u.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[r.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=Y(n),d["c3.cm.genreList"]=F(n),d["c3.cm.genre"]=W(n),d["c3.cm.channel"]=z(n);var p=X(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"},F=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},z=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"},G=function(e){return(null==e?void 0:e.contentType)||"null"},Y=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"},K=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)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var X=function(n,t){var r,i,o,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),c=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(o=n[u-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},Q=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Z=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},$=function(){var n=t(r.mark((function n(t,i){var o,l,a,s,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,s=o.tveProvider,c=o.enable,d=o.appName,v=(i||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(p=u.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=Q(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),H.clear(),U=p.currentSrc();var r=Z(p.currentType()),o=e.getCurrentVideo(),l=B(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]=K(o,i),l.authToken=v||"NULL",l.streamType=r,l.D2CType=a||"NONE",l.subscriberType=s||(a?"D2C":"FREE"),l["c3.cm.affiliate"]=s||"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(){H.has(p.currentSrc())||(H.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){H.has(p.currentSrc())&&H.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==H||H.clear(),f("playbackEnded")}));case 20:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),ee=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-a3a1037e.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-cf50adc0.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-1cc7baa7.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-e38a2315.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-25fc175a.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-20bc6461.js")})).then((function(t){t.initialiseSkin(e,n)}))},ne=!1,te=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)&&!ne){var l=re(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ne=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function re(e,n,t){if(Array.isArray(e))return e.map((function(e){return re(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]=re(e[i],n,t)})),r}return e}function ie(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 oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var le=function(n,t,r,i){var o,a,s,d,v=i.res,f=i.sres,m=u.getPlayer(n),g=(null==v?void 0:v.contentType)||"video",h=(null==v||null===(o=v[g])||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,w=(null==v||null===(s=v[g])||void 0===s||null===(d=s.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(oe({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)})),w&&"Safari"===c.detectBrowser())try{var s;null==m||null===(s=m.liveTracker)||void 0===s||s.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&y(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,g,h=oe(oe({},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&&(S=null==n||null===(i=n.series)||void 0===i?void 0:i.id),b=[],k=0,p=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=u.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());b.includes(k)||(e==k?(b.push(e),O(a,n,l)):e>k&&(k=e+l))})),a.one("ended",(function(){O(a,n,l,!0)})))}(n,h,null==d||null===(f=d.video)||void 0===f||null===(g=f.gist)||void 0===g?void 0:g.id)}if(null!=t&&null!==(o=t.analytics)&&void 0!==o&&o.muxKey&&null!=m&&m.mux){var P,j,T,E,I,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===(E=D.series)||void 0===E?void 0:E.title,video_stream_type:null!=D&&null!==(I=D.streamingInfo)&&void 0!==I&&I.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,s,u,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===(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(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){h&&te(v,n)})),m.on("error",(function(){var t,i;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?te(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(),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 ae(e){return se.apply(this,arguments)}function se(){return(se=t(r.mark((function e(n){var t,i,o,l,a,s,u,c,d,v,p,f,m;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.id_,o=this.el().querySelector("video")||this.el(),l=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),a=(null==n?void 0:n.keySystems)&&(null==n||null===(i=n.keySystems)||void 0===i?void 0:i["com.widevine.alpha"]),s=null==n?void 0:n.src,l&&o?(l.initialize(o,s,!0),a&&(v=null===(u=n.keySystems["com.widevine.alpha"])||void 0===u?void 0:u.url,p=null===(c=n.keySystems["com.microsoft.playready"])||void 0===c?void 0:c.url,f=null===(d=n.keySystems["com.widevine.alpha"])||void 0===d?void 0:d.licenseHeaders["X-AxDRM-Message"],m={"com.widevine.alpha":{serverURL:v,httpRequestHeaders:{"X-AxDRM-Message":f},audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{serverURL:p,httpRequestHeaders:{"X-AxDRM-Message":f},audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_CRYPTO"}},l.setProtectionData(m))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}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 ce(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 de,ve=function(o,a,s,d){var v,p,f,m,y,g,h,w,b,k,S,O,P,j,T,E,C,D,x,R,V,N,A,L,q,M,H,U,B,W,F,z=a.res,G=void 0===z?null:z,Y=a.sres,K=void 0===Y?null:Y,J=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],X=(null===(v=G)||void 0===v?void 0:v.contentType)||"video",Q=u.impolicy16x9(null===(p=G)||void 0===p||null===(f=p[X])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(y=G)||void 0===y||null===(g=y[X])||void 0===g||null===(h=g.gist)||void 0===h||null===(w=h.imageGist)||void 0===w?void 0:w.r16x9),Z=(null===(b=G)||void 0===b||null===(k=b[X])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ne=(null===(O=G)||void 0===O||null===(P=O[X])||void 0===P||null===(j=P.streamingInfo)||void 0===j?void 0:j.isLiveStreafm)||!1,te=(null===(T=G)||void 0===T||null===(E=T.ads)||void 0===E||null===(C=E.preRoll)||void 0===C||null===(D=C.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(R=G)||void 0===R||null===(V=R.ads)||void 0===V||null===(N=V.preRoll)||void 0===N||null===(A=N.adTags)||void 0===A||null===(L=A.web)||void 0===L?void 0:L.url);G=ce(ce({},G),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var re="Chrome"==c.detectBrowser()&&(null===(q=G)||void 0===q||null===(M=q.video)||void 0===M?void 0:M.isSSAIEnabled),ie="dirtvision"==(null===(H=G)||void 0===H?void 0:H.siteName),oe=(F={enableSmoothSeeking:!0,controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==s.skin,liveui:Z},n(F,"autoplay",null==s?void 0:s.autoplay),n(F,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!te),n(F,"loop",(null==s?void 0:s.loop)||!1),n(F,"audioPosterMode",null==s?void 0:s.audioPosterMode),n(F,"html5",ce(ce({vhs:ce(ce(ce({},ie&&{playlistExclusionDuration:30}),{},{liveRangeSafeTimeDelta:10,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==s||null===(U=s.customData)||void 0===U?void 0:U.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),nativeTextTracks:!("Safari"!=c.detectBrowser()&&!re)},0==(null==s||null===(B=s.customData)||void 0===B?void 0:B.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(W=s.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(F,"poster",Q),n(F,"techOrder",J),n(F,"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,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,g=null==y?void 0:y.url;f.licenseUrl=g;var h=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=h}var w=(null==e||null===(r=e[p])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(o=e[p])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;f.duration=b;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 S=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=S,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}(G,e,t)}}),F);if(!i.getPlayers()[o])var se=i(o,oe,function(){var n=t(r.mark((function n(){var t,a,u,c,v,p,f,m,y,g,h,w,b,k,S,O,P,j,T,E,C,D;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(se),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,_(s,G);case 5:k=null===(t=G)||void 0===t||null===(a=t[X])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ne&&d.resolve(ce({status:!0,msg:"Player Initialised"},K?{seriesResponse:K,response:G}:{response:G})),e.inititateBeacon(o,null==s?void 0:s.analyticsCb),$(o,s),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),Z&&I(o,k),!te||null!=s&&null!==(c=s.customData)&&void 0!==c&&c.disableAds||e.initialiseAdvertisement(o,te,G),S=e.getSource(G,o),console.log(S),null!=s&&s.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,s.nearestClusterUrl)),re&&null!==(v=S)&&void 0!==v&&null!==(p=v.src)&&void 0!==p&&p.includes(".mpd")?ae.call(this,S):S?e.loadVideo(o,S):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:G}),e.handleError(o,"Incompatible / Missing Source")),((null===(f=G)||void 0===f||null===(m=f[X])||void 0===m||null===(y=m.contentDetails)||void 0===y||null===(g=y.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=G)||void 0===h||null===(w=h[X])||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0)&&(D=(null===(P=G)||void 0===P||null===(j=P[X])||void 0===j||null===(T=j.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null===(E=G)||void 0===E||null===(C=E[X])||void 0===C?void 0:C.closedCaptions),O=D.filter((function(e){return"VTT"===e.format})),l.addCaptions(o,O)),null!=s&&s.disableControls?e.disableControls(o):ee(o,ce(ce(ce({},s),oe),{},{liveVideo:ne,isDvrEnabled:Z,res:G,sres:K})),le(o,ce(ce(ce({},s),oe),{},{liveVideo:ne}),d,{res:G,sres:K});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function pe(e,n){return fe.apply(this,arguments)}function fe(){return(fe=t(r.mark((function n(t,i){var o,l,a,s,u,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,s=null==t?void 0:t.playerId,u=!(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&&!u)if((null===(p=t.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,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===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",ve(s,{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(){ve(s,{res:f},t,{resolve:o,reject:l})}));else ve(s,{res:f},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,a)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function me(e,n){return ye.apply(this,arguments)}function ye(){return(ye=t(r.mark((function n(t,i){var o,l,a,s,u;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,s=null==t?void 0:t.playerId,u=null==t?void 0:t.epg,e.getLinearChannelDetails(u,a).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,ve(s,{res:n},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,videoId)}));case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function ge(e,n){return he.apply(this,arguments)}function he(){return(he=t(r.mark((function n(t,i){var o,l,a,s,u,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:s=n.sent,u=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,s).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,s),e.getVideoDetails(p,s).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),ve(u,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,u,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,u,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function we(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?we(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):we(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,s,c,v,p,m,y,g,h,w,b,k,S,O,P,j,T,E,I,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(w=(null==n?void 0:n.videoSourceUrl)||!1,b=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,S=null==n?void 0:n.videoId,O=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=S,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:de=JSON.parse(atob(P.split(".")[1]));case 16:return n.isAnonymousUser=!(null===(s=de)||void 0===s||!s.anonymousId),n.siteOwner=(null===(c=de)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=de)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(p=de)||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===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(E=null==n?void 0:n.errors)&&(window.customErrors=E),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(g=n.customData)||void 0===g?void 0:g.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=32,N(n);case 32:T&&f("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then((function(){return e.runGtag(T)})).catch((function(e){})),(I=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&I.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(D={directPlaybackUrl:w,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(C,P).then((function(e){ve(j,{res:be(be({},e),D)},n,{resolve:i,reject:o})})).catch((function(n){e.initiateErrorHandling(n,j,o,C)})):ve(j,{res:D},n,{resolve:i,reject:o})):O?ge(n,{resolve:i,reject:o}):k?me(n,{resolve:i,reject:o}):pe(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:u.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:s.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:g,disableControls:e.disableControls,setPlaybackSpeed:o.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("./generic-2cdbd5ac.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-f9e729be.js"),s=require("./resolution-719c85a4.js"),u=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},y=function(e,n,t){var r=u.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,"'")})},g=function(e){var n=u.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 w(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=[],k=0,S=null;function O(n,t,r){var i,o,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===(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===(s=t.watchHistory)||void 0===s?void 0:s.saveOffline)||!1,y=Math.floor(n.currentTime()),g=u?100:Math.floor(d/v*100),h={};m?j(h={completed:u,watchedTime:y,watchedPercentage:g},c,t.siteOwner):(h=w(w({videoId:p,watchedTime:y,watchedPercentage:g,doneWatching:u,profileId:c},S&&{seriesId:S}),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(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,t){return w(w({},e),{},n({},t,u[t]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===p}));d<0?l.push(w(w({content:c},t),{},{addedDate:a,updateDate:a})):l[d]=w(w(w({},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 E=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=u.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)}}(),I=function(e,n){var t=u.getPlayer(e);t&&n&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(n){var t,r,o,l,a,s=this.el(),u=i.dom.getPointerPosition(s,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*u,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 e.next=2,import("videojs-contrib-eme").then((function(e){i.getPlugin("eme")||i.registerPlugin("eme",e.default)}));case 2: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)}}(),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});function N(e){return A.apply(this,arguments)}function A(){return(A=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 L.apply(this,arguments)}function L(){return(L=t(r.mark((function e(n,t){var i,o,l,a,s,u,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=(null==t?void 0:t.contentType)||"video",u=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,d="Chrome"==c.detectBrowser()&&(null==t||null===(a=t.video)||void 0===a?void 0:a.isSSAIEnabled),e.prev=5,e.next=8,Promise.allSettled([u?D():null,E(n),d?f("https://cdn.dashjs.org/v5.0.0/modern/umd/dash.all.min.js"):null]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function q(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?q(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var H=new Set,U=null,B=function(n,t,r){var i,o,l,a,s,u,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"]=J(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"]=G(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===(s=n[v])||void 0===s?void 0:s.drmEnabled)||"None",d.DAIStream=null!==(u=n[v])&&void 0!==u&&null!==(c=u.gist)&&void 0!==c&&c.isSSAIEnabled?"YES":"NO",d[r.Constants.DEFAULT_RESOURCE]="AKAMAI",d["c3.cm.brand"]="NULL",d.CDVREnabled=Y(n),d["c3.cm.genreList"]=F(n),d["c3.cm.genre"]=W(n),d["c3.cm.channel"]=z(n);var p=X(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"},F=function(e){var n,t=(null==e?void 0:e.contentType)||"video";return((null==e||null===(n=e[t])||void 0===n?void 0:n.categories)||[]).map((function(e){return null==e?void 0:e.title})).join(", ")||"Null"},z=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"},G=function(e){return(null==e?void 0:e.contentType)||"null"},Y=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"},K=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)},J=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var X=function(n,t){var r,i,o,l,a,s={"c3.cm.seriesName":"Null","c3.cm.seasonNumber":"Null","c3.cm.showTitle":"Null","c3.cm.episodeNumber":"Null"};if(!n||!t||null!=t&&t.linearchannel)return s;var u=e.getSeasonNumber(),c=e.getEpisodeNumber();return s["c3.cm.seriesName"]=(null==t||null===(r=t.video)||void 0===r||null===(i=r.series)||void 0===i?void 0:i.title)||"Null",s["c3.cm.seasonNumber"]=(null==u?void 0:u.toString())||"Null",s["c3.cm.showTitle"]=(null==n||null===(o=n[u-1])||void 0===o||null===(l=o.episodes)||void 0===l||null===(a=l[c-1])||void 0===a?void 0:a.title)||"Null",s["c3.cm.episodeNumber"]=(null==c?void 0:c.toString())||"Null",s},Q=function(e){switch(e){case"com.widevine.alpha":return"Widevine";case"com.microsoft.playready":return"PlayReady";case"org.w3.clearkey":return"ClearKey";case"com.apple.fps.1_0":return"FairPlay";default:return"Unknown DRM System"}},Z=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},$=function(){var n=t(r.mark((function n(t,i){var o,l,a,s,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,s=o.tveProvider,c=o.enable,d=o.appName,v=(i||{}).token,c){n.next=4;break}return n.abrupt("return");case 4:if(p=u.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=Q(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),H.clear(),U=p.currentSrc();var r=Z(p.currentType()),o=e.getCurrentVideo(),l=B(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]=K(o,i),l.authToken=v||"NULL",l.streamType=r,l.D2CType=a||"NONE",l.subscriberType=s||(a?"D2C":"FREE"),l["c3.cm.affiliate"]=s||"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(){H.has(p.currentSrc())||(H.add(p.currentSrc()),f("playbackStarted",null))})),p.on("ended",(function(){H.has(p.currentSrc())&&H.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==H||H.clear(),f("playbackEnded")}));case 20:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}(),ee=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-a3a1037e.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-cf50adc0.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-1cc7baa7.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-e38a2315.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-25fc175a.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-b7884a7e.js")})).then((function(t){t.initialiseSkin(e,n)}))},ne=!1,te=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)&&!ne){var l=re(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),ne=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function re(e,n,t){if(Array.isArray(e))return e.map((function(e){return re(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]=re(e[i],n,t)})),r}return e}function ie(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 oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var le=function(n,t,r,i){var o,a,s,d,v=i.res,f=i.sres,m=u.getPlayer(n),g=(null==v?void 0:v.contentType)||"video",h=(null==v||null===(o=v[g])||void 0===o||null===(a=o.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1,w=(null==v||null===(s=v[g])||void 0===s||null===(d=s.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(oe({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)})),w&&"Safari"===c.detectBrowser())try{var s;null==m||null===(s=m.liveTracker)||void 0===s||s.seekToLiveEdge()}catch(e){console.log("Cannot seek to Live Edge",e)}(null==m||!m.muted())&&y(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,g,h=oe(oe({},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&&(S=null==n||null===(i=n.series)||void 0===i?void 0:i.id),b=[],k=0,p=t;var l=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.interval)||30,a=u.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());b.includes(k)||(e==k?(b.push(e),O(a,n,l)):e>k&&(k=e+l))})),a.one("ended",(function(){O(a,n,l,!0)})))}(n,h,null==d||null===(f=d.video)||void 0===f||null===(g=f.gist)||void 0===g?void 0:g.id)}if(null!=t&&null!==(o=t.analytics)&&void 0!==o&&o.muxKey&&null!=m&&m.mux){var P,j,T,E,I,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===(E=D.series)||void 0===E?void 0:E.title,video_stream_type:null!=D&&null!==(I=D.streamingInfo)&&void 0!==I&&I.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,s,u,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===(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(),g=y.media.tracks.filter((function(e){return"TEXT"==e.type}));m=n?new chrome.cast.media.EditTracksInfoRequest([g[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(m)}})),m.tech_.on("retryplaylist",(function(){h&&te(v,n)})),m.on("error",(function(){var t,i;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?te(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(),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 ae(e){return se.apply(this,arguments)}function se(){return(se=t(r.mark((function e(n){var t,i,o,l,a,s,u,c,d,v,p,f,m;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.id_,o=this.el().querySelector("video")||this.el(),l=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),a=(null==n?void 0:n.keySystems)&&(null==n||null===(i=n.keySystems)||void 0===i?void 0:i["com.widevine.alpha"]),s=null==n?void 0:n.src,l&&o?(l.initialize(o,s,!0),a&&(v=null===(u=n.keySystems["com.widevine.alpha"])||void 0===u?void 0:u.url,p=null===(c=n.keySystems["com.microsoft.playready"])||void 0===c?void 0:c.url,f=null===(d=n.keySystems["com.widevine.alpha"])||void 0===d?void 0:d.licenseHeaders["X-AxDRM-Message"],m={"com.widevine.alpha":{serverURL:v,httpRequestHeaders:{"X-AxDRM-Message":f},audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{serverURL:p,httpRequestHeaders:{"X-AxDRM-Message":f},audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_CRYPTO"}},l.setProtectionData(m))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}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 ce(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 de,ve=function(o,a,s,d){var v,p,f,m,y,g,h,w,b,k,S,O,P,j,T,E,C,D,x,R,V,N,A,L,q,M,H,U,B,W,F,z=a.res,G=void 0===z?null:z,Y=a.sres,K=void 0===Y?null:Y,J=null!=s&&s.chromecastReceiverId?["chromecast","html5"]:["html5"],X=(null===(v=G)||void 0===v?void 0:v.contentType)||"video",Q=u.impolicy16x9(null===(p=G)||void 0===p||null===(f=p[X])||void 0===f||null===(m=f.gist)||void 0===m?void 0:m.videoImageUrl)||u.impolicy16x9(null===(y=G)||void 0===y||null===(g=y[X])||void 0===g||null===(h=g.gist)||void 0===h||null===(w=h.imageGist)||void 0===w?void 0:w.r16x9),Z=(null===(b=G)||void 0===b||null===(k=b[X])||void 0===k||null===(S=k.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,ne=(null===(O=G)||void 0===O||null===(P=O[X])||void 0===P||null===(j=P.streamingInfo)||void 0===j?void 0:j.isLiveStreafm)||!1,te=(null===(T=G)||void 0===T||null===(E=T.ads)||void 0===E||null===(C=E.preRoll)||void 0===C||null===(D=C.adTags)||void 0===D||null===(x=D.web)||void 0===x?void 0:x.active)&&(null===(R=G)||void 0===R||null===(V=R.ads)||void 0===V||null===(N=V.preRoll)||void 0===N||null===(A=N.adTags)||void 0===A||null===(L=A.web)||void 0===L?void 0:L.url);G=ce(ce({},G),{},{audioAssetSource:null==s?void 0:s.audioAssetSource});var re="Chrome"==c.detectBrowser()&&(null===(q=G)||void 0===q||null===(M=q.video)||void 0===M?void 0:M.isSSAIEnabled),ie="dirtvision"==(null===(H=G)||void 0===H?void 0:H.siteName),oe=(F={enableSmoothSeeking:!0,controls:0!=(null==s?void 0:s.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==s?void 0:s.muted)||!1,autoplay:(null==s?void 0:s.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!1},muteToggle:"multiplayer"==s.skin,liveui:Z},n(F,"autoplay",null==s?void 0:s.autoplay),n(F,"normalizeAutoplay",(null==s?void 0:s.autoplay)&&!te),n(F,"loop",(null==s?void 0:s.loop)||!1),n(F,"audioPosterMode",null==s?void 0:s.audioPosterMode),n(F,"html5",ce(ce({vhs:ce(ce(ce({},ie&&{playlistExclusionDuration:30}),{},{liveRangeSafeTimeDelta:10,useDevicePixelRatio:!0,experimentalLLHLS:(null==s?void 0:s.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!0},(null==s||null===(U=s.customData)||void 0===U?void 0:U.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0}),nativeTextTracks:!("Safari"!=c.detectBrowser()&&!re)},0==(null==s||null===(B=s.customData)||void 0===B?void 0:B.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==s||null===(W=s.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),n(F,"poster",Q),n(F,"techOrder",J),n(F,"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,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,g=null==y?void 0:y.url;f.licenseUrl=g;var h=null==y?void 0:y.licenseHeaders["X-AxDRM-Message"];f.licenseToken=h}var w=(null==e||null===(r=e[p])||void 0===r||null===(i=r.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(o=e[p])||void 0===o||null===(l=o.gist)||void 0===l?void 0:l.runtime;f.duration=b;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 S=null==e||null===(u=e[p])||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.videoImageUrl;return f.mediaImage=S,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}(G,e,t)}}),F);if(!i.getPlayers()[o])var se=i(o,oe,function(){var n=t(r.mark((function n(){var t,a,u,c,v,p,f,m,y,g,h,w,b,k,S,O,P,j,T,E,C,D;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(se),console.log(i.VERSION),console.log(i.getPlugins()),n.next=5,_(s,G);case 5:k=null===(t=G)||void 0===t||null===(a=t[X])||void 0===a||null===(u=a.liveDetails)||void 0===u?void 0:u.startOverTime,ne&&d.resolve(ce({status:!0,msg:"Player Initialised"},K?{seriesResponse:K,response:G}:{response:G})),e.inititateBeacon(o,null==s?void 0:s.analyticsCb),$(o,s),/Android/i.test(navigator.userAgent)&&(i.options.vhs.overrideNative=!0),Z&&I(o,k),!te||null!=s&&null!==(c=s.customData)&&void 0!==c&&c.disableAds||e.initialiseAdvertisement(o,te,G),S=e.getSource(G,o),console.log(S),null!=s&&s.nearestClusterUrl&&(S=e.getUpdatedClusterSource(S,s.nearestClusterUrl)),re&&null!==(v=S)&&void 0!==v&&null!==(p=v.src)&&void 0!==p&&p.includes(".mpd")?ae.call(this,S):S?e.loadVideo(o,S):(d.reject({status:!1,msg:"Incompatible / Missing Source",response:G}),e.handleError(o,"Incompatible / Missing Source")),((null===(f=G)||void 0===f||null===(m=f[X])||void 0===m||null===(y=m.contentDetails)||void 0===y||null===(g=y.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(h=G)||void 0===h||null===(w=h[X])||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0)&&(D=(null===(P=G)||void 0===P||null===(j=P[X])||void 0===j||null===(T=j.contentDetails)||void 0===T?void 0:T.closedCaptions)||(null===(E=G)||void 0===E||null===(C=E[X])||void 0===C?void 0:C.closedCaptions),O=D.filter((function(e){return"VTT"===e.format})),l.addCaptions(o,O)),null!=s&&s.disableControls?e.disableControls(o):ee(o,ce(ce(ce({},s),oe),{},{liveVideo:ne,isDvrEnabled:Z,res:G,sres:K})),le(o,ce(ce(ce({},s),oe),{},{liveVideo:ne}),d,{res:G,sres:K});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function pe(e,n){return fe.apply(this,arguments)}function fe(){return(fe=t(r.mark((function n(t,i){var o,l,a,s,u,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,s=null==t?void 0:t.playerId,u=!(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&&!u)if((null===(p=t.watchHistory)||void 0===p?void 0:p.saveOffline)||!1){var m,y,g,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===(y=h[0])||void 0===y?void 0:y.watchedTime)||null,t.watchedPercentage=(null===(g=h[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",ve(s,{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(){ve(s,{res:f},t,{resolve:o,reject:l})}));else ve(s,{res:f},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,a)}));case 8:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function me(e,n){return ye.apply(this,arguments)}function ye(){return(ye=t(r.mark((function n(t,i){var o,l,a,s,u;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,s=null==t?void 0:t.playerId,u=null==t?void 0:t.epg,e.getLinearChannelDetails(u,a).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==u?void 0:u.channelId,ve(s,{res:n},t,{resolve:o,reject:l})})).catch((function(n){e.initiateErrorHandling(n,s,l,videoId)}));case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function ge(e,n){return he.apply(this,arguments)}function he(){return(he=t(r.mark((function n(t,i){var o,l,a,s,u,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:s=n.sent,u=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,s).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,s),e.getVideoDetails(p,s).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),ve(u,{res:null==n?void 0:n.data,sres:c},t,{resolve:l,reject:a})})).catch((function(n){e.initiateErrorHandling(n,u,a,videoId)}))})).catch((function(n){e.initiateErrorHandling(n,u,a)}));case 9:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function we(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?we(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):we(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,s,c,v,p,m,y,g,h,w,b,k,S,O,P,j,T,E,I,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(w=(null==n?void 0:n.videoSourceUrl)||!1,b=null==n?void 0:n.asat,k=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,S=null==n?void 0:n.videoId,O=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=S,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:de=JSON.parse(atob(P.split(".")[1]));case 16:return n.isAnonymousUser=!(null===(s=de)||void 0===s||!s.anonymousId),n.siteOwner=(null===(c=de)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=de)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(p=de)||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===(y=n.analytics)||void 0===y?void 0:y.gaId)||null,(E=null==n?void 0:n.errors)&&(window.customErrors=E),window.customData=null==n?void 0:n.customData,d.setLocalisation(null==n||null===(g=n.customData)||void 0===g?void 0:g.localisation),e.baseUrlManager.set(n.apiBaseUrl),null!=n&&n.skin&&!u.isNotAValidSkin(n.skin)||(n.skin="VL_ONE"),t.next=32,N(n);case 32:T&&f("https://www.googletagmanager.com/gtag/js?id=".concat(T)).then((function(){return e.runGtag(T)})).catch((function(e){})),(I=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&I.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(D={directPlaybackUrl:w,id:C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(C,P).then((function(e){ve(j,{res:be(be({},e),D)},n,{resolve:i,reject:o})})).catch((function(n){e.initiateErrorHandling(n,j,o,C)})):ve(j,{res:D},n,{resolve:i,reject:o})):O?ge(n,{resolve:i,reject:o}):k?me(n,{resolve:i,reject:o}):pe(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:u.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:s.playSelectedResolution,getSource:e.getSource,setVolume:y,getVolume:g,disableControls:e.disableControls,setPlaybackSpeed:o.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./features-5cbffaed.js"),r=require("./skin-34fbc337.js"),n=require("./index-6683bb30.js"),t=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var o=require("video.js"),a=require("./keyboardShortcuts-00a00940.js"),i=require("./generic-2cdbd5ac.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-f9e729be.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-235d57ff.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,a){var i=r.getPlayer(o);i&&(i.on("loadeddata",(function(){var e,i,l,s,d;!function(e){var n=r.getPlayer(e);n&&n.qualityMenu({useResolutionLabels:!0})}(o),!(null!=a&&null!==(e=a.series)&&void 0!==e&&e.enable||null!==(i=window)&&void 0!==i&&null!==(l=i.app_data)&&void 0!==l&&null!==(s=l.appcmsMain)&&void 0!==s&&null!==(d=s.features)&&void 0!==d&&d.auto_play)||null!=a&&a.liveVideo||n.addNextEpPreview(o,a),null!=a&&a.liveVideo||t.isMobile()||n.initiateTrickplay(o)})),i.one("play",(function(){var r,n,t,a;null!==(r=window)&&void 0!==r&&null!==(n=r.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(o,null===(t=window)||void 0===t||null===(a=t.customData)||void 0===a?void 0:a.iframeOverlayUrl)})))}function f(e,r){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,r){if(e){if("string"==typeof e)return m(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){n&&(e=n);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 a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n<r;n++)t[n]=e[n];return t}function y(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function b(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?y(Object(n),!0).forEach((function(r){d(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function h(){return h=u(c.mark((function e(n,t){var o,d,p,m,y,h,g,S,j,k,w,q,O,I,P,C,M,x;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(e,t){var o=r.getPlayer(n);Math.floor(o.currentTime());var a,i,l,s,d,u,c,v,p=f(t);try{for(p.s();!(a=p.n()).done;)i=void 0,l=void 0,s=void 0,d=void 0,u=void 0,c=void 0,v=void 0,i=a.value,l=i.eventType,s=i.beaconUrls,d=i.startTimeInSeconds,u=i.startTime,i.durationInSeconds,c=Math.round(d),v=s[0],c!=Math.round(o.currentTime())||M.has(u)||(M.set(u,!0),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",l,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",e),fetch(v))}catch(e){p.e(e)}finally{p.f()}},C=function(e){var r=Math.floor(e/60),n=Math.floor(e%60);return"".concat(r,":").concat(n.toString().padStart(2,"0"))},I=function(e){var r={},n=e.split("?")[1];if(!n)return r;var t,o=f(n.split("&"));try{for(o.s();!(t=o.n()).done;){var a=t.value.split("="),i=s(a,2),l=i[0],d=i[1];r[decodeURIComponent(l)]=decodeURIComponent(d||"")}}catch(e){o.e(e)}finally{o.f()}for(var u={},c=0,v=Object.entries(r);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=r.getPlayer(n),d=t.replace("dash","session").replace("master","session"),d=i.replaceMacros(d,n,{}),p=I(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,j=h+g,k=h+S,console.log("%c TRACKING URL","background: #bdf369; color: #000",j),null!=t&&t.includes(".mpd")?(window.player.attachSource(k),w=performance.now(),o.on("loadeddata",(function(){var e=performance.now();console.log("%c Video loaded in ","background: #e76a50; color: #fff","".concat((e-w).toFixed(3)," ms"))}))):(O=(null==o||null===(q=o.currentSource())||void 0===q?void 0:q.keySystems)||null,i.loadVideo(n,{src:k,type:"application/x-mpegURL",keySystems:O})),o.one("loadeddata",(function(){P(j)})),P=function(){var e=u(c.mark((function e(t){var o,i,s,d,u,p,f,m,y,b,h,g,S,j,k,w;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return i=e.sent,e.next=5,i.json();case 5:s=e.sent,d=s.avails,u=[],p=r.getPlayer(n),f=p.controlBar.progressControl,m=f.seekBar.el(),d.map((function(e){var r;Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(r=e.ads)||void 0===r?void 0:r.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 r=e.markerPositionInSeconds,n=p.duration();if(!(r>n)){var t=r/n*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=-1,p.on("timeupdate",r.throttle((function(){var e=Math.floor(p.currentTime());if(e!==y){y=e;for(var r=!1,n=function(){var n=o[t],i=n.startTimeInSeconds,s=n.durationInSeconds,d=n.ads,u=Math.floor(i+s);if(e>=i&&e<=u){r=!0,a.keyboardManager.disable(),f.el().style.visibility="hidden";for(var c=e-i,v=0,p=0,m=0;m<d.length;m++){var y,h=null==d||null===(y=d[m])||void 0===y?void 0:y.durationInSeconds;if(c<v+h){p=m;break}v+=h}var g=d[p],S=c-v,j=Math.max(0,g.durationInSeconds-S),w=Math.round(j);b.style.display="block",k.textContent="".concat(p+1," of ").concat(d.length," • ").concat(C(w));var q=[];return d.forEach((function(e){var r=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression"].includes(e.eventType)}));q.push.apply(q,l(r))})),x(n,q),"break"}},t=0,o=u;t<o.length;t++){if("break"===n())break}r||(b.style.display="none",f.el().style.visibility="visible",a.keyboardManager.enable())}}),1e3)),(b=document.createElement("div")).className="ssai-ad-container",(h=document.createElement("div")).className="sponsored-adbox",(g=document.createElement("div")).className="sponsored-text",g.textContent="Sponsored Ad",(S=document.createElement("div")).className="ad-info-icon",j=r.parseSvgString(v.InfoIcon()),S.appendChild(j),h.append(g),h.append(S),(k=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",(w=document.createElement("div")).className="ad-visit-advertiser",w.textContent="Visit Advertiser",(null===(o=document.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])&&(w.style.right="8.6rem"),b.append(h),b.append(k),b.append(w),p.el().appendChild(b);case 41:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),M=new Map;case 24:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}var g=function(){var e,r,n,t,a,i,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===(r=e.app_data)||void 0===r||null===(n=r.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(i=a.primary)||void 0===i?void 0:i.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){r.getPlayer(t).addClass("skin_vlone"),p(t,o),function(r,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=i.getSource(null==t?void 0:t.res,r),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(r,null==t?void 0:t.relatedVideos);null!=t&&null!==(u=t.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(r,t);(null==t||null===(c=t.streams)||void 0===c?void 0:c.length)>1&&e.addMulticamSelector(r,null==t?void 0:t.streams);n.addTVProviderImage(r,t),a.initialiseKeyboardEvents(r,t),v&&function(e,r){h.apply(this,arguments)}(r,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 {
@@ -393,6 +393,8 @@
393
393
 
394
394
 
395
395
 
396
+
397
+
396
398
  .video-js .multicamera-parent.default{
397
399
  height: 345px;
398
400
  position: absolute;
@@ -472,8 +474,6 @@
472
474
  }
473
475
 
474
476
 
475
-
476
-
477
477
  /* nextep */
478
478
  .next-ep-preview{
479
479
  position: absolute;
@@ -534,6 +534,38 @@
534
534
  margin-left: 8px;
535
535
  }
536
536
  }
537
+ /* a wrapper element that tracks the mouse vertically */
538
+ .vjs-thumbnail-holder {
539
+ position: absolute;
540
+ left: -1000px;
541
+ }
542
+
543
+ /* the thumbnail image itself */
544
+ .vjs-thumbnail {
545
+ position: absolute;
546
+ left: 0;
547
+ bottom: 1.3em;
548
+ opacity: 0;
549
+ transition: opacity .2s ease;
550
+ -webkit-transition: opacity .2s ease;
551
+ -moz-transition: opacity .2s ease;
552
+ -mz-transition: opacity .2s ease;
553
+ }
554
+
555
+ /* fade in the thumbnail when hovering over the progress bar */
556
+ /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
557
+ .vjs-progress-control:hover .vjs-thumbnail,
558
+ .vjs-progress-control.fake-active .vjs-thumbnail,
559
+ .vjs-progress-control:active .vjs-thumbnail {
560
+ opacity: 1;
561
+ }
562
+
563
+ /* ... but hide the thumbnail when hovering directly over it */
564
+ .vjs-progress-control:hover .vjs-thumbnail:hover,
565
+ .vjs-progress-control:active .vjs-thumbnail:active {
566
+ opacity: 0;
567
+ }
568
+
537
569
  .video-js.vjs-quality-menu {
538
570
  display: block;
539
571
  }
@@ -604,38 +636,6 @@
604
636
  -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
605
637
  animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
606
638
  }
607
- /* a wrapper element that tracks the mouse vertically */
608
- .vjs-thumbnail-holder {
609
- position: absolute;
610
- left: -1000px;
611
- }
612
-
613
- /* the thumbnail image itself */
614
- .vjs-thumbnail {
615
- position: absolute;
616
- left: 0;
617
- bottom: 1.3em;
618
- opacity: 0;
619
- transition: opacity .2s ease;
620
- -webkit-transition: opacity .2s ease;
621
- -moz-transition: opacity .2s ease;
622
- -mz-transition: opacity .2s ease;
623
- }
624
-
625
- /* fade in the thumbnail when hovering over the progress bar */
626
- /* .fake-active is needed for Android only. It's removed on touchend/touchecancel */
627
- .vjs-progress-control:hover .vjs-thumbnail,
628
- .vjs-progress-control.fake-active .vjs-thumbnail,
629
- .vjs-progress-control:active .vjs-thumbnail {
630
- opacity: 1;
631
- }
632
-
633
- /* ... but hide the thumbnail when hovering directly over it */
634
- .vjs-progress-control:hover .vjs-thumbnail:hover,
635
- .vjs-progress-control:active .vjs-thumbnail:active {
636
- opacity: 0;
637
- }
638
-
639
639
  .vjs-poster {
640
640
  display: inline-block;
641
641
  vertical-align: middle;
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 w,u as b,v as k,w as O,x as j,y as S,z as T,A as P,B as I,C as E,D,E as x,F as C,G as R,H as N,I as A,J as _,K as L,L as V,M,N as H}from"./generic-31014ce3.js";import U from"@babel/runtime/helpers/defineProperty";import B from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/regenerator";import W from"video.js";import{o as z,g as q,a as G,s as K,b as Y}from"./util-623a2db0.js";import{g as J,d as X,a as Q,e as Z}from"./captions-135a6d13.js";import{g as $}from"./renditions-cdeb4051.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){U(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?we(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 we(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),{},U({},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 be(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=B(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(W),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=W.dom.getPointerPosition(a,n).x;W.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=B(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=B(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){W.getPlugin("eme")||W.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=B(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(W),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)}}(),Pe=function(){var e=B(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)}}(),Ie=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(W)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(W)}))},loadAdsLibrary:je,loadEMELibrary:Se,loadMuxPlugin:Te,loadDvrSeekbar:Pe});function Ee(e){return De.apply(this,arguments)}function De(){return(De=B(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 Ie})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(e,n){return Ce.apply(this,arguments)}function Ce(){return(Ce=B(F.mark((function e(n,t){var o,i,r,l,a,s,u;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t?void 0:t.contentType)||"video",s=null==t||null===(o=t[a])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[a])||void 0===i||null===(r=i.liveDetails)||void 0===r||r.isDvrEnabled,null==n||n.showPositiveSeekbar,u="Chrome"==ie()&&(null==t||null===(l=t.video)||void 0===l?void 0:l.isSSAIEnabled),e.prev=5,e.next=8,Promise.allSettled([s?Se():null,ke(n),u?se("https://cdn.dashjs.org/v5.0.0/modern/umd/dash.all.min.js"):null]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function Re(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 Ne(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Re(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Re(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ae=new Set,_e=null,Le=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"]=We(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=Be(e),v["c3.cm.genreList"]=Me(e),v["c3.cm.genre"]=Ve(e),v["c3.cm.channel"]=He(e);var f=ze(i(),e);return v=Ne(Ne({},v),f)},Ve=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"},He=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"},Be=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"},Fe=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)},We=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ze=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"}},Ge=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ke=function(){var e=B(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),Ae.clear(),_e=d.currentSrc();var i=Ge(d.currentType()),r=n(),s=Le(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]=Fe(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(){Ae.has(d.currentSrc())||(Ae.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){Ae.has(d.currentSrc())&&Ae.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==Ae||Ae.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-0d2457ba.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-cd44c2c8.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-c8c038b7.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-7934720a.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-bada613c.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-c74f4f3b.js").then((function(t){t.initialiseSkin(e,n)}))},Je=!1,Xe=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)&&!Je){var r=Qe(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),Je=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Qe(e,n,t){if(Array.isArray(e))return e.map((function(e){return Qe(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]=Qe(e[i],n,t)})),o}return e}function Ze(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function $e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ze(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ze(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var en=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($e({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))})),m.on("loadeddata",(function(){var o,i,r,l=J(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=$e($e({},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,w,b,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===(w=O.series)||void 0===w?void 0:w.title,video_stream_type:null!=O&&null!==(b=O.streamingInfo)&&void 0!==b&&b.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&&Xe(p,e)})),m.on("error",(function(){var n,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?Xe(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 nn(e){return tn.apply(this,arguments)}function tn(){return(tn=B(F.mark((function e(n){var t,o,i,r,l,a,s,u,c,d,v,p,f;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.id_,i=this.el().querySelector("video")||this.el(),r=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),l=(null==n?void 0:n.keySystems)&&(null==n||null===(o=n.keySystems)||void 0===o?void 0:o["com.widevine.alpha"]),a=null==n?void 0:n.src,r&&i?(r.initialize(i,a,!0),l&&(d=null===(s=n.keySystems["com.widevine.alpha"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.microsoft.playready"])||void 0===u?void 0:u.url,p=null===(c=n.keySystems["com.widevine.alpha"])||void 0===c?void 0:c.licenseHeaders["X-AxDRM-Message"],f={"com.widevine.alpha":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":p},audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{serverURL:v,httpRequestHeaders:{"X-AxDRM-Message":p},audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_CRYPTO"}},r.setProtectionData(f))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function on(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 rn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?on(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ln,an=function(e,n,t,o){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,T,P,I,E,D,x,C,R,N,A,_,L,V,M,H,z,q,G=n.res,K=void 0===G?null:G,Y=n.sres,J=void 0===Y?null:Y,X=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],Z=(null===(i=K)||void 0===i?void 0:i.contentType)||"video",$=te(null===(r=K)||void 0===r||null===(s=r[Z])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||te(null===(d=K)||void 0===d||null===(y=d[Z])||void 0===y||null===(h=y.gist)||void 0===h||null===(g=h.imageGist)||void 0===g?void 0:g.r16x9),ee=(null===(w=K)||void 0===w||null===(b=w[Z])||void 0===b||null===(k=b.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,ne=(null===(O=K)||void 0===O||null===(j=O[Z])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,oe=(null===(T=K)||void 0===T||null===(P=T.ads)||void 0===P||null===(I=P.preRoll)||void 0===I||null===(E=I.adTags)||void 0===E||null===(D=E.web)||void 0===D?void 0:D.active)&&(null===(x=K)||void 0===x||null===(C=x.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);K=rn(rn({},K),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var re="Chrome"==ie()&&(null===(_=K)||void 0===_||null===(L=_.video)||void 0===L?void 0:L.isSSAIEnabled),le="dirtvision"==(null===(V=K)||void 0===V?void 0:V.siteName),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:ee},U(q,"autoplay",null==t?void 0:t.autoplay),U(q,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!oe),U(q,"loop",(null==t?void 0:t.loop)||!1),U(q,"audioPosterMode",null==t?void 0:t.audioPosterMode),U(q,"html5",rn(rn({vhs:rn(rn(rn({},le&&{playlistExclusionDuration:30}),{},{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:!("Safari"!=ie()&&!re)},0==(null==t||null===(H=t.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(z=t.customData)||void 0===z?void 0:z.nativeVideoTracks)&&{nativeVideoTracks:!1})),U(q,"poster",$),U(q,"techOrder",X),U(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 w=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=b;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}(K,n,o)}}),q);if(!W.getPlayers()[e])var se=W(e,ae,function(){var n=B(F.mark((function n(){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,T,P,I,E,D,x,C,R;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(se),console.log(W.VERSION),console.log(W.getPlugins()),n.next=5,xe(t,K);case 5:S=null===(i=K)||void 0===i||null===(r=i[Z])||void 0===r||null===(s=r.liveDetails)||void 0===s?void 0:s.startOverTime,ne&&o.resolve(rn({status:!0,msg:"Player Initialised"},J?{seriesResponse:J,response:K}:{response:K})),v(e,null==t?void 0:t.analyticsCb),Ke(e,t),/Android/i.test(navigator.userAgent)&&(W.options.vhs.overrideNative=!0),ee&&Oe(e,S),!oe||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||p(e,oe,K),T=l(K,e),console.log(T),null!=t&&t.nearestClusterUrl&&(T=f(T,t.nearestClusterUrl)),re&&null!==(d=T)&&void 0!==d&&null!==(y=d.src)&&void 0!==y&&y.includes(".mpd")?nn.call(this,T):T?a(e,T):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:K}),c(e,"Incompatible / Missing Source")),((null===(h=K)||void 0===h||null===(g=h[Z])||void 0===g||null===(w=g.contentDetails)||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0||(null===(k=K)||void 0===k||null===(O=k[Z])||void 0===O||null===(j=O.closedCaptions)||void 0===j?void 0:j.length)>0)&&(R=(null===(I=K)||void 0===I||null===(E=I[Z])||void 0===E||null===(D=E.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(x=K)||void 0===x||null===(C=x[Z])||void 0===C?void 0:C.closedCaptions),P=R.filter((function(e){return"VTT"===e.format})),Q(e,P)),null!=t&&t.disableControls?m(e):Ye(e,rn(rn(rn({},t),ae),{},{liveVideo:ne,isDvrEnabled:ee,res:K,sres:J})),en(e,rn(rn(rn({},t),ae),{},{liveVideo:ne}),o,{res:K,sres:J});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function sn(e,n){return un.apply(this,arguments)}function un(){return(un=B(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,w();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,w=be((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(w&&w.length)n.watchHistoryResumeTime=(null===(y=w[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=w[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",an(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(){an(l,{res:f},n,{resolve:o,reject:i})}));else an(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 cn(e,n){return dn.apply(this,arguments)}function dn(){return(dn=B(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,w();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,b(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,an(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 vn(e,n){return pn.apply(this,arguments)}function pn(){return(pn=B(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,w();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),an(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 fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function mn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fn(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function yn(){return{loadVideoInstantly:T,onTimeUpdate:z,getVideoDuration:q,onVideoEnded:G,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=B(F.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,h,w,b,k,O,j,S,T,P,I;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!x(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,w=null==e?void 0:e.videoId,b=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=w,k=null==e?void 0:e.token,!L(e)){n.next=16;break}if(sessionStorage.setItem("vlp_token",k),V().set(null==e?void 0:e.refreshToken),k&&!M(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:ln=JSON.parse(atob(k.split(".")[1]));case 16:return e.isAnonymousUser=!(null===(l=ln)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=ln)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=ln)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=ln)||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),_.set(e.apiBaseUrl),null!=e&&e.skin&&!oe(e.skin)||(e.skin="VL_ONE"),n.next=32,Ee(e);case 32:j&&se("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return H(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?(I={directPlaybackUrl:f,id:P="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?y(P,k).then((function(n){an(O,{res:mn(mn({},n),I)},e,{resolve:t,reject:o})})).catch((function(e){g(e,O,o,P)})):an(O,{res:I},e,{resolve:t,reject:o})):b?vn(e,{resolve:t,reject:o}):h?cn(e,{resolve:t,reject:o}):sn(e,{resolve:t,reject:o});case 36:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:$,skip:P,getPlayer:ne,play:I,pause:E,detectBrowser:ie,rewind:D,loadVideo:a,seekToTimeStamp:K,isPlayerInitialised:x,load:C,authenticateLC:R,dispose:N,enableCaptions:Z,disableCaptions:X,getCaptions:J,playSelectedResolution:ee,getSource:l,setVolume:ce,getVolume:de,disableControls:m,setPlaybackSpeed:Y,getEntitlementData:A}}export{yn 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 w,u as b,v as k,w as O,x as j,y as S,z as T,A as P,B as I,C as E,D,E as x,F as C,G as R,H as N,I as A,J as _,K as L,L as V,M,N as H}from"./generic-31014ce3.js";import U from"@babel/runtime/helpers/defineProperty";import B from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/regenerator";import W from"video.js";import{o as z,g as q,a as G,s as K,b as Y}from"./util-623a2db0.js";import{g as J,d as X,a as Q,e as Z}from"./captions-135a6d13.js";import{g as $}from"./renditions-cdeb4051.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){U(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?we(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 we(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),{},U({},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 be(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=B(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(W),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=W.dom.getPointerPosition(a,n).x;W.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=B(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=B(F.mark((function e(){return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){W.getPlugin("eme")||W.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=B(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(W),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)}}(),Pe=function(){var e=B(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)}}(),Ie=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(W)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(W)}))},loadAdsLibrary:je,loadEMELibrary:Se,loadMuxPlugin:Te,loadDvrSeekbar:Pe});function Ee(e){return De.apply(this,arguments)}function De(){return(De=B(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 Ie})).then((function(e){e.importAirplay()}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(e,n){return Ce.apply(this,arguments)}function Ce(){return(Ce=B(F.mark((function e(n,t){var o,i,r,l,a,s,u;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t?void 0:t.contentType)||"video",s=null==t||null===(o=t[a])||void 0===o?void 0:o.drmEnabled,null==t||null===(i=t[a])||void 0===i||null===(r=i.liveDetails)||void 0===r||r.isDvrEnabled,null==n||n.showPositiveSeekbar,u="Chrome"==ie()&&(null==t||null===(l=t.video)||void 0===l?void 0:l.isSSAIEnabled),e.prev=5,e.next=8,Promise.allSettled([s?Se():null,ke(n),u?se("https://cdn.dashjs.org/v5.0.0/modern/umd/dash.all.min.js"):null]);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function Re(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 Ne(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Re(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Re(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ae=new Set,_e=null,Le=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"]=We(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=Be(e),v["c3.cm.genreList"]=Me(e),v["c3.cm.genre"]=Ve(e),v["c3.cm.channel"]=He(e);var f=ze(i(),e);return v=Ne(Ne({},v),f)},Ve=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"},He=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"},Be=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"},Fe=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)},We=function(e){return"linearchannel"===((null==e?void 0:e.contentType)||"video")?"Live":"VOD"};var ze=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"}},Ge=function(e){switch(e){case"application/x-mpegURL":case"application/vnd.apple.mpegurl":return"HLS";case"application/dash+xml":return"DASH";default:return"Unknown"}},Ke=function(){var e=B(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),Ae.clear(),_e=d.currentSrc();var i=Ge(d.currentType()),r=n(),s=Le(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]=Fe(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(){Ae.has(d.currentSrc())||(Ae.add(d.currentSrc()),v("playbackStarted",null))})),d.on("ended",(function(){Ae.has(d.currentSrc())&&Ae.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==Ae||Ae.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-0d2457ba.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-cd44c2c8.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-c8c038b7.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-7934720a.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-bada613c.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-aaf41067.js").then((function(t){t.initialiseSkin(e,n)}))},Je=!1,Xe=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)&&!Je){var r=Qe(e,"videoAssets","secondaryVideoAssets"),s=l(r,n);return s&&a(n,s),Je=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Qe(e,n,t){if(Array.isArray(e))return e.map((function(e){return Qe(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]=Qe(e[i],n,t)})),o}return e}function Ze(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function $e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ze(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ze(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var en=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($e({status:!0,msg:"Player Initialised"},f?{seriesResponse:f,response:p}:{response:p}))})),m.on("loadeddata",(function(){var o,i,r,l=J(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=$e($e({},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,w,b,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===(w=O.series)||void 0===w?void 0:w.title,video_stream_type:null!=O&&null!==(b=O.streamingInfo)&&void 0!==b&&b.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&&Xe(p,e)})),m.on("error",(function(){var n,t;(console.log("ERROR",m.error(),m.error().code),4===m.error().code&&h)?Xe(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 nn(e){return tn.apply(this,arguments)}function tn(){return(tn=B(F.mark((function e(n){var t,o,i,r,l,a,s,u,c,d,v,p,f;return F.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.id_,i=this.el().querySelector("video")||this.el(),r=window.player=null===(t=window.dashjs)||void 0===t?void 0:t.MediaPlayer().create(),l=(null==n?void 0:n.keySystems)&&(null==n||null===(o=n.keySystems)||void 0===o?void 0:o["com.widevine.alpha"]),a=null==n?void 0:n.src,r&&i?(r.initialize(i,a,!0),l&&(d=null===(s=n.keySystems["com.widevine.alpha"])||void 0===s?void 0:s.url,v=null===(u=n.keySystems["com.microsoft.playready"])||void 0===u?void 0:u.url,p=null===(c=n.keySystems["com.widevine.alpha"])||void 0===c?void 0:c.licenseHeaders["X-AxDRM-Message"],f={"com.widevine.alpha":{serverURL:d,httpRequestHeaders:{"X-AxDRM-Message":p},audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_CRYPTO"},"com.microsoft.playready":{serverURL:v,httpRequestHeaders:{"X-AxDRM-Message":p},audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_CRYPTO"}},r.setProtectionData(f))):console.error("Cannot initialise dash player");case 6:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function on(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 rn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?on(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ln,an=function(e,n,t,o){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,T,P,I,E,D,x,C,R,N,A,_,L,V,M,H,z,q,G=n.res,K=void 0===G?null:G,Y=n.sres,J=void 0===Y?null:Y,X=null!=t&&t.chromecastReceiverId?["chromecast","html5"]:["html5"],Z=(null===(i=K)||void 0===i?void 0:i.contentType)||"video",$=te(null===(r=K)||void 0===r||null===(s=r[Z])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl)||te(null===(d=K)||void 0===d||null===(y=d[Z])||void 0===y||null===(h=y.gist)||void 0===h||null===(g=h.imageGist)||void 0===g?void 0:g.r16x9),ee=(null===(w=K)||void 0===w||null===(b=w[Z])||void 0===b||null===(k=b.liveDetails)||void 0===k?void 0:k.isDvrEnabled)||!1,ne=(null===(O=K)||void 0===O||null===(j=O[Z])||void 0===j||null===(S=j.streamingInfo)||void 0===S?void 0:S.isLiveStreafm)||!1,oe=(null===(T=K)||void 0===T||null===(P=T.ads)||void 0===P||null===(I=P.preRoll)||void 0===I||null===(E=I.adTags)||void 0===E||null===(D=E.web)||void 0===D?void 0:D.active)&&(null===(x=K)||void 0===x||null===(C=x.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);K=rn(rn({},K),{},{audioAssetSource:null==t?void 0:t.audioAssetSource});var re="Chrome"==ie()&&(null===(_=K)||void 0===_||null===(L=_.video)||void 0===L?void 0:L.isSSAIEnabled),le="dirtvision"==(null===(V=K)||void 0===V?void 0:V.siteName),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:ee},U(q,"autoplay",null==t?void 0:t.autoplay),U(q,"normalizeAutoplay",(null==t?void 0:t.autoplay)&&!oe),U(q,"loop",(null==t?void 0:t.loop)||!1),U(q,"audioPosterMode",null==t?void 0:t.audioPosterMode),U(q,"html5",rn(rn({vhs:rn(rn(rn({},le&&{playlistExclusionDuration:30}),{},{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:!("Safari"!=ie()&&!re)},0==(null==t||null===(H=t.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==t||null===(z=t.customData)||void 0===z?void 0:z.nativeVideoTracks)&&{nativeVideoTracks:!1})),U(q,"poster",$),U(q,"techOrder",X),U(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 w=(null==e||null===(o=e[p])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";f.contentType=w;var b=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=b;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}(K,n,o)}}),q);if(!W.getPlayers()[e])var se=W(e,ae,function(){var n=B(F.mark((function n(){var i,r,s,u,d,y,h,g,w,b,k,O,j,S,T,P,I,E,D,x,C,R;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(se),console.log(W.VERSION),console.log(W.getPlugins()),n.next=5,xe(t,K);case 5:S=null===(i=K)||void 0===i||null===(r=i[Z])||void 0===r||null===(s=r.liveDetails)||void 0===s?void 0:s.startOverTime,ne&&o.resolve(rn({status:!0,msg:"Player Initialised"},J?{seriesResponse:J,response:K}:{response:K})),v(e,null==t?void 0:t.analyticsCb),Ke(e,t),/Android/i.test(navigator.userAgent)&&(W.options.vhs.overrideNative=!0),ee&&Oe(e,S),!oe||null!=t&&null!==(u=t.customData)&&void 0!==u&&u.disableAds||p(e,oe,K),T=l(K,e),console.log(T),null!=t&&t.nearestClusterUrl&&(T=f(T,t.nearestClusterUrl)),re&&null!==(d=T)&&void 0!==d&&null!==(y=d.src)&&void 0!==y&&y.includes(".mpd")?nn.call(this,T):T?a(e,T):(o.reject({status:!1,msg:"Incompatible / Missing Source",response:K}),c(e,"Incompatible / Missing Source")),((null===(h=K)||void 0===h||null===(g=h[Z])||void 0===g||null===(w=g.contentDetails)||void 0===w||null===(b=w.closedCaptions)||void 0===b?void 0:b.length)>0||(null===(k=K)||void 0===k||null===(O=k[Z])||void 0===O||null===(j=O.closedCaptions)||void 0===j?void 0:j.length)>0)&&(R=(null===(I=K)||void 0===I||null===(E=I[Z])||void 0===E||null===(D=E.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(x=K)||void 0===x||null===(C=x[Z])||void 0===C?void 0:C.closedCaptions),P=R.filter((function(e){return"VTT"===e.format})),Q(e,P)),null!=t&&t.disableControls?m(e):Ye(e,rn(rn(rn({},t),ae),{},{liveVideo:ne,isDvrEnabled:ee,res:K,sres:J})),en(e,rn(rn(rn({},t),ae),{},{liveVideo:ne}),o,{res:K,sres:J});case 19:case"end":return n.stop()}}),n,this)})));return function(){return n.apply(this,arguments)}}())};function sn(e,n){return un.apply(this,arguments)}function un(){return(un=B(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,w();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,w=be((null===(m=n.watchHistory)||void 0===m?void 0:m.profileId)||"",r,null==n?void 0:n.siteOwner);if(w&&w.length)n.watchHistoryResumeTime=(null===(y=w[0])||void 0===y?void 0:y.watchedTime)||null,n.watchedPercentage=(null===(g=w[0])||void 0===g?void 0:g.watchedPercentage)||null;f.contentType="video",an(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(){an(l,{res:f},n,{resolve:o,reject:i})}));else an(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 cn(e,n){return dn.apply(this,arguments)}function dn(){return(dn=B(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,w();case 3:r=e.sent,l=null==n?void 0:n.playerId,a=null==n?void 0:n.epg,b(a,r).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==a?void 0:a.channelId,an(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 vn(e,n){return pn.apply(this,arguments)}function pn(){return(pn=B(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,w();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),an(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 fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function mn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fn(Object(t),!0).forEach((function(n){U(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function yn(){return{loadVideoInstantly:T,onTimeUpdate:z,getVideoDuration:q,onVideoEnded:G,init:function(e){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var n=B(F.mark((function n(t,o){var i,r,l,a,s,u,c,d,v,p,f,m,h,w,b,k,O,j,S,T,P,I;return F.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!x(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,w=null==e?void 0:e.videoId,b=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1,window.videoId=w,k=null==e?void 0:e.token,!L(e)){n.next=16;break}if(sessionStorage.setItem("vlp_token",k),V().set(null==e?void 0:e.refreshToken),k&&!M(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:ln=JSON.parse(atob(k.split(".")[1]));case 16:return e.isAnonymousUser=!(null===(l=ln)||void 0===l||!l.anonymousId),e.siteOwner=(null===(a=ln)||void 0===a?void 0:a.site)||null,e.userId=(null===(s=ln)||void 0===s?void 0:s.userId)||null,window.sessionStorage.setItem("uid",null===(u=ln)||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),_.set(e.apiBaseUrl),null!=e&&e.skin&&!oe(e.skin)||(e.skin="VL_ONE"),n.next=32,Ee(e);case 32:j&&se("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return H(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?(I={directPlaybackUrl:f,id:P="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},m?y(P,k).then((function(n){an(O,{res:mn(mn({},n),I)},e,{resolve:t,reject:o})})).catch((function(e){g(e,O,o,P)})):an(O,{res:I},e,{resolve:t,reject:o})):b?vn(e,{resolve:t,reject:o}):h?cn(e,{resolve:t,reject:o}):sn(e,{resolve:t,reject:o});case 36:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},getRenditions:$,skip:P,getPlayer:ne,play:I,pause:E,detectBrowser:ie,rewind:D,loadVideo:a,seekToTimeStamp:K,isPlayerInitialised:x,load:C,authenticateLC:R,dispose:N,enableCaptions:Z,disableCaptions:X,getCaptions:J,playSelectedResolution:ee,getSource:l,setVolume:ce,getVolume:de,disableControls:m,setPlaybackSpeed:Y,getEntitlementData:A}}export{yn as default};
@@ -0,0 +1 @@
1
+ import{h as e,o as t,p as n,q as r}from"./features-a05b3506.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-614b64ef.js";import{i as c}from"./browser-d4613b36.js";import"videojs-contrib-quality-menu";import u from"video.js";import{k as p,i as m}from"./keyboardShortcuts-41c775a6.js";import{l as v,R as f,e as b}from"./generic-31014ce3.js";import y from"@babel/runtime/helpers/toConsumableArray";import h from"@babel/runtime/helpers/slicedToArray";import g from"@babel/runtime/helpers/defineProperty";import j from"@babel/runtime/helpers/asyncToGenerator";import S 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-cdeb4051.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-10c4c9f6.js";import"./util-623a2db0.js";import"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-135a6d13.js";function w(t,n){var r=o(t);r&&(r.on("loadeddata",(function(){var e,r,a,i,d;!function(e){var t=o(e);t&&t.qualityMenu({useResolutionLabels:!0})}(t),!(null!=n&&null!==(e=n.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!=n&&n.liveVideo||l(t,n),null!=n&&n.liveVideo||c()||s(t)})),r.one("play",(function(){var n,r,o,a;null!==(n=window)&&void 0!==n&&null!==(r=n.customData)&&void 0!==r&&r.iframeOverlayUrl&&e(t,null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.iframeOverlayUrl)})))}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return C(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);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(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(){return E=j(S.mark((function e(t,n){var r,l,s,d,c,u,m,b,g,w,C,I,E,A,T,M,P,N;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N=function(e,n){var r=o(t);Math.floor(r.currentTime());var a,i,l,s,d,c,u,p,m=O(n);try{for(m.s();!(a=m.n()).done;)i=void 0,l=void 0,s=void 0,d=void 0,c=void 0,u=void 0,p=void 0,i=a.value,l=i.eventType,s=i.beaconUrls,d=i.startTimeInSeconds,c=i.startTime,i.durationInSeconds,u=Math.round(d),p=s[0],u!=Math.round(r.currentTime())||P.has(c)||(P.set(c,!0),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",l,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",e),fetch(p))}catch(e){m.e(e)}finally{m.f()}},M=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))},A=function(e){var t={},n=e.split("?")[1];if(!n)return t;var r,o=O(n.split("&"));try{for(o.s();!(r=o.n()).done;){var a=r.value.split("="),i=h(a,2),l=i[0],s=i[1];t[decodeURIComponent(l)]=decodeURIComponent(s||"")}}catch(e){o.e(e)}finally{o.f()}for(var d={},c=0,u=Object.entries(t);c<u.length;c++){var p=h(u[c],2),m=p[0],v=p[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=v;else d[m]=v}return d},r=o(t),l=n.replace("dash","session").replace("master","session"),l=f(l,t,{}),s=A(l),l=l.split("?")[0],e.next=10,fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:x({},s)})});case 10:return d=e.sent,e.next=13,d.json();case 13:c=e.sent,u="https://"+new URL(l).hostname,m=c.trackingUrl,b=c.manifestUrl,g=u+m,w=u+b,console.log("%c TRACKING URL","background: #bdf369; color: #000",g),null!=n&&n.includes(".mpd")?(window.player.attachSource(w),C=performance.now(),r.on("loadeddata",(function(){var e=performance.now();console.log("%c Video loaded in ","background: #e76a50; color: #fff","".concat((e-C).toFixed(3)," ms"))}))):(E=(null==r||null===(I=r.currentSource())||void 0===I?void 0:I.keySystems)||null,v(t,{src:w,type:"application/x-mpegURL",keySystems:E})),r.one("loadeddata",(function(){T(g)})),T=function(){var e=j(S.mark((function e(n){var r,l,s,d,c,u,m,v,f,b,h,g,j,w,O,C;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n);case 2:return l=e.sent,e.next=5,l.json();case 5:s=e.sent,d=s.avails,c=[],u=o(t),m=u.controlBar.progressControl,v=m.seekBar.el(),d.map((function(e){var t;Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&c.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)})})),c.forEach((function(e){var t=e.markerPositionInSeconds,n=u.duration();if(!(t>n)){var r=t/n*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",v.appendChild(o)}})),f=-1,u.on("timeupdate",a((function(){var e=Math.floor(u.currentTime());if(e!==f){f=e;for(var t=!1,n=function(){var n=o[r],a=n.startTimeInSeconds,i=n.durationInSeconds,l=n.ads,s=Math.floor(a+i);if(e>=a&&e<=s){t=!0,p.disable(),m.el().style.visibility="hidden";for(var d=e-a,c=0,u=0,v=0;v<l.length;v++){var f,h=null==l||null===(f=l[v])||void 0===f?void 0:f.durationInSeconds;if(d<c+h){u=v;break}c+=h}var g=l[u],j=d-c,S=Math.max(0,g.durationInSeconds-j),k=Math.round(S);b.style.display="block",O.textContent="".concat(u+1," of ").concat(l.length," • ").concat(M(k));var w=[];return l.forEach((function(e){var t=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression"].includes(e.eventType)}));w.push.apply(w,y(t))})),N(n,w),"break"}},r=0,o=c;r<o.length;r++){if("break"===n())break}t||(b.style.display="none",m.el().style.visibility="visible",p.enable())}}),1e3)),(b=document.createElement("div")).className="ssai-ad-container",(h=document.createElement("div")).className="sponsored-adbox",(g=document.createElement("div")).className="sponsored-text",g.textContent="Sponsored Ad",(j=document.createElement("div")).className="ad-info-icon",w=i(k()),j.appendChild(w),h.append(g),h.append(j),(O=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",(C=document.createElement("div")).className="ad-visit-advertiser",C.textContent="Visit Advertiser",(null===(r=document.getElementsByClassName("tvProviderImage"))||void 0===r?void 0:r[0])&&(C.style.right="8.6rem"),b.append(h),b.append(O),b.append(C),u.el().appendChild(b);case 41:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=new Map;case 24:case"end":return e.stop()}}),e)}))),E.apply(this,arguments)}function A(e,a){o(e).addClass("skin_vlone"),w(e,a),function(e,o){var a,i,l,s,c,u,p=null==o||null===(a=o.res)||void 0===a||null===(i=a.video)||void 0===i?void 0:i.isSSAIEnabled,v=b(null==o?void 0:o.res,e),f=v.src;(null==o||null===(l=o.relatedVideos)||void 0===l||null===(s=l.content)||void 0===s?void 0:s.length)>0&&t(e,null==o?void 0:o.relatedVideos);null!=o&&null!==(c=o.series)&&void 0!==c&&c.enable&&n(e,o);(null==o||null===(u=o.streams)||void 0===u?void 0:u.length)>1&&r(e,null==o?void 0:o.streams);d(e,o),m(e,o),p&&function(e,t){E.apply(this,arguments)}(e,f)}(e,a),T()}var T=function(){var e,t,n,r,o,a,i,l,s,d,c,p,m=u.dom.$(".vjs-play-progress"),v=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");v&&(v.style.color="".concat(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(n=t.appcmsMain)||void 0===n||null===(r=n.brand)||void 0===r||null===(o=r.cta)||void 0===o||null===(a=o.primary)||void 0===a?void 0:a.backgroundColor)),m&&(m.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===(c=d.cta)||void 0===c||null===(p=c.primary)||void 0===p?void 0:p.backgroundColor))};export{A as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.198-backup",
3
+ "version": "1.0.199-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";var e=require("./features-5cbffaed.js"),r=require("./skin-34fbc337.js"),n=require("./index-6683bb30.js"),t=require("./browser-77c57718.js");require("videojs-contrib-quality-menu");var o=require("video.js"),a=require("./keyboardShortcuts-00a00940.js"),i=require("./generic-2cdbd5ac.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-f9e729be.js"),require("./localisation-56e0a999.js"),require("./autoNextVideo-235d57ff.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,a){var i=r.getPlayer(o);i&&(i.on("loadeddata",(function(){var e,i,l,s,d;!function(e){var n=r.getPlayer(e);n&&n.qualityMenu({useResolutionLabels:!0})}(o),!(null!=a&&null!==(e=a.series)&&void 0!==e&&e.enable||null!==(i=window)&&void 0!==i&&null!==(l=i.app_data)&&void 0!==l&&null!==(s=l.appcmsMain)&&void 0!==s&&null!==(d=s.features)&&void 0!==d&&d.auto_play)||null!=a&&a.liveVideo||n.addNextEpPreview(o,a),null!=a&&a.liveVideo||t.isMobile()||n.initiateTrickplay(o)})),i.one("play",(function(){var r,n,t,a;null!==(r=window)&&void 0!==r&&null!==(n=r.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(o,null===(t=window)||void 0===t||null===(a=t.customData)||void 0===a?void 0:a.iframeOverlayUrl)})))}function f(e,r){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,r){if(e){if("string"==typeof e)return m(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){n&&(e=n);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 a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n<r;n++)t[n]=e[n];return t}function y(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function b(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?y(Object(n),!0).forEach((function(r){d(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function h(){return h=u(c.mark((function e(n,t){var o,d,p,m,y,h,g,S,j,k,w,q,O,I,P,C;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C=function(e,t){var o=r.getPlayer(n);Math.floor(o.currentTime());var a,i,l,s,d,u,c,v,p=f(t);try{for(p.s();!(a=p.n()).done;)i=void 0,l=void 0,s=void 0,d=void 0,u=void 0,c=void 0,v=void 0,i=a.value,l=i.eventType,s=i.beaconUrls,d=i.startTimeInSeconds,u=i.startTime,i.durationInSeconds,c=Math.round(d),v=s[0],c!=Math.round(o.currentTime())||P.has(u)||(P.set(u,!0),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",l,"Fired:".concat(Math.round(o.currentTime())),"AD_POD:",e),fetch(v))}catch(e){p.e(e)}finally{p.f()}},I=function(e){var r=Math.floor(e/60),n=Math.floor(e%60);return"".concat(r,":").concat(n.toString().padStart(2,"0"))},q=function(e){var r={},n=e.split("?")[1];if(!n)return r;var t,o=f(n.split("&"));try{for(o.s();!(t=o.n()).done;){var a=t.value.split("="),i=s(a,2),l=i[0],d=i[1];r[decodeURIComponent(l)]=decodeURIComponent(d||"")}}catch(e){o.e(e)}finally{o.f()}for(var u={},c=0,v=Object.entries(r);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=r.getPlayer(n),d=t.replace("dash","session").replace("master","session"),d=i.replaceMacros(d,n,{}),p=q(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,j=h+g,k=h+S,console.log("%c TRACKING URL","background: #bdf369; color: #000",j),null!=t&&t.includes(".mpd")?(window.player.attachSource(k),w=performance.now(),o.on("loadeddata",(function(){var e=performance.now();console.log("%c Video loaded in ","background: #e76a50; color: #fff","".concat((e-w).toFixed(3)," ms"))}))):i.loadVideo(n,{src:k,type:"application/x-mpegURL"}),o.one("loadeddata",(function(){O(j)})),O=function(){var e=u(c.mark((function e(t){var o,i,s,d,u,p,f,m,y,b,h,g,S,j,k,w;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return i=e.sent,e.next=5,i.json();case 5:s=e.sent,d=s.avails,u=[],p=r.getPlayer(n),f=p.controlBar.progressControl,m=f.seekBar.el(),d.map((function(e){var r;Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(r=e.ads)||void 0===r?void 0:r.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 r=e.markerPositionInSeconds,n=p.duration();if(!(r>n)){var t=r/n*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=-1,p.on("timeupdate",r.throttle((function(){var e=Math.floor(p.currentTime());if(e!==y){y=e;for(var r=!1,n=function(){var n=o[t],i=n.startTimeInSeconds,s=n.durationInSeconds,d=n.ads,u=Math.floor(i+s);if(e>=i&&e<=u){r=!0,a.keyboardManager.disable(),f.el().style.visibility="hidden";for(var c=e-i,v=0,p=0,m=0;m<d.length;m++){var y,h=null==d||null===(y=d[m])||void 0===y?void 0:y.durationInSeconds;if(c<v+h){p=m;break}v+=h}var g=d[p],S=c-v,j=Math.max(0,g.durationInSeconds-S),w=Math.round(j);b.style.display="block",k.textContent="".concat(p+1," of ").concat(d.length," • ").concat(I(w));var q=[];return d.forEach((function(e){var r=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression"].includes(e.eventType)}));q.push.apply(q,l(r))})),C(n,q),"break"}},t=0,o=u;t<o.length;t++){if("break"===n())break}r||(b.style.display="none",f.el().style.visibility="visible",a.keyboardManager.enable())}}),1e3)),(b=document.createElement("div")).className="ssai-ad-container",(h=document.createElement("div")).className="sponsored-adbox",(g=document.createElement("div")).className="sponsored-text",g.textContent="Sponsored Ad",(S=document.createElement("div")).className="ad-info-icon",j=r.parseSvgString(v.InfoIcon()),S.appendChild(j),h.append(g),h.append(S),(k=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",(w=document.createElement("div")).className="ad-visit-advertiser",w.textContent="Visit Advertiser",(null===(o=document.getElementsByClassName("tvProviderImage"))||void 0===o?void 0:o[0])&&(w.style.right="8.6rem"),b.append(h),b.append(k),b.append(w),p.el().appendChild(b);case 41:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),P=new Map;case 24:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}var g=function(){var e,r,n,t,a,i,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===(r=e.app_data)||void 0===r||null===(n=r.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(i=a.primary)||void 0===i?void 0:i.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){r.getPlayer(t).addClass("skin_vlone"),p(t,o),function(r,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=i.getSource(null==t?void 0:t.res,r),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(r,null==t?void 0:t.relatedVideos);null!=t&&null!==(u=t.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(r,t);(null==t||null===(c=t.streams)||void 0===c?void 0:c.length)>1&&e.addMulticamSelector(r,null==t?void 0:t.streams);n.addTVProviderImage(r,t),a.initialiseKeyboardEvents(r,t),v&&function(e,r){h.apply(this,arguments)}(r,f)}(t,o),g()};
@@ -1 +0,0 @@
1
- import{h as e,o as t,p as n,q as r}from"./features-a05b3506.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-614b64ef.js";import{i as c}from"./browser-d4613b36.js";import"videojs-contrib-quality-menu";import u from"video.js";import{k as p,i as m}from"./keyboardShortcuts-41c775a6.js";import{l as v,R as f,e as b}from"./generic-31014ce3.js";import y from"@babel/runtime/helpers/toConsumableArray";import h from"@babel/runtime/helpers/slicedToArray";import g from"@babel/runtime/helpers/defineProperty";import j from"@babel/runtime/helpers/asyncToGenerator";import w from"@babel/runtime/regenerator";import{I as S}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-cdeb4051.js";import"./localisation-0bf399a1.js";import"./autoNextVideo-10c4c9f6.js";import"./util-623a2db0.js";import"@babel/runtime/helpers/typeof";import"axios";import"js-cookie";import"ua-parser-js";import"./captions-135a6d13.js";function k(t,n){var r=o(t);r&&(r.on("loadeddata",(function(){var e,r,a,i,d;!function(e){var t=o(e);t&&t.qualityMenu({useResolutionLabels:!0})}(t),!(null!=n&&null!==(e=n.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!=n&&n.liveVideo||l(t,n),null!=n&&n.liveVideo||c()||s(t)})),r.one("play",(function(){var n,r,o,a;null!==(n=window)&&void 0!==n&&null!==(r=n.customData)&&void 0!==r&&r.iframeOverlayUrl&&e(t,null===(o=window)||void 0===o||null===(a=o.customData)||void 0===a?void 0:a.iframeOverlayUrl)})))}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return C(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);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(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(){return E=j(w.mark((function e(t,n){var r,l,s,d,c,u,m,b,g,k,C,I,E,A,T,M;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M=function(e,n){var r=o(t);Math.floor(r.currentTime());var a,i,l,s,d,c,u,p,m=O(n);try{for(m.s();!(a=m.n()).done;)i=void 0,l=void 0,s=void 0,d=void 0,c=void 0,u=void 0,p=void 0,i=a.value,l=i.eventType,s=i.beaconUrls,d=i.startTimeInSeconds,c=i.startTime,i.durationInSeconds,u=Math.round(d),p=s[0],u!=Math.round(r.currentTime())||T.has(c)||(T.set(c,!0),console.log("%c SSAI BEACON ","background: #e25822; color: #fff",l,"Fired:".concat(Math.round(r.currentTime())),"AD_POD:",e),fetch(p))}catch(e){m.e(e)}finally{m.f()}},A=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))},I=function(e){var t={},n=e.split("?")[1];if(!n)return t;var r,o=O(n.split("&"));try{for(o.s();!(r=o.n()).done;){var a=r.value.split("="),i=h(a,2),l=i[0],s=i[1];t[decodeURIComponent(l)]=decodeURIComponent(s||"")}}catch(e){o.e(e)}finally{o.f()}for(var d={},c=0,u=Object.entries(t);c<u.length;c++){var p=h(u[c],2),m=p[0],v=p[1];if(m.startsWith("ads."))d[m.replace(/^ads\./,"")]=v;else d[m]=v}return d},r=o(t),l=n.replace("dash","session").replace("master","session"),l=f(l,t,{}),s=I(l),l=l.split("?")[0],e.next=10,fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adsParams:x({},s)})});case 10:return d=e.sent,e.next=13,d.json();case 13:c=e.sent,u="https://"+new URL(l).hostname,m=c.trackingUrl,b=c.manifestUrl,g=u+m,k=u+b,console.log("%c TRACKING URL","background: #bdf369; color: #000",g),null!=n&&n.includes(".mpd")?(window.player.attachSource(k),C=performance.now(),r.on("loadeddata",(function(){var e=performance.now();console.log("%c Video loaded in ","background: #e76a50; color: #fff","".concat((e-C).toFixed(3)," ms"))}))):v(t,{src:k,type:"application/x-mpegURL"}),r.one("loadeddata",(function(){E(g)})),E=function(){var e=j(w.mark((function e(n){var r,l,s,d,c,u,m,v,f,b,h,g,j,k,O,C;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n);case 2:return l=e.sent,e.next=5,l.json();case 5:s=e.sent,d=s.avails,c=[],u=o(t),m=u.controlBar.progressControl,v=m.seekBar.el(),d.map((function(e){var t;Array.isArray(null==e?void 0:e.ads)&&(null==e||null===(t=e.ads)||void 0===t?void 0:t.length)>0&&c.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)})})),c.forEach((function(e){var t=e.markerPositionInSeconds,n=u.duration();if(!(t>n)){var r=t/n*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",v.appendChild(o)}})),f=-1,u.on("timeupdate",a((function(){var e=Math.floor(u.currentTime());if(e!==f){f=e;for(var t=!1,n=function(){var n=o[r],a=n.startTimeInSeconds,i=n.durationInSeconds,l=n.ads,s=Math.floor(a+i);if(e>=a&&e<=s){t=!0,p.disable(),m.el().style.visibility="hidden";for(var d=e-a,c=0,u=0,v=0;v<l.length;v++){var f,h=null==l||null===(f=l[v])||void 0===f?void 0:f.durationInSeconds;if(d<c+h){u=v;break}c+=h}var g=l[u],j=d-c,w=Math.max(0,g.durationInSeconds-j),S=Math.round(w);b.style.display="block",O.textContent="".concat(u+1," of ").concat(l.length," • ").concat(A(S));var k=[];return l.forEach((function(e){var t=e.trackingEvents.filter((function(e){return["breakStart","breakEnd","firstQuartile","secondQuartile","thirdQuartile","fourthQuartile","midpoint","impression"].includes(e.eventType)}));k.push.apply(k,y(t))})),M(n,k),"break"}},r=0,o=c;r<o.length;r++){if("break"===n())break}t||(b.style.display="none",m.el().style.visibility="visible",p.enable())}}),1e3)),(b=document.createElement("div")).className="ssai-ad-container",(h=document.createElement("div")).className="sponsored-adbox",(g=document.createElement("div")).className="sponsored-text",g.textContent="Sponsored Ad",(j=document.createElement("div")).className="ad-info-icon",k=i(S()),j.appendChild(k),h.append(g),h.append(j),(O=document.createElement("div")).className="ad-counter",document.createElement("div").className="ad-timer",(C=document.createElement("div")).className="ad-visit-advertiser",C.textContent="Visit Advertiser",(null===(r=document.getElementsByClassName("tvProviderImage"))||void 0===r?void 0:r[0])&&(C.style.right="8.6rem"),b.append(h),b.append(O),b.append(C),u.el().appendChild(b);case 41:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=new Map;case 24:case"end":return e.stop()}}),e)}))),E.apply(this,arguments)}function A(e,a){o(e).addClass("skin_vlone"),k(e,a),function(e,o){var a,i,l,s,c,u,p=null==o||null===(a=o.res)||void 0===a||null===(i=a.video)||void 0===i?void 0:i.isSSAIEnabled,v=b(null==o?void 0:o.res,e),f=v.src;(null==o||null===(l=o.relatedVideos)||void 0===l||null===(s=l.content)||void 0===s?void 0:s.length)>0&&t(e,null==o?void 0:o.relatedVideos);null!=o&&null!==(c=o.series)&&void 0!==c&&c.enable&&n(e,o);(null==o||null===(u=o.streams)||void 0===u?void 0:u.length)>1&&r(e,null==o?void 0:o.streams);d(e,o),m(e,o),p&&function(e,t){E.apply(this,arguments)}(e,f)}(e,a),T()}var T=function(){var e,t,n,r,o,a,i,l,s,d,c,p,m=u.dom.$(".vjs-play-progress"),v=u.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");v&&(v.style.color="".concat(null===(e=window)||void 0===e||null===(t=e.app_data)||void 0===t||null===(n=t.appcmsMain)||void 0===n||null===(r=n.brand)||void 0===r||null===(o=r.cta)||void 0===o||null===(a=o.primary)||void 0===a?void 0:a.backgroundColor)),m&&(m.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===(c=d.cta)||void 0===c||null===(p=c.primary)||void 0===p?void 0:p.backgroundColor))};export{A as initialiseSkin};