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