@viewlift/player-backup 1.0.68-backup → 1.0.69-backup

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/bundle.css CHANGED
@@ -15,6 +15,7 @@
15
15
 
16
16
 
17
17
 
18
+
18
19
  .widget-selection{
19
20
  display: flex;
20
21
  align-items: center;
@@ -135,7 +136,6 @@
135
136
  .widget-selector-content #sr-widget{
136
137
  padding: 0 18px;
137
138
  }
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"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-b1a36bc8.js"),r=require("video.js"),l=require("./util-5336ded1.js"),a=require("./renditions-8d0dc6ba.js"),s=require("./resolution-56ae3ef8.js"),d=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 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 m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?v(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,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 f(){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=f(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=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.getToken();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)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=f(),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());c(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:w(),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),c("PLAY",m({pfm:window.platform,uid:w(),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"))c("BUFFERING",m({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,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",m({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===(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;c("AD_REQUEST",m({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===(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}),c("AD_IMPRESSION",m({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 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(g(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var g=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,h,g;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({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?(n=t.adPosition)?String(n):"":"",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===(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),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.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 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 y,b,T=function(e){var t,n,i=o.getPlayer(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.cast?console.log("Chromecast plugin is not available"):null==i||i.chromecast({receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}),null!=e&&e.airplay&&"Safari"==o.detectBrowser()?null==i||i.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},P=function(e,t){var n=o.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*d,v.seek()}}))};function k(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 I(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?k(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var O=[],S=0,E=null;function j(e,t,n){var i,r,l,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];b=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=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,m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f={};"v1"==b?f={videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==b&&(f=I(I({videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},E&&{seriesId:E}),m&&{originalObjectId:m})),o.saveWatchHistory(f,b).then((function(e){})).catch((function(e){})),S=u+n}var D=function(e,t,n){var i=o.getPlayer(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),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,"'")})},C=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function A(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 R(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?A(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var F=function(e,t,n,i){var r,l,a=i.res,s=i.sres,d=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),d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i;(null==d||!d.muted())&&D(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),n.resolve(R({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,u,c=R(R({},t),a);!function(e,t,n){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(E=null==t||null===(r=t.series)||void 0===r?void 0:r.id),O=[],S=0,y=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());O.includes(S)||(e==S?(O.push(e),j(s,t,a)):e>S&&(S=e+a))})),s.one("ended",(function(){j(s,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)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.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 w,p=f.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)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.one("error",(function(){var t,i;o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.message)||"Some error occured"})})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,r,l=null===(n=o.getCurrentVideo())||void 0===n||null===(i=n.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){console.log('chromecast-disconnected,"1"'),console.log("resetting source",d.currentType(),d.currentSource());var e=d.currentSource();d.reset(),d.ready((function(){console.log("Player is ready after reset. Reapplying source."),d.src(e)}))}))},x=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-59b755ba.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-ed0356d5.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-15ef0721.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-0dcf5720.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&Promise.resolve().then((function(){return require("./skin-66524106.js")})).then((function(n){n.initialiseSkin(e,t)}))},B=function(e){return new Promise((function(t,n){if(M(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)}}))},M=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},H=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 _,V=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)}}(),N=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)}}(),q=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){B("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"),B("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:V,loadEMELibrary:N});function L(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 W(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?L(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var U=function(i,l,a,s){var d,u,c,v,m,f,w,p,h,g,y,b,k,I,O,S,E,j,D,C,A,R,B,M,_,q,L,U,z,G,J,K,Q,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z,ee=(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,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=(null===(f=X)||void 0===f?void 0:f.contentType)||"video",ie=o.impolicy16x9(null===(w=X)||void 0===w||null===(p=w[ne])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[ne])||void 0===y||null===(b=y.gist)||void 0===b||null===(k=b.imageGist)||void 0===k?void 0:k.r16x9),oe=(null===(I=X)||void 0===I||null===(O=I[ne])||void 0===O||null===(S=O.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,re=(null===(E=X)||void 0===E||null===(j=E[ne])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,le=(null==a?void 0:a.drmLibrary)||!1,ae=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(B=R.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(_=X)||void 0===_||null===(q=_.ads)||void 0===q||null===(L=q.preRoll)||void 0===L||null===(U=L.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=W(W({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var se=(Q={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:oe},e(Q,"autoplay",null==a?void 0:a.autoplay),e(Q,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!ae),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",W(W({dash:W(W({},!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:W(W({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ie),e(Q,"techOrder",te),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=w;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=p}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),de=r(i,se,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,m,f,w,p,h,g,y,b,k,I,O,S,E,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(a),re&&s.resolve(W({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&H(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[ne])||void 0===l?void 0:l.drmEnabled,k=null===(d=X)||void 0===d||null===(u=d[ne])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!le){e.next=21;break}if("Safari"!==o.detectBrowser()){e.next=14;break}return e.next=12,N();case 12:e.next=21;break;case 14:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=19;break}return e.next=17,N();case 17:e.next=21;break;case 19:return e.next=21,V();case 21:oe&&P(i,k),!ae||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,ae,X),(O=o.getSource(X,i))?o.loadVideo(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[ne])||void 0===f||null===(w=f.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=X)||void 0===h||null===(g=h[ne])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(R=(null===(E=X)||void 0===E||null===(j=E[ne])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[ne])||void 0===A?void 0:A.closedCaptions),S=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,S)),null!=a&&a.disableControls?o.disableControls(i):x(i,W(W(W({},a),se),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),F(i,W(W(W({},a),se),{},{liveVideo:re}),s,{res:X,sres:$});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,n){var i,r,l,a,s,c,v,m,f,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.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)){_=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=_)||void 0===l?void 0:l.siteId,window.siteName=null===(a=_)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=_)||void 0===s||!s.anonymousId),e.siteOwner=(null===(c=_)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=_)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=_)||void 0===m?void 0:m.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,k=null==e?void 0:e.airplay,I=null==e?void 0:e.apiBaseUrl,O=(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,d.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),I&&(window.playerEntitlementUrl=I),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 q})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return q})).then((function(e){e.importChromecast()})),k&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),O&&B("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 E=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(E&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var j,D=null==e||null===(j=e.series)||void 0===j?void 0:j.id;o.getSeriesDetails(D,b).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=g||(null==d||null===(r=d[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 n=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(i){var r,l,a;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(i.data),U(T,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))})).catch((function(e){o.initiateErrorHandling(e,T,n)}))}else if(h){var C=null==e?void 0:e.epg;o.getLinearChannelDetails(C,b).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",U(T,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))}else o.getVideoDetails(g,b).then((function(i){var r,l,a,s;window.contentType=null==i||null===(r=i.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==i?void 0:i.data);var d=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable?o.getVideoInfo(g,b).then((function(i){var o,r,l,a,s,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===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",U(T,{res:d},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)),U(T,{res:d},e,{resolve:t,reject:n})})):U(T,{res:d},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,T,n,g)}))}else n({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:s.playSelectedResolution,getSource:o.getSource,setVolume:D,getVolume:C,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("./generic-b1a36bc8.js"),r=require("video.js"),l=require("./util-5336ded1.js"),a=require("./renditions-8d0dc6ba.js"),d=require("./resolution-56ae3ef8.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 m(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 f(){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=f(),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=f(),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",m({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",m({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",m({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",m({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",m({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",m({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(g(t,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var g=function(e,t,i){return e>=t&&e<=i};window.fireEvent=function(){var e=t(i.mark((function e(t){var r,l,a,d,s,u,c,v,f,h,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({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===(f=v.beacon)||void 0===f?void 0:f.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 y,b,T=function(e,t){var i=o.getPlayer(e);i&&t&&i.controlBar&&i.controlBar.progressControl.seekBar.on("click",(function(t){var i,n,o,l,a,d=this.el(),s=r.dom.getPointerPosition(d,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*s,v.seek()}}))};function P(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 k(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?P(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var I=[],O=0,E=null;function S(e,t,i){var n,r,l,a,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];b=(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,m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f={};"v1"==b?f={videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==b&&(f=k(k({videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:d?100:Math.floor(u/c*100),doneWatching:d,profileId:s},E&&{seriesId:E}),m&&{originalObjectId:m})),o.saveWatchHistory(f,b).then((function(e){})).catch((function(e){})),O=u+i}var j=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,"'")})},D=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function C(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?C(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var R=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())&&j(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&&(E=null==t||null===(r=t.series)||void 0===r?void 0:r.id),I=[],O=0,y=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(O)||(e==O?(I.push(e),S(d,t,a)):e>O&&(O=e+a))})),d.one("ended",(function(){S(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,m=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,f=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"===m){var w,p=f.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-59b755ba.js")})).then((function(i){i.initialiseSkin(e,t)})):"default"==i?Promise.resolve().then((function(){return require("./skin-ed0356d5.js")})).then((function(i){i.initialiseSkin(e,t)})):"carousel"==i?Promise.resolve().then((function(){return require("./skin-15ef0721.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==i?Promise.resolve().then((function(){return require("./skin-0dcf5720.js")})).then((function(i){i.initialiseSkin(e,t)})):"multiplayer"==i&&Promise.resolve().then((function(){return require("./skin-66524106.js")})).then((function(i){i.initialiseSkin(e,t)}))},x=function(e){return new Promise((function(t,i){if(B(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)}}))},B=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)}}(),V=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(e){import("@silvermine/videojs-chromecast").then((function(t){x("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){t.default(r),window.__onGCastApiAvailable=function(){!function(e){var t,i,n=o.getPlayer(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(i=window)||void 0===i||!i.cast?console.log("Chromecast plugin is not available"):null==n||n.chromecast({receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})}(e)}})).catch((function(e){console.log(e)}))}))},importAirplay:function(e){import("@silvermine/videojs-airplay").then((function(t){t.default(r),function(e){var t=o.getPlayer(null==e?void 0:e.playerId);null!=e&&e.airplay&&"Safari"==o.detectBrowser()?null==t||t.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")}(e)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),x("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:H,loadEMELibrary:V});function q(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 L(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?q(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var W=function(n,l,a,d){var s,u,c,v,m,f,w,p,h,g,y,b,P,k,I,O,E,S,j,D,C,A,x,B,_,N,q,W,U,z,G,J,K,Q=l.res,Y=void 0===Q?null:Q,X=l.sres,Z=void 0===X?null:X,$=(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===(m=v.getInstance())||void 0===m?void 0:m.S)||void 0,ee=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==$&&"NOT_CONNECTED"!==$?["html5","chromecast"]:["chromecast","html5"]:["html5"],te=(null===(f=Y)||void 0===f?void 0:f.contentType)||"video",ie=o.impolicy16x9(null===(w=Y)||void 0===w||null===(p=w[te])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=Y)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b||null===(P=b.imageGist)||void 0===P?void 0:P.r16x9),ne=(null===(k=Y)||void 0===k||null===(I=k[te])||void 0===I||null===(O=I.liveDetails)||void 0===O?void 0:O.isDvrEnabled)||!1,oe=(null===(E=Y)||void 0===E||null===(S=E[te])||void 0===S||null===(j=S.streamingInfo)||void 0===j?void 0:j.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(D=Y)||void 0===D||null===(C=D.ads)||void 0===C||null===(A=C.preRoll)||void 0===A||null===(x=A.adTags)||void 0===x||null===(B=x.web)||void 0===B?void 0:B.active)&&(null===(_=Y)||void 0===_||null===(N=_.ads)||void 0===N||null===(q=N.preRoll)||void 0===q||null===(W=q.adTags)||void 0===W||null===(U=W.web)||void 0===U?void 0:U.url);Y=L(L({},Y),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ae=(K={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:ne},e(K,"autoplay",null==a?void 0:a.autoplay),e(K,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!le),e(K,"loop",(null==a?void 0:a.loop)||!1),e(K,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(K,"html5",L(L({dash:L(L({},!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:L(L({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(z=a.customData)||void 0===z?void 0:z.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(G=a.customData)||void 0===G?void 0:G.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(K,"poster",ie),e(K,"techOrder",ee),e(K,"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 function(e,t,i){var n,o,r,l,a,d,s,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=w;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=p}var h=(null==e||null===(n=e[m])||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(d=a.gist)||void 0===d?void 0:d.title;f.mediaTitle=y;var b=null==e||null===(s=e[m])||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=i,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(Y,e,i)}}),K),de=r(n,ae,function(){var e=t(i.mark((function e(){var t,l,s,u,c,v,m,f,w,p,h,g,y,b,P,k,I,O,E,S,j,D,C,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(oe&&d.resolve(L({status:!0,msg:"Player Initialised"},Z?{seriesResponse:Z,response:Y}:{response:Y})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&M(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=Y)||void 0===t||null===(l=t[te])||void 0===l?void 0:l.drmEnabled,P=null===(s=Y)||void 0===s||null===(u=s[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!re){e.next=20;break}if("Safari"!==o.detectBrowser()){e.next=13;break}return e.next=11,V();case 11:e.next=20;break;case 13:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=18;break}return e.next=16,V();case 16:e.next=20;break;case 18:return e.next=20,H();case 20:ne&&T(n,P),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(n,le,Y),(I=o.getSource(Y,n))?o.loadVideo(n,I):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Y}),o.handleError(n,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Y)||void 0===m||null===(f=m[te])||void 0===f||null===(w=f.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=Y)||void 0===h||null===(g=h[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(A=(null===(E=Y)||void 0===E||null===(S=E[te])||void 0===S||null===(j=S.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null===(D=Y)||void 0===D||null===(C=D[te])||void 0===C?void 0:C.closedCaptions),O=A.filter((function(e){return"VTT"===e.format})),o.addCaptions(n,O)),null!=a&&a.disableControls?o.disableControls(n):F(n,L(L(L({},a),ae),{},{liveVideo:oe,isDvrEnabled:ne,res:Y,sres:Z})),R(n,L(L(L({},a),ae),{},{liveVideo:oe}),d,{res:Y,sres:Z});case 27: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,m,f,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)){_=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=_)||void 0===l?void 0:l.siteId,window.siteName=null===(a=_)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(d=_)||void 0===d||!d.anonymousId),e.siteOwner=(null===(c=_)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=_)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=_)||void 0===m?void 0:m.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,k=null==e?void 0:e.airplay,I=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,E=null==e?void 0:e.errors;E&&(window.customErrors=E),window.customData=null==e?void 0:e.customData,s.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),I&&(window.playerEntitlementUrl=I),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(t){t.importChromecast(e)})),k&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return N})).then((function(t){t.importAirplay(e)})),O&&x("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 S=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(S&&S.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var j,D=null==e||null===(j=e.series)||void 0===j?void 0:j.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),W(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 C=null==e?void 0:e.epg;o.getLinearChannelDetails(C,b).then((function(n){var o=null==n?void 0:n.data;o.contentType="linearchannel",W(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",W(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)),W(T,{res:s},e,{resolve:t,reject:i})})):W(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:j,getVolume:D,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
package/esm/bundle.css CHANGED
@@ -15,6 +15,7 @@
15
15
 
16
16
 
17
17
 
18
+
18
19
  .widget-selection{
19
20
  display: flex;
20
21
  align-items: center;
@@ -135,7 +136,6 @@
135
136
  .widget-selector-content #sr-widget{
136
137
  padding: 0 18px;
137
138
  }
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,d as l,s as a,c as s,h as d,b as u,e as c,f as v,i as m,j as f,l as p,k as w,p as h,m as g,r as y,n as b,o as T,q as I,t as k,u as P,v as O,w as E,x as S,y as j,z as D,A,B as R,C as F,D as C,E as x,F as B,G as M,H as _,I as H,J as N,K as L}from"./generic-cea369ce.js";import V from"video.js";import{o as U,g as W,a as q,s as z,b as G}from"./util-d9f4a5a9.js";import{g as J}from"./renditions-d3d8a50e.js";import{playSelectedResolution as K}from"./resolution-a3fef89c.js";import{s as Q}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 Y(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function X(e,t){Y("event",e,t)}function Z(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 $(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function te(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function ne(){return ie.apply(this,arguments)}function ie(){return ie=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)}))),ie.apply(this,arguments)}window.initialise=function(e){window.sid=ee(),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());X(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:te(),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),X("PLAY",$({pfm:window.platform,uid:te(),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"))X("BUFFERING",$({pfm:window.platform,uid:te(),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,X("FIRST_FRAME",$({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),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;X("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),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}),X("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),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(oe(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var oe=function(e,t,n){return e>=t&&e<=n};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=$,e.t1=$,e.t2=$({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=te(),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,ne();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 re,le,ae=function(e){var t,n,i=r(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.cast?console.log("Chromecast plugin is not available"):null==i||i.chromecast({receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}),null!=e&&e.airplay&&"Safari"==l()?null==i||i.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},se=function(e,t){var n=r(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=V.dom.getPointerPosition(a,t).x;V.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=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;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};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 ue(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 ce=[],ve=0,me=null;function fe(e,t,n){var i,o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];le=(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===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,f={};"v1"==le?f={videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==le&&(f=ue(ue({videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},me&&{seriesId:me}),m&&{originalObjectId:m})),a(f,le).then((function(e){})).catch((function(e){})),ve=u+n}var pe=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,"'")})},we=function(e){var t=r(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function he(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 ge(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?he(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):he(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,a=i.res,m=i.sres,f=r(e),p=(null==a?void 0:a.contentType)||"video",w=(null==a||null===(o=a[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(a),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&pe(e,sessionStorage.getItem("volume")||"100");var o=u();if(s(),n.resolve(ge({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,d,c=ge(ge({},t),a);!function(e,t,n){var i,o,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(me=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ce=[],ve=0,re=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());ce.includes(ve)||(e==ve?(ce.push(e),fe(s,t,a)):e>ve&&(ve=e+a))})),s.one("ended",(function(){fe(s,t,a,!0)})))}(e,c,null==o||null===(l=o.video)||void 0===l||null===(d=l.gist)||void 0===d?void 0:d.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;d(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=u())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,l=v().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)})),f.on("chromecastDisconnected",(function(){console.log('chromecast-disconnected,"1"'),console.log("resetting source",f.currentType(),f.currentSource());var e=f.currentSource();f.reset(),f.ready((function(){console.log("Player is ready after reset. Reapplying source."),f.src(e)}))}))},be=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-16d9c13c.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-6cf6eda9.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-8f48c2bd.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-f08a3ead.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&import("./skin-d06710d4.js").then((function(n){n.initialiseSkin(e,t)}))},Te=function(e){return new Promise((function(t,n){if(Ie(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)}}))},Ie=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ke=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 Pe,Oe=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)}}(),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-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){Te("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(V)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(V)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),Te("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Oe,loadEMELibrary:Ee});function je(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 De(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?je(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Ae=function(i,o,a,s){var u,c,v,m,f,p,w,h,g,y,T,I,k,P,O,E,D,A,R,F,C,x,B,M,L,U,W,q,z,G,J,K,Q,Y=o.res,X=void 0===Y?null:Y,Z=o.sres,$=void 0===Z?null:Z,ee=(null===(u=window)||void 0===u||null===(c=u.cast)||void 0===c||null===(v=c.framework)||void 0===v||null===(m=v.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f?void 0:f.S)||void 0,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=(null===(p=X)||void 0===p?void 0:p.contentType)||"video",ie=_(null===(w=X)||void 0===w||null===(h=w[ne])||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.videoImageUrl)||_(null===(y=X)||void 0===y||null===(T=y[ne])||void 0===T||null===(I=T.gist)||void 0===I||null===(k=I.imageGist)||void 0===k?void 0:k.r16x9),oe=(null===(P=X)||void 0===P||null===(O=P[ne])||void 0===O||null===(E=O.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,re=(null===(D=X)||void 0===D||null===(A=D[ne])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,le=(null==a?void 0:a.drmLibrary)||!1,de=(null===(F=X)||void 0===F||null===(C=F.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(B=x.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(L=X)||void 0===L||null===(U=L.ads)||void 0===U||null===(W=U.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(z=q.web)||void 0===z?void 0:z.url);X=De(De({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ue=(Q={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:oe},e(Q,"autoplay",null==a?void 0:a.autoplay),e(Q,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!de),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",De(De({dash:De(De({},!V.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:De(De({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ie),e(Q,"techOrder",te),e(Q,"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 function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=w}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),ce=V(i,ue,function(){var e=t(n.mark((function e(){var t,o,r,u,c,v,m,f,p,w,h,g,y,T,I,k,P,O,E,D,A,R,F,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(a),re&&s.resolve(De({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(ce),window.firstFrame(ce),"white"!==window.controlsColor&&ke(window.controlsColor,ce),/Android/i.test(navigator.userAgent)&&(V.options.vhs.overrideNative=!0),T=null===(t=X)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,I=null===(r=X)||void 0===r||null===(u=r[ne])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!T&&!le){e.next=21;break}if("Safari"!==l()){e.next=14;break}return e.next=12,Ee();case 12:e.next=21;break;case 14:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=19;break}return e.next=17,Ee();case 17:e.next=21;break;case 19:return e.next=21,Oe();case 21:oe&&se(i,I),!de||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||H(i,de,X),(P=S(X,i))?b(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),d(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[ne])||void 0===f||null===(p=f.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[ne])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(C=(null===(E=X)||void 0===E||null===(D=E[ne])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[ne])||void 0===F?void 0:F.closedCaptions),O=C.filter((function(e){return"VTT"===e.format})),N(i,O)),null!=a&&a.disableControls?j(i):be(i,De(De(De({},a),ue),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),ye(i,De(De(De({},a),ue),{},{liveVideo:re}),s,{res:X,sres:$});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Re(){return{loadVideoInstantly:p,onTimeUpdate:U,getVideoDuration:W,onVideoEnded:q,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,p,w,h;if(!T(null==e?void 0:e.playerId)){var g=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,y=null==e?void 0:e.videoId,b=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=y;var I=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),I&&!A(I)){Pe=JSON.parse(atob(I.split(".")[1])),window.siteId=null===(r=Pe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Pe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Pe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Pe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Pe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Pe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var k=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,S=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,Q(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&&!R(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()})),O&&"Safari"==l()&&Promise.resolve().then((function(){return Se})).then((function(e){e.importAirplay()})),S&&Te("https://www.googletagmanager.com/gtag/js?id=".concat(S)).then((function(){return e=S,window.dataLayer=window.dataLayer||[],Y("js",new Date),void Y("config",e);var e})).catch((function(e){}));var _=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(k));if(_&&_.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b){var H,N=null==e||null===(H=e.series)||void 0===H?void 0:H.id;F(N,I).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;L(s);var d=y||(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;m({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),f(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,c(i.data),Ae(k,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))})).catch((function(e){x(e,k,n)}))}else if(g){var V=null==e?void 0:e.epg;B(V,I).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",Ae(k,{res:o},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))}else C(y,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,c(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?M(y,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",Ae(k,{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)),Ae(k,{res:s},e,{resolve:t,reject:n})})):Ae(k,{res:s},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))}else n({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}})}}))},getRenditions:J,skip:w,getPlayer:r,play:h,pause:g,detectBrowser:l,rewind:y,loadVideo:b,seekToTimeStamp:z,isPlayerInitialised:T,load:I,dispose:k,enableCaptions:P,disableCaptions:O,getCaptions:E,playSelectedResolution:K,getSource:S,setVolume:pe,getVolume:we,disableControls:j,setPlaybackSpeed:G}}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,d as l,s as a,c as s,h as d,b as u,e as c,f as v,i as m,j as f,l as p,k as w,p as h,m as g,r as y,n as b,o as T,q as I,t as k,u as P,v as O,w as E,x as j,y as S,z as D,A,B as R,C as F,D as C,E as x,F as B,G as M,H as _,I as H,J as N,K as L}from"./generic-cea369ce.js";import V from"video.js";import{o as U,g as W,a as q,s as z,b as G}from"./util-d9f4a5a9.js";import{g as J}from"./renditions-d3d8a50e.js";import{playSelectedResolution as K}from"./resolution-a3fef89c.js";import{s as Q}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 Y(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function X(e,t){Y("event",e,t)}function Z(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 $(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function te(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function ne(){return ie.apply(this,arguments)}function ie(){return ie=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)}))),ie.apply(this,arguments)}window.initialise=function(e){window.sid=ee(),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());X(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:te(),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),X("PLAY",$({pfm:window.platform,uid:te(),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"))X("BUFFERING",$({pfm:window.platform,uid:te(),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,X("FIRST_FRAME",$({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),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;X("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),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}),X("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),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(oe(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var oe=function(e,t,n){return e>=t&&e<=n};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=$,e.t1=$,e.t2=$({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=te(),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,ne();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 re,le,ae=function(e,t){var n=r(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=V.dom.getPointerPosition(a,t).x;V.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=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;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function se(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 de(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ue=[],ce=0,ve=null;function me(e,t,n){var i,o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];le=(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===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,f={};"v1"==le?f={videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==le&&(f=de(de({videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},ve&&{seriesId:ve}),m&&{originalObjectId:m})),a(f,le).then((function(e){})).catch((function(e){})),ce=u+n}var fe=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,"'")})},pe=function(e){var t=r(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function we(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 he(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?we(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):we(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ge=function(e,t,n,i){var o,l,a=i.res,m=i.sres,f=r(e),p=(null==a?void 0:a.contentType)||"video",w=(null==a||null===(o=a[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(a),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&fe(e,sessionStorage.getItem("volume")||"100");var o=u();if(s(),n.resolve(he({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,d,c=he(he({},t),a);!function(e,t,n){var i,o,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(ve=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ue=[],ce=0,re=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());ue.includes(ce)||(e==ce?(ue.push(e),me(s,t,a)):e>ce&&(ce=e+a))})),s.one("ended",(function(){me(s,t,a,!0)})))}(e,c,null==o||null===(l=o.video)||void 0===l||null===(d=l.gist)||void 0===d?void 0:d.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;d(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=u())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,l=v().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)}))},ye=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-16d9c13c.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-6cf6eda9.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-8f48c2bd.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-f08a3ead.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&import("./skin-d06710d4.js").then((function(n){n.initialiseSkin(e,t)}))},be=function(e){return new Promise((function(t,n){if(Te(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)}}))},Te=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},Ie=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 ke,Pe=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)}}(),Oe=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)}}(),Ee=Object.freeze({__proto__:null,importChromecast:function(e){import("@silvermine/videojs-chromecast").then((function(t){be("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){t.default(V),window.__onGCastApiAvailable=function(){!function(e){var t,n,i=r(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId||null===(n=window)||void 0===n||!n.cast?console.log("Chromecast plugin is not available"):null==i||i.chromecast({receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})}(e)}})).catch((function(e){console.log(e)}))}))},importAirplay:function(e){import("@silvermine/videojs-airplay").then((function(t){t.default(V),function(e){var t=r(null==e?void 0:e.playerId);null!=e&&e.airplay&&"Safari"==l()?null==t||t.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")}(e)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),be("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Pe,loadEMELibrary:Oe});function je(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 Se(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?je(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var De=function(i,o,a,s){var u,c,v,m,f,p,w,h,g,y,T,I,k,P,O,E,D,A,R,F,C,x,B,M,L,U,W,q,z,G,J,K,Q,Y=o.res,X=void 0===Y?null:Y,Z=o.sres,$=void 0===Z?null:Z,ee=(null===(u=window)||void 0===u||null===(c=u.cast)||void 0===c||null===(v=c.framework)||void 0===v||null===(m=v.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f?void 0:f.S)||void 0,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=(null===(p=X)||void 0===p?void 0:p.contentType)||"video",ie=_(null===(w=X)||void 0===w||null===(h=w[ne])||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.videoImageUrl)||_(null===(y=X)||void 0===y||null===(T=y[ne])||void 0===T||null===(I=T.gist)||void 0===I||null===(k=I.imageGist)||void 0===k?void 0:k.r16x9),oe=(null===(P=X)||void 0===P||null===(O=P[ne])||void 0===O||null===(E=O.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,re=(null===(D=X)||void 0===D||null===(A=D[ne])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,le=(null==a?void 0:a.drmLibrary)||!1,se=(null===(F=X)||void 0===F||null===(C=F.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(B=x.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(L=X)||void 0===L||null===(U=L.ads)||void 0===U||null===(W=U.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(z=q.web)||void 0===z?void 0:z.url);X=Se(Se({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var de=(Q={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:oe},e(Q,"autoplay",null==a?void 0:a.autoplay),e(Q,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!se),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",Se(Se({dash:Se(Se({},!V.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:Se(Se({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ie),e(Q,"techOrder",te),e(Q,"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 function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=w}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),ue=V(i,de,function(){var e=t(n.mark((function e(){var t,o,r,u,c,v,m,f,p,w,h,g,y,T,I,k,P,O,E,D,A,R,F,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re&&s.resolve(Se({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(ue),window.firstFrame(ue),"white"!==window.controlsColor&&Ie(window.controlsColor,ue),/Android/i.test(navigator.userAgent)&&(V.options.vhs.overrideNative=!0),T=null===(t=X)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,I=null===(r=X)||void 0===r||null===(u=r[ne])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!T&&!le){e.next=20;break}if("Safari"!==l()){e.next=13;break}return e.next=11,Oe();case 11:e.next=20;break;case 13:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=18;break}return e.next=16,Oe();case 16:e.next=20;break;case 18:return e.next=20,Pe();case 20:oe&&ae(i,I),!se||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||H(i,se,X),(P=j(X,i))?b(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),d(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[ne])||void 0===f||null===(p=f.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[ne])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(C=(null===(E=X)||void 0===E||null===(D=E[ne])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[ne])||void 0===F?void 0:F.closedCaptions),O=C.filter((function(e){return"VTT"===e.format})),N(i,O)),null!=a&&a.disableControls?S(i):ye(i,Se(Se(Se({},a),de),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),ge(i,Se(Se(Se({},a),de),{},{liveVideo:re}),s,{res:X,sres:$});case 27:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Ae(){return{loadVideoInstantly:p,onTimeUpdate:U,getVideoDuration:W,onVideoEnded:q,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,p,w,h;if(!T(null==e?void 0:e.playerId)){var g=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,y=null==e?void 0:e.videoId,b=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=y;var I=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),I&&!A(I)){ke=JSON.parse(atob(I.split(".")[1])),window.siteId=null===(r=ke)||void 0===r?void 0:r.siteId,window.siteName=null===(a=ke)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=ke)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=ke)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=ke)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=ke)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var k=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,j=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,S=null==e?void 0:e.errors;S&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,Q(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&&!R(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Ee})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return Ee})).then((function(t){t.importChromecast(e)})),O&&"Safari"==l()&&Promise.resolve().then((function(){return Ee})).then((function(t){t.importAirplay(e)})),j&&be("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return e=j,window.dataLayer=window.dataLayer||[],Y("js",new Date),void Y("config",e);var e})).catch((function(e){}));var _=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(k));if(_&&_.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b){var H,N=null==e||null===(H=e.series)||void 0===H?void 0:H.id;F(N,I).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;L(s);var d=y||(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;m({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),f(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,c(i.data),De(k,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))})).catch((function(e){x(e,k,n)}))}else if(g){var V=null==e?void 0:e.epg;B(V,I).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",De(k,{res:o},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))}else C(y,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,c(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?M(y,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",De(k,{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)),De(k,{res:s},e,{resolve:t,reject:n})})):De(k,{res:s},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))}else n({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}})}}))},getRenditions:J,skip:w,getPlayer:r,play:h,pause:g,detectBrowser:l,rewind:y,loadVideo:b,seekToTimeStamp:z,isPlayerInitialised:T,load:I,dispose:k,enableCaptions:P,disableCaptions:O,getCaptions:E,playSelectedResolution:K,getSource:j,setVolume:fe,getVolume:pe,disableControls:S,setPlaybackSpeed:G}}export{Ae as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.68-backup",
3
+ "version": "1.0.69-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {