@viewlift/player-backup 1.0.100-backup → 1.0.101-backup
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/bundle.css +2 -2
- package/cjs/index.js +1 -1
- package/cjs/skin-1f82b484.js +1 -0
- package/cjs/skin-db506c8b.js +1 -0
- package/esm/bundle.css +2 -2
- package/esm/index.js +1 -1
- package/esm/skin-25c03649.js +1 -0
- package/esm/skin-d696bdf9.js +1 -0
- package/package.json +1 -1
- package/cjs/skin-8fa76c87.js +0 -1
- package/cjs/skin-b89cd1a3.js +0 -1
- package/esm/skin-808893ac.js +0 -1
- package/esm/skin-e058fad8.js +0 -1
package/cjs/bundle.css
CHANGED
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
17
|
.widget-selection{
|
|
20
18
|
display: flex;
|
|
21
19
|
align-items: center;
|
|
@@ -136,6 +134,8 @@
|
|
|
136
134
|
.widget-selector-content #sr-widget{
|
|
137
135
|
padding: 0 18px;
|
|
138
136
|
}
|
|
137
|
+
|
|
138
|
+
|
|
139
139
|
/* a wrapper element that tracks the mouse vertically */
|
|
140
140
|
.vjs-thumbnail-holder {
|
|
141
141
|
position: absolute;
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-9d9b0e54.js"),r=require("video.js"),l=require("@babel/runtime/helpers/typeof"),a=require("./util-cfdeb4de.js"),s=require("./renditions-97ea2e48.js"),d=require("./resolution-a28ec092.js"),u=require("./localisation-56e0a999.js");function c(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function v(e,t){c("event",e,t)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?f(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):f(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p=function(){var e,t,n,i;return(null===(e=o.getCurrentVideo())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=o.getCurrentVideo())||void 0===i?void 0:i.id)};function w(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function h(){var e=window.sessionStorage.getItem("uid");return e||(e=w(),window.sessionStorage.setItem("uid",e),e)}function g(){return y.apply(this,arguments)}function y(){return y=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}window.initialise=function(e){window.sid=w(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());v(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),v("PLAY",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))v("BUFFERING",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,v("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;v("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),v("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:p()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(b(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var b=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,w,y;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=h(),e.t5=p(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,g();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),w=[e.t31],e.next=37,o.getToken();case 37:y=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:y},contentType:"application/x-www-form-urlencoded",dataType:"text",data:w}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var T,k,P=function(e){return new Promise((function(t,n){if(I(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},I=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},O=function(){var e=t(n.mark((function e(t){var i,l,a,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,P("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(r),e.finish(13);case 16:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==o.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),S=function(e,t){var n=o.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*d,v.seek()}}))};function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function j(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?E(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var D=[],C=0,A=null;function R(t,n,i){var r,l,a,s,d,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];k=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var c=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration()),m=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,w=(null==n||null===(d=n.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,h=Math.floor(t.currentTime()),g=u?100:Math.floor(v/f*100),y={};w?function(t,n,i){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=x(r),a=(new Date).getTime(),s=o.getCurrentVideo(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return j(j({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===T}));c<0?l.push(j(j({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=j(j(j({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(y={completed:u,watchedTime:h,watchedPercentage:g},c,n.siteOwner):("v1"==k?y={videoId:T,watchedTime:h,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:m}:"v2"==k&&(y=j(j({videoId:T,watchedTime:h,watchedPercentage:g,doneWatching:u,profileId:c},A&&{seriesId:A}),p&&{originalObjectId:p})),o.saveWatchHistory(y,k).then((function(e){})).catch((function(e){}))),C=v+i}function x(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var F=function(e,t,n){var i=o.getPlayer(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},B=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},H=!1,M=function(e,t){var n,i,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[r])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!H){var l=V(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,t);return a&&o.loadVideo(t,a),H=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function V(e,t,n){if(Array.isArray(e))return e.map((function(e){return V(e,t,n)}));if(null!==e&&"object"===l(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=V(e[o],t,n)})),i}return e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function N(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var q=function(e,t,n,i){var r,l,a=i.res,s=i.sres,d=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),d&&(d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i,r;(null==d||!d.muted())&&F(e,sessionStorage.getItem("volume")||"100");var l=o.getCurrentVideo();if(o.clearError(),n.resolve(N({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var u,c,v=N(N({},t),a);!function(e,t,n){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(A=null==t||null===(r=t.series)||void 0===r?void 0:r.id),D=[],C=0,T=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());D.includes(C)||(e==C?(D.push(e),R(s,t,a)):e>C&&(C=e+a))})),s.one("ended",(function(){R(s,t,a,!0)})))}(e,v,null==l||null===(u=l.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var p,w=m.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.tech_.on("retryplaylist",(function(){c&&M(a,e)})),d.on("error",(function(){var t,i;4===d.error().code&&c?M(a,e):(o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,r,l=null===(n=o.getCurrentVideo())||void 0===n||null===(i=n.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){if(c){d.currentSource();for(var e=d.textTracks(),t=e.length-1;t>=0;t--)d.removeRemoteTextTrack(e[t])}})))},L=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-cc063da4.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-f8f4e492.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-4ae012ee.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-b89cd1a3.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?Promise.resolve().then((function(){return require("./skin-99b034cf.js")})).then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&Promise.resolve().then((function(){return require("./skin-518e4a9c.js")})).then((function(n){n.initaliseSkin(e,t)}))},U=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var W,z=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){P("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),P("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:z,loadEMELibrary:G});function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Q(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?K(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Y=function(i,l,a,s){var d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R,x,F,B,H,M,V,_,N,W,J,K,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z;null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(f=v.getInstance())||void 0===f||f.S;var ee=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=X)||void 0===m?void 0:m.contentType)||"video",ne=o.impolicy16x9(null===(p=X)||void 0===p||null===(w=p[te])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(k=X)||void 0===k||null===(P=k[te])||void 0===P||null===(I=P.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(x=R.adTags)||void 0===x||null===(F=x.web)||void 0===F?void 0:F.active)&&(null===(B=X)||void 0===B||null===(H=B.ads)||void 0===H||null===(M=H.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(_=V.web)||void 0===_?void 0:_.url);X=Q(Q({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ae=(K={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(K,"autoplay",null==a?void 0:a.autoplay),e(K,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!le),e(K,"loop",(null==a?void 0:a.loop)||!1),e(K,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(K,"html5",Q(Q({dash:Q(Q({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:Q(Q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(N=a.customData)||void 0===N?void 0:N.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(K,"poster",ne),e(K,"techOrder",ee),e(K,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,e,n)}}),K),se=r(i,ae,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(a);case 2:if(oe&&s.resolve(Q({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&U(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[te])||void 0===l?void 0:l.drmEnabled,T=null===(d=X)||void 0===d||null===(u=d[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!re){e.next=22;break}if("Safari"!==o.detectBrowser()){e.next=15;break}return e.next=13,G();case 13:e.next=22;break;case 15:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=20;break}return e.next=18,G();case 18:e.next=22;break;case 20:return e.next=22,z();case 22:if(null==a||!a.videoSourceUrl){e.next=25;break}return e.next=25,z();case 25:ie&&S(i,T),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,le,X),P=o.getSource(X,i),null!=a&&a.nearestClusterUrl&&(P=o.getUpdatedClusterSource(P,a.nearestClusterUrl)),P?o.loadVideo(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(f=X)||void 0===f||null===(m=f[te])||void 0===m||null===(p=m.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(R=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[te])||void 0===A?void 0:A.closedCaptions),I=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,I)),null!=a&&a.disableControls?o.disableControls(i):L(i,Q(Q(Q({},a),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),q(i,Q(Q(Q({},a),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 33:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:a.onTimeUpdate,getVideoDuration:a.getVideoDuration,onVideoEnded:a.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,d,v,f,m,p,w;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e?void 0:e.videoSourceUrl)||!1,g=null==e?void 0:e.asat,y=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,T=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=b;var k=null==e?void 0:e.token;if(o.token_authentication_enabled(e)){if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),!k||o.isTokenExpired(k))return void n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}});W=JSON.parse(atob(k.split(".")[1]))}window.siteId=null===(l=W)||void 0===l?void 0:l.siteId,window.siteName=null===(a=W)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=W)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=W)||void 0===d?void 0:d.site)||null,e.userId=(null===(v=W)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=W)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var O=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,u.setLocalisation(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return J})).then((function(e){e.importIMA()})),O&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return J})).then((function(e){e.importAirplay()})),E&&P("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],c("js",new Date),void c("config",e);var e})).catch((function(e){}));var D=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I));if(D&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h){var C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",A={directPlaybackUrl:h,id:C};g?o.getVideoDetails(C,k).then((function(i){Y(I,{res:Q(Q({},i),A)},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,C)})):Y(I,{res:A},e,{resolve:t,reject:n})}else if(T){var R,F=sessionStorage.getItem("season-idx")||0;o.seasonIdxManager.set(parseInt(F));var B=null==e||null===(R=e.series)||void 0===R?void 0:R.id;o.getSeriesDetails(B,k).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=b||(null==d||null===(r=d[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(B,k),o.getVideoDetails(u,k).then((function(i){var r,l,a;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(i.data),Y(I,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))})).catch((function(e){o.initiateErrorHandling(e,I,n)}))}else if(y){var H=null==e?void 0:e.epg;o.getLinearChannelDetails(H,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==H?void 0:H.channelId,Y(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}else o.getVideoDetails(b,k).then((function(i){var r,l,a,s;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==i?void 0:i.data);var d,u=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(d=e.watchHistory)||void 0===d?void 0:d.saveOffline)||!1){var c,v,f,m=function(e,t,n){var i=x(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(c=e.watchHistory)||void 0===c?void 0:c.profileId)||"",b,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})}else o.getVideoInfo(b,k).then((function(i){var o,r,l,a,s,d;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedPercentage)||null,u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Y(I,{res:u},e,{resolve:t,reject:n})}));else Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}}))},getRenditions:s.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:a.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:F,getVolume:B,disableControls:o.disableControls,setPlaybackSpeed:a.setPlaybackSpeed}};
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-9d9b0e54.js"),r=require("video.js"),l=require("@babel/runtime/helpers/typeof"),a=require("./util-cfdeb4de.js"),s=require("./renditions-97ea2e48.js"),d=require("./resolution-a28ec092.js"),u=require("./localisation-56e0a999.js");function c(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function v(e,t){c("event",e,t)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?f(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):f(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");var p=function(){var e,t,n,i;return(null===(e=o.getCurrentVideo())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=o.getCurrentVideo())||void 0===i?void 0:i.id)};function w(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function h(){var e=window.sessionStorage.getItem("uid");return e||(e=w(),window.sessionStorage.setItem("uid",e),e)}function g(){return y.apply(this,arguments)}function y(){return y=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}window.initialise=function(e){window.sid=w(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());v(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),v("PLAY",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))v("BUFFERING",m({pfm:window.platform,uid:h(),vid:p(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,v("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;v("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),vid:p(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),v("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:h(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:p()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(b(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var b=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,w,y;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=h(),e.t5=p(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,g();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),w=[e.t31],e.next=37,o.getToken();case 37:y=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:y},contentType:"application/x-www-form-urlencoded",dataType:"text",data:w}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var T,k,P=function(e){return new Promise((function(t,n){if(I(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},I=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},O=function(){var e=t(n.mark((function e(t){var i,l,a,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,P("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(r),e.finish(13);case 16:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==o.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),S=function(e,t){var n=o.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),f=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=f*d,v.seek()}}))};function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function j(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?E(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var D=[],C=0,A=null;function R(t,n,i){var r,l,a,s,d,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];k=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var c=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,v=Math.floor(t.currentTime()),f=Math.floor(t.duration()),m=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,p=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,w=(null==n||null===(d=n.watchHistory)||void 0===d?void 0:d.saveOffline)||!1,h=Math.floor(t.currentTime()),g=u?100:Math.floor(v/f*100),y={};w?function(t,n,i){var r=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=x(r),a=(new Date).getTime(),s=o.getCurrentVideo(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return j(j({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===T}));c<0?l.push(j(j({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=j(j(j({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(y={completed:u,watchedTime:h,watchedPercentage:g},c,n.siteOwner):("v1"==k?y={videoId:T,watchedTime:h,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:m}:"v2"==k&&(y=j(j({videoId:T,watchedTime:h,watchedPercentage:g,doneWatching:u,profileId:c},A&&{seriesId:A}),p&&{originalObjectId:p})),o.saveWatchHistory(y,k).then((function(e){})).catch((function(e){}))),C=v+i}function x(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var F=function(e,t,n){var i=o.getPlayer(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},B=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},H=!1,M=function(e,t){var n,i,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[r])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!H){var l=V(e,"videoAssets","secondaryVideoAssets"),a=o.getSource(l,t);return a&&o.loadVideo(t,a),H=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function V(e,t,n){if(Array.isArray(e))return e.map((function(e){return V(e,t,n)}));if(null!==e&&"object"===l(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=V(e[o],t,n)})),i}return e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function N(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?_(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var q=function(e,t,n,i){var r,l,a=i.res,s=i.sres,d=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),d&&(d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i,r;(null==d||!d.muted())&&F(e,sessionStorage.getItem("volume")||"100");var l=o.getCurrentVideo();if(o.clearError(),n.resolve(N({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(r=t.watchHistory)&&void 0!==r&&r.saveOffline)){var u,c,v=N(N({},t),a);!function(e,t,n){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(A=null==t||null===(r=t.series)||void 0===r?void 0:r.id),D=[],C=0,T=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());D.includes(C)||(e==C?(D.push(e),R(s,t,a)):e>C&&(C=e+a))})),s.one("ended",(function(){R(s,t,a,!0)})))}(e,v,null==l||null===(u=l.video)||void 0===u||null===(c=u.gist)||void 0===c?void 0:c.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var p,w=m.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.tech_.on("retryplaylist",(function(){c&&M(a,e)})),d.on("error",(function(){var t,i;4===d.error().code&&c?M(a,e):(o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,r,l=null===(n=o.getCurrentVideo())||void 0===n||null===(i=n.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){if(c){d.currentSource();for(var e=d.textTracks(),t=e.length-1;t>=0;t--)d.removeRemoteTextTrack(e[t])}})))},L=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-cc063da4.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-f8f4e492.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-4ae012ee.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-1f82b484.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?Promise.resolve().then((function(){return require("./skin-99b034cf.js")})).then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&Promise.resolve().then((function(){return require("./skin-518e4a9c.js")})).then((function(n){n.initaliseSkin(e,t)}))},U=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var W,z=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){r.getPlugin("eme")||r.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){P("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),P("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:z,loadEMELibrary:G});function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Q(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?K(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Y=function(i,l,a,s){var d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R,x,F,B,H,M,V,_,N,W,J,K,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z;null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(f=v.getInstance())||void 0===f||f.S;var ee=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=X)||void 0===m?void 0:m.contentType)||"video",ne=o.impolicy16x9(null===(p=X)||void 0===p||null===(w=p[te])||void 0===w||null===(h=w.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(k=X)||void 0===k||null===(P=k[te])||void 0===P||null===(I=P.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(x=R.adTags)||void 0===x||null===(F=x.web)||void 0===F?void 0:F.active)&&(null===(B=X)||void 0===B||null===(H=B.ads)||void 0===H||null===(M=H.preRoll)||void 0===M||null===(V=M.adTags)||void 0===V||null===(_=V.web)||void 0===_?void 0:_.url);X=Q(Q({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ae=(K={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(K,"autoplay",null==a?void 0:a.autoplay),e(K,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!le),e(K,"loop",(null==a?void 0:a.loop)||!1),e(K,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(K,"html5",Q(Q({dash:Q(Q({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:Q(Q({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(N=a.customData)||void 0===N?void 0:N.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(K,"poster",ne),e(K,"techOrder",ee),e(K,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,e,n)}}),K),se=r(i,ae,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,f,m,p,w,h,g,y,b,T,k,P,I,E,j,D,C,A,R;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(a);case 2:if(oe&&s.resolve(Q({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&U(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[te])||void 0===l?void 0:l.drmEnabled,T=null===(d=X)||void 0===d||null===(u=d[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!re){e.next=22;break}if("Safari"!==o.detectBrowser()){e.next=15;break}return e.next=13,G();case 13:e.next=22;break;case 15:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=20;break}return e.next=18,G();case 18:e.next=22;break;case 20:return e.next=22,z();case 22:if(null==a||!a.videoSourceUrl){e.next=25;break}return e.next=25,z();case 25:ie&&S(i,T),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,le,X),P=o.getSource(X,i),null!=a&&a.nearestClusterUrl&&(P=o.getUpdatedClusterSource(P,a.nearestClusterUrl)),P?o.loadVideo(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(f=X)||void 0===f||null===(m=f[te])||void 0===m||null===(p=m.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(R=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[te])||void 0===A?void 0:A.closedCaptions),I=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,I)),null!=a&&a.disableControls?o.disableControls(i):L(i,Q(Q(Q({},a),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),q(i,Q(Q(Q({},a),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 33:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:a.onTimeUpdate,getVideoDuration:a.getVideoDuration,onVideoEnded:a.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,d,v,f,m,p,w;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e?void 0:e.videoSourceUrl)||!1,g=null==e?void 0:e.asat,y=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,b=null==e?void 0:e.videoId,T=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=b;var k=null==e?void 0:e.token;if(o.token_authentication_enabled(e)){if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),!k||o.isTokenExpired(k))return void n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}});W=JSON.parse(atob(k.split(".")[1]))}window.siteId=null===(l=W)||void 0===l?void 0:l.siteId,window.siteName=null===(a=W)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=W)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=W)||void 0===d?void 0:d.site)||null,e.userId=(null===(v=W)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(f=W)||void 0===f?void 0:f.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var O=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(m=e.analytics)||void 0===m?void 0:m.gaId)||null,j=null==e?void 0:e.errors;j&&(window.customErrors=j),window.customData=null==e?void 0:e.customData,u.setLocalisation(null==e||null===(p=e.customData)||void 0===p?void 0:p.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return J})).then((function(e){e.importIMA()})),O&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return J})).then((function(e){e.importAirplay()})),E&&P("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],c("js",new Date),void c("config",e);var e})).catch((function(e){}));var D=null===(w=document)||void 0===w?void 0:w.getElementById("".concat(I));if(D&&D.addEventListener("contextmenu",(function(e){return e.preventDefault()})),h){var C="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",A={directPlaybackUrl:h,id:C};g?o.getVideoDetails(C,k).then((function(i){Y(I,{res:Q(Q({},i),A)},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,C)})):Y(I,{res:A},e,{resolve:t,reject:n})}else if(T){var R,F=sessionStorage.getItem("season-idx")||0;o.seasonIdxManager.set(parseInt(F));var B=null==e||null===(R=e.series)||void 0===R?void 0:R.id;o.getSeriesDetails(B,k).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=b||(null==d||null===(r=d[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(B,k),o.getVideoDetails(u,k).then((function(i){var r,l,a;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(i.data),Y(I,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))})).catch((function(e){o.initiateErrorHandling(e,I,n)}))}else if(y){var H=null==e?void 0:e.epg;o.getLinearChannelDetails(H,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==H?void 0:H.channelId,Y(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}else o.getVideoDetails(b,k).then((function(i){var r,l,a,s;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==i?void 0:i.data);var d,u=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable)if((null===(d=e.watchHistory)||void 0===d?void 0:d.saveOffline)||!1){var c,v,f,m=function(e,t,n){var i=x(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(c=e.watchHistory)||void 0===c?void 0:c.profileId)||"",b,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})}else o.getVideoInfo(b,k).then((function(i){var o,r,l,a,s,d;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedPercentage)||null,u.contentType="video",Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Y(I,{res:u},e,{resolve:t,reject:n})}));else Y(I,{res:u},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,I,n,b)}))}}))},getRenditions:s.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:a.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,authenticateLC:o.authenticateLC,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:d.playSelectedResolution,getSource:o.getSource,setVolume:F,getVolume:B,disableControls:o.disableControls,setPlaybackSpeed:a.setPlaybackSpeed}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./features-86dad21d.js"),t=require("./icons-515b2da0.js"),n=require("./generic-9d9b0e54.js"),r=require("./renditions-97ea2e48.js"),i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./autoNextVideo-b3777f2f.js"),o=require("@babel/runtime/helpers/typeof"),a=require("video.js"),u=require("@babel/runtime/helpers/asyncToGenerator"),s=require("@babel/runtime/regenerator"),c=require("@babel/runtime/helpers/slicedToArray");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("./localisation-56e0a999.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-cfdeb4de.js");var d=n.getCurrentSeries(),v=[];null==d||d.map((function(e){return v.push.apply(v,i(e.episodes))}));var p,m,f,h,g=function(e,t){var r=n.getPlayer(e),i=Math.floor(r.currentTime());if(Math.floor(r.duration())!=i){r.pause(e);var o=n.getVideoIdx();l.switchToNext(o,e,v)}};function y(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function x(e){return b.apply(this,arguments)}function b(){return(b=u(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),l=c(i,2),o=l[0],a=l[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var l=i.width/a,u=i.height/o,s=0;s<o;s++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=l,d.height=u,d.getContext("2d").drawImage(i,c*l,s*u,l,u,0,0,l,u);var v=d.toDataURL("image/png");r.push({uri:v,duration:t.duration})}e(r)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w(e){return C.apply(this,arguments)}function C(){return(C=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",y(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function E(e){return k.apply(this,arguments)}function k(){return(k=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return x(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n=e.duration;r[n*t]={src:e.uri,style:{left:"-60px",height:"68px",width:"120px"}}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}p={0:{src:"example-thumbnail.png"}},m=function e(){var t,n,r,i,l;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[r])i.hasOwnProperty(l)&&("object"===o(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},f=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},h=function e(t){return"HTML"!==t.nodeName&&"static"===f(t)("position")?e(t.offsetParent):t},a.registerPlugin("thumbnails",(function(e){var t,n,r,i,l,o,a,u;n=m({},p,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",m(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",(function(e){o=i.duration()})),i.on("loadedmetadata",(function(e){o=i.duration()})),(l=i.controlBar.progressControl).el().appendChild(t),a=function(e){var i,a,u,s,c,d,v,p,g,y;for(a in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,v=((y=h(l.el()).getBoundingClientRect()).width||y.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=h(l.el()).getBoundingClientRect().left+g,i=Math.floor((s-l.el().offsetLeft)/l.width()*o),n)i>a&&(u=Math.max(u,a));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&m(r.style,c.style),s+(p=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=f(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>v?s-=s+p-v:s<p&&(s=p),t.style.left=s+"px"},l.on("mousemove",a),l.on("touchmove",a),u=function(e){t.style.left="-1000px"},l.on("mouseout",u),l.on("touchcancel",u),l.on("touchend",u),i.on("userinactive",u)}));var N=function(){var e=u(s.mark((function e(t,n){var r,i,l,o;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,l=i.split("\n"),o=[],l.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&l[n-1].includes("#EXT-X-TILES")&&(l[n-1]=l[n-1].split(","),r.uri=t+e,l[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=c(t,2),i=n[0],l=n[1];i=i.toLowerCase(),r[i]=l}))})),o.push(r))})),e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function B(e){return j.apply(this,arguments)}function j(){return(j=u(s.mark((function e(t){var r,i,l,o,a,u,c,d,v,p,m,f,h,g,y,x,b,w,C,E,k,N;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return o=e.sent,e.next=7,o.text();case 7:a=e.sent,u=new DOMParser,c=u.parseFromString(a,"application/xml"),d=null===(i=n.getCurrentVideo())||void 0===i||null===(l=i.video)||void 0===l?void 0:l.runtime,v=c.getElementsByTagName("AdaptationSet"),p=0;case 13:if(!(p<v.length)){e.next=34;break}if("image"!==(m=v[p]).getAttribute("contentType")||"image/png"!==m.getAttribute("mimeType")){e.next=31;break}if(f=m.getElementsByTagName("SegmentTemplate")[0],h=m.getElementsByTagName("Representation")[0],g=h.getElementsByTagName("EssentialProperty")[0],y=g.getAttribute("value"),!f){e.next=31;break}for(f.getAttribute("media"),x=f.getAttribute("duration"),b=f.getAttribute("timescale"),w=x/b,C=Math.round(d/w),E=Math.ceil(C/9),k=f.getAttribute("media"),N=[],p=0;p<E;p++)N.push({duration:w,layout:y,uri:r+"/"+k.replace("$Number$",p)});return e.abrupt("return",N);case 31:p++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).apply(this,arguments)}function S(){return(S=u(s.mark((function e(t){var r,i,l,o,a,u,c,d,v,p,m;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getPlayer(t),i=r.currentSource(),null==(l=i.src)||!l.includes("m3u8")){e.next=18;break}return e.next=5,w(l);case 5:if(!((null==(o=e.sent)?void 0:o.length)>0)){e.next=16;break}return a=(null==o?void 0:o[0])||null,u=a.uri,c=r.tech().vhs.playlists.master.uri.substring(0,r.tech().vhs.playlists.master.uri.lastIndexOf("/"))+"/",e.next=11,N(c,u);case 11:return d=e.sent,e.next=14,E(d);case 14:v=e.sent,r.thumbnails(v);case 16:e.next=27;break;case 18:if(null==l||!l.includes("mpd")){e.next=27;break}return e.next=21,B(l);case 21:if(!((null==(p=e.sent)?void 0:p.length)>0)){e.next=27;break}return e.next=25,E(p);case 25:m=e.sent,r.thumbnails(m);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(t,i){var l=n.getPlayer(t);l&&(l.on("loadeddata",(function(){var o,a,u;(null===(o=r.getRenditions(t))||void 0===o?void 0:o.length)>0&&e.addSettingsButtonV2(t,i),(null===(a=n.getCaptions(t))||void 0===a?void 0:a.length)>0&&e.addCaptionButton(t,i),null!=i&&null!==(u=i.series)&&void 0!==u&&u.enable&&function(e,t){var r;null==t||null===(r=t.series)||void 0===r||r.cb;var i=n.getPlayer(e);i.on("timeupdate",(function(){var e,t=Math.floor(i.currentTime()),r=i.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-t<=10&&n.getVideoIdx()<=(null==v?void 0:v.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}));var l,o=v.filter((function(e,t){return t==n.getVideoIdx()}));if((null==o?void 0:o.length)>0)if(null!==(l=document.getElementsByClassName("next-ep-preview"))&&void 0!==l&&l[0]){var a,u,s,c,d,p,m,f,h,y,x;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var b=null===(u=document.getElementsByClassName("next-ep-title"))||void 0===u?void 0:u[0],w=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],C=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],E=null===(d=o[0])||void 0===d?void 0:d.title;(null===(p=E)||void 0===p?void 0:p.length)>60&&(E=E.substr(0,60)+"..."),b.textContent="".concat(E),w.src=(null===(m=o[0])||void 0===m||null===(f=m.gist)||void 0===f||null===(h=f.imageGist)||void 0===h?void 0:h.r16x9)||(null===(y=window)||void 0===y||null===(x=y.customData)||void 0===x?void 0:x.fallbackImage),C.onclick=function(){return g(e)}}else{var k,N,B,j,S,q,T,P=document.createElement("div");P.className="next-ep-preview",P.style.visibility="hidden",document.getElementById(e).append(P);var M=document.createElement("div");M.className="next-ep-header",M.textContent="Next up";var V=null===(k=o[0])||void 0===k?void 0:k.title,I=document.createElement("img");I.className="next-ep-img",I.src=(null===(N=o[0])||void 0===N||null===(B=N.gist)||void 0===B||null===(j=B.imageGist)||void 0===j?void 0:j.r16x9)||(null===(S=window)||void 0===S||null===(q=S.customData)||void 0===q?void 0:q.fallbackImage);var O=document.createElement("div");O.className="next-ep-title",(null===(T=V)||void 0===T?void 0:T.length)>60&&(V=V.substr(0,60)+"..."),O.textContent="".concat(V);var A=document.createElement("div");A.className="next-ep-content",A.append(I),A.append(O),A.onclick=function(){return g(e)},P.append(M),P.append(A)}}(t,i),function(e,t){var n,r=Math.floor(e/60),i=null===(n=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===n?void 0:n[0];i&&(i.style.marginRight=r>60?"56px":"41px");var l=document.getElementsByClassName("vjs-live-control")[0],o=document.getElementsByClassName("vjs-time-control");t&&l.classList.value.includes("vjs-hidden")&&(o[0].style.display="block",i&&(i.style.marginRight="56px"))}(l.duration(),(null==i?void 0:i.liveVideo)||!1),null!=i&&i.liveVideo||function(e){S.apply(this,arguments)}(t)})),l.one("play",(function(){var n,r,i,l;null!==(n=window)&&void 0!==n&&null!==(r=n.customData)&&void 0!==r&&r.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.iframeOverlayUrl)})))}exports.initialiseSkin=function(r,i){!function(){"Chrome"==n.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));Promise.resolve().then((function(){return require("./skin-db506c8b.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),q(r,i),function(e,r){var i,l,o,a,u,s,c=n.getPlayer(e);null==c||null===(i=c.controlBar)||void 0===i||null===(l=i.getChild("FullscreenToggle"))||void 0===l||null===(o=l.el())||void 0===o||o.appendChild(n.createIconMarkup(t.MinimizeSvg(window.controlsColor))),null==c||null===(a=c.controlBar)||void 0===a||null===(u=a.getChild("FullscreenToggle"))||void 0===u||null===(s=u.el())||void 0===s||s.appendChild(n.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var d=document.getElementsByClassName("vjs-time-control");r.liveVideo&&d[0]&&(d[0].style.display="none")}(r,i),function(n,r){var i,l,o,a,u,s;0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)&&e.addSkipButton(n,"defaultV2",t.SkipSvgV2());(0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)||1==(null==r?void 0:r.liveui))&&e.addRewindButton(n,"defaultV2",t.RewindSvgV2());r.liveVideo||e.addSlowMotion(n);(null==r||null===(i=r.relatedVideos)||void 0===i||null===(l=i.content)||void 0===l?void 0:l.length)>0&&e.addVideoSelector(n,null==r?void 0:r.relatedVideos);(null==r||null===(o=r.streams)||void 0===o?void 0:o.length)>1&&e.addMulticamSelector(n,null==r?void 0:r.streams);(null==r||null===(a=r.playlist)||void 0===a||null===(u=a.content)||void 0===u?void 0:u.length)>0&&e.addPlaylistSelector(n,null==r?void 0:r.playlist);null!=r&&null!==(s=r.series)&&void 0!==s&&s.enable&&e.addSeriesSelectorV2(n,r)}(r,i),function(e,t){var r=n.getPlayer(e),i=null==t?void 0:t.tvProviderLogoUrl;if(!i)return;var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",l.append(o),r.el().appendChild(l),r.on("useractive",(function(){l.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||l.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"}))}(r,i)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.default=".tvProviderImage{\n position: absolute;\n right: 1rem;\n top: 1rem;\n max-height: 100px;\n max-width: 100px;\n}\n.tvProviderImage>img{\n height: 100%;\n width: 100%;\n}\n.vjs-button>.vjs-icon-placeholder:before {\n font-size: 2.2em;\n line-height: 2.6;\n}\n.vjs-control-bar{\n z-index: 1 !important;\n height: 6em !important;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%) !important;\n}\n\n.vjs-fade>* {\n visibility: hidden !important;\n opacity: 0 !important;\n transition: visibility 1s, opacity 1s !important;\n}\n\n.video-js .vjs-progress-control {\n left: -6px;\n position: absolute;\n width: 100%;\n height: 0.5em;\n top: -0.5em;\n transition: height .1s,top .1s;\n}\n\n.video-js .vjs-custom-control-spacer {\n display: block;\n flex: 1 1 auto;\n}\n\n.vjs-remaining-time.vjs-time-control.vjs-control {\n position: absolute;\n right: 0;\n bottom: 18px;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 41px 0 14px;\n}\n.vjs-remaining-time.vjs-time-control.vjs-control{\n display: none;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button {\n font-size: 14px;\n font-weight: 500;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder{\n height: 6px !important;\n}\n\n.video-js .vjs-play-progress:before {\n font-size: 1.9em;\n display: none;\n}\n\n.video-js .vjs-current-time { display: block; }\n\n.video-js .vjs-current-time {\n display: block;\n position: absolute;\n right: 0em;\n bottom: 1.8em;\n font-size: 12px;\n font-weight: 600;\n}\n\n.video-js .vjs-button{\n width: 6em;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button{\n align-self: center;\n height: min-content;\n padding: 5px 2px;\n border-radius: 8px;\n}\n\n\n.vjs-fullscreen .icon-minimize,\n.icon-maximize {\n display: block;\n height: 32px;\n}\n\n.vjs-fullscreen .icon-maximize,\n.icon-minimize {\n display: none;\n height: 32px;\n}\n\nbutton.vjs-play-control.vjs-control.vjs-button{\n outline: none !important;\n}\n\n.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,\n.vjs-icon-fullscreen-enter:before {\n content: '' !important;\n}\n\n.video-js button.vjs-fullscreen-control.vjs-control.vjs-button {\n display: flex;\n justify-content: center;\n align-items: center;\n transform: rotate(90deg);\n}\n\n.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before{\n display: none;\n}\n.video-js .vjs-volume-panel .vjs-volume-control{\n margin-left: -10px;\n}\n\n.skipbtn:hover{\n cursor: pointer;\n}\n\n.rewindbtn:hover{\n cursor: pointer;\n}\n\n.vjs-live-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 1.8em !important;\n font-weight: 700 !important;\n font-size: 11px !important;\n}\n\n.vjs-seek-to-live-control.vjs-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 3.2em !important;\n}\n\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display:none;\n}\n\n.video-js.vjs-paused .vjs-big-play-button {\n width: 90px;\n height: 90px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n font-size: 6em;\n line-height: 1.3em;\n}\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{\n font-weight: bold;\n}\n\n.vjs-menu > ul.vjs-menu-content{\n bottom: 3.5em !important;\n right: -1em;\n}\n\n.video-js .vjs-chromecast-button .vjs-icon-placeholder {\n width: 17px !important;\n height: 17px !important;\n}\n\n.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-control.vjs-button{\n /* display: flex;\n justify-content: center;\n align-items: center; */\n display: none;\n}\n\nbutton.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-button{\n height: min-content;\n width: min-content;\n}\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical{\n width: 6em;\n}\n\n.video-js .content{\n bottom: 3.4rem !important;\n right: -4rem !important; \n}\n\n.setting-icon > svg{\n height:18px !important;\n}\n\n.output-overlay{\n position: absolute;\n bottom: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n border: 0;\n pointer-events:none\n}\n\niframe{\n width: 100%;\n height: 100%;\n}\n\n\n@media(max-width:600px){\n .tvProviderImage{\n display: none\n }\n.vjs-fullscreen .icon-minimize,\n .icon-maximize {\n height: 30px !important;\n }\n\n .vjs-fullscreen .icon-maximize,\n .icon-minimize {\n height: 30px !important;\n }\n\n button.vjs-fullscreen-control.vjs-control.vjs-button>span.vjs-icon-placeholder::before {\n height: min-content;\n }\n\n .vjs-seek-to-live-control.vjs-control{\n position: relative !important;\n right: 0em !important;\n bottom: 0 !important;\n }\n\n .video-js .vjs-progress-control{\n top: -0.85em;\n }\n .vjs-live-control{\n right: -1em !important;\n position: relative !important;\n bottom: 0 !important;\n font-size: 12px !important;\n }\n button.vjs-slowmo-button{\n display: none;\n }\n button.vjs-rewind-button{\n display: none;\n }\n button.vjs-rewind-button>svg{\n height: 20px;\n }\n .video-js .vjs-button{\n width: 4.8em;\n }\n .video-js .widget-selection{\n display: none;\n }\n .video-js .container{\n display: none !important;\n }\n .video-js .vjs-control-bar{\n height: 4em !important;\n }\n .video-js .vjs-button>.vjs-icon-placeholder:before{\n font-size: 2.5em;\n line-height: 1.5;\n }\n .video-js .vjs-play-progress:before {\n font-size: 1.2em;\n position: absolute;\n right: -0.5em;\n /* top: -0.3333333333em; */\n z-index: 1;\n}\nbutton.vjs-skip-button>svg{\n height: 20px;\n}\nbutton.vjs-big-play-button {\n width: 50px !important;\n height: 50px !important;\n font-size: 2.1rem !important;\n}\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display: block;\n}\n\n.stream-selector-icon>svg{\n width: 24px;\n height: 24px;\n}\n.video-js.vjs-live .vjs-progress-control .vjs-progress-holder{\n margin: 0 12px 0 21px;\n}\n.vjs-seek-to-live-text{\n font-size: 12px;\n}\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 40px 0px 21px;\n}\n.video-js .vjs-current-time{\n bottom: 2em !important;\n}\n}";
|
package/esm/bundle.css
CHANGED
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
17
|
.widget-selection{
|
|
20
18
|
display: flex;
|
|
21
19
|
align-items: center;
|
|
@@ -136,6 +134,8 @@
|
|
|
136
134
|
.widget-selector-content #sr-widget{
|
|
137
135
|
padding: 0 18px;
|
|
138
136
|
}
|
|
137
|
+
|
|
138
|
+
|
|
139
139
|
/* a wrapper element that tracks the mouse vertically */
|
|
140
140
|
.vjs-thumbnail-holder {
|
|
141
141
|
position: absolute;
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"axios";import{g as o,a as r,d as l,b as a,s,c as d,l as u,e as c,f as v,h as f,i as m,j as p,k as w,m as h,n as g,p as y,o as b,r as T,q as k,t as I,u as P,v as O,w as j,x as S,y as E,z as D,A,B as R,C as x,D as C,E as F,F as B,G as M,H as _,I as H,J as N,K as L,L as V,M as U,N as W,O as q}from"./generic-30a350ab.js";import z from"video.js";import G from"@babel/runtime/helpers/typeof";import{o as J,g as K,a as Q,s as Y,b as X}from"./util-814500d5.js";import{g as Z}from"./renditions-9e4f9b98.js";import{playSelectedResolution as $}from"./resolution-3396f48a.js";import{s as ee}from"./localisation-0bf399a1.js";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";function te(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function ne(e,t){te("event",e,t)}function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function oe(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ie(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var re=function(){var e,t,n,i;return(null===(e=r())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=r())||void 0===i?void 0:i.id)};function le(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ae(){var e=window.sessionStorage.getItem("uid");return e||(e=le(),window.sessionStorage.setItem("uid",e),e)}function se(){return de.apply(this,arguments)}function de(){return de=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),de.apply(this,arguments)}window.initialise=function(e){window.sid=le(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());ne(r?"FAILED_TO_START":"DROPPED_STREAM",oe({pfm:window.platform,uid:ae(),vid:re(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),ne("PLAY",oe({pfm:window.platform,uid:ae(),vid:re(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))ne("BUFFERING",oe({pfm:window.platform,uid:ae(),vid:re(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,ne("FIRST_FRAME",oe({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),vid:re()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;ne("AD_REQUEST",oe({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),vid:re(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),ne("AD_IMPRESSION",oe({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:re()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(ue(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var ue=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,m,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=oe,e.t1=oe,e.t2=oe({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=ae(),e.t5=re(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,se();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),m=[e.t31],e.next=37,o();case 37:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var ce,ve,fe=function(e){return new Promise((function(t,n){if(me(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},pe=function(){var e=t(n.mark((function e(t){var i,o,r,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(z),e.finish(13);case 16:null!==(r=window)&&void 0!==r&&r.cast?null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==l()?null==o||o.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),we=function(e,t){var n=a(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=z.dom.getPointerPosition(a,t).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ge(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?he(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):he(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ye=[],be=0,Te=null;function ke(t,n,i){var o,l,a,d,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ve=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var v=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,f=Math.floor(t.currentTime()),m=Math.floor(t.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,w=(null==n||null===(d=n.video)||void 0===d?void 0:d.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),y=c?100:Math.floor(f/m*100),b={};h?function(t,n,i){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=Ie(o),a=(new Date).getTime(),s=r(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return ge(ge({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===ce}));c<0?l.push(ge(ge({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=ge(ge(ge({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:y},v,n.siteOwner):("v1"==ve?b={videoId:ce,watchedTime:g,watchedPercentage:y,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==ve&&(b=ge(ge({videoId:ce,watchedTime:g,watchedPercentage:y,doneWatching:c,profileId:v},Te&&{seriesId:Te}),w&&{originalObjectId:w})),s(b,ve).then((function(e){})).catch((function(e){}))),be=f+i}function Ie(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var Pe=function(e,t,n){var i=a(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Oe=function(e){var t=a(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},je=!1,Se=function(e,t){var n,i,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[o])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!je){var r=Ee(e,"videoAssets","secondaryVideoAssets"),l=d(r,t);return l&&u(t,l),je=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Ee(e,t,n){if(Array.isArray(e))return e.map((function(e){return Ee(e,t,n)}));if(null!==e&&"object"===G(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=Ee(e[o],t,n)})),i}return e}function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ae(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?De(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):De(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Re=function(e,t,n,i){var o,l,s=i.res,d=i.sres,u=a(e),p=(null==s?void 0:s.contentType)||"video",w=(null==s||null===(o=s[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(s),u&&(u.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:s})})),u.on("loadeddata",(function(){var i,o;(null==u||!u.muted())&&Pe(e,sessionStorage.getItem("volume")||"100");var l=r();if(v(),n.resolve(Ae({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:s}:{response:s})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var c,f,m=Ae(Ae({},t),s);!function(e,t,n){var i,o,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(Te=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ye=[],be=0,ce=n;var l=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=a(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ye.includes(be)||(e==be?(ye.push(e),ke(s,t,l)):e>be&&(be=e+l))})),s.one("ended",(function(){ke(s,t,l,!0)})))}(e,m,null==l||null===(c=l.video)||void 0===c||null===(f=c.gist)||void 0===f?void 0:f.id)}})),u.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",t)})),u.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var p,w=m.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),u.on("loadedmetadata",(function(){window.endFirstFrame(u)})),u.tech_.on("retryplaylist",(function(){w&&Se(s,e)})),u.on("error",(function(){var t,i;4===u.error().code&&w?Se(s,e):(f(e,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),u.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,l=null===(n=r())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=m().get(l)||{t:0,p:0},s=a.t,d=a.p;s&&d<95&&setTimeout((function(){u.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),u.on("chromecastDisconnected",(function(){if(w){u.currentSource();for(var e=u.textTracks(),t=e.length-1;t>=0;t--)u.removeRemoteTextTrack(e[t])}})))},xe=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-85b3ae06.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-99f72a1b.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-a91b517c.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-e058fad8.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?import("./skin-e7d692fb.js").then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&import("./skin-2d53e012.js").then((function(n){n.initaliseSkin(e,t)}))},Ce=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Fe,Be=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),fe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Be,loadEMELibrary:Me});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 Ne(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 Le=function(i,o,r,s){var c,v,m,p,w,h,g,y,b,T,k,I,P,O,j,S,E,A,R,x,C,F,B,M,_,H,W,q,G,J,K,Q,Y,X=o.res,Z=void 0===X?null:X,$=o.sres,ee=void 0===$?null:$;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(p=m.CastContext)||void 0===p||null===(w=p.getInstance())||void 0===w||w.S;var te=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],ne=(null===(h=Z)||void 0===h?void 0:h.contentType)||"video",ie=N(null===(g=Z)||void 0===g||null===(y=g[ne])||void 0===y||null===(b=y.gist)||void 0===b?void 0:b.videoImageUrl)||N(null===(T=Z)||void 0===T||null===(k=T[ne])||void 0===k||null===(I=k.gist)||void 0===I||null===(P=I.imageGist)||void 0===P?void 0:P.r16x9),oe=(null===(O=Z)||void 0===O||null===(j=O[ne])||void 0===j||null===(S=j.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,re=(null===(E=Z)||void 0===E||null===(A=E[ne])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,le=(null==r?void 0:r.drmLibrary)||!1,ae=(null===(x=Z)||void 0===x||null===(C=x.ads)||void 0===C||null===(F=C.preRoll)||void 0===F||null===(B=F.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(_=Z)||void 0===_||null===(H=_.ads)||void 0===H||null===(W=H.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(G=q.web)||void 0===G?void 0:G.url);Z=Ne(Ne({},Z),{},{audioAssetSource:null==r?void 0:r.audioAssetSource});var se=(Y={controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:("default"==r.skin||"defaultV2"==r.skin||"live"==(null==r?void 0:r.skin))&&{inline:!1},fullscreenToggle:"default"==r.skin||"defaultV2"==r.skin,audioTrackButton:!1,pictureInPictureToggle:(r.skin,!1)},muteToggle:"multiplayer"==r.skin,liveui:oe},e(Y,"autoplay",null==r?void 0:r.autoplay),e(Y,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!ae),e(Y,"loop",(null==r?void 0:r.loop)||!1),e(Y,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(Y,"html5",Ne(Ne({dash:Ne(Ne({},!z.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:Ne(Ne({experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==r||null===(J=r.customData)||void 0===J?void 0:J.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==r?void 0:r.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==r?void 0:r.experimentalBufferBasedABR)||!1})},0==(null==r||null===(K=r.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(Q=r.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Y,"poster",ie),e(Y,"techOrder",te),e(Y,"chromecast",{requestCustomDataFn:function(e){var t=a(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Z,e,n)}}),Y),de=z(i,se,function(){var e=t(n.mark((function e(){var t,o,a,c,v,m,p,w,h,g,y,b,T,k,I,P,O,j,S,E,A,R,x,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pe(r);case 2:if(re&&s.resolve(Ne({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&Ce(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),k=null===(t=Z)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,I=null===(a=Z)||void 0===a||null===(c=a[ne])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!k&&!le){e.next=22;break}if("Safari"!==l()){e.next=15;break}return e.next=13,Me();case 13:e.next=22;break;case 15:if("caliente"!=(null===(P=window)||void 0===P?void 0:P.siteName)){e.next=20;break}return e.next=18,Me();case 18:e.next=22;break;case 20:return e.next=22,Be();case 22:if(null==r||!r.videoSourceUrl){e.next=25;break}return e.next=25,Be();case 25:oe&&we(i,I),!ae||null!=r&&null!==(m=r.customData)&&void 0!==m&&m.disableAds||L(i,ae,Z),O=d(Z,i),null!=r&&r.nearestClusterUrl&&(O=V(O,r.nearestClusterUrl)),O?u(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),f(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=Z)||void 0===p||null===(w=p[ne])||void 0===w||null===(h=w.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=Z)||void 0===y||null===(b=y[ne])||void 0===b||null===(T=b.closedCaptions)||void 0===T?void 0:T.length)>0)&&(C=(null===(S=Z)||void 0===S||null===(E=S[ne])||void 0===E||null===(A=E.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=Z)||void 0===R||null===(x=R[ne])||void 0===x?void 0:x.closedCaptions),j=C.filter((function(e){return"VTT"===e.format})),U(i,j)),null!=r&&r.disableControls?D(i):xe(i,Ne(Ne(Ne({},r),se),{},{liveVideo:re,isDvrEnabled:oe,res:Z,sres:ee})),Re(i,Ne(Ne(Ne({},r),se),{},{liveVideo:re}),s,{res:Z,sres:ee});case 33:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Ve(){return{loadVideoInstantly:h,onTimeUpdate:J,getVideoDuration:K,onVideoEnded:Q,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,f,m,h;if(!k(null==e?void 0:e.playerId)){var g=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,b=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,T=null==e?void 0:e.videoId,I=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=T;var P=null==e?void 0:e.token;if(A(e)){if(R().set(null==e?void 0:e.refreshToken),!P||x(P))return void n({status:!1,msg:"".concat(P?"Token is expired !":"Missing Authorization Token"),response:{token:P}});Fe=JSON.parse(atob(P.split(".")[1]))}window.siteId=null===(r=Fe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Fe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Fe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Fe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Fe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Fe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",P);var O=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var j=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,D=null==e?void 0:e.errors;D&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,ee(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!C(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return _e})).then((function(e){e.importIMA()})),j&&"Safari"==l()&&Promise.resolve().then((function(){return _e})).then((function(e){e.importAirplay()})),E&&fe("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],te("js",new Date),void te("config",e);var e})).catch((function(e){}));var N=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(O));if(N&&N.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g){var L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",V={directPlaybackUrl:g,id:L};y?F(L,P).then((function(i){Le(O,{res:Ne(Ne({},i),V)},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,L)})):Le(O,{res:V},e,{resolve:t,reject:n})}else if(I){var U,z=sessionStorage.getItem("season-idx")||0;W.set(parseInt(z));var G=null==e||null===(U=e.series)||void 0===U?void 0:U.id;M(G,P).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;q(s);var d=T||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var n=new Map;p({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),w(n)})).catch((function(e){return console.log(e)}))}(G,P),F(d,P).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(i.data),Le(O,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))})).catch((function(e){B(e,O,n)}))}else if(b){var J=null==e?void 0:e.epg;_(J,P).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==J?void 0:J.channelId,Le(O,{res:o},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}else F(T,P).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==i?void 0:i.data);var s,d=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable)if((null===(s=e.watchHistory)||void 0===s?void 0:s.saveOffline)||!1){var u,v,f,m=function(e,t,n){var i=Ie(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(u=e.watchHistory)||void 0===u?void 0:u.profileId)||"",T,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;d.contentType="video",Le(O,{res:d},e,{resolve:t,reject:n})}else H(T,P).then((function(i){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",Le(O,{res:d},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Le(O,{res:d},e,{resolve:t,reject:n})}));else Le(O,{res:d},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}}))},getRenditions:Z,skip:g,getPlayer:a,play:y,pause:b,detectBrowser:l,rewind:T,loadVideo:u,seekToTimeStamp:Y,isPlayerInitialised:k,load:I,authenticateLC:P,dispose:O,enableCaptions:j,disableCaptions:S,getCaptions:E,playSelectedResolution:$,getSource:d,setVolume:Pe,getVolume:Oe,disableControls:D,setPlaybackSpeed:X}}export{Ve as default};
|
|
1
|
+
import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"axios";import{g as o,a as r,d as l,b as a,s,c as d,l as u,e as c,f as v,h as f,i as m,j as p,k as w,m as h,n as g,p as y,o as b,r as T,q as k,t as I,u as P,v as O,w as j,x as S,y as E,z as D,A,B as R,C as x,D as C,E as F,F as B,G as M,H as _,I as H,J as N,K as L,L as V,M as U,N as W,O as q}from"./generic-30a350ab.js";import z from"video.js";import G from"@babel/runtime/helpers/typeof";import{o as J,g as K,a as Q,s as Y,b as X}from"./util-814500d5.js";import{g as Z}from"./renditions-9e4f9b98.js";import{playSelectedResolution as $}from"./resolution-3396f48a.js";import{s as ee}from"./localisation-0bf399a1.js";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";function te(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function ne(e,t){te("event",e,t)}function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function oe(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ie(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var re=function(){var e,t,n,i;return(null===(e=r())||void 0===e||null===(t=e.video)||void 0===t||null===(n=t.gist)||void 0===n?void 0:n.id)||(null===(i=r())||void 0===i?void 0:i.id)};function le(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function ae(){var e=window.sessionStorage.getItem("uid");return e||(e=le(),window.sessionStorage.setItem("uid",e),e)}function se(){return de.apply(this,arguments)}function de(){return de=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(!(t=e.sent)){e.next=10;break}if(null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=9;break}return e.abrupt("return","guest-user");case 9:return e.abrupt("return",null==i?void 0:i.userId);case 10:return e.abrupt("return","guest-user");case 11:case"end":return e.stop()}}),e)}))),de.apply(this,arguments)}window.initialise=function(e){window.sid=le(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());ne(r?"FAILED_TO_START":"DROPPED_STREAM",oe({pfm:window.platform,uid:ae(),vid:re(),videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),ne("PLAY",oe({pfm:window.platform,uid:ae(),vid:re(),videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){var t,n;null!=e&&null!==(t=e.el_)&&void 0!==t&&null!==(n=t.className)&&void 0!==n&&n.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))ne("BUFFERING",oe({pfm:window.platform,uid:ae(),vid:re(),videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,ne("FIRST_FRAME",oe({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),vid:re()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;ne("AD_REQUEST",oe({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),vid:re(),resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),ne("AD_IMPRESSION",oe({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:ae(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:re()},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(ue(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var ue=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,m,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=oe,e.t1=oe,e.t2=oe({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=ae(),e.t5=re(),e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,se();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),m=[e.t31],e.next=37,o();case 37:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:m}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var ce,ve,fe=function(e){return new Promise((function(t,n){if(me(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},me=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},pe=function(){var e=t(n.mark((function e(t){var i,o,r,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=20;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return s=e.sent,e.prev=5,e.next=8,fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),console.log("Error",e.t0);case 13:return e.prev=13,s.default(z),e.finish(13);case 16:null!==(r=window)&&void 0!==r&&r.cast?null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=21;break;case 20:console.log("Chromecast plugin is not available");case 21:null!=t&&t.airplay&&"Safari"==l()?null==o||o.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 22:case"end":return e.stop()}}),e,null,[[5,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),we=function(e,t){var n=a(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=z.dom.getPointerPosition(a,t).x;z.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ge(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?he(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):he(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ye=[],be=0,Te=null;function ke(t,n,i){var o,l,a,d,u,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ve=(null==n||null===(o=n.watchHistory)||void 0===o?void 0:o.apiVersion)||"v1";var v=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,f=Math.floor(t.currentTime()),m=Math.floor(t.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,w=(null==n||null===(d=n.video)||void 0===d?void 0:d.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,g=Math.floor(t.currentTime()),y=c?100:Math.floor(f/m*100),b={};h?function(t,n,i){var o=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(i),l=Ie(o),a=(new Date).getTime(),s=r(),d=(null==s?void 0:s.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(t,n){return ge(ge({},t),{},e({},n,d[n]))}),{}),c=l.findIndex((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===ce}));c<0?l.push(ge(ge({content:u},t),{},{addedDate:a,updateDate:a})):l[c]=ge(ge(ge({},l[c]),t),{},{updateDate:a});localStorage.setItem("".concat(o),JSON.stringify(l))}(b={completed:c,watchedTime:g,watchedPercentage:y},v,n.siteOwner):("v1"==ve?b={videoId:ce,watchedTime:g,watchedPercentage:y,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==ve&&(b=ge(ge({videoId:ce,watchedTime:g,watchedPercentage:y,doneWatching:c,profileId:v},Te&&{seriesId:Te}),w&&{originalObjectId:w})),s(b,ve).then((function(e){})).catch((function(e){}))),be=f+i}function Ie(e){var t=[];return e&&(t=JSON.parse(localStorage.getItem("".concat(e))||"[]")),t}var Pe=function(e,t,n){var i=a(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},Oe=function(e){var t=a(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},je=!1,Se=function(e,t){var n,i,o=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(n=e[o])||void 0===n||null===(i=n.streamingInfo)||void 0===i?void 0:i.secondaryVideoAssets)||null)&&!je){var r=Ee(e,"videoAssets","secondaryVideoAssets"),l=d(r,t);return l&&u(t,l),je=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function Ee(e,t,n){if(Array.isArray(e))return e.map((function(e){return Ee(e,t,n)}));if(null!==e&&"object"===G(e)){var i={};return Object.keys(e).forEach((function(o){o===t&&void 0!==e[n]?i[o]=e[n]:o===n&&void 0!==e[t]?i[o]=e[t]:i[o]=Ee(e[o],t,n)})),i}return e}function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ae(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?De(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):De(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Re=function(e,t,n,i){var o,l,s=i.res,d=i.sres,u=a(e),p=(null==s?void 0:s.contentType)||"video",w=(null==s||null===(o=s[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(s),u&&(u.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:s})})),u.on("loadeddata",(function(){var i,o;(null==u||!u.muted())&&Pe(e,sessionStorage.getItem("volume")||"100");var l=r();if(v(),n.resolve(Ae({status:!0,msg:"Player Initialised"},d?{seriesResponse:d,response:s}:{response:s})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(o=t.watchHistory)&&void 0!==o&&o.saveOffline)){var c,f,m=Ae(Ae({},t),s);!function(e,t,n){var i,o,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(Te=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ye=[],be=0,ce=n;var l=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=a(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ye.includes(be)||(e==be?(ye.push(e),ke(s,t,l)):e>be&&(be=e+l))})),s.one("ended",(function(){ke(s,t,l,!0)})))}(e,m,null==l||null===(c=l.video)||void 0===c||null===(f=c.gist)||void 0===f?void 0:f.id)}})),u.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",t)})),u.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,f=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,m=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===f){var p,w=m.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),u.on("loadedmetadata",(function(){window.endFirstFrame(u)})),u.tech_.on("retryplaylist",(function(){w&&Se(s,e)})),u.on("error",(function(){var t,i;4===u.error().code&&w?Se(s,e):(f(e,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==u||null===(i=u.error())||void 0===i?void 0:i.message)||"Some error occured"}))})),u.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,l=null===(n=r())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,a=m().get(l)||{t:0,p:0},s=a.t,d=a.p;s&&d<95&&setTimeout((function(){u.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){u.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),u.on("volumechange",(function(){var e=100*u.volume().toFixed(2);u.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),u.on("chromecastDisconnected",(function(){if(w){u.currentSource();for(var e=u.textTracks(),t=e.length-1;t>=0;t--)u.removeRemoteTextTrack(e[t])}})))},xe=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-85b3ae06.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-99f72a1b.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-a91b517c.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-d696bdf9.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n?import("./skin-e7d692fb.js").then((function(n){n.initialiseSkin(e,t)})):"minimalist"==n&&import("./skin-2d53e012.js").then((function(n){n.initaliseSkin(e,t)}))},Ce=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Fe,Be=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Me=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){z.getPlugin("eme")||z.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){fe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(z)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(z)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),fe("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Be,loadEMELibrary:Me});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 Ne(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 Le=function(i,o,r,s){var c,v,m,p,w,h,g,y,b,T,k,I,P,O,j,S,E,A,R,x,C,F,B,M,_,H,W,q,G,J,K,Q,Y,X=o.res,Z=void 0===X?null:X,$=o.sres,ee=void 0===$?null:$;null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(p=m.CastContext)||void 0===p||null===(w=p.getInstance())||void 0===w||w.S;var te=null!=r&&r.chromecastReceiverId?["chromecast","html5"]:["html5"],ne=(null===(h=Z)||void 0===h?void 0:h.contentType)||"video",ie=N(null===(g=Z)||void 0===g||null===(y=g[ne])||void 0===y||null===(b=y.gist)||void 0===b?void 0:b.videoImageUrl)||N(null===(T=Z)||void 0===T||null===(k=T[ne])||void 0===k||null===(I=k.gist)||void 0===I||null===(P=I.imageGist)||void 0===P?void 0:P.r16x9),oe=(null===(O=Z)||void 0===O||null===(j=O[ne])||void 0===j||null===(S=j.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,re=(null===(E=Z)||void 0===E||null===(A=E[ne])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,le=(null==r?void 0:r.drmLibrary)||!1,ae=(null===(x=Z)||void 0===x||null===(C=x.ads)||void 0===C||null===(F=C.preRoll)||void 0===F||null===(B=F.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(_=Z)||void 0===_||null===(H=_.ads)||void 0===H||null===(W=H.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(G=q.web)||void 0===G?void 0:G.url);Z=Ne(Ne({},Z),{},{audioAssetSource:null==r?void 0:r.audioAssetSource});var se=(Y={controls:0!=(null==r?void 0:r.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==r?void 0:r.muted)||!1,autoplay:(null==r?void 0:r.autoplay)||!1,controlBar:{volumePanel:("default"==r.skin||"defaultV2"==r.skin||"live"==(null==r?void 0:r.skin))&&{inline:!1},fullscreenToggle:"default"==r.skin||"defaultV2"==r.skin,audioTrackButton:!1,pictureInPictureToggle:(r.skin,!1)},muteToggle:"multiplayer"==r.skin,liveui:oe},e(Y,"autoplay",null==r?void 0:r.autoplay),e(Y,"normalizeAutoplay",(null==r?void 0:r.autoplay)&&!ae),e(Y,"loop",(null==r?void 0:r.loop)||!1),e(Y,"audioPosterMode",null==r?void 0:r.audioPosterMode),e(Y,"html5",Ne(Ne({dash:Ne(Ne({},!z.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:Ne(Ne({experimentalLLHLS:(null==r?void 0:r.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==r||null===(J=r.customData)||void 0===J?void 0:J.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==r?void 0:r.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==r?void 0:r.experimentalBufferBasedABR)||!1})},0==(null==r||null===(K=r.customData)||void 0===K?void 0:K.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==r||null===(Q=r.customData)||void 0===Q?void 0:Q.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Y,"poster",ie),e(Y,"techOrder",te),e(Y,"chromecast",{requestCustomDataFn:function(e){var t=a(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,f=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[f]&&null!=e&&e[f].drmEnabled){m.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=w}var h=(null==e||null===(i=e[f])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var g=null==e||null===(r=e[f])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=g;var y=null==e||null===(a=e[f])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=y;var b=null==e||null===(d=e[f])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return m.mediaImage=b,m.subTitles=n,m.DVR=(null==e||null===(c=e[f])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(Z,e,n)}}),Y),de=z(i,se,function(){var e=t(n.mark((function e(){var t,o,a,c,v,m,p,w,h,g,y,b,T,k,I,P,O,j,S,E,A,R,x,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pe(r);case 2:if(re&&s.resolve(Ne({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&Ce(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(z.options.vhs.overrideNative=!0),k=null===(t=Z)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,I=null===(a=Z)||void 0===a||null===(c=a[ne])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.startOverTime,!k&&!le){e.next=22;break}if("Safari"!==l()){e.next=15;break}return e.next=13,Me();case 13:e.next=22;break;case 15:if("caliente"!=(null===(P=window)||void 0===P?void 0:P.siteName)){e.next=20;break}return e.next=18,Me();case 18:e.next=22;break;case 20:return e.next=22,Be();case 22:if(null==r||!r.videoSourceUrl){e.next=25;break}return e.next=25,Be();case 25:oe&&we(i,I),!ae||null!=r&&null!==(m=r.customData)&&void 0!==m&&m.disableAds||L(i,ae,Z),O=d(Z,i),null!=r&&r.nearestClusterUrl&&(O=V(O,r.nearestClusterUrl)),O?u(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),f(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=Z)||void 0===p||null===(w=p[ne])||void 0===w||null===(h=w.contentDetails)||void 0===h||null===(g=h.closedCaptions)||void 0===g?void 0:g.length)>0||(null===(y=Z)||void 0===y||null===(b=y[ne])||void 0===b||null===(T=b.closedCaptions)||void 0===T?void 0:T.length)>0)&&(C=(null===(S=Z)||void 0===S||null===(E=S[ne])||void 0===E||null===(A=E.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=Z)||void 0===R||null===(x=R[ne])||void 0===x?void 0:x.closedCaptions),j=C.filter((function(e){return"VTT"===e.format})),U(i,j)),null!=r&&r.disableControls?D(i):xe(i,Ne(Ne(Ne({},r),se),{},{liveVideo:re,isDvrEnabled:oe,res:Z,sres:ee})),Re(i,Ne(Ne(Ne({},r),se),{},{liveVideo:re}),s,{res:Z,sres:ee});case 33:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Ve(){return{loadVideoInstantly:h,onTimeUpdate:J,getVideoDuration:K,onVideoEnded:Q,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,f,m,h;if(!k(null==e?void 0:e.playerId)){var g=(null==e?void 0:e.videoSourceUrl)||!1,y=null==e?void 0:e.asat,b=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,T=null==e?void 0:e.videoId,I=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=T;var P=null==e?void 0:e.token;if(A(e)){if(R().set(null==e?void 0:e.refreshToken),!P||x(P))return void n({status:!1,msg:"".concat(P?"Token is expired !":"Missing Authorization Token"),response:{token:P}});Fe=JSON.parse(atob(P.split(".")[1]))}window.siteId=null===(r=Fe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Fe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Fe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Fe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Fe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Fe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",P);var O=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var j=null==e?void 0:e.airplay,S=null==e?void 0:e.apiBaseUrl,E=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,D=null==e?void 0:e.errors;D&&(window.customErrors=D),window.customData=null==e?void 0:e.customData,ee(null==e||null===(m=e.customData)||void 0===m?void 0:m.localisation),S&&(window.playerEntitlementUrl=S),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!C(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return _e})).then((function(e){e.importIMA()})),j&&"Safari"==l()&&Promise.resolve().then((function(){return _e})).then((function(e){e.importAirplay()})),E&&fe("https://www.googletagmanager.com/gtag/js?id=".concat(E)).then((function(){return e=E,window.dataLayer=window.dataLayer||[],te("js",new Date),void te("config",e);var e})).catch((function(e){}));var N=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(O));if(N&&N.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g){var L="c09576ca-8202-4e8e-ba1e-06d1ab0ce063",V={directPlaybackUrl:g,id:L};y?F(L,P).then((function(i){Le(O,{res:Ne(Ne({},i),V)},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,L)})):Le(O,{res:V},e,{resolve:t,reject:n})}else if(I){var U,z=sessionStorage.getItem("season-idx")||0;W.set(parseInt(z));var G=null==e||null===(U=e.series)||void 0===U?void 0:U.id;M(G,P).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;q(s);var d=T||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var n=new Map;p({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),w(n)})).catch((function(e){return console.log(e)}))}(G,P),F(d,P).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(i.data),Le(O,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))})).catch((function(e){B(e,O,n)}))}else if(b){var J=null==e?void 0:e.epg;_(J,P).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",o.channelId=null==J?void 0:J.channelId,Le(O,{res:o},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}else F(T,P).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==i?void 0:i.data);var s,d=null==i?void 0:i.data;if(null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable)if((null===(s=e.watchHistory)||void 0===s?void 0:s.saveOffline)||!1){var u,v,f,m=function(e,t,n){var i=Ie(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(n)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===t}))),o}((null===(u=e.watchHistory)||void 0===u?void 0:u.profileId)||"",T,null==e?void 0:e.siteOwner);if(m&&m.length)e.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,e.watchedPercentage=(null===(f=m[0])||void 0===f?void 0:f.watchedPercentage)||null;d.contentType="video",Le(O,{res:d},e,{resolve:t,reject:n})}else H(T,P).then((function(i){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",Le(O,{res:d},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Le(O,{res:d},e,{resolve:t,reject:n})}));else Le(O,{res:d},e,{resolve:t,reject:n})})).catch((function(e){B(e,O,n,T)}))}}))},getRenditions:Z,skip:g,getPlayer:a,play:y,pause:b,detectBrowser:l,rewind:T,loadVideo:u,seekToTimeStamp:Y,isPlayerInitialised:k,load:I,authenticateLC:P,dispose:O,enableCaptions:j,disableCaptions:S,getCaptions:E,playSelectedResolution:$,getSource:d,setVolume:Pe,getVolume:Oe,disableControls:D,setPlaybackSpeed:X}}export{Ve as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=".tvProviderImage{\n position: absolute;\n right: 1rem;\n top: 1rem;\n max-height: 100px;\n max-width: 100px;\n}\n.tvProviderImage>img{\n height: 100%;\n width: 100%;\n}\n.vjs-button>.vjs-icon-placeholder:before {\n font-size: 2.2em;\n line-height: 2.6;\n}\n.vjs-control-bar{\n z-index: 1 !important;\n height: 6em !important;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%) !important;\n}\n\n.vjs-fade>* {\n visibility: hidden !important;\n opacity: 0 !important;\n transition: visibility 1s, opacity 1s !important;\n}\n\n.video-js .vjs-progress-control {\n left: -6px;\n position: absolute;\n width: 100%;\n height: 0.5em;\n top: -0.5em;\n transition: height .1s,top .1s;\n}\n\n.video-js .vjs-custom-control-spacer {\n display: block;\n flex: 1 1 auto;\n}\n\n.vjs-remaining-time.vjs-time-control.vjs-control {\n position: absolute;\n right: 0;\n bottom: 18px;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 41px 0 14px;\n}\n.vjs-remaining-time.vjs-time-control.vjs-control{\n display: none;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button {\n font-size: 14px;\n font-weight: 500;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder{\n height: 6px !important;\n}\n\n.video-js .vjs-play-progress:before {\n font-size: 1.9em;\n display: none;\n}\n\n.video-js .vjs-current-time { display: block; }\n\n.video-js .vjs-current-time {\n display: block;\n position: absolute;\n right: 0em;\n bottom: 1.8em;\n font-size: 12px;\n font-weight: 600;\n}\n\n.video-js .vjs-button{\n width: 6em;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button{\n align-self: center;\n height: min-content;\n padding: 5px 2px;\n border-radius: 8px;\n}\n\n\n.vjs-fullscreen .icon-minimize,\n.icon-maximize {\n display: block;\n height: 32px;\n}\n\n.vjs-fullscreen .icon-maximize,\n.icon-minimize {\n display: none;\n height: 32px;\n}\n\nbutton.vjs-play-control.vjs-control.vjs-button{\n outline: none !important;\n}\n\n.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,\n.vjs-icon-fullscreen-enter:before {\n content: '' !important;\n}\n\n.video-js button.vjs-fullscreen-control.vjs-control.vjs-button {\n display: flex;\n justify-content: center;\n align-items: center;\n transform: rotate(90deg);\n}\n\n.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before{\n display: none;\n}\n.video-js .vjs-volume-panel .vjs-volume-control{\n margin-left: -10px;\n}\n\n.skipbtn:hover{\n cursor: pointer;\n}\n\n.rewindbtn:hover{\n cursor: pointer;\n}\n\n.vjs-live-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 1.8em !important;\n font-weight: 700 !important;\n font-size: 11px !important;\n}\n\n.vjs-seek-to-live-control.vjs-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 3.2em !important;\n}\n\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display:none;\n}\n\n.video-js.vjs-paused .vjs-big-play-button {\n width: 90px;\n height: 90px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n font-size: 6em;\n line-height: 1.3em;\n}\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{\n font-weight: bold;\n}\n\n.vjs-menu > ul.vjs-menu-content{\n bottom: 3.5em !important;\n right: -1em;\n}\n\n.video-js .vjs-chromecast-button .vjs-icon-placeholder {\n width: 17px !important;\n height: 17px !important;\n}\n\n.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-control.vjs-button{\n /* display: flex;\n justify-content: center;\n align-items: center; */\n display: none;\n}\n\nbutton.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-button{\n height: min-content;\n width: min-content;\n}\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical{\n width: 6em;\n}\n\n.video-js .content{\n bottom: 3.4rem !important;\n right: -4rem !important; \n}\n\n.setting-icon > svg{\n height:18px !important;\n}\n\n.output-overlay{\n position: absolute;\n bottom: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n border: 0;\n pointer-events:none\n}\n\niframe{\n width: 100%;\n height: 100%;\n}\n\n\n@media(max-width:600px){\n .tvProviderImage{\n display: none\n }\n.vjs-fullscreen .icon-minimize,\n .icon-maximize {\n height: 30px !important;\n }\n\n .vjs-fullscreen .icon-maximize,\n .icon-minimize {\n height: 30px !important;\n }\n\n button.vjs-fullscreen-control.vjs-control.vjs-button>span.vjs-icon-placeholder::before {\n height: min-content;\n }\n\n .vjs-seek-to-live-control.vjs-control{\n position: relative !important;\n right: 0em !important;\n bottom: 0 !important;\n }\n\n .video-js .vjs-progress-control{\n top: -0.85em;\n }\n .vjs-live-control{\n right: -1em !important;\n position: relative !important;\n bottom: 0 !important;\n font-size: 12px !important;\n }\n button.vjs-slowmo-button{\n display: none;\n }\n button.vjs-rewind-button{\n display: none;\n }\n button.vjs-rewind-button>svg{\n height: 20px;\n }\n .video-js .vjs-button{\n width: 4.8em;\n }\n .video-js .widget-selection{\n display: none;\n }\n .video-js .container{\n display: none !important;\n }\n .video-js .vjs-control-bar{\n height: 4em !important;\n }\n .video-js .vjs-button>.vjs-icon-placeholder:before{\n font-size: 2.5em;\n line-height: 1.5;\n }\n .video-js .vjs-play-progress:before {\n font-size: 1.2em;\n position: absolute;\n right: -0.5em;\n /* top: -0.3333333333em; */\n z-index: 1;\n}\nbutton.vjs-skip-button>svg{\n height: 20px;\n}\nbutton.vjs-big-play-button {\n width: 50px !important;\n height: 50px !important;\n font-size: 2.1rem !important;\n}\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display: block;\n}\n\n.stream-selector-icon>svg{\n width: 24px;\n height: 24px;\n}\n.video-js.vjs-live .vjs-progress-control .vjs-progress-holder{\n margin: 0 12px 0 21px;\n}\n.vjs-seek-to-live-text{\n font-size: 12px;\n}\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 40px 0px 21px;\n}\n.video-js .vjs-current-time{\n bottom: 2em !important;\n}\n}";export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,j as t,k as n,g as r,h as i,d as l,l as o,m as a,n as s,o as u}from"./features-25f8bfd9.js";import{M as c,a as d,c as m,d as p}from"./icons-3e9a1686.js";import{R as v,b as f,S as h,a as g,y,Q as b,d as x}from"./generic-30a350ab.js";import{g as w}from"./renditions-9e4f9b98.js";import E from"@babel/runtime/helpers/toConsumableArray";import{s as C}from"./autoNextVideo-a74ccb76.js";import N from"@babel/runtime/helpers/typeof";import k from"video.js";import j from"@babel/runtime/helpers/asyncToGenerator";import T from"@babel/runtime/regenerator";import B from"@babel/runtime/helpers/slicedToArray";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"./localisation-0bf399a1.js";import"axios";import"js-cookie";import"ua-parser-js";import"./util-814500d5.js";var A=v(),M=[];null==A||A.map((function(e){return M.push.apply(M,E(e.episodes))}));var I,L,O,P,R=function(e,t){var n=f(e),r=Math.floor(n.currentTime());if(Math.floor(n.duration())!=r){n.pause(e);var i=h();C(i,e,M)}};function S(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function V(e){return X.apply(this,arguments)}function X(){return(X=j(T.mark((function e(t){return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),l=B(i,2),o=l[0],a=l[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var l=i.width/a,s=i.height/o,u=0;u<o;u++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=l,d.height=s,d.getContext("2d").drawImage(i,c*l,u*s,l,s,0,0,l,s);var m=d.toDataURL("image/png");r.push({uri:m,duration:t.duration})}e(r)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(e){return D.apply(this,arguments)}function D(){return(D=j(T.mark((function e(t){var n,r;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",S(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function U(e){return G.apply(this,arguments)}function G(){return(G=j(T.mark((function e(t){var n,r;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return V(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n=e.duration;r[n*t]={src:e.uri,style:{left:"-60px",height:"68px",width:"120px"}}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}I={0:{src:"example-thumbnail.png"}},L=function e(){var t,n,r,i,l;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[r])i.hasOwnProperty(l)&&("object"===N(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},O=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},P=function e(t){return"HTML"!==t.nodeName&&"static"===O(t)("position")?e(t.offsetParent):t},k.registerPlugin("thumbnails",(function(e){var t,n,r,i,l,o,a,s;n=L({},I,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",L(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",(function(e){o=i.duration()})),i.on("loadedmetadata",(function(e){o=i.duration()})),(l=i.controlBar.progressControl).el().appendChild(t),a=function(e){var i,a,s,u,c,d,m,p,v,f;for(a in s=0,v=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,m=((f=P(l.el()).getBoundingClientRect()).width||f.right)+v,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),u=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,u-=P(l.el()).getBoundingClientRect().left+v,i=Math.floor((u-l.el().offsetLeft)/l.width()*o),n)i>a&&(s=Math.max(s,a));(c=n[s]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&L(r.style,c.style),u+(p=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=O(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>m?u-=u+p-m:u<p&&(u=p),t.style.left=u+"px"},l.on("mousemove",a),l.on("touchmove",a),s=function(e){t.style.left="-1000px"},l.on("mouseout",s),l.on("touchcancel",s),l.on("touchend",s),i.on("userinactive",s)}));var W=function(){var e=j(T.mark((function e(t,n){var r,i,l,o;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,l=i.split("\n"),o=[],l.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&l[n-1].includes("#EXT-X-TILES")&&(l[n-1]=l[n-1].split(","),r.uri=t+e,l[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=B(t,2),i=n[0],l=n[1];i=i.toLowerCase(),r[i]=l}))})),o.push(r))})),e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function $(e){return _.apply(this,arguments)}function _(){return(_=j(T.mark((function e(t){var n,r,i,l,o,a,s,u,c,d,m,p,v,f,h,y,b,x,w,E,C,N;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.split("/").slice(0,t.split("/").indexOf("dash")+1).join("/")||t,e.prev=1,e.next=4,fetch(t);case 4:return l=e.sent,e.next=7,l.text();case 7:o=e.sent,a=new DOMParser,s=a.parseFromString(o,"application/xml"),u=null===(r=g())||void 0===r||null===(i=r.video)||void 0===i?void 0:i.runtime,c=s.getElementsByTagName("AdaptationSet"),d=0;case 13:if(!(d<c.length)){e.next=34;break}if("image"!==(m=c[d]).getAttribute("contentType")||"image/png"!==m.getAttribute("mimeType")){e.next=31;break}if(p=m.getElementsByTagName("SegmentTemplate")[0],v=m.getElementsByTagName("Representation")[0],f=v.getElementsByTagName("EssentialProperty")[0],h=f.getAttribute("value"),!p){e.next=31;break}for(p.getAttribute("media"),y=p.getAttribute("duration"),b=p.getAttribute("timescale"),x=y/b,w=Math.round(u/x),E=Math.ceil(w/9),C=p.getAttribute("media"),N=[],d=0;d<E;d++)N.push({duration:x,layout:h,uri:n+"/"+C.replace("$Number$",d)});return e.abrupt("return",N);case 31:d++,e.next=13;break;case 34:return console.log("No trickplay segment found."),e.abrupt("return",null);case 38:e.prev=38,e.t0=e.catch(1),console.error("Error fetching or parsing MPD:",e.t0);case 41:case"end":return e.stop()}}),e,null,[[1,38]])})))).apply(this,arguments)}function z(){return(z=j(T.mark((function e(t){var n,r,i,l,o,a,s,u,c,d,m;return T.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f(t),r=n.currentSource(),null==(i=r.src)||!i.includes("m3u8")){e.next=18;break}return e.next=5,F(i);case 5:if(!((null==(l=e.sent)?void 0:l.length)>0)){e.next=16;break}return o=(null==l?void 0:l[0])||null,a=o.uri,s=n.tech().vhs.playlists.master.uri.substring(0,n.tech().vhs.playlists.master.uri.lastIndexOf("/"))+"/",e.next=11,W(s,a);case 11:return u=e.sent,e.next=14,U(u);case 14:c=e.sent,n.thumbnails(c);case 16:e.next=27;break;case 18:if(null==i||!i.includes("mpd")){e.next=27;break}return e.next=21,$(i);case 21:if(!((null==(d=e.sent)?void 0:d.length)>0)){e.next=27;break}return e.next=25,U(d);case 25:m=e.sent,n.thumbnails(m);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(r,i){var l=f(r);l&&(l.on("loadeddata",(function(){var n,o,a;(null===(n=w(r))||void 0===n?void 0:n.length)>0&&e(r,i),(null===(o=y(r))||void 0===o?void 0:o.length)>0&&t(r,i),null!=i&&null!==(a=i.series)&&void 0!==a&&a.enable&&function(e,t){var n;null==t||null===(n=t.series)||void 0===n||n.cb;var r=f(e);r.on("timeupdate",(function(){var e,t=Math.floor(r.currentTime()),n=r.duration(),i=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-t<=10&&h()<=(null==M?void 0:M.length)-1?i&&(i.style.visibility="visible"):i&&(i.style.visibility="hidden")}));var i,l=M.filter((function(e,t){return t==h()}));if((null==l?void 0:l.length)>0)if(null!==(i=document.getElementsByClassName("next-ep-preview"))&&void 0!==i&&i[0]){var o,a,s,u,c,d,m,p,v,g,y;(null===(o=document.getElementsByClassName("next-ep-preview"))||void 0===o?void 0:o[0]).style.visibility="hidden";var b=null===(a=document.getElementsByClassName("next-ep-title"))||void 0===a?void 0:a[0],x=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],w=null===(u=document.getElementsByClassName("next-ep-content"))||void 0===u?void 0:u[0],E=null===(c=l[0])||void 0===c?void 0:c.title;(null===(d=E)||void 0===d?void 0:d.length)>60&&(E=E.substr(0,60)+"..."),b.textContent="".concat(E),x.src=(null===(m=l[0])||void 0===m||null===(p=m.gist)||void 0===p||null===(v=p.imageGist)||void 0===v?void 0:v.r16x9)||(null===(g=window)||void 0===g||null===(y=g.customData)||void 0===y?void 0:y.fallbackImage),w.onclick=function(){return R(e)}}else{var C,N,k,j,T,B,A,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===(C=l[0])||void 0===C?void 0:C.title,P=document.createElement("img");P.className="next-ep-img",P.src=(null===(N=l[0])||void 0===N||null===(k=N.gist)||void 0===k||null===(j=k.imageGist)||void 0===j?void 0:j.r16x9)||(null===(T=window)||void 0===T||null===(B=T.customData)||void 0===B?void 0:B.fallbackImage);var S=document.createElement("div");S.className="next-ep-title",(null===(A=O)||void 0===A?void 0:A.length)>60&&(O=O.substr(0,60)+"..."),S.textContent="".concat(O);var V=document.createElement("div");V.className="next-ep-content",V.append(P),V.append(S),V.onclick=function(){return R(e)},I.append(L),I.append(V)}}(r,i),function(e,t){var n,r=Math.floor(e/60),i=null===(n=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===n?void 0:n[0];i&&(i.style.marginRight=r>60?"56px":"41px");var l=document.getElementsByClassName("vjs-live-control")[0],o=document.getElementsByClassName("vjs-time-control");t&&l.classList.value.includes("vjs-hidden")&&(o[0].style.display="block",i&&(i.style.marginRight="56px"))}(l.duration(),(null==i?void 0:i.liveVideo)||!1),null!=i&&i.liveVideo||function(e){z.apply(this,arguments)}(r)})),l.one("play",(function(){var e,t,i,l;null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.iframeOverlayUrl&&n(r,null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.iframeOverlayUrl)})))}function Q(e,t){!function(){"Chrome"==x()&&import("./chromett-a3cbb2e1.js").then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));import("./skin-25c03649.js").then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),H(e,t),function(e,t){var n,r,i,l,o,a,s=f(e);null==s||null===(n=s.controlBar)||void 0===n||null===(r=n.getChild("FullscreenToggle"))||void 0===r||null===(i=r.el())||void 0===i||i.appendChild(b(c(window.controlsColor))),null==s||null===(l=s.controlBar)||void 0===l||null===(o=l.getChild("FullscreenToggle"))||void 0===o||null===(a=o.el())||void 0===a||a.appendChild(b(d(window.controlsColor)));var u=document.getElementsByClassName("vjs-time-control");t.liveVideo&&u[0]&&(u[0].style.display="none")}(e,t),function(e,t){var n,c,d,v,f,h;0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)&&r(e,"defaultV2",m());(0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)||1==(null==t?void 0:t.liveui))&&i(e,"defaultV2",p());t.liveVideo||l(e);(null==t||null===(n=t.relatedVideos)||void 0===n||null===(c=n.content)||void 0===c?void 0:c.length)>0&&o(e,null==t?void 0:t.relatedVideos);(null==t||null===(d=t.streams)||void 0===d?void 0:d.length)>1&&a(e,null==t?void 0:t.streams);(null==t||null===(v=t.playlist)||void 0===v||null===(f=v.content)||void 0===f?void 0:f.length)>0&&s(e,null==t?void 0:t.playlist);null!=t&&null!==(h=t.series)&&void 0!==h&&h.enable&&u(e,t)}(e,t),function(e,t){var n=f(e),r=null==t?void 0:t.tvProviderLogoUrl;if(!r)return;var i=document.createElement("div");i.className="tvProviderImage";var l=document.createElement("img");l.src="".concat(r),l.alt="Provider Image",i.append(l),n.el().appendChild(i),n.on("useractive",(function(){i.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||i.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?i.style.top="3.2rem":i.style.top="1rem"}))}(e,t)}export{Q as initialiseSkin};
|
package/package.json
CHANGED
package/cjs/skin-8fa76c87.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.default=".tvProviderImage{\n position: absolute;\n right: 1rem;\n top: 1rem;\n max-height: 100px;\n max-width: 100px;\n}\n.tvProviderImage>img{\n height: 100%;\n width: 100%;\n}\n.vjs-button>.vjs-icon-placeholder:before {\n font-size: 2.2em;\n line-height: 2.6;\n}\n.vjs-control-bar{\n z-index: 1 !important;\n height: 6em !important;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%) !important;\n}\n\n.vjs-fade>* {\n visibility: hidden !important;\n opacity: 0 !important;\n transition: visibility 1s, opacity 1s !important;\n}\n\n.video-js .vjs-progress-control {\n left: -6px;\n position: absolute;\n width: 100%;\n height: 0.5em;\n top: -0.5em;\n transition: height .1s,top .1s;\n}\n\n.video-js .vjs-custom-control-spacer {\n display: block;\n flex: 1 1 auto;\n}\n\n.vjs-remaining-time.vjs-time-control.vjs-control {\n position: absolute;\n right: 0;\n bottom: 18px;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 41px 0 14px;\n}\n.vjs-remaining-time.vjs-time-control.vjs-control{\n display: none;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button {\n font-size: 14px;\n font-weight: 500;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder{\n height: 6px !important;\n}\n\n.video-js .vjs-play-progress:before {\n font-size: 1.9em;\n}\n\n.video-js .vjs-current-time { display: block; }\n\n.video-js .vjs-current-time {\n display: block;\n position: absolute;\n right: 0em;\n bottom: 1.8em;\n font-size: 12px;\n font-weight: 600;\n}\n\n.video-js .vjs-button{\n width: 6em;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button{\n align-self: center;\n height: min-content;\n padding: 5px 2px;\n border-radius: 8px;\n}\n\n\n.vjs-fullscreen .icon-minimize,\n.icon-maximize {\n display: block;\n height: 32px;\n}\n\n.vjs-fullscreen .icon-maximize,\n.icon-minimize {\n display: none;\n height: 32px;\n}\n\nbutton.vjs-play-control.vjs-control.vjs-button{\n outline: none !important;\n}\n\n.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,\n.vjs-icon-fullscreen-enter:before {\n content: '' !important;\n}\n\n.video-js button.vjs-fullscreen-control.vjs-control.vjs-button {\n display: flex;\n justify-content: center;\n align-items: center;\n transform: rotate(90deg);\n}\n\n.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before{\n display: none;\n}\n.video-js .vjs-volume-panel .vjs-volume-control{\n margin-left: -10px;\n}\n\n.skipbtn:hover{\n cursor: pointer;\n}\n\n.rewindbtn:hover{\n cursor: pointer;\n}\n\n.vjs-live-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 1.8em !important;\n font-weight: 700 !important;\n font-size: 11px !important;\n}\n\n.vjs-seek-to-live-control.vjs-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 3.2em !important;\n}\n\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display:none;\n}\n\n.video-js.vjs-paused .vjs-big-play-button {\n width: 90px;\n height: 90px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n font-size: 6em;\n line-height: 1.3em;\n}\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{\n font-weight: bold;\n}\n\n.vjs-menu > ul.vjs-menu-content{\n bottom: 3.5em !important;\n right: -1em;\n}\n\n.video-js .vjs-chromecast-button .vjs-icon-placeholder {\n width: 17px !important;\n height: 17px !important;\n}\n\n.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-control.vjs-button{\n /* display: flex;\n justify-content: center;\n align-items: center; */\n display: none;\n}\n\nbutton.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-button{\n height: min-content;\n width: min-content;\n}\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical{\n width: 6em;\n}\n\n.video-js .content{\n bottom: 3.4rem !important;\n right: -4rem !important; \n}\n\n.setting-icon > svg{\n height:18px !important;\n}\n\n.output-overlay{\n position: absolute;\n bottom: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n border: 0;\n pointer-events:none\n}\n\niframe{\n width: 100%;\n height: 100%;\n}\n\n\n@media(max-width:600px){\n .tvProviderImage{\n display: none\n }\n.vjs-fullscreen .icon-minimize,\n .icon-maximize {\n height: 30px !important;\n }\n\n .vjs-fullscreen .icon-maximize,\n .icon-minimize {\n height: 30px !important;\n }\n\n button.vjs-fullscreen-control.vjs-control.vjs-button>span.vjs-icon-placeholder::before {\n height: min-content;\n }\n\n .vjs-seek-to-live-control.vjs-control{\n position: relative !important;\n right: 0em !important;\n bottom: 0 !important;\n }\n\n .video-js .vjs-progress-control{\n top: -0.85em;\n }\n .vjs-live-control{\n right: -1em !important;\n position: relative !important;\n bottom: 0 !important;\n font-size: 12px !important;\n }\n button.vjs-slowmo-button{\n display: none;\n }\n button.vjs-rewind-button{\n display: none;\n }\n button.vjs-rewind-button>svg{\n height: 20px;\n }\n .video-js .vjs-button{\n width: 4.8em;\n }\n .video-js .widget-selection{\n display: none;\n }\n .video-js .container{\n display: none !important;\n }\n .video-js .vjs-control-bar{\n height: 4em !important;\n }\n .video-js .vjs-button>.vjs-icon-placeholder:before{\n font-size: 2.5em;\n line-height: 1.5;\n }\n .video-js .vjs-play-progress:before {\n font-size: 1.2em;\n position: absolute;\n right: -0.5em;\n /* top: -0.3333333333em; */\n z-index: 1;\n}\nbutton.vjs-skip-button>svg{\n height: 20px;\n}\nbutton.vjs-big-play-button {\n width: 50px !important;\n height: 50px !important;\n font-size: 2.1rem !important;\n}\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display: block;\n}\n\n.stream-selector-icon>svg{\n width: 24px;\n height: 24px;\n}\n.video-js.vjs-live .vjs-progress-control .vjs-progress-holder{\n margin: 0 12px 0 21px;\n}\n.vjs-seek-to-live-text{\n font-size: 12px;\n}\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 40px 0px 21px;\n}\n.video-js .vjs-current-time{\n bottom: 2em !important;\n}\n}";
|
package/cjs/skin-b89cd1a3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./features-86dad21d.js"),t=require("./icons-515b2da0.js"),n=require("./generic-9d9b0e54.js"),r=require("./renditions-97ea2e48.js"),i=require("@babel/runtime/helpers/toConsumableArray"),l=require("./autoNextVideo-b3777f2f.js"),o=require("@babel/runtime/helpers/typeof"),a=require("video.js"),u=require("@babel/runtime/helpers/asyncToGenerator"),s=require("@babel/runtime/regenerator"),c=require("@babel/runtime/helpers/slicedToArray");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("./localisation-56e0a999.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-cfdeb4de.js");var d=n.getCurrentSeries(),v=[];null==d||d.map((function(e){return v.push.apply(v,i(e.episodes))}));var p,m,f,h,g=function(e,t){var r=n.getPlayer(e),i=Math.floor(r.currentTime());if(Math.floor(r.duration())!=i){r.pause(e);var o=n.getVideoIdx();l.switchToNext(o,e,v)}};function y(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),r={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(r.resolution=e.split("=")[1]),e.includes("URI")&&(r.uri=e.split("=")[1].replace(/"/g,""))})),n.push(r)}})),n}function x(e){return w.apply(this,arguments)}function w(){return(w=u(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var r=[],i=t.layout.split("x"),l=c(i,2),o=l[0],a=l[1];n.onload=function(){var i=document.createElement("canvas");i.width=n.width,i.height=n.height,i.getContext("2d").drawImage(n,0,0,i.width,i.height);for(var l=i.width/a,u=i.height/o,s=0;s<o;s++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=l,d.height=u,d.getContext("2d").drawImage(i,c*l,s*u,l,u,0,0,l,u);var v=d.toDataURL("image/png");r.push({uri:v,duration:t.duration})}e(r)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e){return C.apply(this,arguments)}function C(){return(C=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return r=e.sent,e.abrupt("return",y(r));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function E(e){return j.apply(this,arguments)}function j(){return(j=u(s.mark((function e(t){var n,r;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return x(e)})));case 2:return n=e.sent.flat(),r={},n.map((function(e,t){var n=e.duration;r[n*t]={src:e.uri,style:{left:"-60px",height:"68px",width:"120px"}}})),e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}p={0:{src:"example-thumbnail.png"}},m=function e(){var t,n,r,i,l;for(r in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(l in i=t[r])i.hasOwnProperty(l)&&("object"===o(i[l])?n[l]=e(n[l],i[l]):n[l]=i[l]);return n},f=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},h=function e(t){return"HTML"!==t.nodeName&&"static"===f(t)("position")?e(t.offsetParent):t},a.plugin("thumbnails",(function(e){var t,n,r,i,l,o,a,u;n=m({},p,e),i=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=i.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",r=document.createElement("img"),t.appendChild(r),r.src=n[0].src,r.className="vjs-thumbnail",m(r.style,n[0].style),r.style.left||r.style.right||(r.onload=function(){r.style.left=-r.naturalWidth/2+"px"}),o=i.duration(),i.on("durationchange",(function(e){o=i.duration()})),i.on("loadedmetadata",(function(e){o=i.duration()})),(l=i.controlBar.progressControl).el().appendChild(t),a=function(e){var i,a,u,s,c,d,v,p,g,y;for(a in u=0,g=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,v=((y=h(l.el()).getBoundingClientRect()).width||y.right)+g,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),s=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,s-=h(l.el()).getBoundingClientRect().left+g,i=Math.floor((s-l.el().offsetLeft)/l.width()*o),n)i>a&&(u=Math.max(u,a));(c=n[u]).src&&r.src!=c.src&&(r.src=c.src),c.style&&r.style!=c.style&&m(r.style,c.style),s+(p=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=f(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(r,c.width||n[0].width)/2)>v?s-=s+p-v:s<p&&(s=p),t.style.left=s+"px"},l.on("mousemove",a),l.on("touchmove",a),u=function(e){t.style.left="-1000px"},l.on("mouseout",u),l.on("touchcancel",u),l.on("touchend",u),i.on("userinactive",u)}));var q=function(){var e=u(s.mark((function e(t,n){var r,i,l,o;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return r=e.sent,e.next=5,r.text();case 5:return i=e.sent,l=i.split("\n"),o=[],l.forEach((function(e,n){e=e.trim();var r={resolution:null,duration:null,uri:null,layout:null};n>0&&l[n-1].includes("#EXT-X-TILES")&&(l[n-1]=l[n-1].split(","),r.uri=t+e,l[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=c(t,2),i=n[0],l=n[1];i=i.toLowerCase(),r[i]=l}))})),o.push(r))})),e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function N(){return(N=u(s.mark((function e(t){var r,i,l,o,a,u,c,d,v;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.getPlayer(t),i=r.currentSource(),l=i.src,e.next=4,b(l);case 4:if(!((null==(o=e.sent)?void 0:o.length)>0)){e.next=15;break}return a=(null==o?void 0:o[0])||null,u=a.uri,c=r.tech().vhs.playlists.master.uri.substring(0,r.tech().vhs.playlists.master.uri.lastIndexOf("/"))+"/",e.next=10,q(c,u);case 10:return d=e.sent,e.next=13,E(d);case 13:v=e.sent,r.thumbnails(v);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(t,i){var l=n.getPlayer(t);l&&(l.on("loadeddata",(function(){var o,a,u;(null===(o=r.getRenditions(t))||void 0===o?void 0:o.length)>0&&e.addSettingsButtonV2(t,i),(null===(a=n.getCaptions(t))||void 0===a?void 0:a.length)>0&&e.addCaptionButton(t,i),null!=i&&null!==(u=i.series)&&void 0!==u&&u.enable&&function(e,t){var r;null==t||null===(r=t.series)||void 0===r||r.cb;var i=n.getPlayer(e);i.on("timeupdate",(function(){var e,t=Math.floor(i.currentTime()),r=i.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];r-t<=10&&n.getVideoIdx()<=(null==v?void 0:v.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}));var l,o=v.filter((function(e,t){return t==n.getVideoIdx()}));if((null==o?void 0:o.length)>0)if(null!==(l=document.getElementsByClassName("next-ep-preview"))&&void 0!==l&&l[0]){var a,u,s,c,d,p,m,f,h,y,x;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var w=null===(u=document.getElementsByClassName("next-ep-title"))||void 0===u?void 0:u[0],b=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],C=null===(c=document.getElementsByClassName("next-ep-content"))||void 0===c?void 0:c[0],E=null===(d=o[0])||void 0===d?void 0:d.title;(null===(p=E)||void 0===p?void 0:p.length)>60&&(E=E.substr(0,60)+"..."),w.textContent="".concat(E),b.src=(null===(m=o[0])||void 0===m||null===(f=m.gist)||void 0===f||null===(h=f.imageGist)||void 0===h?void 0:h.r16x9)||(null===(y=window)||void 0===y||null===(x=y.customData)||void 0===x?void 0:x.fallbackImage),C.onclick=function(){return g(e)}}else{var j,q,N,B,S,k,I,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(e).append(V);var P=document.createElement("div");P.className="next-ep-header",P.textContent="Next up";var M=null===(j=o[0])||void 0===j?void 0:j.title,T=document.createElement("img");T.className="next-ep-img",T.src=(null===(q=o[0])||void 0===q||null===(N=q.gist)||void 0===N||null===(B=N.imageGist)||void 0===B?void 0:B.r16x9)||(null===(S=window)||void 0===S||null===(k=S.customData)||void 0===k?void 0:k.fallbackImage);var L=document.createElement("div");L.className="next-ep-title",(null===(I=M)||void 0===I?void 0:I.length)>60&&(M=M.substr(0,60)+"..."),L.textContent="".concat(M);var O=document.createElement("div");O.className="next-ep-content",O.append(T),O.append(L),O.onclick=function(){return g(e)},V.append(P),V.append(O)}}(t,i),function(e,t){var n,r=Math.floor(e/60),i=null===(n=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===n?void 0:n[0];i&&(i.style.marginRight=r>60?"56px":"41px");var l=document.getElementsByClassName("vjs-live-control")[0],o=document.getElementsByClassName("vjs-time-control");t&&l.classList.value.includes("vjs-hidden")&&(o[0].style.display="block",i&&(i.style.marginRight="56px"))}(l.duration(),(null==i?void 0:i.liveVideo)||!1),null!=i&&i.liveVideo||function(e){N.apply(this,arguments)}(t)})),l.one("play",(function(){var n,r,i,l;null!==(n=window)&&void 0!==n&&null!==(r=n.customData)&&void 0!==r&&r.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(i=window)||void 0===i||null===(l=i.customData)||void 0===l?void 0:l.iframeOverlayUrl)})))}exports.initialiseSkin=function(r,i){!function(){"Chrome"==n.detectBrowser()&&Promise.resolve().then((function(){return require("./chromett-f925fb6c.js")})).then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));Promise.resolve().then((function(){return require("./skin-8fa76c87.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),B(r,i),function(e,r){var i,l,o,a,u,s,c=n.getPlayer(e);null==c||null===(i=c.controlBar)||void 0===i||null===(l=i.getChild("FullscreenToggle"))||void 0===l||null===(o=l.el())||void 0===o||o.appendChild(n.createIconMarkup(t.MinimizeSvg(window.controlsColor))),null==c||null===(a=c.controlBar)||void 0===a||null===(u=a.getChild("FullscreenToggle"))||void 0===u||null===(s=u.el())||void 0===s||s.appendChild(n.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var d=document.getElementsByClassName("vjs-time-control");r.liveVideo&&d[0]&&(d[0].style.display="none")}(r,i),function(n,r){var i,l,o,a,u,s;0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)&&e.addSkipButton(n,"defaultV2",t.SkipSvgV2());(0==(null==r?void 0:r.liveVideo)&&0==(null==r?void 0:r.liveui)||1==(null==r?void 0:r.liveui))&&e.addRewindButton(n,"defaultV2",t.RewindSvgV2());r.liveVideo||e.addSlowMotion(n);(null==r||null===(i=r.relatedVideos)||void 0===i||null===(l=i.content)||void 0===l?void 0:l.length)>0&&e.addVideoSelector(n,null==r?void 0:r.relatedVideos);(null==r||null===(o=r.streams)||void 0===o?void 0:o.length)>1&&e.addMulticamSelector(n,null==r?void 0:r.streams);(null==r||null===(a=r.playlist)||void 0===a||null===(u=a.content)||void 0===u?void 0:u.length)>0&&e.addPlaylistSelector(n,null==r?void 0:r.playlist);null!=r&&null!==(s=r.series)&&void 0!==s&&s.enable&&e.addSeriesSelectorV2(n,r)}(r,i),function(e,t){var r=n.getPlayer(e),i=null==t?void 0:t.tvProviderLogoUrl;if(!i)return;var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",l.append(o),r.el().appendChild(l),r.on("useractive",(function(){l.classList.remove("vjs-fade")})),r.on("userinactive",(function(){r.paused()||l.classList.add("vjs-fade")})),r.on("fullscreenchange",(function(){r.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"}))}(r,i)};
|
package/esm/skin-808893ac.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n=".tvProviderImage{\n position: absolute;\n right: 1rem;\n top: 1rem;\n max-height: 100px;\n max-width: 100px;\n}\n.tvProviderImage>img{\n height: 100%;\n width: 100%;\n}\n.vjs-button>.vjs-icon-placeholder:before {\n font-size: 2.2em;\n line-height: 2.6;\n}\n.vjs-control-bar{\n z-index: 1 !important;\n height: 6em !important;\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 100%) !important;\n}\n\n.vjs-fade>* {\n visibility: hidden !important;\n opacity: 0 !important;\n transition: visibility 1s, opacity 1s !important;\n}\n\n.video-js .vjs-progress-control {\n left: -6px;\n position: absolute;\n width: 100%;\n height: 0.5em;\n top: -0.5em;\n transition: height .1s,top .1s;\n}\n\n.video-js .vjs-custom-control-spacer {\n display: block;\n flex: 1 1 auto;\n}\n\n.vjs-remaining-time.vjs-time-control.vjs-control {\n position: absolute;\n right: 0;\n bottom: 18px;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 41px 0 14px;\n}\n.vjs-remaining-time.vjs-time-control.vjs-control{\n display: none;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button {\n font-size: 14px;\n font-weight: 500;\n}\n\n.video-js .vjs-progress-control .vjs-progress-holder{\n height: 6px !important;\n}\n\n.video-js .vjs-play-progress:before {\n font-size: 1.9em;\n}\n\n.video-js .vjs-current-time { display: block; }\n\n.video-js .vjs-current-time {\n display: block;\n position: absolute;\n right: 0em;\n bottom: 1.8em;\n font-size: 12px;\n font-weight: 600;\n}\n\n.video-js .vjs-button{\n width: 6em;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\nbutton.vjs-control.vjs-button.vjs-slowmo-button{\n align-self: center;\n height: min-content;\n padding: 5px 2px;\n border-radius: 8px;\n}\n\n\n.vjs-fullscreen .icon-minimize,\n.icon-maximize {\n display: block;\n height: 32px;\n}\n\n.vjs-fullscreen .icon-maximize,\n.icon-minimize {\n display: none;\n height: 32px;\n}\n\nbutton.vjs-play-control.vjs-control.vjs-button{\n outline: none !important;\n}\n\n.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,\n.vjs-icon-fullscreen-enter:before {\n content: '' !important;\n}\n\n.video-js button.vjs-fullscreen-control.vjs-control.vjs-button {\n display: flex;\n justify-content: center;\n align-items: center;\n transform: rotate(90deg);\n}\n\n.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before{\n display: none;\n}\n.video-js .vjs-volume-panel .vjs-volume-control{\n margin-left: -10px;\n}\n\n.skipbtn:hover{\n cursor: pointer;\n}\n\n.rewindbtn:hover{\n cursor: pointer;\n}\n\n.vjs-live-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 1.8em !important;\n font-weight: 700 !important;\n font-size: 11px !important;\n}\n\n.vjs-seek-to-live-control.vjs-control{\n position: absolute !important;\n right: 0em !important;\n background-color: none;\n bottom: 3.2em !important;\n}\n\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display:none;\n}\n\n.video-js.vjs-paused .vjs-big-play-button {\n width: 90px;\n height: 90px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n margin: auto;\n font-size: 6em;\n line-height: 1.3em;\n}\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{\n font-weight: bold;\n}\n\n.vjs-menu > ul.vjs-menu-content{\n bottom: 3.5em !important;\n right: -1em;\n}\n\n.video-js .vjs-chromecast-button .vjs-icon-placeholder {\n width: 17px !important;\n height: 17px !important;\n}\n\n.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-control.vjs-button{\n /* display: flex;\n justify-content: center;\n align-items: center; */\n display: none;\n}\n\nbutton.vjs-subs-caps-button.vjs-menu-button.vjs-menu-button-popup.vjs-button{\n height: min-content;\n width: min-content;\n}\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical{\n width: 6em;\n}\n\n.video-js .content{\n bottom: 3.4rem !important;\n right: -4rem !important; \n}\n\n.setting-icon > svg{\n height:18px !important;\n}\n\n.output-overlay{\n position: absolute;\n bottom: 0;\n height: 100%;\n width: 100%;\n z-index: 0;\n border: 0;\n pointer-events:none\n}\n\niframe{\n width: 100%;\n height: 100%;\n}\n\n\n@media(max-width:600px){\n .tvProviderImage{\n display: none\n }\n.vjs-fullscreen .icon-minimize,\n .icon-maximize {\n height: 30px !important;\n }\n\n .vjs-fullscreen .icon-maximize,\n .icon-minimize {\n height: 30px !important;\n }\n\n button.vjs-fullscreen-control.vjs-control.vjs-button>span.vjs-icon-placeholder::before {\n height: min-content;\n }\n\n .vjs-seek-to-live-control.vjs-control{\n position: relative !important;\n right: 0em !important;\n bottom: 0 !important;\n }\n\n .video-js .vjs-progress-control{\n top: -0.85em;\n }\n .vjs-live-control{\n right: -1em !important;\n position: relative !important;\n bottom: 0 !important;\n font-size: 12px !important;\n }\n button.vjs-slowmo-button{\n display: none;\n }\n button.vjs-rewind-button{\n display: none;\n }\n button.vjs-rewind-button>svg{\n height: 20px;\n }\n .video-js .vjs-button{\n width: 4.8em;\n }\n .video-js .widget-selection{\n display: none;\n }\n .video-js .container{\n display: none !important;\n }\n .video-js .vjs-control-bar{\n height: 4em !important;\n }\n .video-js .vjs-button>.vjs-icon-placeholder:before{\n font-size: 2.5em;\n line-height: 1.5;\n }\n .video-js .vjs-play-progress:before {\n font-size: 1.2em;\n position: absolute;\n right: -0.5em;\n /* top: -0.3333333333em; */\n z-index: 1;\n}\nbutton.vjs-skip-button>svg{\n height: 20px;\n}\nbutton.vjs-big-play-button {\n width: 50px !important;\n height: 50px !important;\n font-size: 2.1rem !important;\n}\n.vjs-seek-to-live-control.vjs-control >span.vjs-icon-placeholder{\n display: block;\n}\n\n.stream-selector-icon>svg{\n width: 24px;\n height: 24px;\n}\n.video-js.vjs-live .vjs-progress-control .vjs-progress-holder{\n margin: 0 12px 0 21px;\n}\n.vjs-seek-to-live-text{\n font-size: 12px;\n}\n.video-js .vjs-progress-control .vjs-progress-holder {\n margin: 0 40px 0px 21px;\n}\n.video-js .vjs-current-time{\n bottom: 2em !important;\n}\n}";export{n as default};
|
package/esm/skin-e058fad8.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,j as t,k as n,g as l,h as o,d as r,l as i,m as a,n as s,o as u}from"./features-25f8bfd9.js";import{M as c,a as d,c as m,d as v}from"./icons-3e9a1686.js";import{R as p,b as f,S as h,y as g,Q as y,d as x}from"./generic-30a350ab.js";import{g as w}from"./renditions-9e4f9b98.js";import b from"@babel/runtime/helpers/toConsumableArray";import{s as C}from"./autoNextVideo-a74ccb76.js";import E from"@babel/runtime/helpers/typeof";import j from"video.js";import N from"@babel/runtime/helpers/asyncToGenerator";import k from"@babel/runtime/regenerator";import B from"@babel/runtime/helpers/slicedToArray";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"./localisation-0bf399a1.js";import"axios";import"js-cookie";import"ua-parser-js";import"./util-814500d5.js";var T=p(),I=[];null==T||T.map((function(e){return I.push.apply(I,b(e.episodes))}));var L,O,M,V,R=function(e,t){var n=f(e),l=Math.floor(n.currentTime());if(Math.floor(n.duration())!=l){n.pause(e);var o=h();C(o,e,I)}};function P(e){var t=e.split("\n"),n=[];return t.forEach((function(e){if((e=e.trim()).startsWith("#EXT-X-IMAGE-STREAM-INF")){var t=e.split(","),l={resolution:null,uri:null};t.forEach((function(e){e.includes("RESOLUTION")&&(l.resolution=e.split("=")[1]),e.includes("URI")&&(l.uri=e.split("=")[1].replace(/"/g,""))})),n.push(l)}})),n}function X(e){return S.apply(this,arguments)}function S(){return(S=N(k.mark((function e(t){return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new Image;n.src=t.uri,n.crossOrigin="Anonymous";var l=[],o=t.layout.split("x"),r=B(o,2),i=r[0],a=r[1];n.onload=function(){var o=document.createElement("canvas");o.width=n.width,o.height=n.height,o.getContext("2d").drawImage(n,0,0,o.width,o.height);for(var r=o.width/a,s=o.height/i,u=0;u<i;u++)for(var c=0;c<a;c++){var d=document.createElement("canvas");d.width=r,d.height=s,d.getContext("2d").drawImage(o,c*r,u*s,r,s,0,0,r,s);var m=d.toDataURL("image/png");l.push({uri:m,duration:t.duration})}e(l)}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e){return F.apply(this,arguments)}function F(){return(F=N(k.mark((function e(t){var n,l;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:return l=e.sent,e.abrupt("return",P(l));case 10:e.prev=10,e.t0=e.catch(0),console.error("Error fetching the M3U8 manifest:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function U(e){return D.apply(this,arguments)}function D(){return(D=N(k.mark((function e(t){var n,l;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return X(e)})));case 2:return n=e.sent.flat(),l={},n.map((function(e,t){var n=e.duration;l[n*t]={src:e.uri,style:{left:"-60px",height:"68px",width:"120px"}}})),e.abrupt("return",l);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}L={0:{src:"example-thumbnail.png"}},O=function e(){var t,n,l,o,r;for(l in n=(t=Array.prototype.slice.call(arguments)).shift()||{},t)for(r in o=t[l])o.hasOwnProperty(r)&&("object"===E(o[r])?n[r]=e(n[r],o[r]):n[r]=o[r]);return n},M=function(e,t){return function(n){return window.getComputedStyle?window.getComputedStyle(e,t)[n]:e.currentStyle[n]}},V=function e(t){return"HTML"!==t.nodeName&&"static"===M(t)("position")?e(t.offsetParent):t},j.plugin("thumbnails",(function(e){var t,n,l,o,r,i,a,s;n=O({},L,e),o=this,function(){var e,t,n;-1!==navigator.userAgent.toLowerCase().indexOf("android")&&(t=function(){e.addClass("fake-active")},n=function(){e.removeClass("fake-active")},(e=o.controlBar.progressControl).on("touchstart",t),e.on("touchend",n),e.on("touchcancel",n))}(),(t=document.createElement("div")).className="vjs-thumbnail-holder",l=document.createElement("img"),t.appendChild(l),l.src=n[0].src,l.className="vjs-thumbnail",O(l.style,n[0].style),l.style.left||l.style.right||(l.onload=function(){l.style.left=-l.naturalWidth/2+"px"}),i=o.duration(),o.on("durationchange",(function(e){i=o.duration()})),o.on("loadedmetadata",(function(e){i=o.duration()})),(r=o.controlBar.progressControl).el().appendChild(t),a=function(e){var o,a,s,u,c,d,m,v,p,f;for(a in s=0,p=(window.pageXOffset?{x:window.pageXOffset,y:window.pageYOffset}:{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}).x,m=((f=V(r.el()).getBoundingClientRect()).width||f.right)+p,d=e.pageX,e.changedTouches&&(d=e.changedTouches[0].pageX),u=d||e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,u-=V(r.el()).getBoundingClientRect().left+p,o=Math.floor((u-r.el().offsetLeft)/r.width()*i),n)o>a&&(s=Math.max(s,a));(c=n[s]).src&&l.src!=c.src&&(l.src=c.src),c.style&&l.style!=c.style&&O(l.style,c.style),u+(v=function(e,t){var n;return t?parseFloat(t):"auto"!==(n=M(e)("clip"))&&"inherit"!==n&&4===(n=n.split(/(?:\(|\))/)[1].split(/(?:,| )/)).length?parseFloat(n[1])-parseFloat(n[3]):0}(l,c.width||n[0].width)/2)>m?u-=u+v-m:u<v&&(u=v),t.style.left=u+"px"},r.on("mousemove",a),r.on("touchmove",a),s=function(e){t.style.left="-1000px"},r.on("mouseout",s),r.on("touchcancel",s),r.on("touchend",s),o.on("userinactive",s)}));var G=function(){var e=N(k.mark((function e(t,n){var l,o,r,i;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t+n);case 2:return l=e.sent,e.next=5,l.text();case 5:return o=e.sent,r=o.split("\n"),i=[],r.forEach((function(e,n){e=e.trim();var l={resolution:null,duration:null,uri:null,layout:null};n>0&&r[n-1].includes("#EXT-X-TILES")&&(r[n-1]=r[n-1].split(","),l.uri=t+e,r[n-1].forEach((function(e){(e.includes(":")?e.split(":")[1]:e).split(",").forEach((function(e){var t=e.split("="),n=B(t,2),o=n[0],r=n[1];o=o.toLowerCase(),l[o]=r}))})),i.push(l))})),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function W(){return(W=N(k.mark((function e(t){var n,l,o,r,i,a,s,u,c;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f(t),l=n.currentSource(),o=l.src,e.next=4,A(o);case 4:if(!((null==(r=e.sent)?void 0:r.length)>0)){e.next=15;break}return i=(null==r?void 0:r[0])||null,a=i.uri,s=n.tech().vhs.playlists.master.uri.substring(0,n.tech().vhs.playlists.master.uri.lastIndexOf("/"))+"/",e.next=10,G(s,a);case 10:return u=e.sent,e.next=13,U(u);case 13:c=e.sent,n.thumbnails(c);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(l,o){var r=f(l);r&&(r.on("loadeddata",(function(){var n,i,a;(null===(n=w(l))||void 0===n?void 0:n.length)>0&&e(l,o),(null===(i=g(l))||void 0===i?void 0:i.length)>0&&t(l,o),null!=o&&null!==(a=o.series)&&void 0!==a&&a.enable&&function(e,t){var n;null==t||null===(n=t.series)||void 0===n||n.cb;var l=f(e);l.on("timeupdate",(function(){var e,t=Math.floor(l.currentTime()),n=l.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-t<=10&&h()<=(null==I?void 0:I.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,r=I.filter((function(e,t){return t==h()}));if((null==r?void 0:r.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var i,a,s,u,c,d,m,v,p,g,y;(null===(i=document.getElementsByClassName("next-ep-preview"))||void 0===i?void 0:i[0]).style.visibility="hidden";var x=null===(a=document.getElementsByClassName("next-ep-title"))||void 0===a?void 0:a[0],w=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],b=null===(u=document.getElementsByClassName("next-ep-content"))||void 0===u?void 0:u[0],C=null===(c=r[0])||void 0===c?void 0:c.title;(null===(d=C)||void 0===d?void 0:d.length)>60&&(C=C.substr(0,60)+"..."),x.textContent="".concat(C),w.src=(null===(m=r[0])||void 0===m||null===(v=m.gist)||void 0===v||null===(p=v.imageGist)||void 0===p?void 0:p.r16x9)||(null===(g=window)||void 0===g||null===(y=g.customData)||void 0===y?void 0:y.fallbackImage),b.onclick=function(){return R(e)}}else{var E,j,N,k,B,T,L,O=document.createElement("div");O.className="next-ep-preview",O.style.visibility="hidden",document.getElementById(e).append(O);var M=document.createElement("div");M.className="next-ep-header",M.textContent="Next up";var V=null===(E=r[0])||void 0===E?void 0:E.title,P=document.createElement("img");P.className="next-ep-img",P.src=(null===(j=r[0])||void 0===j||null===(N=j.gist)||void 0===N||null===(k=N.imageGist)||void 0===k?void 0:k.r16x9)||(null===(B=window)||void 0===B||null===(T=B.customData)||void 0===T?void 0:T.fallbackImage);var X=document.createElement("div");X.className="next-ep-title",(null===(L=V)||void 0===L?void 0:L.length)>60&&(V=V.substr(0,60)+"..."),X.textContent="".concat(V);var S=document.createElement("div");S.className="next-ep-content",S.append(P),S.append(X),S.onclick=function(){return R(e)},O.append(M),O.append(S)}}(l,o),function(e,t){var n,l=Math.floor(e/60),o=null===(n=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===n?void 0:n[0];o&&(o.style.marginRight=l>60?"56px":"41px");var r=document.getElementsByClassName("vjs-live-control")[0],i=document.getElementsByClassName("vjs-time-control");t&&r.classList.value.includes("vjs-hidden")&&(i[0].style.display="block",o&&(o.style.marginRight="56px"))}(r.duration(),(null==o?void 0:o.liveVideo)||!1),null!=o&&o.liveVideo||function(e){W.apply(this,arguments)}(l)})),r.one("play",(function(){var e,t,o,r;null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.iframeOverlayUrl&&n(l,null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r?void 0:r.iframeOverlayUrl)})))}function z(e,t){!function(){"Chrome"==x()&&import("./chromett-a3cbb2e1.js").then((function(e){var t=document.createElement("style");t.id="chromett",t.append("".concat(e.default)),document.head.appendChild(t)}));import("./skin-808893ac.js").then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)}))}(),_(e,t),function(e,t){var n,l,o,r,i,a,s=f(e);null==s||null===(n=s.controlBar)||void 0===n||null===(l=n.getChild("FullscreenToggle"))||void 0===l||null===(o=l.el())||void 0===o||o.appendChild(y(c(window.controlsColor))),null==s||null===(r=s.controlBar)||void 0===r||null===(i=r.getChild("FullscreenToggle"))||void 0===i||null===(a=i.el())||void 0===a||a.appendChild(y(d(window.controlsColor)));var u=document.getElementsByClassName("vjs-time-control");t.liveVideo&&u[0]&&(u[0].style.display="none")}(e,t),function(e,t){var n,c,d,p,f,h;0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)&&l(e,"defaultV2",m());(0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)||1==(null==t?void 0:t.liveui))&&o(e,"defaultV2",v());t.liveVideo||r(e);(null==t||null===(n=t.relatedVideos)||void 0===n||null===(c=n.content)||void 0===c?void 0:c.length)>0&&i(e,null==t?void 0:t.relatedVideos);(null==t||null===(d=t.streams)||void 0===d?void 0:d.length)>1&&a(e,null==t?void 0:t.streams);(null==t||null===(p=t.playlist)||void 0===p||null===(f=p.content)||void 0===f?void 0:f.length)>0&&s(e,null==t?void 0:t.playlist);null!=t&&null!==(h=t.series)&&void 0!==h&&h.enable&&u(e,t)}(e,t),function(e,t){var n=f(e),l=null==t?void 0:t.tvProviderLogoUrl;if(!l)return;var o=document.createElement("div");o.className="tvProviderImage";var r=document.createElement("img");r.src="".concat(l),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"}))}(e,t)}export{z as initialiseSkin};
|