@viewlift/player-backup 1.0.109-backup → 1.0.111-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/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-819fdf83.js"),r=require("video.js"),l=require("@babel/runtime/helpers/typeof"),a=require("./util-2f3f324f.js"),s=require("./renditions-bcb51d31.js"),d=require("./resolution-b10ce6e9.js"),u=require("./localisation-56e0a999.js");function c(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function v(e,t){c("event",e,t)}function f(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?f(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):f(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");var p=function(){var e,t,n,i;return(null===(e=o.getCurrentVideo())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=o.getCurrentVideo())||void 0===i?void 0:i.id)};function w(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function h(){var e=window.sessionStorage.getItem("uid");return e||(e=w(),window.sessionStorage.setItem("uid",e),e)}function g(){return y.apply(this,arguments)}function y(){return y=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)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}window.initialise=function(e){window.sid=w(),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());v(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:h(),vid:p(),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),v("PLAY",m({pfm:window.platform,uid:h(),vid:p(),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(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.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"))v("BUFFERING",m({pfm:window.platform,uid:h(),vid:p(),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,v("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p()},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;v("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p(),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}),v("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:p()},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(b(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var b=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,w,y;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=h(),e.t5=p(),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,g();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),w=[e.t31],e.next=37,o.getToken();case 37:y=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:y},contentType:"application/x-www-form-urlencoded",dataType:"text",data:w}).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 T,k,P=function(e){return new Promise((function(t,n){if(I(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},I=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},O=function(){var e=t(n.mark((function e(t){var i,l,a,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,P("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(r),e.finish(13);case 16:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==o.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),S=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),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*d,v.seek()}}))};function E(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 j(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?E(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var D=[],C=0,A=null;function R(t,n,i){var r,l,a,s,d,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];k=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var c=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration()),m=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,w=(null==n||null===(d=n.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,h=Math.floor(t.currentTime()),g=u?100:Math.floor(v/f*100),y={};w?function(t,n,i){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=x(r),a=(new Date).getTime(),s=o.getCurrentVideo(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return j(j({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===T}));c<0?l.push(j(j({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=j(j(j({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(y={completed:u,watchedTime:h,watchedPercentage:g},c,n.siteOwner):("v1"==k?y={videoId:T,watchedTime:h,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:m}:"v2"==k&&(y=j(j({videoId:T,watchedTime:h,watchedPercentage:g,doneWatching:u,profileId:c},A&&{seriesId:A}),p&&{originalObjectId:p})),o.saveWatchHistory(y,k).then((function(e){})).catch((function(e){}))),C=v+i}function x(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var F=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,"'")})},H=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},B=!1,V=function(e,t){var n,i,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[r])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!B){var l=M(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,t);return a&&o.loadVideo(t,a),B=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function M(e,t,n){if(Array.isArray(e))return e.map((function(e){return M(e,t,n)}));if(null!==e&&"object"===l(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=M(e[o],t,n)})),i}return e}function _(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 N(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var q=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&&(d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i,r;(null==d||!d.muted())&&F(e,sessionStorage.getItem("volume")||"100");var l=o.getCurrentVideo();if(o.clearError(),n.resolve(N({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||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var u,c,v=N(N({},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&&(A=null==t||null===(r=t.series)||void 0===r?void 0:r.id),D=[],C=0,T=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());D.includes(C)||(e==C?(D.push(e),R(s,t,a)):e>C&&(C=e+a))})),s.one("ended",(function(){R(s,t,a,!0)})))}(e,v,null==l||null===(u=l.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===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,f=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,m=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"===f){var p,w=m.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)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.tech_.on("retryplaylist",(function(){c&&V(a,e)})),d.on("error",(function(){var t,i;4===d.error().code&&c?V(a,e):(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(){if(c){d.currentSource();for(var e=d.textTracks(),t=e.length-1;t>=0;t--)d.removeRemoteTextTrack(e[t])}})))},L=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-6f735c22.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-2bec6fc1.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-3195e042.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-18510876.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?Promise.resolve().then((function(){return require("./skin-217fddda.js")})).then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&Promise.resolve().then((function(){return require("./skin-283228cf.js")})).then((function(n){n.initaliseSkin(e,t)}))},U=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 W,z=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)}}(),G=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").then((function(e){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){P("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"),P("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:z,loadEMELibrary:G});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 Q(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 Y=function(i,l,a,s){var d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R,x,F,H,B,V,M,_,N,W,J,K,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z;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===(f=v.getInstance())||void 0===f||f.S;var ee=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=X)||void 0===m?void 0:m.contentType)||"video",ne=o.impolicy16x9(null===(p=X)||void 0===p||null===(w=p[te])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(k=X)||void 0===k||null===(P=k[te])||void 0===P||null===(I=P.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(x=R.adTags)||void 0===x||null===(F=x.web)||void 0===F?void 0:F.active)&&(null===(H=X)||void 0===H||null===(B=H.ads)||void 0===B||null===(V=B.preRoll)||void 0===V||null===(M=V.adTags)||void 0===M||null===(_=M.web)||void 0===_?void 0:_.url);X=Q(Q({},X),{},{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:ie},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",Q(Q({dash:{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},vhs:Q(Q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(N=a.customData)||void 0===N?void 0:N.overrideNative)&&{overrideNative:!0}),{},{bufferBasedABR:!0,enableLowInitialPlaylist:!0})},0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(K,"poster",ne),e(K,"techOrder",ee),e(K,"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,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,e,n)}}),K);if(!r.getPlayers()[i])var se=r(i,ae,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(a);case 2:if(oe&&s.resolve(Q({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&U(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[te])||void 0===l?void 0:l.drmEnabled,T=null===(d=X)||void 0===d||null===(u=d[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!re){e.next=22;break}if("Safari"!==o.detectBrowser()){e.next=15;break}return e.next=13,G();case 13:e.next=22;break;case 15:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=20;break}return e.next=18,G();case 18:e.next=22;break;case 20:return e.next=22,z();case 22:if(null==a||!a.videoSourceUrl){e.next=25;break}return e.next=25,z();case 25:ie&&S(i,T),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,le,X),P=o.getSource(X,i),null!=a&&a.nearestClusterUrl&&(P=o.getUpdatedClusterSource(P,a.nearestClusterUrl)),P?o.loadVideo(i,P):(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===(f=X)||void 0===f||null===(m=f[te])||void 0===m||null===(p=m.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[te])||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[te])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[te])||void 0===A?void 0:A.closedCaptions),I=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,I)),null!=a&&a.disableControls?o.disableControls(i):L(i,Q(Q(Q({},a),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),q(i,Q(Q(Q({},a),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 33:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:a.onTimeUpdate,getVideoDuration:a.getVideoDuration,onVideoEnded:a.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,d,v,f,m,p,w;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e?void 0:e.videoSourceUrl)||!1,g=null==e?void 0:e.asat,y=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,T=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=b;var k=null==e?void 0:e.token;if(o.token_authentication_enabled(e)){if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),!k||o.isTokenExpired(k))return void n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}});W=JSON.parse(atob(k.split(".")[1]))}window.siteId=null===(l=W)||void 0===l?void 0:l.siteId,window.siteName=null===(a=W)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=W)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=W)||void 0===d?void 0:d.site)||null,e.userId=(null===(v=W)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=W)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var O=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,u.setLocalisation(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),S&&(window.playerEntitlementUrl=S),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 J})).then((function(e){e.importIMA()})),O&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return J})).then((function(e){e.importAirplay()})),E&&P("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],c("js",new Date),void c("config",e);var e})).catch((function(e){}));var D=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I));if(D&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h){var C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",A={directPlaybackUrl:h,id:C};g?o.getVideoDetails(C,k).then((function(i){Y(I,{res:Q(Q({},i),A)},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,C)})):Y(I,{res:A},e,{resolve:t,reject:n})}else if(T){var R,F=sessionStorage.getItem("season-idx")||0;o.seasonIdxManager.set(parseInt(F));var H=null==e||null===(R=e.series)||void 0===R?void 0:R.id;o.getSeriesDetails(H,k).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=b||(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)}))}(H,k),o.getVideoDetails(u,k).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),Y(I,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))})).catch((function(e){o.initiateErrorHandling(e,I,n)}))}else if(y){var B=null==e?void 0:e.epg;o.getLinearChannelDetails(B,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==B?void 0:B.channelId,Y(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}else o.getVideoDetails(b,k).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,u=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(d=e.watchHistory)||void 0===d?void 0:d.saveOffline)||!1){var c,v,f,m=function(e,t,n){var i=x(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(c=e.watchHistory)||void 0===c?void 0:c.profileId)||"",b,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})}else o.getVideoInfo(b,k).then((function(i){var o,r,l,a,s,d;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===(d=i.data)||void 0===d?void 0:d.watchedPercentage)||null,u.contentType="video",Y(I,{res:u},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)),Y(I,{res:u},e,{resolve:t,reject:n})}));else Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}}))},getRenditions:s.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:a.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:F,getVolume:H,disableControls:o.disableControls,setPlaybackSpeed:a.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"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-819fdf83.js"),r=require("video.js"),l=require("@babel/runtime/helpers/typeof"),a=require("./util-2f3f324f.js"),s=require("./renditions-bcb51d31.js"),d=require("./resolution-b10ce6e9.js"),u=require("./localisation-56e0a999.js");function c(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function v(e,t){c("event",e,t)}function f(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?f(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):f(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");var p=function(){var e,t,n,i;return(null===(e=o.getCurrentVideo())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=o.getCurrentVideo())||void 0===i?void 0:i.id)};function w(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function h(){var e=window.sessionStorage.getItem("uid");return e||(e=w(),window.sessionStorage.setItem("uid",e),e)}function g(){return y.apply(this,arguments)}function y(){return y=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)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}window.initialise=function(e){window.sid=w(),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());v(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:h(),vid:p(),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),v("PLAY",m({pfm:window.platform,uid:h(),vid:p(),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(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.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"))v("BUFFERING",m({pfm:window.platform,uid:h(),vid:p(),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,v("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p()},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;v("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p(),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}),v("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:p()},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(b(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var b=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,w,y;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=h(),e.t5=p(),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,g();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),w=[e.t31],e.next=37,o.getToken();case 37:y=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:y},contentType:"application/x-www-form-urlencoded",dataType:"text",data:w}).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 T,k,P=function(e){return new Promise((function(t,n){if(I(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},I=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},O=function(){var e=t(n.mark((function e(t){var i,l,a,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,P("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(r),e.finish(13);case 16:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==o.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),S=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),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*d,v.seek()}}))};function E(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 j(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?E(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var D=[],C=0,A=null;function R(t,n,i){var r,l,a,s,d,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];k=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var c=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration()),m=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,w=(null==n||null===(d=n.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,h=Math.floor(t.currentTime()),g=u?100:Math.floor(v/f*100),y={};w?function(t,n,i){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=x(r),a=(new Date).getTime(),s=o.getCurrentVideo(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return j(j({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===T}));c<0?l.push(j(j({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=j(j(j({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(y={completed:u,watchedTime:h,watchedPercentage:g},c,n.siteOwner):("v1"==k?y={videoId:T,watchedTime:h,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:m}:"v2"==k&&(y=j(j({videoId:T,watchedTime:h,watchedPercentage:g,doneWatching:u,profileId:c},A&&{seriesId:A}),p&&{originalObjectId:p})),o.saveWatchHistory(y,k).then((function(e){})).catch((function(e){}))),C=v+i}function x(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var F=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,"'")})},H=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},B=!1,V=function(e,t){var n,i,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[r])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!B){var l=M(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,t);return a&&o.loadVideo(t,a),B=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function M(e,t,n){if(Array.isArray(e))return e.map((function(e){return M(e,t,n)}));if(null!==e&&"object"===l(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=M(e[o],t,n)})),i}return e}function _(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 N(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var q=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&&(d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i,r;(null==d||!d.muted())&&F(e,sessionStorage.getItem("volume")||"100");var l=o.getCurrentVideo();if(o.clearError(),n.resolve(N({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||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var u,c,v=N(N({},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&&(A=null==t||null===(r=t.series)||void 0===r?void 0:r.id),D=[],C=0,T=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());D.includes(C)||(e==C?(D.push(e),R(s,t,a)):e>C&&(C=e+a))})),s.one("ended",(function(){R(s,t,a,!0)})))}(e,v,null==l||null===(u=l.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===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,f=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,m=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"===f){var p,w=m.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)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.tech_.on("retryplaylist",(function(){c&&V(a,e)})),d.on("error",(function(){var t,i;4===d.error().code&&c?V(a,e):(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(){if(c){d.currentSource();for(var e=d.textTracks(),t=e.length-1;t>=0;t--)d.removeRemoteTextTrack(e[t])}})))},L=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-6f735c22.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-2bec6fc1.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-3195e042.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-ad5de08f.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?Promise.resolve().then((function(){return require("./skin-217fddda.js")})).then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&Promise.resolve().then((function(){return require("./skin-283228cf.js")})).then((function(n){n.initaliseSkin(e,t)}))},U=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 W,z=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)}}(),G=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").then((function(e){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){P("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"),P("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:z,loadEMELibrary:G});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 Q(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 Y=function(i,l,a,s){var d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R,x,F,H,B,V,M,_,N,W,J,K,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z;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===(f=v.getInstance())||void 0===f||f.S;var ee=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=X)||void 0===m?void 0:m.contentType)||"video",ne=o.impolicy16x9(null===(p=X)||void 0===p||null===(w=p[te])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(k=X)||void 0===k||null===(P=k[te])||void 0===P||null===(I=P.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(x=R.adTags)||void 0===x||null===(F=x.web)||void 0===F?void 0:F.active)&&(null===(H=X)||void 0===H||null===(B=H.ads)||void 0===B||null===(V=B.preRoll)||void 0===V||null===(M=V.adTags)||void 0===M||null===(_=M.web)||void 0===_?void 0:_.url);X=Q(Q({},X),{},{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:ie},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",Q(Q({dash:{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},vhs:Q(Q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(N=a.customData)||void 0===N?void 0:N.overrideNative)&&{overrideNative:!0}),{},{bufferBasedABR:!0,enableLowInitialPlaylist:!0})},0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(K,"poster",ne),e(K,"techOrder",ee),e(K,"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,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,e,n)}}),K);if(!r.getPlayers()[i])var se=r(i,ae,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(a);case 2:if(oe&&s.resolve(Q({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&U(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[te])||void 0===l?void 0:l.drmEnabled,T=null===(d=X)||void 0===d||null===(u=d[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!re){e.next=22;break}if("Safari"!==o.detectBrowser()){e.next=15;break}return e.next=13,G();case 13:e.next=22;break;case 15:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=20;break}return e.next=18,G();case 18:e.next=22;break;case 20:return e.next=22,z();case 22:if(null==a||!a.videoSourceUrl){e.next=25;break}return e.next=25,z();case 25:ie&&S(i,T),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,le,X),P=o.getSource(X,i),null!=a&&a.nearestClusterUrl&&(P=o.getUpdatedClusterSource(P,a.nearestClusterUrl)),P?o.loadVideo(i,P):(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===(f=X)||void 0===f||null===(m=f[te])||void 0===m||null===(p=m.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[te])||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[te])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[te])||void 0===A?void 0:A.closedCaptions),I=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,I)),null!=a&&a.disableControls?o.disableControls(i):L(i,Q(Q(Q({},a),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),q(i,Q(Q(Q({},a),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 33:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:a.onTimeUpdate,getVideoDuration:a.getVideoDuration,onVideoEnded:a.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,d,v,f,m,p,w;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e?void 0:e.videoSourceUrl)||!1,g=null==e?void 0:e.asat,y=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,T=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=b;var k=null==e?void 0:e.token;if(o.token_authentication_enabled(e)){if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),!k||o.isTokenExpired(k))return void n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}});W=JSON.parse(atob(k.split(".")[1]))}window.siteId=null===(l=W)||void 0===l?void 0:l.siteId,window.siteName=null===(a=W)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=W)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=W)||void 0===d?void 0:d.site)||null,e.userId=(null===(v=W)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=W)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var O=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,u.setLocalisation(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),S&&(window.playerEntitlementUrl=S),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 J})).then((function(e){e.importIMA()})),O&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return J})).then((function(e){e.importAirplay()})),E&&P("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],c("js",new Date),void c("config",e);var e})).catch((function(e){}));var D=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I));if(D&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h){var C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",A={directPlaybackUrl:h,id:C};g?o.getVideoDetails(C,k).then((function(i){Y(I,{res:Q(Q({},i),A)},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,C)})):Y(I,{res:A},e,{resolve:t,reject:n})}else if(T){var R,F=sessionStorage.getItem("season-idx")||0;o.seasonIdxManager.set(parseInt(F));var H=null==e||null===(R=e.series)||void 0===R?void 0:R.id;o.getSeriesDetails(H,k).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=b||(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)}))}(H,k),o.getVideoDetails(u,k).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),Y(I,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))})).catch((function(e){o.initiateErrorHandling(e,I,n)}))}else if(y){var B=null==e?void 0:e.epg;o.getLinearChannelDetails(B,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==B?void 0:B.channelId,Y(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}else o.getVideoDetails(b,k).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,u=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(d=e.watchHistory)||void 0===d?void 0:d.saveOffline)||!1){var c,v,f,m=function(e,t,n){var i=x(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(c=e.watchHistory)||void 0===c?void 0:c.profileId)||"",b,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})}else o.getVideoInfo(b,k).then((function(i){var o,r,l,a,s,d;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===(d=i.data)||void 0===d?void 0:d.watchedPercentage)||null,u.contentType="video",Y(I,{res:u},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)),Y(I,{res:u},e,{resolve:t,reject:n})}));else Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}}))},getRenditions:s.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:a.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:F,getVolume:H,disableControls:o.disableControls,setPlaybackSpeed:a.setPlaybackSpeed}};
@@ -1 +1 @@
1
- "use strict";var e=require("./features-74c175f9.js"),l=require("./icons-515b2da0.js"),t=require("./generic-819fdf83.js"),n=require("./renditions-bcb51d31.js"),i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./autoNextVideo-31193232.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-2f3f324f.js");var r=t.getCurrentSeries(),a=[];null==r||r.map((function(e){return a.push.apply(a,i(e.episodes))}));var d=function(e,l){var n=t.getPlayer(e),i=Math.floor(n.currentTime());if(Math.floor(n.duration())!=i){n.pause(e);var r=t.getVideoIdx();o.switchToNext(r,e,a)}};function u(l,i){var o=t.getPlayer(l);o&&(o.on("loadeddata",(function(){var r,u,s;(null===(r=n.getRenditions(l))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(l,i),(null===(u=t.getCaptions(l))||void 0===u?void 0:u.length)>0&&e.addCaptionButton(l,i),null!=i&&null!==(s=i.series)&&void 0!==s&&s.enable&&function(e,l){var n;null==l||null===(n=l.series)||void 0===n||n.cb;var i=t.getPlayer(e);i.on("timeupdate",(function(){var e,l=Math.floor(i.currentTime()),n=i.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-l<=10&&t.getVideoIdx()<=(null==a?void 0:a.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=a.filter((function(e,l){return l==t.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var u,s,v,c,m,p,g,h,f,y,b;(null===(u=document.getElementsByClassName("next-ep-preview"))||void 0===u?void 0:u[0]).style.visibility="hidden";var C=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],x=null===(v=document.getElementsByClassName("next-ep-img"))||void 0===v?void 0:v[0],q=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],w=null===(m=r[0])||void 0===m?void 0:m.title;(null===(p=w)||void 0===p?void 0:p.length)>60&&(w=w.substr(0,60)+"..."),C.textContent="".concat(w),x.src=(null===(g=r[0])||void 0===g||null===(h=g.gist)||void 0===h||null===(f=h.imageGist)||void 0===f?void 0:f.r16x9)||(null===(y=window)||void 0===y||null===(b=y.customData)||void 0===b?void 0:b.fallbackImage),q.onclick=function(){return d(e)}}else{var j,E,N,B,V,S,k,P=document.createElement("div");P.className="next-ep-preview",P.style.visibility="hidden",document.getElementById(e).append(P);var I=document.createElement("div");I.className="next-ep-header",I.textContent="Next up";var M=null===(j=r[0])||void 0===j?void 0:j.title,R=document.createElement("img");R.className="next-ep-img",R.src=(null===(E=r[0])||void 0===E||null===(N=E.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null===(V=window)||void 0===V||null===(S=V.customData)||void 0===S?void 0:S.fallbackImage);var T=document.createElement("div");T.className="next-ep-title",(null===(k=M)||void 0===k?void 0:k.length)>60&&(M=M.substr(0,60)+"..."),T.textContent="".concat(M);var O=document.createElement("div");O.className="next-ep-content",O.append(R),O.append(T),O.onclick=function(){return d(e)},P.append(I),P.append(O)}}(l,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(l,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}exports.initialiseSkin=function(n,i){!function(){"Chrome"==t.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));Promise.resolve().then((function(){return require("./skin-8fa76c87.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),u(n,i),function(e,n){var i,o,r,a,d,u,s=t.getPlayer(e);null==s||null===(i=s.controlBar)||void 0===i||null===(o=i.getChild("FullscreenToggle"))||void 0===o||null===(r=o.el())||void 0===r||r.appendChild(t.createIconMarkup(l.MinimizeSvg(window.controlsColor))),null==s||null===(a=s.controlBar)||void 0===a||null===(d=a.getChild("FullscreenToggle"))||void 0===d||null===(u=d.el())||void 0===u||u.appendChild(t.createIconMarkup(l.MaximizeSvg(window.controlsColor)));var v=document.getElementsByClassName("vjs-time-control");n.liveVideo&&v[0]&&(v[0].style.display="none")}(n,i),function(t,n){var i,o,r,a,d,u;0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(t,"defaultV2",l.SkipSvgV2());(0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(t,"defaultV2",l.RewindSvgV2());n.liveVideo||e.addSlowMotion(t);(null==n||null===(i=n.relatedVideos)||void 0===i||null===(o=i.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(t,null==n?void 0:n.relatedVideos);(null==n||null===(r=n.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(t,null==n?void 0:n.streams);(null==n||null===(a=n.playlist)||void 0===a||null===(d=a.content)||void 0===d?void 0:d.length)>0&&e.addPlaylistSelector(t,null==n?void 0:n.playlist);null!=n&&null!==(u=n.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(t,n)}(n,i),function(e,l){var n=t.getPlayer(e),i=null==l?void 0:l.tvProviderLogoUrl;if(!i)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(i),r.alt="Provider Image",o.append(r),n.el().appendChild(o),n.on("useractive",(function(){o.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||o.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(n,i)};
1
+ "use strict";var e=require("./features-74c175f9.js"),l=require("./icons-515b2da0.js"),t=require("./generic-819fdf83.js"),n=require("./renditions-bcb51d31.js"),i=require("@babel/runtime/helpers/toConsumableArray"),o=require("./autoNextVideo-31193232.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-2f3f324f.js");var r=t.getCurrentSeries(),a=[];null==r||r.map((function(e){return a.push.apply(a,i(e.episodes))}));var d=function(e,l){var n=t.getPlayer(e),i=Math.floor(n.currentTime());if(Math.floor(n.duration())!=i){n.pause(e);var r=t.getVideoIdx();o.switchToNext(r,e,a)}};function u(l,i){var o=t.getPlayer(l);o&&(o.on("loadeddata",(function(){var r,u,s;(null===(r=n.getRenditions(l))||void 0===r?void 0:r.length)>0&&e.addSettingsButtonV2(l,i),(null===(u=t.getCaptions(l))||void 0===u?void 0:u.length)>0&&e.addCaptionButton(l,i),null!=i&&null!==(s=i.series)&&void 0!==s&&s.enable&&function(e,l){var n;null==l||null===(n=l.series)||void 0===n||n.cb;var i=t.getPlayer(e);i.on("timeupdate",(function(){var e,l=Math.floor(i.currentTime()),n=i.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-l<=10&&t.getVideoIdx()<=(null==a?void 0:a.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=a.filter((function(e,l){return l==t.getVideoIdx()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var u,s,v,c,m,p,g,h,f,y,b;(null===(u=document.getElementsByClassName("next-ep-preview"))||void 0===u?void 0:u[0]).style.visibility="hidden";var C=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],x=null===(v=document.getElementsByClassName("next-ep-img"))||void 0===v?void 0:v[0],q=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],w=null===(m=r[0])||void 0===m?void 0:m.title;(null===(p=w)||void 0===p?void 0:p.length)>60&&(w=w.substr(0,60)+"..."),C.textContent="".concat(w),x.src=(null===(g=r[0])||void 0===g||null===(h=g.gist)||void 0===h||null===(f=h.imageGist)||void 0===f?void 0:f.r16x9)||(null===(y=window)||void 0===y||null===(b=y.customData)||void 0===b?void 0:b.fallbackImage),q.onclick=function(){return d(e)}}else{var j,E,N,B,V,S,k,P=document.createElement("div");P.className="next-ep-preview",P.style.visibility="hidden",document.getElementById(e).append(P);var I=document.createElement("div");I.className="next-ep-header",I.textContent="Next up";var M=null===(j=r[0])||void 0===j?void 0:j.title,R=document.createElement("img");R.className="next-ep-img",R.src=(null===(E=r[0])||void 0===E||null===(N=E.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null===(V=window)||void 0===V||null===(S=V.customData)||void 0===S?void 0:S.fallbackImage);var T=document.createElement("div");T.className="next-ep-title",(null===(k=M)||void 0===k?void 0:k.length)>60&&(M=M.substr(0,60)+"..."),T.textContent="".concat(M);var O=document.createElement("div");O.className="next-ep-content",O.append(R),O.append(T),O.onclick=function(){return d(e)},P.append(I),P.append(O)}}(l,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(r[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var t,n,i,o;null!==(t=window)&&void 0!==t&&null!==(n=t.customData)&&void 0!==n&&n.iframeOverlayUrl&&e.addOutputtingOverlay(l,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}exports.initialiseSkin=function(n,i){!function(){"Chrome"==t.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));Promise.resolve().then((function(){return require("./skin-e69bd3fe.js")})).then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),u(n,i),function(e,n){var i,o,r,a,d,u,s=t.getPlayer(e);null==s||null===(i=s.controlBar)||void 0===i||null===(o=i.getChild("FullscreenToggle"))||void 0===o||null===(r=o.el())||void 0===r||r.appendChild(t.createIconMarkup(l.MinimizeSvg(window.controlsColor))),null==s||null===(a=s.controlBar)||void 0===a||null===(d=a.getChild("FullscreenToggle"))||void 0===d||null===(u=d.el())||void 0===u||u.appendChild(t.createIconMarkup(l.MaximizeSvg(window.controlsColor)));var v=document.getElementsByClassName("vjs-time-control");n.liveVideo&&v[0]&&(v[0].style.display="none")}(n,i),function(t,n){var i,o,r,a,d,u;0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(t,"defaultV2",l.SkipSvgV2());(0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(t,"defaultV2",l.RewindSvgV2());n.liveVideo||e.addSlowMotion(t);(null==n||null===(i=n.relatedVideos)||void 0===i||null===(o=i.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(t,null==n?void 0:n.relatedVideos);(null==n||null===(r=n.streams)||void 0===r?void 0:r.length)>1&&e.addMulticamSelector(t,null==n?void 0:n.streams);(null==n||null===(a=n.playlist)||void 0===a||null===(d=a.content)||void 0===d?void 0:d.length)>0&&e.addPlaylistSelector(t,null==n?void 0:n.playlist);null!=n&&null!==(u=n.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(t,n)}(n,i),function(e,l){var n=t.getPlayer(e),i=null==l?void 0:l.tvProviderLogoUrl;if(!i)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(i),r.alt="Provider Image",o.append(r),n.el().appendChild(o),n.on("useractive",(function(){o.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||o.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(n,i)};
@@ -0,0 +1 @@
1
+ "use strict";exports.default=".tvProviderImage{\n position: absolute;\n right: 1rem;\n top: 1rem;\n max-height: 100px;\n max-width: 100px;\n}\n.tvProviderImage>img{\n height: 100%;\n width: 100%;\n}\n.vjs-button>.vjs-icon-placeholder:before {\n font-size: 2.2em;\n line-height: 2.6;\n}\n.vjs-control-bar{\n z-index: 1 !important;\n height: 6em !important;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%) !important;\n}\n\n.vjs-fade>* {\n visibility: hidden !important;\n opacity: 0 !important;\n transition: visibility 1s, opacity 1s !important;\n}\n\n.video-js .vjs-progress-control {\n left: -6px;\n position: absolute;\n width: 100%;\n height: 0.5em;\n top: -0.5em;\n transition: height .1s,top .1s;\n}\n\n.video-js .vjs-custom-control-spacer {\n display: block;\n flex: 1 1 auto;\n}\n\n.vjs-remaining-time.vjs-time-control.vjs-control {\n position: absolute;\n right: 0;\n bottom: 18px;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 41px 0 14px;\n}\n.vjs-remaining-time.vjs-time-control.vjs-control{\n display: none;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button {\n font-size: 14px;\n font-weight: 500;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder{\n height: 6px !important;\n}\n\n.video-js .vjs-play-progress:before {\n font-size: 1.9em;\n}\n.video-js .vjs-play-progress .vjs-time-tooltip {\n display: none !important;\n}\n\n/* */\n\n.video-js .vjs-mouse-display{\n font-size: 1.6666666667em;\n}\n\n.video-js .vjs-progress-control:hover .vjs-progress-holder { \n font-size: 1em !important; \n} \n\n.video-js .vjs-current-time { display: block; }\n\n.video-js .vjs-current-time {\n display: block;\n position: absolute;\n right: 0em;\n bottom: 1.8em;\n font-size: 12px;\n font-weight: 600;\n}\n\n.video-js .vjs-button{\n width: 6em;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button{\n align-self: center;\n height: min-content;\n padding: 5px 2px;\n border-radius: 8px;\n}\n\n\n.vjs-fullscreen .icon-minimize,\n.icon-maximize {\n display: block;\n height: 32px;\n}\n\n.vjs-fullscreen .icon-maximize,\n.icon-minimize {\n display: none;\n height: 32px;\n}\n\nbutton.vjs-play-control.vjs-control.vjs-button{\n outline: none !important;\n}\n\n.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,\n.vjs-icon-fullscreen-enter:before {\n content: '' !important;\n}\n\n.video-js button.vjs-fullscreen-control.vjs-control.vjs-button {\n display: flex;\n justify-content: center;\n align-items: center;\n transform: rotate(90deg);\n}\n\n.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before{\n display: none;\n}\n.video-js .vjs-volume-panel .vjs-volume-control{\n margin-left: -10px;\n}\n\n.skipbtn:hover{\n cursor: pointer;\n}\n\n.rewindbtn:hover{\n cursor: pointer;\n}\n\n.vjs-live-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 1.8em !important;\n font-weight: 700 !important;\n font-size: 11px !important;\n}\n\n.vjs-seek-to-live-control.vjs-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 3.2em !important;\n}\n\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display:none;\n}\n\n.video-js.vjs-paused .vjs-big-play-button {\n width: 90px;\n height: 90px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n font-size: 6em;\n line-height: 1.3em;\n}\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{\n font-weight: bold;\n}\n\n.vjs-menu > ul.vjs-menu-content{\n bottom: 3.5em !important;\n right: -1em;\n}\n\n.video-js .vjs-chromecast-button .vjs-icon-placeholder {\n width: 17px !important;\n height: 17px !important;\n}\n\n.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-control.vjs-button{\n /* display: flex;\n justify-content: center;\n align-items: center; */\n display: none;\n}\n\nbutton.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-button{\n height: min-content;\n width: min-content;\n}\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical{\n width: 6em;\n}\n\n.video-js .content{\n bottom: 3.4rem !important;\n right: -4rem !important; \n}\n\n.setting-icon > svg{\n height:18px !important;\n}\n\n.output-overlay{\n position: absolute;\n bottom: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n border: 0;\n pointer-events:none\n}\n\niframe{\n width: 100%;\n height: 100%;\n}\n\n\n@media(max-width:600px){\n .tvProviderImage{\n display: none\n }\n.vjs-fullscreen .icon-minimize,\n .icon-maximize {\n height: 30px !important;\n }\n\n .vjs-fullscreen .icon-maximize,\n .icon-minimize {\n height: 30px !important;\n }\n\n button.vjs-fullscreen-control.vjs-control.vjs-button>span.vjs-icon-placeholder::before {\n height: min-content;\n }\n\n .vjs-seek-to-live-control.vjs-control{\n position: relative !important;\n right: 0em !important;\n bottom: 0 !important;\n }\n\n .video-js .vjs-progress-control{\n top: -0.85em;\n }\n .vjs-live-control{\n right: -1em !important;\n position: relative !important;\n bottom: 0 !important;\n font-size: 12px !important;\n }\n button.vjs-slowmo-button{\n display: none;\n }\n button.vjs-rewind-button{\n display: none;\n }\n button.vjs-rewind-button>svg{\n height: 20px;\n }\n .video-js .vjs-button{\n width: 4.8em;\n }\n .video-js .widget-selection{\n display: none;\n }\n .video-js .container{\n display: none !important;\n }\n .video-js .vjs-control-bar{\n height: 4em !important;\n }\n .video-js .vjs-button>.vjs-icon-placeholder:before{\n font-size: 2.5em;\n line-height: 1.5;\n }\n .video-js .vjs-play-progress:before {\n font-size: 1.2em;\n position: absolute;\n right: -0.5em;\n /* top: -0.3333333333em; */\n z-index: 1;\n}\nbutton.vjs-skip-button>svg{\n height: 20px;\n}\nbutton.vjs-big-play-button {\n width: 50px !important;\n height: 50px !important;\n font-size: 2.1rem !important;\n}\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display: block;\n}\n\n.stream-selector-icon>svg{\n width: 24px;\n height: 24px;\n}\n.video-js.vjs-live .vjs-progress-control .vjs-progress-holder{\n margin: 0 12px 0 21px;\n}\n.vjs-seek-to-live-text{\n font-size: 12px;\n}\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 40px 0px 21px;\n}\n.video-js .vjs-current-time{\n bottom: 2em !important;\n}\n}";
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,b as a,s,c as d,l as u,e as c,f as v,h as f,i as m,j as p,k as w,m as h,n as g,p as y,o as b,r as T,q as k,t as P,u as I,v as O,w as j,x as S,y as E,z as D,A,B as R,C as x,D as C,E as F,F as B,G as H,H as M,I as _,J as N,K as L,L as V,M as U,N as W,O as q}from"./generic-b792f482.js";import z from"video.js";import G from"@babel/runtime/helpers/typeof";import{o as J,g as K,a as Q,s as Y,b as X}from"./util-46e139c1.js";import{g as Z}from"./renditions-825bf986.js";import{playSelectedResolution as $}from"./resolution-e8ee75fd.js";import{s as ee}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 te(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function ne(e,t){te("event",e,t)}function ie(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 oe(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ie(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var re=function(){var e,t,n,i;return(null===(e=r())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=r())||void 0===i?void 0:i.id)};function le(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ae(){var e=window.sessionStorage.getItem("uid");return e||(e=le(),window.sessionStorage.setItem("uid",e),e)}function se(){return de.apply(this,arguments)}function de(){return de=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)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),de.apply(this,arguments)}window.initialise=function(e){window.sid=le(),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());ne(r?"FAILED_TO_START":"DROPPED_STREAM",oe({pfm:window.platform,uid:ae(),vid:re(),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),ne("PLAY",oe({pfm:window.platform,uid:ae(),vid:re(),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(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.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"))ne("BUFFERING",oe({pfm:window.platform,uid:ae(),vid:re(),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,ne("FIRST_FRAME",oe({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),vid:re()},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;ne("AD_REQUEST",oe({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),vid:re(),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}),ne("AD_IMPRESSION",oe({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:re()},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(ue(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var ue=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,m,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=oe,e.t1=oe,e.t2=oe({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=ae(),e.t5=re(),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,se();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),m=[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===(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:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).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 ce,ve,fe=function(e){return new Promise((function(t,n){if(me(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},pe=function(){var e=t(n.mark((function e(t){var i,o,r,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(z),e.finish(13);case 16:null!==(r=window)&&void 0!==r&&r.cast?null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==l()?null==o||o.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),we=function(e,t){var n=a(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=z.dom.getPointerPosition(a,t).x;z.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 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=[],be=0,Te=null;function ke(t,n,i){var o,l,a,d,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ve=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var v=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,f=Math.floor(t.currentTime()),m=Math.floor(t.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,w=(null==n||null===(d=n.video)||void 0===d?void 0:d.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),y=c?100:Math.floor(f/m*100),b={};h?function(t,n,i){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=Pe(o),a=(new Date).getTime(),s=r(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return ge(ge({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===ce}));c<0?l.push(ge(ge({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=ge(ge(ge({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:y},v,n.siteOwner):("v1"==ve?b={videoId:ce,watchedTime:g,watchedPercentage:y,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==ve&&(b=ge(ge({videoId:ce,watchedTime:g,watchedPercentage:y,doneWatching:c,profileId:v},Te&&{seriesId:Te}),w&&{originalObjectId:w})),s(b,ve).then((function(e){})).catch((function(e){}))),be=f+i}function Pe(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var Ie=function(e,t,n){var i=a(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,"'")})},Oe=function(e){var t=a(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},je=!1,Se=function(e,t){var n,i,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[o])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!je){var r=Ee(e,"videoAssets","secondaryVideoAssets"),l=d(r,t);return l&&u(t,l),je=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Ee(e,t,n){if(Array.isArray(e))return e.map((function(e){return Ee(e,t,n)}));if(null!==e&&"object"===G(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=Ee(e[o],t,n)})),i}return e}function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ae(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?De(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):De(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Re=function(e,t,n,i){var o,l,s=i.res,d=i.sres,u=a(e),p=(null==s?void 0:s.contentType)||"video",w=(null==s||null===(o=s[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(s),u&&(u.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:s})})),u.on("loadeddata",(function(){var i,o;(null==u||!u.muted())&&Ie(e,sessionStorage.getItem("volume")||"100");var l=r();if(v(),n.resolve(Ae({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:s}:{response:s})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var c,f,m=Ae(Ae({},t),s);!function(e,t,n){var i,o,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(Te=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ye=[],be=0,ce=n;var l=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=a(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ye.includes(be)||(e==be?(ye.push(e),ke(s,t,l)):e>be&&(be=e+l))})),s.one("ended",(function(){ke(s,t,l,!0)})))}(e,m,null==l||null===(c=l.video)||void 0===c||null===(f=c.gist)||void 0===f?void 0:f.id)}})),u.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",t)})),u.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,f=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,m=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"===f){var p,w=m.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)}})),u.on("loadedmetadata",(function(){window.endFirstFrame(u)})),u.tech_.on("retryplaylist",(function(){w&&Se(s,e)})),u.on("error",(function(){var t,i;4===u.error().code&&w?Se(s,e):(f(e,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),u.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,l=null===(n=r())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=m().get(l)||{t:0,p:0},s=a.t,d=a.p;s&&d<95&&setTimeout((function(){u.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),u.on("chromecastDisconnected",(function(){if(w){u.currentSource();for(var e=u.textTracks(),t=e.length-1;t>=0;t--)u.removeRemoteTextTrack(e[t])}})))},xe=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-75d22c3c.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-2b3225e9.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-8d99e7b1.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-562714e4.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?import("./skin-c3a031af.js").then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&import("./skin-edada803.js").then((function(n){n.initaliseSkin(e,t)}))},Ce=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 Fe,Be=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)}}(),He=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").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),fe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Be,loadEMELibrary:He});function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ne(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Le=function(i,o,r,s){var c,v,m,p,w,h,g,y,b,T,k,P,I,O,j,S,E,A,R,x,C,F,B,H,M,_,W,q,G,J,K,Q,Y,X=o.res,Z=void 0===X?null:X,$=o.sres,ee=void 0===$?null:$;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(p=m.CastContext)||void 0===p||null===(w=p.getInstance())||void 0===w||w.S;var te=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],ne=(null===(h=Z)||void 0===h?void 0:h.contentType)||"video",ie=N(null===(g=Z)||void 0===g||null===(y=g[ne])||void 0===y||null===(b=y.gist)||void 0===b?void 0:b.videoImageUrl)||N(null===(T=Z)||void 0===T||null===(k=T[ne])||void 0===k||null===(P=k.gist)||void 0===P||null===(I=P.imageGist)||void 0===I?void 0:I.r16x9),oe=(null===(O=Z)||void 0===O||null===(j=O[ne])||void 0===j||null===(S=j.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,re=(null===(E=Z)||void 0===E||null===(A=E[ne])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,le=(null==r?void 0:r.drmLibrary)||!1,ae=(null===(x=Z)||void 0===x||null===(C=x.ads)||void 0===C||null===(F=C.preRoll)||void 0===F||null===(B=F.adTags)||void 0===B||null===(H=B.web)||void 0===H?void 0:H.active)&&(null===(M=Z)||void 0===M||null===(_=M.ads)||void 0===_||null===(W=_.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(G=q.web)||void 0===G?void 0:G.url);Z=Ne(Ne({},Z),{},{audioAssetSource:null==r?void 0:r.audioAssetSource});var se=(Y={controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:("default"==r.skin||"defaultV2"==r.skin||"live"==(null==r?void 0:r.skin))&&{inline:!1},fullscreenToggle:"default"==r.skin||"defaultV2"==r.skin,audioTrackButton:!1,pictureInPictureToggle:(r.skin,!1)},muteToggle:"multiplayer"==r.skin,liveui:oe},e(Y,"autoplay",null==r?void 0:r.autoplay),e(Y,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!ae),e(Y,"loop",(null==r?void 0:r.loop)||!1),e(Y,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(Y,"html5",Ne(Ne({dash:{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:Ne(Ne({experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==r||null===(J=r.customData)||void 0===J?void 0:J.overrideNative)&&{overrideNative:!0}),{},{bufferBasedABR:!0,enableLowInitialPlaylist:!0})},0==(null==r||null===(K=r.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(Q=r.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Y,"poster",ie),e(Y,"techOrder",te),e(Y,"chromecast",{requestCustomDataFn:function(e){var t=a(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,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Z,e,n)}}),Y);if(!z.getPlayers()[i])var de=z(i,se,function(){var e=t(n.mark((function e(){var t,o,a,c,v,m,p,w,h,g,y,b,T,k,P,I,O,j,S,E,A,R,x,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pe(r);case 2:if(re&&s.resolve(Ne({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&Ce(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),k=null===(t=Z)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,P=null===(a=Z)||void 0===a||null===(c=a[ne])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!k&&!le){e.next=22;break}if("Safari"!==l()){e.next=15;break}return e.next=13,He();case 13:e.next=22;break;case 15:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=20;break}return e.next=18,He();case 18:e.next=22;break;case 20:return e.next=22,Be();case 22:if(null==r||!r.videoSourceUrl){e.next=25;break}return e.next=25,Be();case 25:oe&&we(i,P),!ae||null!=r&&null!==(m=r.customData)&&void 0!==m&&m.disableAds||L(i,ae,Z),O=d(Z,i),null!=r&&r.nearestClusterUrl&&(O=V(O,r.nearestClusterUrl)),O?u(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),f(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=Z)||void 0===p||null===(w=p[ne])||void 0===w||null===(h=w.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=Z)||void 0===y||null===(b=y[ne])||void 0===b||null===(T=b.closedCaptions)||void 0===T?void 0:T.length)>0)&&(C=(null===(S=Z)||void 0===S||null===(E=S[ne])||void 0===E||null===(A=E.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=Z)||void 0===R||null===(x=R[ne])||void 0===x?void 0:x.closedCaptions),j=C.filter((function(e){return"VTT"===e.format})),U(i,j)),null!=r&&r.disableControls?D(i):xe(i,Ne(Ne(Ne({},r),se),{},{liveVideo:re,isDvrEnabled:oe,res:Z,sres:ee})),Re(i,Ne(Ne(Ne({},r),se),{},{liveVideo:re}),s,{res:Z,sres:ee});case 33:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Ve(){return{loadVideoInstantly:h,onTimeUpdate:J,getVideoDuration:K,onVideoEnded:Q,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,f,m,h;if(!k(null==e?void 0:e.playerId)){var g=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,b=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,T=null==e?void 0:e.videoId,P=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=T;var I=null==e?void 0:e.token;if(A(e)){if(R().set(null==e?void 0:e.refreshToken),!I||x(I))return void n({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}});Fe=JSON.parse(atob(I.split(".")[1]))}window.siteId=null===(r=Fe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Fe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Fe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Fe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Fe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Fe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var O=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var j=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,D=null==e?void 0:e.errors;D&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,ee(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!C(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Me})).then((function(e){e.importIMA()})),j&&"Safari"==l()&&Promise.resolve().then((function(){return Me})).then((function(e){e.importAirplay()})),E&&fe("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],te("js",new Date),void te("config",e);var e})).catch((function(e){}));var N=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(O));if(N&&N.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g){var L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",V={directPlaybackUrl:g,id:L};y?F(L,I).then((function(i){Le(O,{res:Ne(Ne({},i),V)},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,L)})):Le(O,{res:V},e,{resolve:t,reject:n})}else if(P){var U,z=sessionStorage.getItem("season-idx")||0;W.set(parseInt(z));var G=null==e||null===(U=e.series)||void 0===U?void 0:U.id;H(G,I).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;q(s);var d=T||(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;p({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),w(n)})).catch((function(e){return console.log(e)}))}(G,I),F(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),Le(O,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))})).catch((function(e){B(e,O,n)}))}else if(b){var J=null==e?void 0:e.epg;M(J,I).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==J?void 0:J.channelId,Le(O,{res:o},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}else F(T,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,d=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable)if((null===(s=e.watchHistory)||void 0===s?void 0:s.saveOffline)||!1){var u,v,f,m=function(e,t,n){var i=Pe(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(u=e.watchHistory)||void 0===u?void 0:u.profileId)||"",T,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;d.contentType="video",Le(O,{res:d},e,{resolve:t,reject:n})}else _(T,I).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",Le(O,{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)),Le(O,{res:d},e,{resolve:t,reject:n})}));else Le(O,{res:d},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}}))},getRenditions:Z,skip:g,getPlayer:a,play:y,pause:b,detectBrowser:l,rewind:T,loadVideo:u,seekToTimeStamp:Y,isPlayerInitialised:k,load:P,authenticateLC:I,dispose:O,enableCaptions:j,disableCaptions:S,getCaptions:E,playSelectedResolution:$,getSource:d,setVolume:Ie,getVolume:Oe,disableControls:D,setPlaybackSpeed:X}}export{Ve 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,b as a,s,c as d,l as u,e as c,f as v,h as f,i as m,j as p,k as w,m as h,n as g,p as y,o as b,r as T,q as k,t as P,u as I,v as O,w as j,x as S,y as E,z as D,A,B as R,C as x,D as C,E as F,F as B,G as H,H as M,I as _,J as N,K as L,L as V,M as U,N as W,O as q}from"./generic-b792f482.js";import z from"video.js";import G from"@babel/runtime/helpers/typeof";import{o as J,g as K,a as Q,s as Y,b as X}from"./util-46e139c1.js";import{g as Z}from"./renditions-825bf986.js";import{playSelectedResolution as $}from"./resolution-e8ee75fd.js";import{s as ee}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 te(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function ne(e,t){te("event",e,t)}function ie(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 oe(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ie(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var re=function(){var e,t,n,i;return(null===(e=r())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=r())||void 0===i?void 0:i.id)};function le(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ae(){var e=window.sessionStorage.getItem("uid");return e||(e=le(),window.sessionStorage.setItem("uid",e),e)}function se(){return de.apply(this,arguments)}function de(){return de=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)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),de.apply(this,arguments)}window.initialise=function(e){window.sid=le(),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());ne(r?"FAILED_TO_START":"DROPPED_STREAM",oe({pfm:window.platform,uid:ae(),vid:re(),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),ne("PLAY",oe({pfm:window.platform,uid:ae(),vid:re(),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(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.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"))ne("BUFFERING",oe({pfm:window.platform,uid:ae(),vid:re(),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,ne("FIRST_FRAME",oe({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),vid:re()},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;ne("AD_REQUEST",oe({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),vid:re(),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}),ne("AD_IMPRESSION",oe({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:re()},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(ue(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var ue=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,m,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=oe,e.t1=oe,e.t2=oe({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=ae(),e.t5=re(),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,se();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),m=[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===(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:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).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 ce,ve,fe=function(e){return new Promise((function(t,n){if(me(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},pe=function(){var e=t(n.mark((function e(t){var i,o,r,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(z),e.finish(13);case 16:null!==(r=window)&&void 0!==r&&r.cast?null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==l()?null==o||o.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),we=function(e,t){var n=a(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=z.dom.getPointerPosition(a,t).x;z.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 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=[],be=0,Te=null;function ke(t,n,i){var o,l,a,d,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ve=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var v=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,f=Math.floor(t.currentTime()),m=Math.floor(t.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,w=(null==n||null===(d=n.video)||void 0===d?void 0:d.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),y=c?100:Math.floor(f/m*100),b={};h?function(t,n,i){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=Pe(o),a=(new Date).getTime(),s=r(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return ge(ge({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===ce}));c<0?l.push(ge(ge({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=ge(ge(ge({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:y},v,n.siteOwner):("v1"==ve?b={videoId:ce,watchedTime:g,watchedPercentage:y,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==ve&&(b=ge(ge({videoId:ce,watchedTime:g,watchedPercentage:y,doneWatching:c,profileId:v},Te&&{seriesId:Te}),w&&{originalObjectId:w})),s(b,ve).then((function(e){})).catch((function(e){}))),be=f+i}function Pe(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var Ie=function(e,t,n){var i=a(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,"'")})},Oe=function(e){var t=a(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},je=!1,Se=function(e,t){var n,i,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[o])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!je){var r=Ee(e,"videoAssets","secondaryVideoAssets"),l=d(r,t);return l&&u(t,l),je=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Ee(e,t,n){if(Array.isArray(e))return e.map((function(e){return Ee(e,t,n)}));if(null!==e&&"object"===G(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=Ee(e[o],t,n)})),i}return e}function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ae(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?De(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):De(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Re=function(e,t,n,i){var o,l,s=i.res,d=i.sres,u=a(e),p=(null==s?void 0:s.contentType)||"video",w=(null==s||null===(o=s[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(s),u&&(u.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:s})})),u.on("loadeddata",(function(){var i,o;(null==u||!u.muted())&&Ie(e,sessionStorage.getItem("volume")||"100");var l=r();if(v(),n.resolve(Ae({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:s}:{response:s})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var c,f,m=Ae(Ae({},t),s);!function(e,t,n){var i,o,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(Te=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ye=[],be=0,ce=n;var l=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=a(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ye.includes(be)||(e==be?(ye.push(e),ke(s,t,l)):e>be&&(be=e+l))})),s.one("ended",(function(){ke(s,t,l,!0)})))}(e,m,null==l||null===(c=l.video)||void 0===c||null===(f=c.gist)||void 0===f?void 0:f.id)}})),u.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",t)})),u.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,f=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,m=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"===f){var p,w=m.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)}})),u.on("loadedmetadata",(function(){window.endFirstFrame(u)})),u.tech_.on("retryplaylist",(function(){w&&Se(s,e)})),u.on("error",(function(){var t,i;4===u.error().code&&w?Se(s,e):(f(e,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),u.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,l=null===(n=r())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=m().get(l)||{t:0,p:0},s=a.t,d=a.p;s&&d<95&&setTimeout((function(){u.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),u.on("chromecastDisconnected",(function(){if(w){u.currentSource();for(var e=u.textTracks(),t=e.length-1;t>=0;t--)u.removeRemoteTextTrack(e[t])}})))},xe=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-75d22c3c.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-2b3225e9.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-8d99e7b1.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-375b9ad0.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?import("./skin-c3a031af.js").then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&import("./skin-edada803.js").then((function(n){n.initaliseSkin(e,t)}))},Ce=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 Fe,Be=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)}}(),He=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").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),fe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Be,loadEMELibrary:He});function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ne(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Le=function(i,o,r,s){var c,v,m,p,w,h,g,y,b,T,k,P,I,O,j,S,E,A,R,x,C,F,B,H,M,_,W,q,G,J,K,Q,Y,X=o.res,Z=void 0===X?null:X,$=o.sres,ee=void 0===$?null:$;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(p=m.CastContext)||void 0===p||null===(w=p.getInstance())||void 0===w||w.S;var te=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],ne=(null===(h=Z)||void 0===h?void 0:h.contentType)||"video",ie=N(null===(g=Z)||void 0===g||null===(y=g[ne])||void 0===y||null===(b=y.gist)||void 0===b?void 0:b.videoImageUrl)||N(null===(T=Z)||void 0===T||null===(k=T[ne])||void 0===k||null===(P=k.gist)||void 0===P||null===(I=P.imageGist)||void 0===I?void 0:I.r16x9),oe=(null===(O=Z)||void 0===O||null===(j=O[ne])||void 0===j||null===(S=j.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,re=(null===(E=Z)||void 0===E||null===(A=E[ne])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,le=(null==r?void 0:r.drmLibrary)||!1,ae=(null===(x=Z)||void 0===x||null===(C=x.ads)||void 0===C||null===(F=C.preRoll)||void 0===F||null===(B=F.adTags)||void 0===B||null===(H=B.web)||void 0===H?void 0:H.active)&&(null===(M=Z)||void 0===M||null===(_=M.ads)||void 0===_||null===(W=_.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(G=q.web)||void 0===G?void 0:G.url);Z=Ne(Ne({},Z),{},{audioAssetSource:null==r?void 0:r.audioAssetSource});var se=(Y={controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:("default"==r.skin||"defaultV2"==r.skin||"live"==(null==r?void 0:r.skin))&&{inline:!1},fullscreenToggle:"default"==r.skin||"defaultV2"==r.skin,audioTrackButton:!1,pictureInPictureToggle:(r.skin,!1)},muteToggle:"multiplayer"==r.skin,liveui:oe},e(Y,"autoplay",null==r?void 0:r.autoplay),e(Y,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!ae),e(Y,"loop",(null==r?void 0:r.loop)||!1),e(Y,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(Y,"html5",Ne(Ne({dash:{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:Ne(Ne({experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==r||null===(J=r.customData)||void 0===J?void 0:J.overrideNative)&&{overrideNative:!0}),{},{bufferBasedABR:!0,enableLowInitialPlaylist:!0})},0==(null==r||null===(K=r.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(Q=r.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Y,"poster",ie),e(Y,"techOrder",te),e(Y,"chromecast",{requestCustomDataFn:function(e){var t=a(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,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Z,e,n)}}),Y);if(!z.getPlayers()[i])var de=z(i,se,function(){var e=t(n.mark((function e(){var t,o,a,c,v,m,p,w,h,g,y,b,T,k,P,I,O,j,S,E,A,R,x,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pe(r);case 2:if(re&&s.resolve(Ne({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&Ce(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),k=null===(t=Z)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,P=null===(a=Z)||void 0===a||null===(c=a[ne])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!k&&!le){e.next=22;break}if("Safari"!==l()){e.next=15;break}return e.next=13,He();case 13:e.next=22;break;case 15:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=20;break}return e.next=18,He();case 18:e.next=22;break;case 20:return e.next=22,Be();case 22:if(null==r||!r.videoSourceUrl){e.next=25;break}return e.next=25,Be();case 25:oe&&we(i,P),!ae||null!=r&&null!==(m=r.customData)&&void 0!==m&&m.disableAds||L(i,ae,Z),O=d(Z,i),null!=r&&r.nearestClusterUrl&&(O=V(O,r.nearestClusterUrl)),O?u(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),f(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=Z)||void 0===p||null===(w=p[ne])||void 0===w||null===(h=w.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=Z)||void 0===y||null===(b=y[ne])||void 0===b||null===(T=b.closedCaptions)||void 0===T?void 0:T.length)>0)&&(C=(null===(S=Z)||void 0===S||null===(E=S[ne])||void 0===E||null===(A=E.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=Z)||void 0===R||null===(x=R[ne])||void 0===x?void 0:x.closedCaptions),j=C.filter((function(e){return"VTT"===e.format})),U(i,j)),null!=r&&r.disableControls?D(i):xe(i,Ne(Ne(Ne({},r),se),{},{liveVideo:re,isDvrEnabled:oe,res:Z,sres:ee})),Re(i,Ne(Ne(Ne({},r),se),{},{liveVideo:re}),s,{res:Z,sres:ee});case 33:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Ve(){return{loadVideoInstantly:h,onTimeUpdate:J,getVideoDuration:K,onVideoEnded:Q,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,f,m,h;if(!k(null==e?void 0:e.playerId)){var g=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,b=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,T=null==e?void 0:e.videoId,P=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=T;var I=null==e?void 0:e.token;if(A(e)){if(R().set(null==e?void 0:e.refreshToken),!I||x(I))return void n({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}});Fe=JSON.parse(atob(I.split(".")[1]))}window.siteId=null===(r=Fe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Fe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Fe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Fe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Fe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Fe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var O=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var j=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,D=null==e?void 0:e.errors;D&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,ee(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!C(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Me})).then((function(e){e.importIMA()})),j&&"Safari"==l()&&Promise.resolve().then((function(){return Me})).then((function(e){e.importAirplay()})),E&&fe("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],te("js",new Date),void te("config",e);var e})).catch((function(e){}));var N=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(O));if(N&&N.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g){var L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",V={directPlaybackUrl:g,id:L};y?F(L,I).then((function(i){Le(O,{res:Ne(Ne({},i),V)},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,L)})):Le(O,{res:V},e,{resolve:t,reject:n})}else if(P){var U,z=sessionStorage.getItem("season-idx")||0;W.set(parseInt(z));var G=null==e||null===(U=e.series)||void 0===U?void 0:U.id;H(G,I).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;q(s);var d=T||(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;p({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),w(n)})).catch((function(e){return console.log(e)}))}(G,I),F(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),Le(O,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))})).catch((function(e){B(e,O,n)}))}else if(b){var J=null==e?void 0:e.epg;M(J,I).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==J?void 0:J.channelId,Le(O,{res:o},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}else F(T,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,d=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable)if((null===(s=e.watchHistory)||void 0===s?void 0:s.saveOffline)||!1){var u,v,f,m=function(e,t,n){var i=Pe(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(u=e.watchHistory)||void 0===u?void 0:u.profileId)||"",T,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;d.contentType="video",Le(O,{res:d},e,{resolve:t,reject:n})}else _(T,I).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",Le(O,{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)),Le(O,{res:d},e,{resolve:t,reject:n})}));else Le(O,{res:d},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}}))},getRenditions:Z,skip:g,getPlayer:a,play:y,pause:b,detectBrowser:l,rewind:T,loadVideo:u,seekToTimeStamp:Y,isPlayerInitialised:k,load:P,authenticateLC:I,dispose:O,enableCaptions:j,disableCaptions:S,getCaptions:E,playSelectedResolution:$,getSource:d,setVolume:Ie,getVolume:Oe,disableControls:D,setPlaybackSpeed:X}}export{Ve as default};
@@ -0,0 +1 @@
1
+ var n=".tvProviderImage{\n position: absolute;\n right: 1rem;\n top: 1rem;\n max-height: 100px;\n max-width: 100px;\n}\n.tvProviderImage>img{\n height: 100%;\n width: 100%;\n}\n.vjs-button>.vjs-icon-placeholder:before {\n font-size: 2.2em;\n line-height: 2.6;\n}\n.vjs-control-bar{\n z-index: 1 !important;\n height: 6em !important;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%) !important;\n}\n\n.vjs-fade>* {\n visibility: hidden !important;\n opacity: 0 !important;\n transition: visibility 1s, opacity 1s !important;\n}\n\n.video-js .vjs-progress-control {\n left: -6px;\n position: absolute;\n width: 100%;\n height: 0.5em;\n top: -0.5em;\n transition: height .1s,top .1s;\n}\n\n.video-js .vjs-custom-control-spacer {\n display: block;\n flex: 1 1 auto;\n}\n\n.vjs-remaining-time.vjs-time-control.vjs-control {\n position: absolute;\n right: 0;\n bottom: 18px;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 41px 0 14px;\n}\n.vjs-remaining-time.vjs-time-control.vjs-control{\n display: none;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button {\n font-size: 14px;\n font-weight: 500;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder{\n height: 6px !important;\n}\n\n.video-js .vjs-play-progress:before {\n font-size: 1.9em;\n}\n.video-js .vjs-play-progress .vjs-time-tooltip {\n display: none !important;\n}\n\n/* */\n\n.video-js .vjs-mouse-display{\n font-size: 1.6666666667em;\n}\n\n.video-js .vjs-progress-control:hover .vjs-progress-holder { \n font-size: 1em !important; \n} \n\n.video-js .vjs-current-time { display: block; }\n\n.video-js .vjs-current-time {\n display: block;\n position: absolute;\n right: 0em;\n bottom: 1.8em;\n font-size: 12px;\n font-weight: 600;\n}\n\n.video-js .vjs-button{\n width: 6em;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button{\n align-self: center;\n height: min-content;\n padding: 5px 2px;\n border-radius: 8px;\n}\n\n\n.vjs-fullscreen .icon-minimize,\n.icon-maximize {\n display: block;\n height: 32px;\n}\n\n.vjs-fullscreen .icon-maximize,\n.icon-minimize {\n display: none;\n height: 32px;\n}\n\nbutton.vjs-play-control.vjs-control.vjs-button{\n outline: none !important;\n}\n\n.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,\n.vjs-icon-fullscreen-enter:before {\n content: '' !important;\n}\n\n.video-js button.vjs-fullscreen-control.vjs-control.vjs-button {\n display: flex;\n justify-content: center;\n align-items: center;\n transform: rotate(90deg);\n}\n\n.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before{\n display: none;\n}\n.video-js .vjs-volume-panel .vjs-volume-control{\n margin-left: -10px;\n}\n\n.skipbtn:hover{\n cursor: pointer;\n}\n\n.rewindbtn:hover{\n cursor: pointer;\n}\n\n.vjs-live-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 1.8em !important;\n font-weight: 700 !important;\n font-size: 11px !important;\n}\n\n.vjs-seek-to-live-control.vjs-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 3.2em !important;\n}\n\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display:none;\n}\n\n.video-js.vjs-paused .vjs-big-play-button {\n width: 90px;\n height: 90px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n font-size: 6em;\n line-height: 1.3em;\n}\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{\n font-weight: bold;\n}\n\n.vjs-menu > ul.vjs-menu-content{\n bottom: 3.5em !important;\n right: -1em;\n}\n\n.video-js .vjs-chromecast-button .vjs-icon-placeholder {\n width: 17px !important;\n height: 17px !important;\n}\n\n.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-control.vjs-button{\n /* display: flex;\n justify-content: center;\n align-items: center; */\n display: none;\n}\n\nbutton.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-button{\n height: min-content;\n width: min-content;\n}\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical{\n width: 6em;\n}\n\n.video-js .content{\n bottom: 3.4rem !important;\n right: -4rem !important; \n}\n\n.setting-icon > svg{\n height:18px !important;\n}\n\n.output-overlay{\n position: absolute;\n bottom: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n border: 0;\n pointer-events:none\n}\n\niframe{\n width: 100%;\n height: 100%;\n}\n\n\n@media(max-width:600px){\n .tvProviderImage{\n display: none\n }\n.vjs-fullscreen .icon-minimize,\n .icon-maximize {\n height: 30px !important;\n }\n\n .vjs-fullscreen .icon-maximize,\n .icon-minimize {\n height: 30px !important;\n }\n\n button.vjs-fullscreen-control.vjs-control.vjs-button>span.vjs-icon-placeholder::before {\n height: min-content;\n }\n\n .vjs-seek-to-live-control.vjs-control{\n position: relative !important;\n right: 0em !important;\n bottom: 0 !important;\n }\n\n .video-js .vjs-progress-control{\n top: -0.85em;\n }\n .vjs-live-control{\n right: -1em !important;\n position: relative !important;\n bottom: 0 !important;\n font-size: 12px !important;\n }\n button.vjs-slowmo-button{\n display: none;\n }\n button.vjs-rewind-button{\n display: none;\n }\n button.vjs-rewind-button>svg{\n height: 20px;\n }\n .video-js .vjs-button{\n width: 4.8em;\n }\n .video-js .widget-selection{\n display: none;\n }\n .video-js .container{\n display: none !important;\n }\n .video-js .vjs-control-bar{\n height: 4em !important;\n }\n .video-js .vjs-button>.vjs-icon-placeholder:before{\n font-size: 2.5em;\n line-height: 1.5;\n }\n .video-js .vjs-play-progress:before {\n font-size: 1.2em;\n position: absolute;\n right: -0.5em;\n /* top: -0.3333333333em; */\n z-index: 1;\n}\nbutton.vjs-skip-button>svg{\n height: 20px;\n}\nbutton.vjs-big-play-button {\n width: 50px !important;\n height: 50px !important;\n font-size: 2.1rem !important;\n}\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display: block;\n}\n\n.stream-selector-icon>svg{\n width: 24px;\n height: 24px;\n}\n.video-js.vjs-live .vjs-progress-control .vjs-progress-holder{\n margin: 0 12px 0 21px;\n}\n.vjs-seek-to-live-text{\n font-size: 12px;\n}\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 40px 0px 21px;\n}\n.video-js .vjs-current-time{\n bottom: 2em !important;\n}\n}";export{n as default};
@@ -1 +1 @@
1
- import{i as e,j as l,k as t,g as n,h as i,d as o,l as a,m as r,n as s,o as d}from"./features-503e067b.js";import{M as u,a as v,c as m,d as c}from"./icons-3e9a1686.js";import{R as p,b as f,S as g,y as h,Q as y,d as b}from"./generic-b792f482.js";import{g as C}from"./renditions-825bf986.js";import x from"@babel/runtime/helpers/toConsumableArray";import{s as j}from"./autoNextVideo-c598d3d6.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./util-46e139c1.js";var E=p(),N=[];null==E||E.map((function(e){return N.push.apply(N,x(e.episodes))}));var w=function(e,l){var t=f(e),n=Math.floor(t.currentTime());if(Math.floor(t.duration())!=n){t.pause(e);var i=g();j(i,e,N)}};function B(n,i){var o=f(n);o&&(o.on("loadeddata",(function(){var t,a,r;(null===(t=C(n))||void 0===t?void 0:t.length)>0&&e(n,i),(null===(a=h(n))||void 0===a?void 0:a.length)>0&&l(n,i),null!=i&&null!==(r=i.series)&&void 0!==r&&r.enable&&function(e,l){var t;null==l||null===(t=l.series)||void 0===t||t.cb;var n=f(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),t=n.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];t-l<=10&&g()<=(null==N?void 0:N.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var i,o=N.filter((function(e,l){return l==g()}));if((null==o?void 0:o.length)>0)if(null!==(i=document.getElementsByClassName("next-ep-preview"))&&void 0!==i&&i[0]){var a,r,s,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(r=document.getElementsByClassName("next-ep-title"))||void 0===r?void 0:r[0],C=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],x=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],j=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=j)||void 0===v?void 0:v.length)>60&&(j=j.substr(0,60)+"..."),b.textContent="".concat(j),C.src=(null===(m=o[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),x.onclick=function(){return w(e)}}else{var E,B,V,k,I,M,P,T=document.createElement("div");T.className="next-ep-preview",T.style.visibility="hidden",document.getElementById(e).append(T);var D=document.createElement("div");D.className="next-ep-header",D.textContent="Next up";var L=null===(E=o[0])||void 0===E?void 0:E.title,R=document.createElement("img");R.className="next-ep-img",R.src=(null===(B=o[0])||void 0===B||null===(V=B.gist)||void 0===V||null===(k=V.imageGist)||void 0===k?void 0:k.r16x9)||(null===(I=window)||void 0===I||null===(M=I.customData)||void 0===M?void 0:M.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(P=L)||void 0===P?void 0:P.length)>60&&(L=L.substr(0,60)+"..."),F.textContent="".concat(L);var G=document.createElement("div");G.className="next-ep-content",G.append(R),G.append(F),G.onclick=function(){return w(e)},T.append(D),T.append(G)}}(n,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var e,l,i,o;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&t(n,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}function V(e,l){!function(){"Chrome"==b()&&import("./chromett-a3cbb2e1.js").then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));import("./skin-808893ac.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),B(e,l),function(e,l){var t,n,i,o,a,r,s=f(e);null==s||null===(t=s.controlBar)||void 0===t||null===(n=t.getChild("FullscreenToggle"))||void 0===n||null===(i=n.el())||void 0===i||i.appendChild(y(u(window.controlsColor))),null==s||null===(o=s.controlBar)||void 0===o||null===(a=o.getChild("FullscreenToggle"))||void 0===a||null===(r=a.el())||void 0===r||r.appendChild(y(v(window.controlsColor)));var d=document.getElementsByClassName("vjs-time-control");l.liveVideo&&d[0]&&(d[0].style.display="none")}(e,l),function(e,l){var t,u,v,p,f,g;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&i(e,"defaultV2",c());l.liveVideo||o(e);(null==l||null===(t=l.relatedVideos)||void 0===t||null===(u=t.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&r(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&s(e,null==l?void 0:l.playlist);null!=l&&null!==(g=l.series)&&void 0!==g&&g.enable&&d(e,l)}(e,l),function(e,l){var t=f(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(n),o.alt="Provider Image",i.append(o),t.el().appendChild(i),t.on("useractive",(function(){i.classList.remove("vjs-fade")})),t.on("userinactive",(function(){t.paused()||i.classList.add("vjs-fade")})),t.on("fullscreenchange",(function(){t.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}(e,l)}export{V as initialiseSkin};
1
+ import{i as e,j as l,k as t,g as n,h as i,d as o,l as a,m as r,n as s,o as d}from"./features-503e067b.js";import{M as u,a as v,c as m,d as c}from"./icons-3e9a1686.js";import{R as p,b as f,S as g,y as h,Q as y,d as b}from"./generic-b792f482.js";import{g as C}from"./renditions-825bf986.js";import x from"@babel/runtime/helpers/toConsumableArray";import{s as j}from"./autoNextVideo-c598d3d6.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"js-cookie";import"ua-parser-js";import"./util-46e139c1.js";var E=p(),N=[];null==E||E.map((function(e){return N.push.apply(N,x(e.episodes))}));var w=function(e,l){var t=f(e),n=Math.floor(t.currentTime());if(Math.floor(t.duration())!=n){t.pause(e);var i=g();j(i,e,N)}};function B(n,i){var o=f(n);o&&(o.on("loadeddata",(function(){var t,a,r;(null===(t=C(n))||void 0===t?void 0:t.length)>0&&e(n,i),(null===(a=h(n))||void 0===a?void 0:a.length)>0&&l(n,i),null!=i&&null!==(r=i.series)&&void 0!==r&&r.enable&&function(e,l){var t;null==l||null===(t=l.series)||void 0===t||t.cb;var n=f(e);n.on("timeupdate",(function(){var e,l=Math.floor(n.currentTime()),t=n.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];t-l<=10&&g()<=(null==N?void 0:N.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var i,o=N.filter((function(e,l){return l==g()}));if((null==o?void 0:o.length)>0)if(null!==(i=document.getElementsByClassName("next-ep-preview"))&&void 0!==i&&i[0]){var a,r,s,d,u,v,m,c,p,h,y;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(r=document.getElementsByClassName("next-ep-title"))||void 0===r?void 0:r[0],C=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],x=null===(d=document.getElementsByClassName("next-ep-content"))||void 0===d?void 0:d[0],j=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=j)||void 0===v?void 0:v.length)>60&&(j=j.substr(0,60)+"..."),b.textContent="".concat(j),C.src=(null===(m=o[0])||void 0===m||null===(c=m.gist)||void 0===c||null===(p=c.imageGist)||void 0===p?void 0:p.r16x9)||(null===(h=window)||void 0===h||null===(y=h.customData)||void 0===y?void 0:y.fallbackImage),x.onclick=function(){return w(e)}}else{var E,B,V,k,I,M,P,T=document.createElement("div");T.className="next-ep-preview",T.style.visibility="hidden",document.getElementById(e).append(T);var D=document.createElement("div");D.className="next-ep-header",D.textContent="Next up";var L=null===(E=o[0])||void 0===E?void 0:E.title,R=document.createElement("img");R.className="next-ep-img",R.src=(null===(B=o[0])||void 0===B||null===(V=B.gist)||void 0===V||null===(k=V.imageGist)||void 0===k?void 0:k.r16x9)||(null===(I=window)||void 0===I||null===(M=I.customData)||void 0===M?void 0:M.fallbackImage);var F=document.createElement("div");F.className="next-ep-title",(null===(P=L)||void 0===P?void 0:P.length)>60&&(L=L.substr(0,60)+"..."),F.textContent="".concat(L);var G=document.createElement("div");G.className="next-ep-content",G.append(R),G.append(F),G.onclick=function(){return w(e)},T.append(D),T.append(G)}}(n,i),function(e,l){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px");var o=document.getElementsByClassName("vjs-live-control")[0],a=document.getElementsByClassName("vjs-time-control");l&&o.classList.value.includes("vjs-hidden")&&(a[0].style.display="block",i&&(i.style.marginRight="56px"))}(o.duration(),(null==i?void 0:i.liveVideo)||!1)})),o.one("play",(function(){var e,l,i,o;null!==(e=window)&&void 0!==e&&null!==(l=e.customData)&&void 0!==l&&l.iframeOverlayUrl&&t(n,null===(i=window)||void 0===i||null===(o=i.customData)||void 0===o?void 0:o.iframeOverlayUrl)})))}function V(e,l){!function(){"Chrome"==b()&&import("./chromett-a3cbb2e1.js").then((function(e){var l=document.createElement("style");l.id="chromett",l.append("".concat(e.default)),document.head.appendChild(l)}));import("./skin-0387c083.js").then((function(e){var l=document.createElement("style");l.id="default_v2",l.append("".concat(e.default)),document.head.appendChild(l)}))}(),B(e,l),function(e,l){var t,n,i,o,a,r,s=f(e);null==s||null===(t=s.controlBar)||void 0===t||null===(n=t.getChild("FullscreenToggle"))||void 0===n||null===(i=n.el())||void 0===i||i.appendChild(y(u(window.controlsColor))),null==s||null===(o=s.controlBar)||void 0===o||null===(a=o.getChild("FullscreenToggle"))||void 0===a||null===(r=a.el())||void 0===r||r.appendChild(y(v(window.controlsColor)));var d=document.getElementsByClassName("vjs-time-control");l.liveVideo&&d[0]&&(d[0].style.display="none")}(e,l),function(e,l){var t,u,v,p,f,g;0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)&&n(e,"defaultV2",m());(0==(null==l?void 0:l.liveVideo)&&0==(null==l?void 0:l.liveui)||1==(null==l?void 0:l.liveui))&&i(e,"defaultV2",c());l.liveVideo||o(e);(null==l||null===(t=l.relatedVideos)||void 0===t||null===(u=t.content)||void 0===u?void 0:u.length)>0&&a(e,null==l?void 0:l.relatedVideos);(null==l||null===(v=l.streams)||void 0===v?void 0:v.length)>1&&r(e,null==l?void 0:l.streams);(null==l||null===(p=l.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&s(e,null==l?void 0:l.playlist);null!=l&&null!==(g=l.series)&&void 0!==g&&g.enable&&d(e,l)}(e,l),function(e,l){var t=f(e),n=null==l?void 0:l.tvProviderLogoUrl;if(!n)return;var i=document.createElement("div");i.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(n),o.alt="Provider Image",i.append(o),t.el().appendChild(i),t.on("useractive",(function(){i.classList.remove("vjs-fade")})),t.on("userinactive",(function(){t.paused()||i.classList.add("vjs-fade")})),t.on("fullscreenchange",(function(){t.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}(e,l)}export{V as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.109-backup",
3
+ "version": "1.0.111-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";exports.default=".tvProviderImage{\n position: absolute;\n right: 1rem;\n top: 1rem;\n max-height: 100px;\n max-width: 100px;\n}\n.tvProviderImage>img{\n height: 100%;\n width: 100%;\n}\n.vjs-button>.vjs-icon-placeholder:before {\n font-size: 2.2em;\n line-height: 2.6;\n}\n.vjs-control-bar{\n z-index: 1 !important;\n height: 6em !important;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%) !important;\n}\n\n.vjs-fade>* {\n visibility: hidden !important;\n opacity: 0 !important;\n transition: visibility 1s, opacity 1s !important;\n}\n\n.video-js .vjs-progress-control {\n left: -6px;\n position: absolute;\n width: 100%;\n height: 0.5em;\n top: -0.5em;\n transition: height .1s,top .1s;\n}\n\n.video-js .vjs-custom-control-spacer {\n display: block;\n flex: 1 1 auto;\n}\n\n.vjs-remaining-time.vjs-time-control.vjs-control {\n position: absolute;\n right: 0;\n bottom: 18px;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 41px 0 14px;\n}\n.vjs-remaining-time.vjs-time-control.vjs-control{\n display: none;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button {\n font-size: 14px;\n font-weight: 500;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder{\n height: 6px !important;\n}\n\n.video-js .vjs-play-progress:before {\n font-size: 1.9em;\n}\n\n.video-js .vjs-current-time { display: block; }\n\n.video-js .vjs-current-time {\n display: block;\n position: absolute;\n right: 0em;\n bottom: 1.8em;\n font-size: 12px;\n font-weight: 600;\n}\n\n.video-js .vjs-button{\n width: 6em;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button{\n align-self: center;\n height: min-content;\n padding: 5px 2px;\n border-radius: 8px;\n}\n\n\n.vjs-fullscreen .icon-minimize,\n.icon-maximize {\n display: block;\n height: 32px;\n}\n\n.vjs-fullscreen .icon-maximize,\n.icon-minimize {\n display: none;\n height: 32px;\n}\n\nbutton.vjs-play-control.vjs-control.vjs-button{\n outline: none !important;\n}\n\n.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,\n.vjs-icon-fullscreen-enter:before {\n content: '' !important;\n}\n\n.video-js button.vjs-fullscreen-control.vjs-control.vjs-button {\n display: flex;\n justify-content: center;\n align-items: center;\n transform: rotate(90deg);\n}\n\n.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before{\n display: none;\n}\n.video-js .vjs-volume-panel .vjs-volume-control{\n margin-left: -10px;\n}\n\n.skipbtn:hover{\n cursor: pointer;\n}\n\n.rewindbtn:hover{\n cursor: pointer;\n}\n\n.vjs-live-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 1.8em !important;\n font-weight: 700 !important;\n font-size: 11px !important;\n}\n\n.vjs-seek-to-live-control.vjs-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 3.2em !important;\n}\n\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display:none;\n}\n\n.video-js.vjs-paused .vjs-big-play-button {\n width: 90px;\n height: 90px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n font-size: 6em;\n line-height: 1.3em;\n}\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{\n font-weight: bold;\n}\n\n.vjs-menu > ul.vjs-menu-content{\n bottom: 3.5em !important;\n right: -1em;\n}\n\n.video-js .vjs-chromecast-button .vjs-icon-placeholder {\n width: 17px !important;\n height: 17px !important;\n}\n\n.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-control.vjs-button{\n /* display: flex;\n justify-content: center;\n align-items: center; */\n display: none;\n}\n\nbutton.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-button{\n height: min-content;\n width: min-content;\n}\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical{\n width: 6em;\n}\n\n.video-js .content{\n bottom: 3.4rem !important;\n right: -4rem !important; \n}\n\n.setting-icon > svg{\n height:18px !important;\n}\n\n.output-overlay{\n position: absolute;\n bottom: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n border: 0;\n pointer-events:none\n}\n\niframe{\n width: 100%;\n height: 100%;\n}\n\n\n@media(max-width:600px){\n .tvProviderImage{\n display: none\n }\n.vjs-fullscreen .icon-minimize,\n .icon-maximize {\n height: 30px !important;\n }\n\n .vjs-fullscreen .icon-maximize,\n .icon-minimize {\n height: 30px !important;\n }\n\n button.vjs-fullscreen-control.vjs-control.vjs-button>span.vjs-icon-placeholder::before {\n height: min-content;\n }\n\n .vjs-seek-to-live-control.vjs-control{\n position: relative !important;\n right: 0em !important;\n bottom: 0 !important;\n }\n\n .video-js .vjs-progress-control{\n top: -0.85em;\n }\n .vjs-live-control{\n right: -1em !important;\n position: relative !important;\n bottom: 0 !important;\n font-size: 12px !important;\n }\n button.vjs-slowmo-button{\n display: none;\n }\n button.vjs-rewind-button{\n display: none;\n }\n button.vjs-rewind-button>svg{\n height: 20px;\n }\n .video-js .vjs-button{\n width: 4.8em;\n }\n .video-js .widget-selection{\n display: none;\n }\n .video-js .container{\n display: none !important;\n }\n .video-js .vjs-control-bar{\n height: 4em !important;\n }\n .video-js .vjs-button>.vjs-icon-placeholder:before{\n font-size: 2.5em;\n line-height: 1.5;\n }\n .video-js .vjs-play-progress:before {\n font-size: 1.2em;\n position: absolute;\n right: -0.5em;\n /* top: -0.3333333333em; */\n z-index: 1;\n}\nbutton.vjs-skip-button>svg{\n height: 20px;\n}\nbutton.vjs-big-play-button {\n width: 50px !important;\n height: 50px !important;\n font-size: 2.1rem !important;\n}\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display: block;\n}\n\n.stream-selector-icon>svg{\n width: 24px;\n height: 24px;\n}\n.video-js.vjs-live .vjs-progress-control .vjs-progress-holder{\n margin: 0 12px 0 21px;\n}\n.vjs-seek-to-live-text{\n font-size: 12px;\n}\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 40px 0px 21px;\n}\n.video-js .vjs-current-time{\n bottom: 2em !important;\n}\n}";
@@ -1 +0,0 @@
1
- var n=".tvProviderImage{\n position: absolute;\n right: 1rem;\n top: 1rem;\n max-height: 100px;\n max-width: 100px;\n}\n.tvProviderImage>img{\n height: 100%;\n width: 100%;\n}\n.vjs-button>.vjs-icon-placeholder:before {\n font-size: 2.2em;\n line-height: 2.6;\n}\n.vjs-control-bar{\n z-index: 1 !important;\n height: 6em !important;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%) !important;\n}\n\n.vjs-fade>* {\n visibility: hidden !important;\n opacity: 0 !important;\n transition: visibility 1s, opacity 1s !important;\n}\n\n.video-js .vjs-progress-control {\n left: -6px;\n position: absolute;\n width: 100%;\n height: 0.5em;\n top: -0.5em;\n transition: height .1s,top .1s;\n}\n\n.video-js .vjs-custom-control-spacer {\n display: block;\n flex: 1 1 auto;\n}\n\n.vjs-remaining-time.vjs-time-control.vjs-control {\n position: absolute;\n right: 0;\n bottom: 18px;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 41px 0 14px;\n}\n.vjs-remaining-time.vjs-time-control.vjs-control{\n display: none;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button {\n font-size: 14px;\n font-weight: 500;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder{\n height: 6px !important;\n}\n\n.video-js .vjs-play-progress:before {\n font-size: 1.9em;\n}\n\n.video-js .vjs-current-time { display: block; }\n\n.video-js .vjs-current-time {\n display: block;\n position: absolute;\n right: 0em;\n bottom: 1.8em;\n font-size: 12px;\n font-weight: 600;\n}\n\n.video-js .vjs-button{\n width: 6em;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button{\n align-self: center;\n height: min-content;\n padding: 5px 2px;\n border-radius: 8px;\n}\n\n\n.vjs-fullscreen .icon-minimize,\n.icon-maximize {\n display: block;\n height: 32px;\n}\n\n.vjs-fullscreen .icon-maximize,\n.icon-minimize {\n display: none;\n height: 32px;\n}\n\nbutton.vjs-play-control.vjs-control.vjs-button{\n outline: none !important;\n}\n\n.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,\n.vjs-icon-fullscreen-enter:before {\n content: '' !important;\n}\n\n.video-js button.vjs-fullscreen-control.vjs-control.vjs-button {\n display: flex;\n justify-content: center;\n align-items: center;\n transform: rotate(90deg);\n}\n\n.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before{\n display: none;\n}\n.video-js .vjs-volume-panel .vjs-volume-control{\n margin-left: -10px;\n}\n\n.skipbtn:hover{\n cursor: pointer;\n}\n\n.rewindbtn:hover{\n cursor: pointer;\n}\n\n.vjs-live-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 1.8em !important;\n font-weight: 700 !important;\n font-size: 11px !important;\n}\n\n.vjs-seek-to-live-control.vjs-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 3.2em !important;\n}\n\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display:none;\n}\n\n.video-js.vjs-paused .vjs-big-play-button {\n width: 90px;\n height: 90px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n font-size: 6em;\n line-height: 1.3em;\n}\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{\n font-weight: bold;\n}\n\n.vjs-menu > ul.vjs-menu-content{\n bottom: 3.5em !important;\n right: -1em;\n}\n\n.video-js .vjs-chromecast-button .vjs-icon-placeholder {\n width: 17px !important;\n height: 17px !important;\n}\n\n.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-control.vjs-button{\n /* display: flex;\n justify-content: center;\n align-items: center; */\n display: none;\n}\n\nbutton.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-button{\n height: min-content;\n width: min-content;\n}\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical{\n width: 6em;\n}\n\n.video-js .content{\n bottom: 3.4rem !important;\n right: -4rem !important; \n}\n\n.setting-icon > svg{\n height:18px !important;\n}\n\n.output-overlay{\n position: absolute;\n bottom: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n border: 0;\n pointer-events:none\n}\n\niframe{\n width: 100%;\n height: 100%;\n}\n\n\n@media(max-width:600px){\n .tvProviderImage{\n display: none\n }\n.vjs-fullscreen .icon-minimize,\n .icon-maximize {\n height: 30px !important;\n }\n\n .vjs-fullscreen .icon-maximize,\n .icon-minimize {\n height: 30px !important;\n }\n\n button.vjs-fullscreen-control.vjs-control.vjs-button>span.vjs-icon-placeholder::before {\n height: min-content;\n }\n\n .vjs-seek-to-live-control.vjs-control{\n position: relative !important;\n right: 0em !important;\n bottom: 0 !important;\n }\n\n .video-js .vjs-progress-control{\n top: -0.85em;\n }\n .vjs-live-control{\n right: -1em !important;\n position: relative !important;\n bottom: 0 !important;\n font-size: 12px !important;\n }\n button.vjs-slowmo-button{\n display: none;\n }\n button.vjs-rewind-button{\n display: none;\n }\n button.vjs-rewind-button>svg{\n height: 20px;\n }\n .video-js .vjs-button{\n width: 4.8em;\n }\n .video-js .widget-selection{\n display: none;\n }\n .video-js .container{\n display: none !important;\n }\n .video-js .vjs-control-bar{\n height: 4em !important;\n }\n .video-js .vjs-button>.vjs-icon-placeholder:before{\n font-size: 2.5em;\n line-height: 1.5;\n }\n .video-js .vjs-play-progress:before {\n font-size: 1.2em;\n position: absolute;\n right: -0.5em;\n /* top: -0.3333333333em; */\n z-index: 1;\n}\nbutton.vjs-skip-button>svg{\n height: 20px;\n}\nbutton.vjs-big-play-button {\n width: 50px !important;\n height: 50px !important;\n font-size: 2.1rem !important;\n}\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display: block;\n}\n\n.stream-selector-icon>svg{\n width: 24px;\n height: 24px;\n}\n.video-js.vjs-live .vjs-progress-control .vjs-progress-holder{\n margin: 0 12px 0 21px;\n}\n.vjs-seek-to-live-text{\n font-size: 12px;\n}\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 40px 0px 21px;\n}\n.video-js .vjs-current-time{\n bottom: 2em !important;\n}\n}";export{n as default};