@viewlift/player-backup 1.0.60-backup → 1.0.61

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
@@ -15,7 +15,6 @@
15
15
 
16
16
 
17
17
 
18
-
19
18
  .widget-selection{
20
19
  display: flex;
21
20
  align-items: center;
@@ -136,6 +135,7 @@
136
135
  .widget-selector-content #sr-widget{
137
136
  padding: 0 18px;
138
137
  }
138
+
139
139
  .vjs-poster {
140
140
  display: inline-block;
141
141
  vertical-align: middle;
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/regenerator"),n=require("axios"),o=require("./chromecast-5dad1eb5.js"),r=require("video.js"),l=require("./util-835bacf7.js"),a=require("./renditions-a603eee8.js"),d=require("./resolution-3354cead.js"),s=require("./localisation-56e0a999.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?v(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}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");function m(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=m(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=t(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(n=JSON.parse(atob(t.split(".")[1])))||!n.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==n?void 0:n.userId);case 9:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=m(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var i,n,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,i,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var i,n;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(i=t.el_)&&void 0!==i&&null!==(n=i.className)&&void 0!==n&&n.includes("vjs-waiting"))c("BUFFERING",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,i,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",f({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,i,n,o,r,l;c("AD_REQUEST",f({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",f({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var i=Math.floor(e.currentTime());i>=30&&i%30==0&&!t.includes(i)&&(t.push(i),fireEvent({eventName:"PING",videoPosition:i,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),i=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(b(t,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var g,y,b=function(e,t,i){return e>=t&&e<=i};function T(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function P(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?T(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}window.fireEvent=function(){var e=t(i.mark((function e(t){var r,l,a,d,s,u,c,v,m,h,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=f,e.t1=f,e.t2=f({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=w(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(i=t.adPosition)?String(i):"":"",e.next=20,p();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s||null===(u=s.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,n({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var i}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var I=[],E=0,O=null;function j(e,t,i){var n,r,l,a,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];y=(null==t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1";var s=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,f=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,m={};"v1"==y?m={videoId:g,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==y&&(m=P(P({videoId:g,watchedTime:Math.floor(e.currentTime()),watchedPercentage:d?100:Math.floor(u/c*100),doneWatching:d,profileId:s},O&&{seriesId:O}),f&&{originalObjectId:f})),o.saveWatchHistory(m,y).then((function(e){})).catch((function(e){})),E=u+i}var k=function(e,t,i){var n=o.getPlayer(e);if(n)if(t>=0&&t<=100){n.muted()&&n.muted(!1);var r=parseFloat(t)/100;n.volume(r),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},S=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function D(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?D(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var C=function(e,t,i,n){var r,l,a=n.res,d=n.sres,s=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),s.on("loadstart",(function(){c&&i.resolve({status:!0,msg:"Video Loaded",response:a})})),s.on("loadeddata",(function(){var n;(null==s||!s.muted())&&k(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),i.resolve(A({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(n=t.watchHistory)&&void 0!==n&&n.enable&&!t.isAnonymousUser){var l,u,c=A(A({},t),a);!function(e,t,i){var n,r,l;null!=t&&t.series&&null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable&&(O=null==t||null===(r=t.series)||void 0===r?void 0:r.id),I=[],E=0,g=i;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,d=o.getPlayer(e);d&&(d.on("timeupdate",(function(){var e=Math.floor(d.currentTime());I.includes(E)||(e==E?(I.push(e),j(d,t,a)):e>E&&(E=e+a))})),d.one("ended",(function(){j(d,t,a,!0)})))}(e,c,null==r||null===(l=r.video)||void 0===l||null===(u=l.gist)||void 0===u?void 0:u.id)}})),s.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];s.trigger("subtitlechanged",t)})),s.on("subtitlechanged",(function(e,t){var i,n,o,r,l,a,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(d=a.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var w,p=m.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),s.on("loadedmetadata",(function(){window.endFirstFrame(s)})),s.one("error",(function(){var t,n;o.handleError(e,(null==s||null===(t=s.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==s||null===(n=s.error())||void 0===n?void 0:n.message)||"Some error occured"})})),s.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var i,n,r,l=null===(i=o.getCurrentVideo())||void 0===i||null===(n=i.video)||void 0===n||null===(r=n.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},d=a.t,u=a.p;d&&u<95&&setTimeout((function(){s.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){s.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),s.on("volumechange",(function(){var e=100*s.volume().toFixed(2);s.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},F=function(e,t){var i=null==t?void 0:t.skin;"live"==i?Promise.resolve().then((function(){return require("./skin-c7ccea8f.js")})).then((function(i){i.initialiseSkin(e,t)})):"default"==i?Promise.resolve().then((function(){return require("./skin-8d437032.js")})).then((function(i){i.initialiseSkin(e,t)})):"carousel"==i?Promise.resolve().then((function(){return require("./skin-4f320cb6.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==i?Promise.resolve().then((function(){return require("./skin-7cf58f50.js")})).then((function(i){i.initialiseSkin(e,t)})):"multiplayer"==i&&Promise.resolve().then((function(){return require("./skin-76fc1f46.js")})).then((function(i){i.initialiseSkin(e,t)}))},R=function(e){return new Promise((function(t,i){if(x(e))i("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){t()},n.onerror=function(t){i("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(n)}}))},x=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},M=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var H,_=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){R("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),R("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:_,loadEMELibrary:B});function V(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function q(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?V(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var L=function(n,l,a,d){var s,u,c,v,f,m,w,p,h,g,y,b,T,P,I,E,O,j,k,S,D,A,R,x,H,N,V,L,W,U,z,G,J,K=l.res,Q=void 0===K?null:K,Y=l.sres,X=void 0===Y?null:Y,Z=(null===(s=window)||void 0===s||null===(u=s.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(f=v.getInstance())||void 0===f?void 0:f.S)||void 0,$=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==Z&&"NOT_CONNECTED"!==Z?["html5","chromecast"]:["chromecast","html5"]:["html5"],ee=(null===(m=Q)||void 0===m?void 0:m.contentType)||"video",te=o.impolicy16x9(null===(w=Q)||void 0===w||null===(p=w[ee])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=Q)||void 0===g||null===(y=g[ee])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(P=Q)||void 0===P||null===(I=P[ee])||void 0===I||null===(E=I.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,ne=(null===(O=Q)||void 0===O||null===(j=O[ee])||void 0===j||null===(k=j.streamingInfo)||void 0===k?void 0:k.isLiveStream)||!1,oe=(null==a?void 0:a.drmLibrary)||!1,re=(null===(S=Q)||void 0===S||null===(D=S.ads)||void 0===D||null===(A=D.preRoll)||void 0===A||null===(R=A.adTags)||void 0===R||null===(x=R.web)||void 0===x?void 0:x.active)&&(null===(H=Q)||void 0===H||null===(N=H.ads)||void 0===N||null===(V=N.preRoll)||void 0===V||null===(L=V.adTags)||void 0===L||null===(W=L.web)||void 0===W?void 0:W.url);Q=q(q({},Q),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var le=(J={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(J,"autoplay",null==a?void 0:a.autoplay),e(J,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!re),e(J,"loop",(null==a?void 0:a.loop)||!1),e(J,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(J,"html5",q(q({dash:q(q({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:q(q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(U=a.customData)||void 0===U?void 0:U.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(z=a.customData)||void 0===z?void 0:z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(G=a.customData)||void 0===G?void 0:G.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(J,"poster",te),e(J,"techOrder",$),e(J,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(n),i=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return o.getChromecastCustomData(Q,e,i)}}),J),ae=r(n,le,function(){var e=t(i.mark((function e(){var t,l,s,u,c,v,f,m,w,p,h,g,y,b,T,P,I,E,O,j,k,S,D,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.initialisePlugins(a),ne&&d.resolve(q({status:!0,msg:"Player Initialised"},X?{seriesResponse:X,response:Q}:{response:Q})),window.initialise(ae),window.firstFrame(ae),"white"!==window.controlsColor&&M(window.controlsColor,ae),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=Q)||void 0===t||null===(l=t[ee])||void 0===l?void 0:l.drmEnabled,T=null===(s=Q)||void 0===s||null===(u=s[ee])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!oe){e.next=21;break}if("Safari"!==o.detectBrowser()){e.next=14;break}return e.next=12,B();case 12:e.next=21;break;case 14:if("caliente"!=(null===(P=window)||void 0===P?void 0:P.siteName)){e.next=19;break}return e.next=17,B();case 17:e.next=21;break;case 19:return e.next=21,_();case 21:ie&&o.addChromecastConfigurationDVR(n,T),!re||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(n,re,Q),(I=o.getSource(Q,n))?o.loadVideo(n,I):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Q}),o.handleError(n,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(f=Q)||void 0===f||null===(m=f[ee])||void 0===m||null===(w=m.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=Q)||void 0===h||null===(g=h[ee])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(A=(null===(O=Q)||void 0===O||null===(j=O[ee])||void 0===j||null===(k=j.contentDetails)||void 0===k?void 0:k.closedCaptions)||(null===(S=Q)||void 0===S||null===(D=S[ee])||void 0===D?void 0:D.closedCaptions),E=A.filter((function(e){return"VTT"===e.format})),o.addCaptions(n,E)),null!=a&&a.disableControls?o.disableControls(n):F(n,q(q(q({},a),le),{},{liveVideo:ne,isDvrEnabled:ie,res:Q,sres:X})),C(n,q(q(q({},a),le),{},{liveVideo:ne}),d,{res:Q,sres:X});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,i){var n,r,l,a,d,c,v,f,m,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(n=e.epg)||void 0===n?void 0:n.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=g;var b=null==e?void 0:e.token;if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),b&&!o.isTokenExpired(b)){H=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=H)||void 0===l?void 0:l.siteId,window.siteName=null===(a=H)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(d=H)||void 0===d||!d.anonymousId),e.siteOwner=(null===(c=H)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=H)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=H)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b);var T=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,I=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,s.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return N})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return N})).then((function(e){e.importChromecast()})),I&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return N})).then((function(e){e.importAirplay()})),O&&R("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then((function(){return e=O,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var k=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(k&&k.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var S,D=null==e||null===(S=e.series)||void 0===S?void 0:S.id;o.getSeriesDetails(D,b).then((function(n){var r,l,a,d=n.data,s=n.data.seasons;o.setCurrentSeries(s);var u=g||(null==s||null===(r=s[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var i=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(i)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(n){var r,l,a;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(n.data),L(T,{res:null==n?void 0:n.data,sres:d},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))})).catch((function(e){o.initiateErrorHandling(e,T,i)}))}else if(h){var A=null==e?void 0:e.epg;o.getLinearChannelDetails(A,b).then((function(n){var o=null==n?void 0:n.data;o.contentType="linearchannel",L(T,{res:o},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else o.getVideoDetails(g,b).then((function(n){var r,l,a,d;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(d=e.watchHistory)&&void 0!==d&&d.enable?o.getVideoInfo(g,b).then((function(n){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",L(T,{res:s},e,{resolve:t,reject:i})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),L(T,{res:s},e,{resolve:t,reject:i})})):L(T,{res:s},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else i({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}})}}))},getRenditions:a.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:k,getVolume:S,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/regenerator"),n=require("axios"),o=require("./chromecast-5dad1eb5.js"),r=require("video.js"),l=require("./util-835bacf7.js"),a=require("./renditions-a603eee8.js"),d=require("./resolution-3354cead.js"),s=require("./localisation-56e0a999.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?v(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}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");function m(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=m(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=t(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(n=JSON.parse(atob(t.split(".")[1])))||!n.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==n?void 0:n.userId);case 9:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=m(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var i,n,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,i,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var i,n;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(i=t.el_)&&void 0!==i&&null!==(n=i.className)&&void 0!==n&&n.includes("vjs-waiting"))c("BUFFERING",f({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,i,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",f({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,i,n,o,r,l;c("AD_REQUEST",f({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",f({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var i=Math.floor(e.currentTime());i>=30&&i%30==0&&!t.includes(i)&&(t.push(i),fireEvent({eventName:"PING",videoPosition:i,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),i=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(b(t,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var g,y,b=function(e,t,i){return e>=t&&e<=i};function T(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function P(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?T(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}window.fireEvent=function(){var e=t(i.mark((function e(t){var r,l,a,d,s,u,c,v,m,h,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=f,e.t1=f,e.t2=f({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=w(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(i=t.adPosition)?String(i):"":"",e.next=20,p();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(d=window)||void 0===d||null===(s=d.customData)||void 0===s||null===(u=s.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,n({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var i}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var I=[],E=0,O=null;function j(e,t,i){var n,r,l,a,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];y=(null==t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1";var s=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,f=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,m={};"v1"==y?m={videoId:g,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==y&&(m=P(P({videoId:g,watchedTime:Math.floor(e.currentTime()),watchedPercentage:d?100:Math.floor(u/c*100),doneWatching:d,profileId:s},O&&{seriesId:O}),f&&{originalObjectId:f})),o.saveWatchHistory(m,y).then((function(e){})).catch((function(e){})),E=u+i}var k=function(e,t,i){var n=o.getPlayer(e);if(n)if(t>=0&&t<=100){n.muted()&&n.muted(!1);var r=parseFloat(t)/100;n.volume(r),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},S=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function D(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?D(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var C=function(e,t,i,n){var r,l,a=n.res,d=n.sres,s=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),s.on("loadstart",(function(){c&&i.resolve({status:!0,msg:"Video Loaded",response:a})})),s.on("loadeddata",(function(){var n;(null==s||!s.muted())&&k(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),i.resolve(A({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(n=t.watchHistory)&&void 0!==n&&n.enable&&!t.isAnonymousUser){var l,u,c=A(A({},t),a);!function(e,t,i){var n,r,l;null!=t&&t.series&&null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable&&(O=null==t||null===(r=t.series)||void 0===r?void 0:r.id),I=[],E=0,g=i;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,d=o.getPlayer(e);d&&(d.on("timeupdate",(function(){var e=Math.floor(d.currentTime());I.includes(E)||(e==E?(I.push(e),j(d,t,a)):e>E&&(E=e+a))})),d.one("ended",(function(){j(d,t,a,!0)})))}(e,c,null==r||null===(l=r.video)||void 0===l||null===(u=l.gist)||void 0===u?void 0:u.id)}})),s.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];s.trigger("subtitlechanged",t)})),s.on("subtitlechanged",(function(e,t){var i,n,o,r,l,a,d,s,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(d=a.cast)||void 0===d||null===(s=d.framework)||void 0===s||null===(u=s.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var w,p=m.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),s.on("loadedmetadata",(function(){window.endFirstFrame(s)})),s.one("error",(function(){var t,n;o.handleError(e,(null==s||null===(t=s.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==s||null===(n=s.error())||void 0===n?void 0:n.message)||"Some error occured"})})),s.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var i,n,r,l=null===(i=o.getCurrentVideo())||void 0===i||null===(n=i.video)||void 0===n||null===(r=n.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},d=a.t,u=a.p;d&&u<95&&setTimeout((function(){s.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){s.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),s.on("volumechange",(function(){var e=100*s.volume().toFixed(2);s.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},F=function(e,t){var i=null==t?void 0:t.skin;"live"==i?Promise.resolve().then((function(){return require("./skin-c7ccea8f.js")})).then((function(i){i.initialiseSkin(e,t)})):"default"==i?Promise.resolve().then((function(){return require("./skin-8d437032.js")})).then((function(i){i.initialiseSkin(e,t)})):"carousel"==i?Promise.resolve().then((function(){return require("./skin-4f320cb6.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==i?Promise.resolve().then((function(){return require("./skin-093cf3e2.js")})).then((function(i){i.initialiseSkin(e,t)})):"multiplayer"==i&&Promise.resolve().then((function(){return require("./skin-76fc1f46.js")})).then((function(i){i.initialiseSkin(e,t)}))},R=function(e){return new Promise((function(t,i){if(x(e))i("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){t()},n.onerror=function(t){i("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(n)}}))},x=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},M=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var H,_=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){R("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),R("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:_,loadEMELibrary:B});function V(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function q(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?V(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var L=function(n,l,a,d){var s,u,c,v,f,m,w,p,h,g,y,b,T,P,I,E,O,j,k,S,D,A,R,x,H,N,V,L,W,U,z,G,J,K=l.res,Q=void 0===K?null:K,Y=l.sres,X=void 0===Y?null:Y,Z=(null===(s=window)||void 0===s||null===(u=s.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(f=v.getInstance())||void 0===f?void 0:f.S)||void 0,$=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==Z&&"NOT_CONNECTED"!==Z?["html5","chromecast"]:["chromecast","html5"]:["html5"],ee=(null===(m=Q)||void 0===m?void 0:m.contentType)||"video",te=o.impolicy16x9(null===(w=Q)||void 0===w||null===(p=w[ee])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=Q)||void 0===g||null===(y=g[ee])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(P=Q)||void 0===P||null===(I=P[ee])||void 0===I||null===(E=I.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,ne=(null===(O=Q)||void 0===O||null===(j=O[ee])||void 0===j||null===(k=j.streamingInfo)||void 0===k?void 0:k.isLiveStream)||!1,oe=(null==a?void 0:a.drmLibrary)||!1,re=(null===(S=Q)||void 0===S||null===(D=S.ads)||void 0===D||null===(A=D.preRoll)||void 0===A||null===(R=A.adTags)||void 0===R||null===(x=R.web)||void 0===x?void 0:x.active)&&(null===(H=Q)||void 0===H||null===(N=H.ads)||void 0===N||null===(V=N.preRoll)||void 0===V||null===(L=V.adTags)||void 0===L||null===(W=L.web)||void 0===W?void 0:W.url);Q=q(q({},Q),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var le=(J={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(J,"autoplay",null==a?void 0:a.autoplay),e(J,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!re),e(J,"loop",(null==a?void 0:a.loop)||!1),e(J,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(J,"html5",q(q({dash:q(q({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:q(q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(U=a.customData)||void 0===U?void 0:U.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(z=a.customData)||void 0===z?void 0:z.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(G=a.customData)||void 0===G?void 0:G.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(J,"poster",te),e(J,"techOrder",$),e(J,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(n),i=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return o.getChromecastCustomData(Q,e,i)}}),J),ae=r(n,le,function(){var e=t(i.mark((function e(){var t,l,s,u,c,v,f,m,w,p,h,g,y,b,T,P,I,E,O,j,k,S,D,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.initialisePlugins(a),ne&&d.resolve(q({status:!0,msg:"Player Initialised"},X?{seriesResponse:X,response:Q}:{response:Q})),window.initialise(ae),window.firstFrame(ae),"white"!==window.controlsColor&&M(window.controlsColor,ae),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=Q)||void 0===t||null===(l=t[ee])||void 0===l?void 0:l.drmEnabled,T=null===(s=Q)||void 0===s||null===(u=s[ee])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!oe){e.next=21;break}if("Safari"!==o.detectBrowser()){e.next=14;break}return e.next=12,B();case 12:e.next=21;break;case 14:if("caliente"!=(null===(P=window)||void 0===P?void 0:P.siteName)){e.next=19;break}return e.next=17,B();case 17:e.next=21;break;case 19:return e.next=21,_();case 21:ie&&o.addChromecastConfigurationDVR(n,T),!re||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(n,re,Q),(I=o.getSource(Q,n))?o.loadVideo(n,I):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Q}),o.handleError(n,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(f=Q)||void 0===f||null===(m=f[ee])||void 0===m||null===(w=m.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=Q)||void 0===h||null===(g=h[ee])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(A=(null===(O=Q)||void 0===O||null===(j=O[ee])||void 0===j||null===(k=j.contentDetails)||void 0===k?void 0:k.closedCaptions)||(null===(S=Q)||void 0===S||null===(D=S[ee])||void 0===D?void 0:D.closedCaptions),E=A.filter((function(e){return"VTT"===e.format})),o.addCaptions(n,E)),null!=a&&a.disableControls?o.disableControls(n):F(n,q(q(q({},a),le),{},{liveVideo:ne,isDvrEnabled:ie,res:Q,sres:X})),C(n,q(q(q({},a),le),{},{liveVideo:ne}),d,{res:Q,sres:X});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,i){var n,r,l,a,d,c,v,f,m,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(n=e.epg)||void 0===n?void 0:n.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=g;var b=null==e?void 0:e.token;if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),b&&!o.isTokenExpired(b)){H=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=H)||void 0===l?void 0:l.siteId,window.siteName=null===(a=H)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(d=H)||void 0===d||!d.anonymousId),e.siteOwner=(null===(c=H)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=H)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=H)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b);var T=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,I=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,s.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return N})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return N})).then((function(e){e.importChromecast()})),I&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return N})).then((function(e){e.importAirplay()})),O&&R("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then((function(){return e=O,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var k=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(k&&k.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var S,D=null==e||null===(S=e.series)||void 0===S?void 0:S.id;o.getSeriesDetails(D,b).then((function(n){var r,l,a,d=n.data,s=n.data.seasons;o.setCurrentSeries(s);var u=g||(null==s||null===(r=s[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var i=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(i)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(n){var r,l,a;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(n.data),L(T,{res:null==n?void 0:n.data,sres:d},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))})).catch((function(e){o.initiateErrorHandling(e,T,i)}))}else if(h){var A=null==e?void 0:e.epg;o.getLinearChannelDetails(A,b).then((function(n){var o=null==n?void 0:n.data;o.contentType="linearchannel",L(T,{res:o},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else o.getVideoDetails(g,b).then((function(n){var r,l,a,d;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(d=e.watchHistory)&&void 0!==d&&d.enable?o.getVideoInfo(g,b).then((function(n){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",L(T,{res:s},e,{resolve:t,reject:i})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),L(T,{res:s},e,{resolve:t,reject:i})})):L(T,{res:s},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else i({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}})}}))},getRenditions:a.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:k,getVolume:S,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./features-e9401bd9.js"),t=require("./icons-0f7b3404.js"),l=require("./chromecast-5dad1eb5.js"),n=require("./renditions-a603eee8.js"),i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./autoNextVideo-50ffd441.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-835bacf7.js");var r=l.getCurrentSeries(),a=[];null==r||r.map((function(e){return a.push.apply(a,i(e.episodes))}));var d=function(e,t){var n=l.getPlayer(e),i=Math.floor(n.currentTime());if(Math.floor(n.duration())!=i){n.pause(e);var r=l.getVideoIdx();o.switchToNext(r,e,a)}};function s(t,i){var o=l.getPlayer(t);o.on("chromecastDisconnected",(function(){l.chromecastDisconnectStateManager.set(!0)})),o.on("loadeddata",(function(){var r,s,u;console.log("LOADEDDATA",l.chromecastDisconnectStateManager.get()),console.log("CAPTION",o.textTracks()),console.log("REMOTE",o.remoteTextTracks()),(null===(r=n.getRenditions(t))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(t,i),(null===(s=l.getCaptions(t))||void 0===s?void 0:s.length)>0&&e.addCaptionButton(t,i),null!=i&&null!==(u=i.series)&&void 0!==u&&u.enable&&function(e,t){var n;null==t||null===(n=t.series)||void 0===n||n.cb;var i=l.getPlayer(e);i.on("timeupdate",(function(){var e,t=Math.floor(i.currentTime()),n=i.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-t<=10&&l.getVideoIdx()<=(null==a?void 0:a.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=a.filter((function(e,t){return t==l.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var s,u,v,c,m,p,g,h,f,y,b;(null===(s=document.getElementsByClassName("next-ep-preview"))||void 0===s?void 0:s[0]).style.visibility="hidden";var C=null===(u=document.getElementsByClassName("next-ep-title"))||void 0===u?void 0:u[0],x=null===(v=document.getElementsByClassName("next-ep-img"))||void 0===v?void 0:v[0],E=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],q=null===(m=r[0])||void 0===m?void 0:m.title;(null===(p=q)||void 0===p?void 0:p.length)>60&&(q=q.substr(0,60)+"..."),C.textContent="".concat(q),x.src=(null===(g=r[0])||void 0===g||null===(h=g.gist)||void 0===h||null===(f=h.imageGist)||void 0===f?void 0:f.r16x9)||(null===(y=window)||void 0===y||null===(b=y.customData)||void 0===b?void 0:b.fallbackImage),E.onclick=function(){return d(e)}}else{var j,w,N,B,V,S,k,P=document.createElement("div");P.className="next-ep-preview",P.style.visibility="hidden",document.getElementById(e).append(P);var M=document.createElement("div");M.className="next-ep-header",M.textContent="Next up";var T=null===(j=r[0])||void 0===j?void 0:j.title,I=document.createElement("img");I.className="next-ep-img",I.src=(null===(w=r[0])||void 0===w||null===(N=w.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null===(V=window)||void 0===V||null===(S=V.customData)||void 0===S?void 0:S.fallbackImage);var D=document.createElement("div");D.className="next-ep-title",(null===(k=T)||void 0===k?void 0:k.length)>60&&(T=T.substr(0,60)+"..."),D.textContent="".concat(T);var O=document.createElement("div");O.className="next-ep-content",O.append(I),O.append(D),O.onclick=function(){return d(e)},P.append(M),P.append(O)}}(t,i),function(e,t){var l,n=Math.floor(e/60),i=null===(l=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===l?void 0:l[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");t&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var l,n,i,o;null!==(l=window)&&void 0!==l&&null!==(n=l.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}exports.initialiseSkin=function(n,i){!function(){"Chrome"==l.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));Promise.resolve().then((function(){return require("./skin-921d35a8.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),s(n,i),function(e,n){var i,o,r,a,d=l.getPlayer(e);null===(i=d.controlBar.getChild("FullscreenToggle"))||void 0===i||null===(o=i.el())||void 0===o||o.appendChild(l.createIconMarkup(t.MinimizeSvg(window.controlsColor))),null===(r=d.controlBar.getChild("FullscreenToggle"))||void 0===r||null===(a=r.el())||void 0===a||a.appendChild(l.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var s=document.getElementsByClassName("vjs-time-control");n.liveVideo&&(s[0].style.display="none")}(n,i),function(l,n){var i,o,r,a,d,s;0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(l,"defaultV2",t.SkipSvgV2());(0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(l,"defaultV2",t.RewindSvgV2());n.liveVideo||e.addSlowMotion(l);(null==n||null===(i=n.relatedVideos)||void 0===i||null===(o=i.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(l,null==n?void 0:n.relatedVideos);(null==n||null===(r=n.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(l,null==n?void 0:n.streams);(null==n||null===(a=n.playlist)||void 0===a||null===(d=a.content)||void 0===d?void 0:d.length)>0&&e.addPlaylistSelector(l,null==n?void 0:n.playlist);null!=n&&null!==(s=n.series)&&void 0!==s&&s.enable&&e.addSeriesSelectorV2(l,n)}(n,i),function(e,t){var n=l.getPlayer(e),i=null==t?void 0:t.tvProviderLogoUrl;if(!i)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(i),r.alt="Provider Image",o.append(r),n.el().appendChild(o),n.on("useractive",(function(){o.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||o.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(n,i)};
package/esm/bundle.css CHANGED
@@ -15,7 +15,6 @@
15
15
 
16
16
 
17
17
 
18
-
19
18
  .widget-selection{
20
19
  display: flex;
21
20
  align-items: center;
@@ -136,6 +135,7 @@
136
135
  .widget-selector-content #sr-widget{
137
136
  padding: 0 18px;
138
137
  }
138
+
139
139
  .vjs-poster {
140
140
  display: inline-block;
141
141
  vertical-align: middle;
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"axios";import{g as o,a as r,s as l,c as a,h as s,b as d,d as u,e as c,f as v,i as m,l as f,j as p,p as w,k as h,m as g,r as b,n as y,o as T,q as I,t as O,u as P,v as j,w as E,x as k,y as S,z as D,A,B as F,C as R,D as C,E as x,F as M,G as _,H as B,I as H,J as N,K as L,L as V,M as W,N as U}from"./chromecast-e2000c4e.js";import q from"video.js";import{o as z,g as G,a as J,s as K,b as Q}from"./util-2b4b9f11.js";import{g as Y}from"./renditions-4d6b5b1b.js";import{playSelectedResolution as X}from"./resolution-908b6145.js";import{s as Z}from"./localisation-0bf399a1.js";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";function $(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function ee(e,t){$("event",e,t)}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ne(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?te(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):te(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function oe(){var e=window.sessionStorage.getItem("uid");return e||(e=ie(),window.sessionStorage.setItem("uid",e),e)}function re(){return le.apply(this,arguments)}function le(){return le=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),le.apply(this,arguments)}window.initialise=function(e){window.sid=ie(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());ee(r?"FAILED_TO_START":"DROPPED_STREAM",ne({pfm:window.platform,uid:oe(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),ee("PLAY",ne({pfm:window.platform,uid:oe(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))ee("BUFFERING",ne({pfm:window.platform,uid:oe(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,ee("FIRST_FRAME",ne({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;ee("AD_REQUEST",ne({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),ee("AD_IMPRESSION",ne({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(de(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var ae,se,de=function(e,t,n){return e>=t&&e<=n};function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ce(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ue(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ue(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,m,f,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ne,e.t1=ne,e.t2=ne({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=oe(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,re();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),f=[e.t31],e.next=37,o();case 37:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:f}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var ve=[],me=0,fe=null;function pe(e,t,n){var i,o,r,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];se=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.xapiKey,m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f={};"v1"==se?f={videoId:ae,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==se&&(f=ce(ce({videoId:ae,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},fe&&{seriesId:fe}),m&&{originalObjectId:m})),l(f,se).then((function(e){})).catch((function(e){})),me=u+n}var we=function(e,t,n){var i=r(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},he=function(e){var t=r(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function be(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ge(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ge(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ye=function(e,t,n,i){var o,l,v=i.res,m=i.sres,f=r(e),p=(null==v?void 0:v.contentType)||"video",w=(null==v||null===(o=v[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;u(v),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:v})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&we(e,sessionStorage.getItem("volume")||"100");var o=d();if(a(),n.resolve(be({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:v}:{response:v})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,s,u=be(be({},t),v);!function(e,t,n){var i,o,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(fe=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ve=[],me=0,ae=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=r(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ve.includes(me)||(e==me?(ve.push(e),pe(s,t,a)):e>me&&(me=e+a))})),s.one("ended",(function(){pe(s,t,a,!0)})))}(e,u,null==o||null===(l=o.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.id)}})),f.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",t)})),f.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.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===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var p,w=f.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),f.on("loadedmetadata",(function(){window.endFirstFrame(f)})),f.one("error",(function(){var t,i;s(e,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured"})})),f.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,r=null===(n=d())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,l=c().get(r)||{t:0,p:0},a=l.t,s=l.p;a&&s<95&&setTimeout((function(){f.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},Te=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-0b805562.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-2a7ae6e4.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-1701672c.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-62b593ac.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&import("./skin-1c5d53d8.js").then((function(n){n.initialiseSkin(e,t)}))},Ie=function(e){return new Promise((function(t,n){if(Oe(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!1,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},Oe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Pe=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var je,Ee=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(q)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(q)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),Ie("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Ee,loadEMELibrary:ke});function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ae(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?De(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):De(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Fe=function(i,o,l,a){var d,u,c,v,m,f,p,w,h,b,T,I,O,P,j,E,D,A,F,R,C,x,M,_,U,z,G,J,K,Q,Y,X,Z,$=o.res,ee=void 0===$?null:$,te=o.sres,ne=void 0===te?null:te,ie=(null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m?void 0:m.S)||void 0,oe=null!=l&&l.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ie&&"NOT_CONNECTED"!==ie?["html5","chromecast"]:["chromecast","html5"]:["html5"],re=(null===(f=ee)||void 0===f?void 0:f.contentType)||"video",le=B(null===(p=ee)||void 0===p||null===(w=p[re])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||B(null===(b=ee)||void 0===b||null===(T=b[re])||void 0===T||null===(I=T.gist)||void 0===I||null===(O=I.imageGist)||void 0===O?void 0:O.r16x9),ae=(null===(P=ee)||void 0===P||null===(j=P[re])||void 0===j||null===(E=j.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,se=(null===(D=ee)||void 0===D||null===(A=D[re])||void 0===A||null===(F=A.streamingInfo)||void 0===F?void 0:F.isLiveStream)||!1,de=(null==l?void 0:l.drmLibrary)||!1,ue=(null===(R=ee)||void 0===R||null===(C=R.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(M=x.adTags)||void 0===M||null===(_=M.web)||void 0===_?void 0:_.active)&&(null===(U=ee)||void 0===U||null===(z=U.ads)||void 0===z||null===(G=z.preRoll)||void 0===G||null===(J=G.adTags)||void 0===J||null===(K=J.web)||void 0===K?void 0:K.url);ee=Ae(Ae({},ee),{},{audioAssetSource:null==l?void 0:l.audioAssetSource});var ce=(Z={controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:("default"==l.skin||"defaultV2"==l.skin||"live"==(null==l?void 0:l.skin))&&{inline:!1},fullscreenToggle:"default"==l.skin||"defaultV2"==l.skin,audioTrackButton:!1,pictureInPictureToggle:(l.skin,!1)},muteToggle:"multiplayer"==l.skin,liveui:ae},e(Z,"autoplay",null==l?void 0:l.autoplay),e(Z,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!ue),e(Z,"loop",(null==l?void 0:l.loop)||!1),e(Z,"audioPosterMode",null==l?void 0:l.audioPosterMode),e(Z,"html5",Ae(Ae({dash:Ae(Ae({},!q.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:Ae(Ae({experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==l||null===(Q=l.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==l?void 0:l.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==l?void 0:l.experimentalBufferBasedABR)||!1})},0==(null==l||null===(Y=l.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(X=l.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Z,"poster",le),e(Z,"techOrder",oe),e(Z,"chromecast",{requestCustomDataFn:function(e){var t=r(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return H(ee,e,n)}}),Z),ve=q(i,ce,function(){var e=t(n.mark((function e(){var t,o,r,d,u,c,v,m,f,p,w,h,b,T,I,O,P,j,E,D,A,F,R,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(W(l),se&&a.resolve(Ae({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:ee}:{response:ee})),window.initialise(ve),window.firstFrame(ve),"white"!==window.controlsColor&&Pe(window.controlsColor,ve),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),T=null===(t=ee)||void 0===t||null===(o=t[re])||void 0===o?void 0:o.drmEnabled,I=null===(r=ee)||void 0===r||null===(d=r[re])||void 0===d||null===(u=d.liveDetails)||void 0===u?void 0:u.startOverTime,!T&&!de){e.next=21;break}if("Safari"!==g()){e.next=14;break}return e.next=12,ke();case 12:e.next=21;break;case 14:if("caliente"!=(null===(O=window)||void 0===O?void 0:O.siteName)){e.next=19;break}return e.next=17,ke();case 17:e.next=21;break;case 19:return e.next=21,Ee();case 21:ae&&N(i,I),!ue||null!=l&&null!==(c=l.customData)&&void 0!==c&&c.disableAds||L(i,ue,ee),(P=k(ee,i))?y(i,P):(a.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:ee}),s(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(v=ee)||void 0===v||null===(m=v[re])||void 0===m||null===(f=m.contentDetails)||void 0===f||null===(p=f.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(w=ee)||void 0===w||null===(h=w[re])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(C=(null===(E=ee)||void 0===E||null===(D=E[re])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(F=ee)||void 0===F||null===(R=F[re])||void 0===R?void 0:R.closedCaptions),j=C.filter((function(e){return"VTT"===e.format})),V(i,j)),null!=l&&l.disableControls?S(i):Te(i,Ae(Ae(Ae({},l),ce),{},{liveVideo:se,isDvrEnabled:ae,res:ee,sres:ne})),ye(i,Ae(Ae(Ae({},l),ce),{},{liveVideo:se}),a,{res:ee,sres:ne});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Re(){return{loadVideoInstantly:f,onTimeUpdate:z,getVideoDuration:G,onVideoEnded:J,init:function(e){return new Promise((function(t,n){var i,o,r,l,a,s,d,c,f,p,w;if(!T(null==e?void 0:e.playerId)){var h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,y=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=b;var I=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),I&&!A(I)){je=JSON.parse(atob(I.split(".")[1])),window.siteId=null===(r=je)||void 0===r?void 0:r.siteId,window.siteName=null===(l=je)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=je)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=je)||void 0===s?void 0:s.site)||null,e.userId=(null===(d=je)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=je)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var O=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,j=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,k=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,S=null==e?void 0:e.errors;S&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,Z(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!F(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Se})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return Se})).then((function(e){e.importChromecast()})),j&&"Safari"==g()&&Promise.resolve().then((function(){return Se})).then((function(e){e.importAirplay()})),k&&Ie("https://www.googletagmanager.com/gtag/js?id=".concat(k)).then((function(){return e=k,window.dataLayer=window.dataLayer||[],$("js",new Date),void $("config",e);var e})).catch((function(e){}));var B=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(O));if(B&&B.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var H,N=null==e||null===(H=e.series)||void 0===H?void 0:H.id;R(N,I).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;U(s);var d=b||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var n=new Map;v({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),m(n)})).catch((function(e){return console.log(e)}))}(N,I),C(d,I).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,u(i.data),Fe(O,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){x(e,O,n,b)}))})).catch((function(e){x(e,O,n)}))}else if(h){var L=null==e?void 0:e.epg;M(L,I).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",Fe(O,{res:o},e,{resolve:t,reject:n})})).catch((function(e){x(e,O,n,b)}))}else C(b,I).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,u(null==i?void 0:i.data);var s=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?_(b,I).then((function(i){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",Fe(O,{res:s},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Fe(O,{res:s},e,{resolve:t,reject:n})})):Fe(O,{res:s},e,{resolve:t,reject:n})})).catch((function(e){x(e,O,n,b)}))}else n({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}})}}))},getRenditions:Y,skip:p,getPlayer:r,play:w,pause:h,detectBrowser:g,rewind:b,loadVideo:y,seekToTimeStamp:K,isPlayerInitialised:T,load:I,dispose:O,enableCaptions:P,disableCaptions:j,getCaptions:E,playSelectedResolution:X,getSource:k,setVolume:we,getVolume:he,disableControls:S,setPlaybackSpeed:Q}}export{Re as default};
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"axios";import{g as o,a as r,s as l,c as a,h as s,b as d,d as u,e as c,f as v,i as m,l as f,j as p,p as w,k as h,m as g,r as b,n as y,o as T,q as I,t as O,u as P,v as j,w as E,x as k,y as S,z as D,A,B as F,C as R,D as C,E as x,F as M,G as _,H as B,I as H,J as N,K as L,L as V,M as W,N as U}from"./chromecast-e2000c4e.js";import q from"video.js";import{o as z,g as G,a as J,s as K,b as Q}from"./util-2b4b9f11.js";import{g as Y}from"./renditions-4d6b5b1b.js";import{playSelectedResolution as X}from"./resolution-908b6145.js";import{s as Z}from"./localisation-0bf399a1.js";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";function $(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function ee(e,t){$("event",e,t)}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ne(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?te(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):te(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ie(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function oe(){var e=window.sessionStorage.getItem("uid");return e||(e=ie(),window.sessionStorage.setItem("uid",e),e)}function re(){return le.apply(this,arguments)}function le(){return le=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),le.apply(this,arguments)}window.initialise=function(e){window.sid=ie(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());ee(r?"FAILED_TO_START":"DROPPED_STREAM",ne({pfm:window.platform,uid:oe(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),ee("PLAY",ne({pfm:window.platform,uid:oe(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))ee("BUFFERING",ne({pfm:window.platform,uid:oe(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,ee("FIRST_FRAME",ne({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;ee("AD_REQUEST",ne({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),ee("AD_IMPRESSION",ne({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:oe(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(de(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var ae,se,de=function(e,t,n){return e>=t&&e<=n};function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ce(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ue(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ue(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,m,f,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ne,e.t1=ne,e.t2=ne({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=oe(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,re();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),f=[e.t31],e.next=37,o();case 37:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:f}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var ve=[],me=0,fe=null;function pe(e,t,n){var i,o,r,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];se=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.xapiKey,m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f={};"v1"==se?f={videoId:ae,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==se&&(f=ce(ce({videoId:ae,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},fe&&{seriesId:fe}),m&&{originalObjectId:m})),l(f,se).then((function(e){})).catch((function(e){})),me=u+n}var we=function(e,t,n){var i=r(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},he=function(e){var t=r(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function be(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ge(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ge(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ye=function(e,t,n,i){var o,l,v=i.res,m=i.sres,f=r(e),p=(null==v?void 0:v.contentType)||"video",w=(null==v||null===(o=v[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;u(v),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:v})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&we(e,sessionStorage.getItem("volume")||"100");var o=d();if(a(),n.resolve(be({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:v}:{response:v})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,s,u=be(be({},t),v);!function(e,t,n){var i,o,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(fe=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ve=[],me=0,ae=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=r(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ve.includes(me)||(e==me?(ve.push(e),pe(s,t,a)):e>me&&(me=e+a))})),s.one("ended",(function(){pe(s,t,a,!0)})))}(e,u,null==o||null===(l=o.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.id)}})),f.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",t)})),f.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.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===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var p,w=f.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),f.on("loadedmetadata",(function(){window.endFirstFrame(f)})),f.one("error",(function(){var t,i;s(e,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured"})})),f.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,r=null===(n=d())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,l=c().get(r)||{t:0,p:0},a=l.t,s=l.p;a&&s<95&&setTimeout((function(){f.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},Te=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-0b805562.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-2a7ae6e4.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-1701672c.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-20fe3397.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&import("./skin-1c5d53d8.js").then((function(n){n.initialiseSkin(e,t)}))},Ie=function(e){return new Promise((function(t,n){if(Oe(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!1,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},Oe=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Pe=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var je,Ee=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(q)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(q)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),Ie("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Ee,loadEMELibrary:ke});function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ae(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?De(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):De(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Fe=function(i,o,l,a){var d,u,c,v,m,f,p,w,h,b,T,I,O,P,j,E,D,A,F,R,C,x,M,_,U,z,G,J,K,Q,Y,X,Z,$=o.res,ee=void 0===$?null:$,te=o.sres,ne=void 0===te?null:te,ie=(null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m?void 0:m.S)||void 0,oe=null!=l&&l.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ie&&"NOT_CONNECTED"!==ie?["html5","chromecast"]:["chromecast","html5"]:["html5"],re=(null===(f=ee)||void 0===f?void 0:f.contentType)||"video",le=B(null===(p=ee)||void 0===p||null===(w=p[re])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||B(null===(b=ee)||void 0===b||null===(T=b[re])||void 0===T||null===(I=T.gist)||void 0===I||null===(O=I.imageGist)||void 0===O?void 0:O.r16x9),ae=(null===(P=ee)||void 0===P||null===(j=P[re])||void 0===j||null===(E=j.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,se=(null===(D=ee)||void 0===D||null===(A=D[re])||void 0===A||null===(F=A.streamingInfo)||void 0===F?void 0:F.isLiveStream)||!1,de=(null==l?void 0:l.drmLibrary)||!1,ue=(null===(R=ee)||void 0===R||null===(C=R.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(M=x.adTags)||void 0===M||null===(_=M.web)||void 0===_?void 0:_.active)&&(null===(U=ee)||void 0===U||null===(z=U.ads)||void 0===z||null===(G=z.preRoll)||void 0===G||null===(J=G.adTags)||void 0===J||null===(K=J.web)||void 0===K?void 0:K.url);ee=Ae(Ae({},ee),{},{audioAssetSource:null==l?void 0:l.audioAssetSource});var ce=(Z={controls:0!=(null==l?void 0:l.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==l?void 0:l.muted)||!1,autoplay:(null==l?void 0:l.autoplay)||!1,controlBar:{volumePanel:("default"==l.skin||"defaultV2"==l.skin||"live"==(null==l?void 0:l.skin))&&{inline:!1},fullscreenToggle:"default"==l.skin||"defaultV2"==l.skin,audioTrackButton:!1,pictureInPictureToggle:(l.skin,!1)},muteToggle:"multiplayer"==l.skin,liveui:ae},e(Z,"autoplay",null==l?void 0:l.autoplay),e(Z,"normalizeAutoplay",(null==l?void 0:l.autoplay)&&!ue),e(Z,"loop",(null==l?void 0:l.loop)||!1),e(Z,"audioPosterMode",null==l?void 0:l.audioPosterMode),e(Z,"html5",Ae(Ae({dash:Ae(Ae({},!q.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:Ae(Ae({experimentalLLHLS:(null==l?void 0:l.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==l||null===(Q=l.customData)||void 0===Q?void 0:Q.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==l?void 0:l.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==l?void 0:l.experimentalBufferBasedABR)||!1})},0==(null==l||null===(Y=l.customData)||void 0===Y?void 0:Y.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==l||null===(X=l.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Z,"poster",le),e(Z,"techOrder",oe),e(Z,"chromecast",{requestCustomDataFn:function(e){var t=r(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return H(ee,e,n)}}),Z),ve=q(i,ce,function(){var e=t(n.mark((function e(){var t,o,r,d,u,c,v,m,f,p,w,h,b,T,I,O,P,j,E,D,A,F,R,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(W(l),se&&a.resolve(Ae({status:!0,msg:"Player Initialised"},ne?{seriesResponse:ne,response:ee}:{response:ee})),window.initialise(ve),window.firstFrame(ve),"white"!==window.controlsColor&&Pe(window.controlsColor,ve),/Android/i.test(navigator.userAgent)&&(q.options.vhs.overrideNative=!0),T=null===(t=ee)||void 0===t||null===(o=t[re])||void 0===o?void 0:o.drmEnabled,I=null===(r=ee)||void 0===r||null===(d=r[re])||void 0===d||null===(u=d.liveDetails)||void 0===u?void 0:u.startOverTime,!T&&!de){e.next=21;break}if("Safari"!==g()){e.next=14;break}return e.next=12,ke();case 12:e.next=21;break;case 14:if("caliente"!=(null===(O=window)||void 0===O?void 0:O.siteName)){e.next=19;break}return e.next=17,ke();case 17:e.next=21;break;case 19:return e.next=21,Ee();case 21:ae&&N(i,I),!ue||null!=l&&null!==(c=l.customData)&&void 0!==c&&c.disableAds||L(i,ue,ee),(P=k(ee,i))?y(i,P):(a.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:ee}),s(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(v=ee)||void 0===v||null===(m=v[re])||void 0===m||null===(f=m.contentDetails)||void 0===f||null===(p=f.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(w=ee)||void 0===w||null===(h=w[re])||void 0===h||null===(b=h.closedCaptions)||void 0===b?void 0:b.length)>0)&&(C=(null===(E=ee)||void 0===E||null===(D=E[re])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(F=ee)||void 0===F||null===(R=F[re])||void 0===R?void 0:R.closedCaptions),j=C.filter((function(e){return"VTT"===e.format})),V(i,j)),null!=l&&l.disableControls?S(i):Te(i,Ae(Ae(Ae({},l),ce),{},{liveVideo:se,isDvrEnabled:ae,res:ee,sres:ne})),ye(i,Ae(Ae(Ae({},l),ce),{},{liveVideo:se}),a,{res:ee,sres:ne});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Re(){return{loadVideoInstantly:f,onTimeUpdate:z,getVideoDuration:G,onVideoEnded:J,init:function(e){return new Promise((function(t,n){var i,o,r,l,a,s,d,c,f,p,w;if(!T(null==e?void 0:e.playerId)){var h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,y=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=b;var I=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),I&&!A(I)){je=JSON.parse(atob(I.split(".")[1])),window.siteId=null===(r=je)||void 0===r?void 0:r.siteId,window.siteName=null===(l=je)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=je)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=je)||void 0===s?void 0:s.site)||null,e.userId=(null===(d=je)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=je)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var O=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,j=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,k=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,S=null==e?void 0:e.errors;S&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,Z(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!F(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Se})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return Se})).then((function(e){e.importChromecast()})),j&&"Safari"==g()&&Promise.resolve().then((function(){return Se})).then((function(e){e.importAirplay()})),k&&Ie("https://www.googletagmanager.com/gtag/js?id=".concat(k)).then((function(){return e=k,window.dataLayer=window.dataLayer||[],$("js",new Date),void $("config",e);var e})).catch((function(e){}));var B=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(O));if(B&&B.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var H,N=null==e||null===(H=e.series)||void 0===H?void 0:H.id;R(N,I).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;U(s);var d=b||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var n=new Map;v({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),m(n)})).catch((function(e){return console.log(e)}))}(N,I),C(d,I).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,u(i.data),Fe(O,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){x(e,O,n,b)}))})).catch((function(e){x(e,O,n)}))}else if(h){var L=null==e?void 0:e.epg;M(L,I).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",Fe(O,{res:o},e,{resolve:t,reject:n})})).catch((function(e){x(e,O,n,b)}))}else C(b,I).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,u(null==i?void 0:i.data);var s=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?_(b,I).then((function(i){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",Fe(O,{res:s},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Fe(O,{res:s},e,{resolve:t,reject:n})})):Fe(O,{res:s},e,{resolve:t,reject:n})})).catch((function(e){x(e,O,n,b)}))}else n({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}})}}))},getRenditions:Y,skip:p,getPlayer:r,play:w,pause:h,detectBrowser:g,rewind:b,loadVideo:y,seekToTimeStamp:K,isPlayerInitialised:T,load:I,dispose:O,enableCaptions:P,disableCaptions:j,getCaptions:E,playSelectedResolution:X,getSource:k,setVolume:we,getVolume:he,disableControls:S,setPlaybackSpeed:Q}}export{Re as default};
@@ -0,0 +1 @@
1
+ import{i as e,j as l,k as t,g as n,h as o,d as i,l as a,m as s,n as r,o as d}from"./features-c246b1d0.js";import{M as u,a as v,c as m,d as c}from"./icons-c2efba97.js";import{Q as p,a as f,R as g,S as h,w as y,P as b,m as C}from"./chromecast-e2000c4e.js";import{g as x}from"./renditions-4d6b5b1b.js";import E from"@babel/runtime/helpers/toConsumableArray";import{s as j}from"./autoNextVideo-69d64a90.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./util-2b4b9f11.js";var N=p(),w=[];null==N||N.map((function(e){return w.push.apply(w,E(e.episodes))}));var B=function(e,l){var t=f(e),n=Math.floor(t.currentTime());if(Math.floor(t.duration())!=n){t.pause(e);var o=g();j(o,e,w)}};function k(n,o){var i=f(n);i.on("chromecastDisconnected",(function(){h.set(!0)})),i.on("loadeddata",(function(){var t,a,s;console.log("LOADEDDATA",h.get()),console.log("CAPTION",i.textTracks()),console.log("REMOTE",i.remoteTextTracks()),(null===(t=x(n))||void 0===t?void 0:t.length)>0&&e(n,o),(null===(a=y(n))||void 0===a?void 0:a.length)>0&&l(n,o),null!=o&&null!==(s=o.series)&&void 0!==s&&s.enable&&function(e,l){var t;null==l||null===(t=l.series)||void 0===t||t.cb;var n=f(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),t=n.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];t-l<=10&&g()<=(null==w?void 0:w.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,i=w.filter((function(e,l){return l==g()}));if((null==i?void 0:i.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var a,s,r,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],C=null===(r=document.getElementsByClassName("next-ep-img"))||void 0===r?void 0:r[0],x=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],E=null===(u=i[0])||void 0===u?void 0:u.title;(null===(v=E)||void 0===v?void 0:v.length)>60&&(E=E.substr(0,60)+"..."),b.textContent="".concat(E),C.src=(null===(m=i[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),x.onclick=function(){return B(e)}}else{var j,N,k,T,V,D,P,I=document.createElement("div");I.className="next-ep-preview",I.style.visibility="hidden",document.getElementById(e).append(I);var M=document.createElement("div");M.className="next-ep-header",M.textContent="Next up";var O=null===(j=i[0])||void 0===j?void 0:j.title,A=document.createElement("img");A.className="next-ep-img",A.src=(null===(N=i[0])||void 0===N||null===(k=N.gist)||void 0===k||null===(T=k.imageGist)||void 0===T?void 0:T.r16x9)||(null===(V=window)||void 0===V||null===(D=V.customData)||void 0===D?void 0:D.fallbackImage);var L=document.createElement("div");L.className="next-ep-title",(null===(P=O)||void 0===P?void 0:P.length)>60&&(O=O.substr(0,60)+"..."),L.textContent="".concat(O);var R=document.createElement("div");R.className="next-ep-content",R.append(A),R.append(L),R.onclick=function(){return B(e)},I.append(M),I.append(R)}}(n,o),function(e,l){var t,n=Math.floor(e/60),o=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];o&&(o.style.marginRight=n>60?"56px":"41px");var i=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&i.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",o&&(o.style.marginRight="56px"))}(i.duration(),(null==o?void 0:o.liveVideo)||!1)})),i.one("play",(function(){var e,l,o,i;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&t(n,null===(o=window)||void 0===o||null===(i=o.customData)||void 0===i?void 0:i.iframeOverlayUrl)}))}function T(e,l){!function(){"Chrome"==C()&&import("./chromett-a3cbb2e1.js").then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));import("./skin-3470b8fa.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),k(e,l),function(e,l){var t,n,o,i,a=f(e);null===(t=a.controlBar.getChild("FullscreenToggle"))||void 0===t||null===(n=t.el())||void 0===n||n.appendChild(b(u(window.controlsColor))),null===(o=a.controlBar.getChild("FullscreenToggle"))||void 0===o||null===(i=o.el())||void 0===i||i.appendChild(b(v(window.controlsColor)));var s=document.getElementsByClassName("vjs-time-control");l.liveVideo&&(s[0].style.display="none")}(e,l),function(e,l){var t,u,v,p,f,g;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&o(e,"defaultV2",c());l.liveVideo||i(e);(null==l||null===(t=l.relatedVideos)||void 0===t||null===(u=t.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&s(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&r(e,null==l?void 0:l.playlist);null!=l&&null!==(g=l.series)&&void 0!==g&&g.enable&&d(e,l)}(e,l),function(e,l){var t=f(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var o=document.createElement("div");o.className="tvProviderImage";var i=document.createElement("img");i.src="".concat(n),i.alt="Provider Image",o.append(i),t.el().appendChild(o),t.on("useractive",(function(){o.classList.remove("vjs-fade")})),t.on("userinactive",(function(){t.paused()||o.classList.add("vjs-fade")})),t.on("fullscreenchange",(function(){t.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(e,l)}export{T as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.60-backup",
3
+ "version": "1.0.61",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";var e=require("./features-e9401bd9.js"),t=require("./icons-0f7b3404.js"),l=require("./chromecast-5dad1eb5.js"),n=require("./renditions-a603eee8.js"),i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./autoNextVideo-50ffd441.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-835bacf7.js");var r=l.getCurrentSeries(),a=[];null==r||r.map((function(e){return a.push.apply(a,i(e.episodes))}));var d=function(e,t){var n=l.getPlayer(e),i=Math.floor(n.currentTime());if(Math.floor(n.duration())!=i){n.pause(e);var r=l.getVideoIdx();o.switchToNext(r,e,a)}};function u(t,i){var o=l.getPlayer(t);o.on("chromecastDisconnected",(function(){l.chromecastDisconnectStateManager.set(!0)})),o.on("loadeddata",(function(){var r,u,s;console.log("LOADEDDATA",l.chromecastDisconnectStateManager.get()),(null===(r=n.getRenditions(t))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(t,i),(null===(u=l.getCaptions(t))||void 0===u?void 0:u.length)>0&&!l.chromecastDisconnectStateManager.get()&&e.addCaptionButton(t,i),null!=i&&null!==(s=i.series)&&void 0!==s&&s.enable&&function(e,t){var n;null==t||null===(n=t.series)||void 0===n||n.cb;var i=l.getPlayer(e);i.on("timeupdate",(function(){var e,t=Math.floor(i.currentTime()),n=i.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-t<=10&&l.getVideoIdx()<=(null==a?void 0:a.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=a.filter((function(e,t){return t==l.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var u,s,v,c,m,p,g,h,f,y,b;(null===(u=document.getElementsByClassName("next-ep-preview"))||void 0===u?void 0:u[0]).style.visibility="hidden";var C=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],x=null===(v=document.getElementsByClassName("next-ep-img"))||void 0===v?void 0:v[0],q=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],j=null===(m=r[0])||void 0===m?void 0:m.title;(null===(p=j)||void 0===p?void 0:p.length)>60&&(j=j.substr(0,60)+"..."),C.textContent="".concat(j),x.src=(null===(g=r[0])||void 0===g||null===(h=g.gist)||void 0===h||null===(f=h.imageGist)||void 0===f?void 0:f.r16x9)||(null===(y=window)||void 0===y||null===(b=y.customData)||void 0===b?void 0:b.fallbackImage),q.onclick=function(){return d(e)}}else{var w,E,N,B,S,V,k,M=document.createElement("div");M.className="next-ep-preview",M.style.visibility="hidden",document.getElementById(e).append(M);var P=document.createElement("div");P.className="next-ep-header",P.textContent="Next up";var D=null===(w=r[0])||void 0===w?void 0:w.title,I=document.createElement("img");I.className="next-ep-img",I.src=(null===(E=r[0])||void 0===E||null===(N=E.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null===(S=window)||void 0===S||null===(V=S.customData)||void 0===V?void 0:V.fallbackImage);var T=document.createElement("div");T.className="next-ep-title",(null===(k=D)||void 0===k?void 0:k.length)>60&&(D=D.substr(0,60)+"..."),T.textContent="".concat(D);var O=document.createElement("div");O.className="next-ep-content",O.append(I),O.append(T),O.onclick=function(){return d(e)},M.append(P),M.append(O)}}(t,i),function(e,t){var l,n=Math.floor(e/60),i=null===(l=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===l?void 0:l[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");t&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var l,n,i,o;null!==(l=window)&&void 0!==l&&null!==(n=l.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}exports.initialiseSkin=function(n,i){!function(){"Chrome"==l.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));Promise.resolve().then((function(){return require("./skin-921d35a8.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),u(n,i),function(e,n){var i,o,r,a,d=l.getPlayer(e);null===(i=d.controlBar.getChild("FullscreenToggle"))||void 0===i||null===(o=i.el())||void 0===o||o.appendChild(l.createIconMarkup(t.MinimizeSvg(window.controlsColor))),null===(r=d.controlBar.getChild("FullscreenToggle"))||void 0===r||null===(a=r.el())||void 0===a||a.appendChild(l.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var u=document.getElementsByClassName("vjs-time-control");n.liveVideo&&(u[0].style.display="none")}(n,i),function(l,n){var i,o,r,a,d,u;0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(l,"defaultV2",t.SkipSvgV2());(0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(l,"defaultV2",t.RewindSvgV2());n.liveVideo||e.addSlowMotion(l);(null==n||null===(i=n.relatedVideos)||void 0===i||null===(o=i.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(l,null==n?void 0:n.relatedVideos);(null==n||null===(r=n.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(l,null==n?void 0:n.streams);(null==n||null===(a=n.playlist)||void 0===a||null===(d=a.content)||void 0===d?void 0:d.length)>0&&e.addPlaylistSelector(l,null==n?void 0:n.playlist);null!=n&&null!==(u=n.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(l,n)}(n,i),function(e,t){var n=l.getPlayer(e),i=null==t?void 0:t.tvProviderLogoUrl;if(!i)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(i),r.alt="Provider Image",o.append(r),n.el().appendChild(o),n.on("useractive",(function(){o.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||o.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(n,i)};
@@ -1 +0,0 @@
1
- import{i as e,j as l,k as t,g as n,h as i,d as o,l as a,m as s,n as r,o as d}from"./features-c246b1d0.js";import{M as u,a as v,c as m,d as c}from"./icons-c2efba97.js";import{Q as p,a as f,R as g,S as h,w as y,P as b,m as C}from"./chromecast-e2000c4e.js";import{g as x}from"./renditions-4d6b5b1b.js";import j from"@babel/runtime/helpers/toConsumableArray";import{s as E}from"./autoNextVideo-69d64a90.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./util-2b4b9f11.js";var N=p(),w=[];null==N||N.map((function(e){return w.push.apply(w,j(e.episodes))}));var B=function(e,l){var t=f(e),n=Math.floor(t.currentTime());if(Math.floor(t.duration())!=n){t.pause(e);var i=g();E(i,e,w)}};function V(n,i){var o=f(n);o.on("chromecastDisconnected",(function(){h.set(!0)})),o.on("loadeddata",(function(){var t,a,s;console.log("LOADEDDATA",h.get()),(null===(t=x(n))||void 0===t?void 0:t.length)>0&&e(n,i),(null===(a=y(n))||void 0===a?void 0:a.length)>0&&!h.get()&&l(n,i),null!=i&&null!==(s=i.series)&&void 0!==s&&s.enable&&function(e,l){var t;null==l||null===(t=l.series)||void 0===t||t.cb;var n=f(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),t=n.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];t-l<=10&&g()<=(null==w?void 0:w.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var i,o=w.filter((function(e,l){return l==g()}));if((null==o?void 0:o.length)>0)if(null!==(i=document.getElementsByClassName("next-ep-preview"))&&void 0!==i&&i[0]){var a,s,r,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],C=null===(r=document.getElementsByClassName("next-ep-img"))||void 0===r?void 0:r[0],x=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],j=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=j)||void 0===v?void 0:v.length)>60&&(j=j.substr(0,60)+"..."),b.textContent="".concat(j),C.src=(null===(m=o[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),x.onclick=function(){return B(e)}}else{var E,N,V,k,D,P,T,I=document.createElement("div");I.className="next-ep-preview",I.style.visibility="hidden",document.getElementById(e).append(I);var L=document.createElement("div");L.className="next-ep-header",L.textContent="Next up";var M=null===(E=o[0])||void 0===E?void 0:E.title,A=document.createElement("img");A.className="next-ep-img",A.src=(null===(N=o[0])||void 0===N||null===(V=N.gist)||void 0===V||null===(k=V.imageGist)||void 0===k?void 0:k.r16x9)||(null===(D=window)||void 0===D||null===(P=D.customData)||void 0===P?void 0:P.fallbackImage);var O=document.createElement("div");O.className="next-ep-title",(null===(T=M)||void 0===T?void 0:T.length)>60&&(M=M.substr(0,60)+"..."),O.textContent="".concat(M);var R=document.createElement("div");R.className="next-ep-content",R.append(A),R.append(O),R.onclick=function(){return B(e)},I.append(L),I.append(R)}}(n,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var e,l,i,o;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&t(n,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)}))}function k(e,l){!function(){"Chrome"==C()&&import("./chromett-a3cbb2e1.js").then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));import("./skin-3470b8fa.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),V(e,l),function(e,l){var t,n,i,o,a=f(e);null===(t=a.controlBar.getChild("FullscreenToggle"))||void 0===t||null===(n=t.el())||void 0===n||n.appendChild(b(u(window.controlsColor))),null===(i=a.controlBar.getChild("FullscreenToggle"))||void 0===i||null===(o=i.el())||void 0===o||o.appendChild(b(v(window.controlsColor)));var s=document.getElementsByClassName("vjs-time-control");l.liveVideo&&(s[0].style.display="none")}(e,l),function(e,l){var t,u,v,p,f,g;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&i(e,"defaultV2",c());l.liveVideo||o(e);(null==l||null===(t=l.relatedVideos)||void 0===t||null===(u=t.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&s(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&r(e,null==l?void 0:l.playlist);null!=l&&null!==(g=l.series)&&void 0!==g&&g.enable&&d(e,l)}(e,l),function(e,l){var t=f(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(n),o.alt="Provider Image",i.append(o),t.el().appendChild(i),t.on("useractive",(function(){i.classList.remove("vjs-fade")})),t.on("userinactive",(function(){t.paused()||i.classList.add("vjs-fade")})),t.on("fullscreenchange",(function(){t.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}(e,l)}export{k as initialiseSkin};