@viewlift/player-backup 1.0.125-backup → 1.0.127-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 +17 -2
- package/cjs/index.js +1 -1
- package/esm/bundle.css +17 -2
- package/esm/index.js +1 -1
- package/package.json +1 -1
package/cjs/bundle.css
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
.video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
|
|
8
7
|
height: 0.7em;
|
|
9
8
|
position: absolute;
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.vjs-button>.vjs-icon-placeholder:before {
|
|
47
|
-
font-size: 2em;
|
|
46
|
+
font-size: 2em !important;
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
.video-js.skin_vlone .vjs-control {
|
|
@@ -86,6 +85,21 @@
|
|
|
86
85
|
justify-content: center;
|
|
87
86
|
}
|
|
88
87
|
|
|
88
|
+
.video-js.skin_vlone .vjs-live-control{
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
}
|
|
92
|
+
.video-js.skin_vlone .vjs-live-display{
|
|
93
|
+
height: 2.2em;
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
font-family: monospace;
|
|
97
|
+
width: 4em;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
background: red;
|
|
100
|
+
margin: 4px 0px 4px 12px;
|
|
101
|
+
}
|
|
102
|
+
|
|
89
103
|
.video-js.skin_vlone .vjs-time-control {
|
|
90
104
|
line-height: 3.5em !important;
|
|
91
105
|
font-size: 1.1em !important;
|
|
@@ -102,6 +116,7 @@
|
|
|
102
116
|
}
|
|
103
117
|
|
|
104
118
|
|
|
119
|
+
|
|
105
120
|
.video-js.vjs-quality-menu {
|
|
106
121
|
display: block;
|
|
107
122
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("video.js/dist/video-js.min.css");var e=require("./beacon-98bf9c09.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/regenerator"),o=require("video.js");require("videojs-contrib-quality-menu");var r=require("@babel/runtime/helpers/typeof"),l=require("./util-851e11a6.js"),a=require("./renditions-16a49685.js"),s=require("./resolution-fcfc39c2.js"),u=require("./localisation-56e0a999.js");require("axios"),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 d,c,v=function(e){return new Promise((function(n,t){if(p(e))t("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}}))},p=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},m=function(){var t=n(i.mark((function n(t){var r,l,a,s;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=e.getPlayer(null==t?void 0:t.playerId),console.log(t),null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=5,import("@silvermine/videojs-chromecast");case 5:return s=n.sent,n.prev=6,n.next=9,v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(6),console.log("Error",n.t0);case 14:return n.prev=14,s.default(o),n.finish(14);case 17:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}}),n,null,[[6,11,14,17]])})));return function(e){return t.apply(this,arguments)}}(),f=function(n,t){var i=e.getPlayer(n);i&&t&&i.controlBar&&i.controlBar.progressControl.seekBar.on("click",(function(e){var t,i,r,l,a,s=this.el(),u=o.dom.getPointerPosition(s,e).x;o.getPlayer(n).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(r=i.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?g(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var y=[],w=0,b=null;function k(n,i,o){var r,l,a,s,u,v=arguments.length>3&&void 0!==arguments[3]&&arguments[3];c=(null==i||null===(r=i.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var p=null==i||null===(l=i.watchHistory)||void 0===l?void 0:l.profileId,m=Math.floor(n.currentTime()),f=Math.floor(n.duration()),g=null==i||null===(a=i.watchHistory)||void 0===a?void 0:a.xapiKey,y=(null==i||null===(s=i.video)||void 0===s?void 0:s.originalObjectId)||null,k=(null==i||null===(u=i.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,O=Math.floor(n.currentTime()),I=v?100:Math.floor(m/f*100),T={};k?function(n,i,o){var r=i?"watchhistory-data-".concat(i):"watchhistory-data-guest-".concat(o),l=P(r),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return h(h({},e),{},t({},n,u[n]))}),{}),v=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===d}));v<0?l.push(h(h({content:c},n),{},{addedDate:a,updateDate:a})):l[v]=h(h(h({},l[v]),n),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(T={completed:v,watchedTime:O,watchedPercentage:I},p,i.siteOwner):("v1"==c?T={videoId:d,watchedTime:O,watchedPercentage:I,siteOwner:i.siteOwner,userId:i.userId,xApiKey:g}:"v2"==c&&(T=h(h({videoId:d,watchedTime:O,watchedPercentage:I,doneWatching:v,profileId:p},b&&{seriesId:b}),y&&{originalObjectId:y})),e.saveWatchHistory(T,c).then((function(e){})).catch((function(e){}))),w=m+o}function P(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function O(e,n,t){var i=P(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),o}var I=function(n,t,i){var o=e.getPlayer(n);if(o)if(t>=0&&t<=100){o.muted()&&o.muted(!1);var r=parseFloat(t)/100;o.volume(r),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(n,"'")})},T=function(n){var t=e.getPlayer(n);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(n,"'")},j=!1,S=function(n,t){var i,o,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(i=n[r])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!j){var l=C(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),j=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function C(e,n,t){if(Array.isArray(e))return e.map((function(e){return C(e,n,t)}));if(null!==e&&"object"===r(e)){var i={};return Object.keys(e).forEach((function(o){o===n&&void 0!==e[t]?i[o]=e[t]:o===t&&void 0!==e[n]?i[o]=e[n]:i[o]=C(e[o],n,t)})),i}return e}function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function x(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?D(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var E=function(n,t,i,o){var r,l,a=o.res,s=o.sres,u=e.getPlayer(n),c=(null==a?void 0:a.contentType)||"video",v=(null==a||null===(r=a[c])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;e.setCurrentVideo(a),u&&(u.on("loadstart",(function(){v?i.resolve({status:!0,msg:"Video Loaded",response:a}):i.resolve(x({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a}))})),u.on("loadeddata",(function(){var i,o;(null==u||!u.muted())&&I(n,sessionStorage.getItem("volume")||"100");var r=e.getCurrentVideo();if(e.clearError(),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 l,s,c=x(x({},t),a);!function(n,t,i){var o,r,l;null!=t&&t.series&&null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable&&(b=null==t||null===(r=t.series)||void 0===r?void 0:r.id),y=[],w=0,d=i;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=e.getPlayer(n);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());y.includes(w)||(e==w?(y.push(e),k(s,t,a)):e>w&&(w=e+a))})),s.one("ended",(function(){k(s,t,a,!0)})))}(n,c,null==r||null===(l=r.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.id)}})),u.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",n)})),u.on("subtitlechanged",(function(e,n){var t,i,o,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(i=t.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===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var f,g=m.getMediaSession(),h=g.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}})),u.tech_.on("retryplaylist",(function(){v&&S(a,n)})),u.on("error",(function(){var t,o;(console.log("ERROR",u.error(),u.error().code),4===u.error().code&&v)?S(a,n):(e.handleError(n,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==u||null===(o=u.error())||void 0===o?void 0:o.message)||"Some error occured",response:a}))})),u.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var i,o,r,l=null===(i=e.getCurrentVideo())||void 0===i||null===(o=i.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},d=s.t,c=s.p;d&&c<95&&setTimeout((function(){u.currentTime(d)}),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(v){u.currentSource();for(var e=u.textTracks(),n=e.length-1;n>=0;n--)u.removeRemoteTextTrack(e[n])}})))},V=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-e3bc9b23.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-33f8a3fe.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-2fed1a03.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-ff6429e8.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-4f845aec.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-2aa80e9a.js")})).then((function(t){t.initialiseSkin(e,n)}))};var R,A=function(){var e=n(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(o)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},importIMA:function(){import("videojs-contrib-ads"),import("ima"),v("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadEMELibrary:A}),H=function(n,t){var i=new Map;e.getSeriesWatchHistory({videoId:n,token:t}).then((function(n){n.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),e.setSeriesWatchMap(i)})).catch((function(e){return console.log(e)}))};function B(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function L(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?B(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var M=function(r,l,a,s){var u,d,c,v,p,g,h,y,w,b,k,P,O,I,T,j,S,C,D,x,R,q,H,B,M,_,N,U,z,F,J,W,G,K=l.res,X=void 0===K?null:K,Q=l.sres,Y=void 0===Q?null:Q;null===(u=window)||void 0===u||null===(d=u.cast)||void 0===d||null===(c=d.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(p=v.getInstance())||void 0===p||p.S;var Z=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],$=(null===(g=X)||void 0===g?void 0:g.contentType)||"video",ee=e.impolicy16x9(null===(h=X)||void 0===h||null===(y=h[$])||void 0===y||null===(w=y.gist)||void 0===w?void 0:w.videoImageUrl)||e.impolicy16x9(null===(b=X)||void 0===b||null===(k=b[$])||void 0===k||null===(P=k.gist)||void 0===P||null===(O=P.imageGist)||void 0===O?void 0:O.r16x9),ne=(null===(I=X)||void 0===I||null===(T=I[$])||void 0===T||null===(j=T.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,te=(null===(S=X)||void 0===S||null===(C=S[$])||void 0===C||null===(D=C.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!0,ie=(null===(x=X)||void 0===x||null===(R=x.ads)||void 0===R||null===(q=R.preRoll)||void 0===q||null===(H=q.adTags)||void 0===H||null===(B=H.web)||void 0===B?void 0:B.active)&&(null===(M=X)||void 0===M||null===(_=M.ads)||void 0===_||null===(N=_.preRoll)||void 0===N||null===(U=N.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=L(L({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var oe=(G={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:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==a.skin,liveui:!0},t(G,"autoplay",null==a?void 0:a.autoplay),t(G,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!ie),t(G,"loop",(null==a?void 0:a.loop)||!1),t(G,"audioPosterMode",null==a?void 0:a.audioPosterMode),t(G,"html5",L(L({vhs:L(L({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==a||null===(F=a.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(G,"poster",ee),t(G,"techOrder",Z),t(G,"chromecast",{requestCustomDataFn:function(n){var t=e.getPlayer(r),i=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var i,o,r,l,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){m.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var g=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=g}var h=(null==e||null===(i=e[p])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var y=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=y;var w=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=w;var b=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=b,m.subTitles=t,m.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,n,i)}}),G);if(!o.getPlayers()[r])var re=o(r,oe,function(){var t=n(i.mark((function n(){var t,l,u,d,c,v,p,g,h,y,w,b,k,P,O,I,T,j,S,C,D,x,R;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(re),n.next=3,m(a);case 3:if(te&&s.resolve(L({status:!0,msg:"Player Initialised"},Y?{seriesResponse:Y,response:X}:{response:X})),e.inititateBeacon(r),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),P=null===(t=X)||void 0===t||null===(l=t[$])||void 0===l?void 0:l.drmEnabled,O=null===(u=X)||void 0===u||null===(d=u[$])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,!P){n.next=11;break}return n.next=11,A();case 11:ne&&f(r,O),!ie||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(r,ie,X),I=e.getSource(X,r),console.log(I),null!=a&&a.nearestClusterUrl&&(I=e.getUpdatedClusterSource(I,a.nearestClusterUrl)),I?e.loadVideo(r,I):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),e.handleError(r,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=X)||void 0===p||null===(g=p[$])||void 0===g||null===(h=g.contentDetails)||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0||(null===(w=X)||void 0===w||null===(b=w[$])||void 0===b||null===(k=b.closedCaptions)||void 0===k?void 0:k.length)>0)&&(R=(null===(j=X)||void 0===j||null===(S=j[$])||void 0===S||null===(C=S.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(D=X)||void 0===D||null===(x=D[$])||void 0===x?void 0:x.closedCaptions),T=R.filter((function(e){return"VTT"===e.format})),e.addCaptions(r,T)),null!=a&&a.disableControls?e.disableControls(r):V(r,L(L(L({},a),oe),{},{liveVideo:te,isDvrEnabled:ne,res:X,sres:Y})),E(r,L(L(L({},a),oe),{},{liveVideo:te}),s,{res:X,sres:Y});case 20:case"end":return n.stop()}}),n)})));return function(){return t.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(t){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(i.mark((function n(o,r){var l,a,s,d,c,p,m,f,g,h,y,w,b,k,P,I,T,j,S,C,D,x,E,V,A,B,_,N,U,z;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.isPlayerInitialised(null==t?void 0:t.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(w=(null==t?void 0:t.videoSourceUrl)||!1,b=null==t?void 0:t.asat,k=(null==t||null===(l=t.epg)||void 0===l?void 0:l.enable)||!1,P=null==t?void 0:t.videoId,I=(null==t||null===(a=t.series)||void 0===a?void 0:a.enable)||!1,window.videoId=P,T=null==t?void 0:t.token,!e.token_authentication_enabled(t)){n.next=15;break}if(e.refreshTokenManager().set(null==t?void 0:t.refreshToken),T&&!e.isTokenExpired(T)){n.next=14;break}return r({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),n.abrupt("return");case 14:R=JSON.parse(atob(T.split(".")[1]));case 15:window.siteId=null===(s=R)||void 0===s?void 0:s.siteId,window.siteName=null===(d=R)||void 0===d?void 0:d.site,t.isAnonymousUser=!(null===(c=R)||void 0===c||!c.anonymousId),t.siteOwner=(null===(p=R)||void 0===p?void 0:p.site)||null,t.userId=(null===(m=R)||void 0===m?void 0:m.userId)||null,window.sessionStorage.setItem("uid",null===(f=R)||void 0===f?void 0:f.userId),window.watchHistory=t.watchHistory||null,sessionStorage.setItem("vlp_token",T),j=null==t?void 0:t.playerId,S=t.chromecastReceiverId=null!=t&&t.series?null:null==t?void 0:t.chromecastReceiverId,t.chromecastReceiverId=S,C=null==t?void 0:t.airplay,D=null==t?void 0:t.apiBaseUrl,x=(null==t||null===(g=t.analytics)||void 0===g?void 0:g.gaId)||null,(E=null==t?void 0:t.errors)&&(window.customErrors=E),window.customData=null==t?void 0:t.customData,u.setLocalisation(null==t||null===(h=t.customData)||void 0===h?void 0:h.localisation),D&&(window.playerEntitlementUrl=D),null!=t&&t.skin&&!e.isNotAValidSkin(t.skin)||(t.skin="VL_ONE"),Promise.resolve().then((function(){return q})).then((function(e){e.importIMA()})),C&&"Safari"==e.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),x&&v("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then((function(){return e.runGtag(x)})).catch((function(e){})),(V=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(j)))&&V.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(B={directPlaybackUrl:w,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(A,T).then((function(e){M(j,{res:L(L({},e),B)},t,{resolve:o,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,A)})):M(j,{res:B},t,{resolve:o,reject:r})):I?(N=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(N)),U=null==t||null===(_=t.series)||void 0===_?void 0:_.id,e.getSeriesDetails(U,T).then((function(n){var i,l,a,s=n.data,u=n.data.seasons;e.setCurrentSeries(u);var d=P||(null==u||null===(i=u[0])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);H(U,T),e.getVideoDetails(d,T).then((function(n){var i,l,a;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(l=i.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,e.setCurrentVideo(n.data),M(j,{res:null==n?void 0:n.data,sres:s},t,{resolve:o,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}))})).catch((function(n){e.initiateErrorHandling(n,j,r)}))):k?(z=null==t?void 0:t.epg,e.getLinearChannelDetails(z,T).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==z?void 0:z.channelId,M(j,{res:n},t,{resolve:o,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}))):e.getVideoDetails(P,T).then((function(n){var i,l,a,s;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(l=i.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,e.setCurrentVideo(null==n?void 0:n.data);var u,d=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(s=t.watchHistory)&&void 0!==s&&s.enable)if((null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,p,m=O((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",P,null==t?void 0:t.siteOwner);if(m&&m.length)t.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;d.contentType="video",M(j,{res:d},t,{resolve:o,reject:r})}else e.getVideoInfo(P,T).then((function(e){var n,i,l,a,s,u;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,t.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",M(j,{res:d},t,{resolve:o,reject:r})})).catch((function(e){var n,i,l,a;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(e)),M(j,{res:d},t,{resolve:o,reject:r})}));else M(j,{res:d},t,{resolve:o,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}));case 41:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:e.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:e.enableCaptions,disableCaptions:e.disableCaptions,getCaptions:e.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:I,getVolume:T,disableControls:e.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
|
|
1
|
+
"use strict";require("video.js/dist/video-js.min.css");var e=require("./beacon-98bf9c09.js"),n=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),i=require("@babel/runtime/regenerator"),o=require("video.js");require("videojs-contrib-quality-menu");var r=require("@babel/runtime/helpers/typeof"),l=require("./util-851e11a6.js"),a=require("./renditions-16a49685.js"),s=require("./resolution-fcfc39c2.js"),u=require("./localisation-56e0a999.js");require("axios"),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 d,c,v=function(e){return new Promise((function(n,t){if(p(e))t("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){n()},i.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(i)}}))},p=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},m=function(){var t=n(i.mark((function n(t){var r,l,a,s;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=e.getPlayer(null==t?void 0:t.playerId),console.log(t),null!=t&&null!==(r=t.series)&&void 0!==r&&r.enable||null==t||!t.chromecastReceiverId){n.next=21;break}return n.next=5,import("@silvermine/videojs-chromecast");case 5:return s=n.sent,n.prev=6,n.next=9,v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(6),console.log("Error",n.t0);case 14:return n.prev=14,s.default(o),n.finish(14);case 17:null!==(a=window)&&void 0!==a&&a.cast?null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},n.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=t&&t.airplay&&"Safari"==e.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"new"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return n.stop()}}),n,null,[[6,11,14,17]])})));return function(e){return t.apply(this,arguments)}}(),f=function(n,t){var i=e.getPlayer(n);i&&t&&i.controlBar&&i.controlBar.progressControl.seekBar.on("click",(function(e){var t,i,r,l,a,s=this.el(),u=o.dom.getPointerPosition(s,e).x;o.getPlayer(n).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(t=window)||void 0===t||null===(i=t.cast)||void 0===i||null===(r=i.framework)||void 0===r||null===(l=r.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(d),d&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),p=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=p*u,v.seek()}}))};function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?g(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var y=[],w=0,b=null;function k(n,i,o){var r,l,a,s,u,v=arguments.length>3&&void 0!==arguments[3]&&arguments[3];c=(null==i||null===(r=i.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var p=null==i||null===(l=i.watchHistory)||void 0===l?void 0:l.profileId,m=Math.floor(n.currentTime()),f=Math.floor(n.duration()),g=null==i||null===(a=i.watchHistory)||void 0===a?void 0:a.xapiKey,y=(null==i||null===(s=i.video)||void 0===s?void 0:s.originalObjectId)||null,k=(null==i||null===(u=i.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,O=Math.floor(n.currentTime()),I=v?100:Math.floor(m/f*100),T={};k?function(n,i,o){var r=i?"watchhistory-data-".concat(i):"watchhistory-data-guest-".concat(o),l=P(r),a=(new Date).getTime(),s=e.getCurrentVideo(),u=(null==s?void 0:s.video)||{},c=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return h(h({},e),{},t({},n,u[n]))}),{}),v=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===d}));v<0?l.push(h(h({content:c},n),{},{addedDate:a,updateDate:a})):l[v]=h(h(h({},l[v]),n),{},{updateDate:a});localStorage.setItem("".concat(r),JSON.stringify(l))}(T={completed:v,watchedTime:O,watchedPercentage:I},p,i.siteOwner):("v1"==c?T={videoId:d,watchedTime:O,watchedPercentage:I,siteOwner:i.siteOwner,userId:i.userId,xApiKey:g}:"v2"==c&&(T=h(h({videoId:d,watchedTime:O,watchedPercentage:I,doneWatching:v,profileId:p},b&&{seriesId:b}),y&&{originalObjectId:y})),e.saveWatchHistory(T,c).then((function(e){})).catch((function(e){}))),w=m+o}function P(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function O(e,n,t){var i=P(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),o=[];return i&&Array.isArray(i)&&(o=i.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),o}var I=function(n,t,i){var o=e.getPlayer(n);if(o)if(t>=0&&t<=100){o.muted()&&o.muted(!1);var r=parseFloat(t)/100;o.volume(r),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(n,"'")})},T=function(n){var t=e.getPlayer(n);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(n,"'")},j=!1,S=function(n,t){var i,o,r=(null==n?void 0:n.contentType)||"video";if(((null==n||null===(i=n[r])||void 0===i||null===(o=i.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!j){var l=C(n,"videoAssets","secondaryVideoAssets"),a=e.getSource(l,t);return a&&e.loadVideo(t,a),j=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function C(e,n,t){if(Array.isArray(e))return e.map((function(e){return C(e,n,t)}));if(null!==e&&"object"===r(e)){var i={};return Object.keys(e).forEach((function(o){o===n&&void 0!==e[t]?i[o]=e[t]:o===t&&void 0!==e[n]?i[o]=e[n]:i[o]=C(e[o],n,t)})),i}return e}function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function x(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?D(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var E=function(n,t,i,o){var r,l,a=o.res,s=o.sres,u=e.getPlayer(n),c=(null==a?void 0:a.contentType)||"video",v=(null==a||null===(r=a[c])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;e.setCurrentVideo(a),u&&(u.on("loadstart",(function(){v?i.resolve({status:!0,msg:"Video Loaded",response:a}):i.resolve(x({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a}))})),u.on("loadeddata",(function(){var i,o;(null==u||!u.muted())&&I(n,sessionStorage.getItem("volume")||"100");var r=e.getCurrentVideo();if(e.clearError(),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 l,s,c=x(x({},t),a);!function(n,t,i){var o,r,l;null!=t&&t.series&&null!=t&&null!==(o=t.series)&&void 0!==o&&o.enable&&(b=null==t||null===(r=t.series)||void 0===r?void 0:r.id),y=[],w=0,d=i;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=e.getPlayer(n);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());y.includes(w)||(e==w?(y.push(e),k(s,t,a)):e>w&&(w=e+a))})),s.one("ended",(function(){k(s,t,a,!0)})))}(n,c,null==r||null===(l=r.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.id)}})),u.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];u.trigger("subtitlechanged",n)})),u.on("subtitlechanged",(function(e,n){var t,i,o,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(t=window)||void 0===t||null===(i=t.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===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===p){var f,g=m.getMediaSession(),h=g.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),g.editTracksInfo(f)}})),u.tech_.on("retryplaylist",(function(){v&&S(a,n)})),u.on("error",(function(){var t,o;(console.log("ERROR",u.error(),u.error().code),4===u.error().code&&v)?S(a,n):(e.handleError(n,(null==u||null===(t=u.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==u||null===(o=u.error())||void 0===o?void 0:o.message)||"Some error occured",response:a}))})),u.one("play",(function(){var n;if(null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable){var i,o,r,l=null===(i=e.getCurrentVideo())||void 0===i||null===(o=i.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id,a=e.getSeriesWatchMap(),s=(null==a?void 0:a.get(l))||{t:0,p:0},d=s.t,c=s.p;d&&c<95&&setTimeout((function(){u.currentTime(d)}),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(v){u.currentSource();for(var e=u.textTracks(),n=e.length-1;n>=0;n--)u.removeRemoteTextTrack(e[n])}})))},V=function(e,n){var t=null==n?void 0:n.skin;"default"==t?Promise.resolve().then((function(){return require("./skin-e3bc9b23.js")})).then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?Promise.resolve().then((function(){return require("./skin-33f8a3fe.js")})).then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?Promise.resolve().then((function(){return require("./skin-2fed1a03.js")})).then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?Promise.resolve().then((function(){return require("./skin-ff6429e8.js")})).then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?Promise.resolve().then((function(){return require("./skin-4f845aec.js")})).then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&Promise.resolve().then((function(){return require("./skin-2aa80e9a.js")})).then((function(t){t.initialiseSkin(e,n)}))};var R,A=function(){var e=n(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){o.getPlugin("eme")||o.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(o)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(o)}))},importIMA:function(){import("videojs-contrib-ads"),import("ima"),v("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadEMELibrary:A}),H=function(n,t){var i=new Map;e.getSeriesWatchHistory({videoId:n,token:t}).then((function(n){n.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),e.setSeriesWatchMap(i)})).catch((function(e){return console.log(e)}))};function B(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function L(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?B(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var M=function(r,l,a,s){var u,d,c,v,p,g,h,y,w,b,k,P,O,I,T,j,S,C,D,x,R,q,H,B,M,_,N,U,z,F,J,W,G,K=l.res,X=void 0===K?null:K,Q=l.sres,Y=void 0===Q?null:Q;null===(u=window)||void 0===u||null===(d=u.cast)||void 0===d||null===(c=d.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(p=v.getInstance())||void 0===p||p.S;var Z=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],$=(null===(g=X)||void 0===g?void 0:g.contentType)||"video",ee=e.impolicy16x9(null===(h=X)||void 0===h||null===(y=h[$])||void 0===y||null===(w=y.gist)||void 0===w?void 0:w.videoImageUrl)||e.impolicy16x9(null===(b=X)||void 0===b||null===(k=b[$])||void 0===k||null===(P=k.gist)||void 0===P||null===(O=P.imageGist)||void 0===O?void 0:O.r16x9),ne=(null===(I=X)||void 0===I||null===(T=I[$])||void 0===T||null===(j=T.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,te=(null===(S=X)||void 0===S||null===(C=S[$])||void 0===C||null===(D=C.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!0,ie=(null===(x=X)||void 0===x||null===(R=x.ads)||void 0===R||null===(q=R.preRoll)||void 0===q||null===(H=q.adTags)||void 0===H||null===(B=H.web)||void 0===B?void 0:B.active)&&(null===(M=X)||void 0===M||null===(_=M.ads)||void 0===_||null===(N=_.preRoll)||void 0===N||null===(U=N.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=L(L({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var oe=(G={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:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==a.skin,liveui:ne},t(G,"autoplay",null==a?void 0:a.autoplay),t(G,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!ie),t(G,"loop",(null==a?void 0:a.loop)||!1),t(G,"audioPosterMode",null==a?void 0:a.audioPosterMode),t(G,"html5",L(L({vhs:L(L({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==a||null===(F=a.customData)||void 0===F?void 0:F.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(W=a.customData)||void 0===W?void 0:W.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(G,"poster",ee),t(G,"techOrder",Z),t(G,"chromecast",{requestCustomDataFn:function(n){var t=e.getPlayer(r),i=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var i,o,r,l,a,s,u,d,c,v,p=(null==e?void 0:e.contentType)||"video",m={};if(e&&null!=e&&e[p]&&null!=e&&e[p].drmEnabled){m.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;m.licenseUrl=f;var g=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=g}var h=(null==e||null===(i=e[p])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";m.contentType=h;var y=null==e||null===(r=e[p])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=y;var w=null==e||null===(a=e[p])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=w;var b=null==e||null===(u=e[p])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=b,m.subTitles=t,m.DVR=(null==e||null===(c=e[p])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(X,n,i)}}),G);if(!o.getPlayers()[r])var re=o(r,oe,function(){var t=n(i.mark((function n(){var t,l,u,d,c,v,p,g,h,y,w,b,k,P,O,I,T,j,S,C,D,x,R;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(re),n.next=3,m(a);case 3:if(te&&s.resolve(L({status:!0,msg:"Player Initialised"},Y?{seriesResponse:Y,response:X}:{response:X})),e.inititateBeacon(r),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),P=null===(t=X)||void 0===t||null===(l=t[$])||void 0===l?void 0:l.drmEnabled,O=null===(u=X)||void 0===u||null===(d=u[$])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,!P){n.next=11;break}return n.next=11,A();case 11:ne&&f(r,O),!ie||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||e.initialiseAdvertisement(r,ie,X),I=e.getSource(X,r),console.log(I),null!=a&&a.nearestClusterUrl&&(I=e.getUpdatedClusterSource(I,a.nearestClusterUrl)),I?e.loadVideo(r,I):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),e.handleError(r,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(p=X)||void 0===p||null===(g=p[$])||void 0===g||null===(h=g.contentDetails)||void 0===h||null===(y=h.closedCaptions)||void 0===y?void 0:y.length)>0||(null===(w=X)||void 0===w||null===(b=w[$])||void 0===b||null===(k=b.closedCaptions)||void 0===k?void 0:k.length)>0)&&(R=(null===(j=X)||void 0===j||null===(S=j[$])||void 0===S||null===(C=S.contentDetails)||void 0===C?void 0:C.closedCaptions)||(null===(D=X)||void 0===D||null===(x=D[$])||void 0===x?void 0:x.closedCaptions),T=R.filter((function(e){return"VTT"===e.format})),e.addCaptions(r,T)),null!=a&&a.disableControls?e.disableControls(r):V(r,L(L(L({},a),oe),{},{liveVideo:te,isDvrEnabled:ne,res:X,sres:Y})),E(r,L(L(L({},a),oe),{},{liveVideo:te}),s,{res:X,sres:Y});case 20:case"end":return n.stop()}}),n)})));return function(){return t.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:e.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(t){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var o=n(i.mark((function n(o,r){var l,a,s,d,c,p,m,f,g,h,y,w,b,k,P,I,T,j,S,C,D,x,E,V,A,B,_,N,U,z;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.isPlayerInitialised(null==t?void 0:t.playerId)){n.next=2;break}return n.abrupt("return");case 2:if(w=(null==t?void 0:t.videoSourceUrl)||!1,b=null==t?void 0:t.asat,k=(null==t||null===(l=t.epg)||void 0===l?void 0:l.enable)||!1,P=null==t?void 0:t.videoId,I=(null==t||null===(a=t.series)||void 0===a?void 0:a.enable)||!1,window.videoId=P,T=null==t?void 0:t.token,!e.token_authentication_enabled(t)){n.next=15;break}if(e.refreshTokenManager().set(null==t?void 0:t.refreshToken),T&&!e.isTokenExpired(T)){n.next=14;break}return r({status:!1,msg:"".concat(T?"Token is expired !":"Missing Authorization Token"),response:{token:T}}),n.abrupt("return");case 14:R=JSON.parse(atob(T.split(".")[1]));case 15:window.siteId=null===(s=R)||void 0===s?void 0:s.siteId,window.siteName=null===(d=R)||void 0===d?void 0:d.site,t.isAnonymousUser=!(null===(c=R)||void 0===c||!c.anonymousId),t.siteOwner=(null===(p=R)||void 0===p?void 0:p.site)||null,t.userId=(null===(m=R)||void 0===m?void 0:m.userId)||null,window.sessionStorage.setItem("uid",null===(f=R)||void 0===f?void 0:f.userId),window.watchHistory=t.watchHistory||null,sessionStorage.setItem("vlp_token",T),j=null==t?void 0:t.playerId,S=t.chromecastReceiverId=null!=t&&t.series?null:null==t?void 0:t.chromecastReceiverId,t.chromecastReceiverId=S,C=null==t?void 0:t.airplay,D=null==t?void 0:t.apiBaseUrl,x=(null==t||null===(g=t.analytics)||void 0===g?void 0:g.gaId)||null,(E=null==t?void 0:t.errors)&&(window.customErrors=E),window.customData=null==t?void 0:t.customData,u.setLocalisation(null==t||null===(h=t.customData)||void 0===h?void 0:h.localisation),D&&(window.playerEntitlementUrl=D),null!=t&&t.skin&&!e.isNotAValidSkin(t.skin)||(t.skin="VL_ONE"),Promise.resolve().then((function(){return q})).then((function(e){e.importIMA()})),C&&"Safari"==e.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),x&&v("https://www.googletagmanager.com/gtag/js?id=".concat(x)).then((function(){return e.runGtag(x)})).catch((function(e){})),(V=null===(y=document)||void 0===y?void 0:y.getElementById("".concat(j)))&&V.addEventListener("contextmenu",(function(e){return e.preventDefault()})),w?(B={directPlaybackUrl:w,id:A="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},b?e.getVideoDetails(A,T).then((function(e){M(j,{res:L(L({},e),B)},t,{resolve:o,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,A)})):M(j,{res:B},t,{resolve:o,reject:r})):I?(N=sessionStorage.getItem("season-idx")||0,e.seasonIdxManager.set(parseInt(N)),U=null==t||null===(_=t.series)||void 0===_?void 0:_.id,e.getSeriesDetails(U,T).then((function(n){var i,l,a,s=n.data,u=n.data.seasons;e.setCurrentSeries(u);var d=P||(null==u||null===(i=u[0])||void 0===i||null===(l=i.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);H(U,T),e.getVideoDetails(d,T).then((function(n){var i,l,a;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(l=i.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,e.setCurrentVideo(n.data),M(j,{res:null==n?void 0:n.data,sres:s},t,{resolve:o,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}))})).catch((function(n){e.initiateErrorHandling(n,j,r)}))):k?(z=null==t?void 0:t.epg,e.getLinearChannelDetails(z,T).then((function(e){var n=null==e?void 0:e.data;n.contentType="linearchannel",n.channelId=null==z?void 0:z.channelId,M(j,{res:n},t,{resolve:o,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}))):e.getVideoDetails(P,T).then((function(n){var i,l,a,s;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(l=i.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,e.setCurrentVideo(null==n?void 0:n.data);var u,d=null==n?void 0:n.data;if(null!=t&&t.watchHistory&&null!=t&&null!==(s=t.watchHistory)&&void 0!==s&&s.enable)if((null===(u=t.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,p,m=O((null===(c=t.watchHistory)||void 0===c?void 0:c.profileId)||"",P,null==t?void 0:t.siteOwner);if(m&&m.length)t.watchHistoryResumeTime=(null===(v=m[0])||void 0===v?void 0:v.watchedTime)||null,t.watchedPercentage=(null===(p=m[0])||void 0===p?void 0:p.watchedPercentage)||null;d.contentType="video",M(j,{res:d},t,{resolve:o,reject:r})}else e.getVideoInfo(P,T).then((function(e){var n,i,l,a,s,u;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data)),t.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,t.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",M(j,{res:d},t,{resolve:o,reject:r})})).catch((function(e){var n,i,l,a;null!==(n=window)&&void 0!==n&&null!==(i=n.watchHistory)&&void 0!==i&&i.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(e)),M(j,{res:d},t,{resolve:o,reject:r})}));else M(j,{res:d},t,{resolve:o,reject:r})})).catch((function(n){e.initiateErrorHandling(n,j,r,P)}));case 41:case"end":return n.stop()}}),n)})));return function(e,n){return o.apply(this,arguments)}}())},getRenditions:a.getRenditions,skip:e.skip,getPlayer:e.getPlayer,play:e.play,pause:e.pause,detectBrowser:e.detectBrowser,rewind:e.rewind,loadVideo:e.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:e.isPlayerInitialised,load:e.load,authenticateLC:e.authenticateLC,dispose:e.dispose,enableCaptions:e.enableCaptions,disableCaptions:e.disableCaptions,getCaptions:e.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:e.getSource,setVolume:I,getVolume:T,disableControls:e.disableControls,setPlaybackSpeed:l.setPlaybackSpeed,getEntitlementData:e.getEntitlementData}};
|
package/esm/bundle.css
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
.video-js.skin_vlone .vjs-control-bar .vjs-progress-control.vjs-control {
|
|
8
7
|
height: 0.7em;
|
|
9
8
|
position: absolute;
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.vjs-button>.vjs-icon-placeholder:before {
|
|
47
|
-
font-size: 2em;
|
|
46
|
+
font-size: 2em !important;
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
.video-js.skin_vlone .vjs-control {
|
|
@@ -86,6 +85,21 @@
|
|
|
86
85
|
justify-content: center;
|
|
87
86
|
}
|
|
88
87
|
|
|
88
|
+
.video-js.skin_vlone .vjs-live-control{
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
}
|
|
92
|
+
.video-js.skin_vlone .vjs-live-display{
|
|
93
|
+
height: 2.2em;
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
font-family: monospace;
|
|
97
|
+
width: 4em;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
background: red;
|
|
100
|
+
margin: 4px 0px 4px 12px;
|
|
101
|
+
}
|
|
102
|
+
|
|
89
103
|
.video-js.skin_vlone .vjs-time-control {
|
|
90
104
|
line-height: 3.5em !important;
|
|
91
105
|
font-size: 1.1em !important;
|
|
@@ -102,6 +116,7 @@
|
|
|
102
116
|
}
|
|
103
117
|
|
|
104
118
|
|
|
119
|
+
|
|
105
120
|
.video-js.vjs-quality-menu {
|
|
106
121
|
display: block;
|
|
107
122
|
}
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"video.js/dist/video-js.min.css";import{d as e,g as n,s as t,a as o,b as i,l,c as r,e as a,h as s,f as u,i as d,j as c,k as v,m,p,n as f,r as h,o as w,q as g,t as y,u as b,v as k,w as O,x as I,y as j,z as T,A as P,B as S,C as D,D as C,E as x,F as R,G as E,H as A,I as V,J as H,K as B,L,M,N as _,O as N,P as U,Q as q}from"./beacon-053a96a3.js";import z from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/helpers/defineProperty";import J from"@babel/runtime/regenerator";import G from"video.js";import"videojs-contrib-quality-menu";import K from"@babel/runtime/helpers/typeof";import{o as Q,g as X,a as W,s as Y,b as Z}from"./util-c2a374ed.js";import{g as $}from"./renditions-1bc0052e.js";import{playSelectedResolution as ee}from"./resolution-af32e7a6.js";import{s as ne}from"./localisation-0bf399a1.js";import"axios";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";var te,oe,ie=function(e){return new Promise((function(n,t){if(le(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},re=function(){var t=z(J.mark((function t(o){var i,l,r,a;return J.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=n(null==o?void 0:o.playerId),console.log(o),null!=o&&null!==(i=o.series)&&void 0!==i&&i.enable||null==o||!o.chromecastReceiverId){t.next=21;break}return t.next=5,import("@silvermine/videojs-chromecast");case 5:return a=t.sent,t.prev=6,t.next=9,ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(6),console.log("Error",t.t0);case 14:return t.prev=14,a.default(G),t.finish(14);case 17:null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},t.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=o&&o.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return t.stop()}}),t,null,[[6,11,14,17]])})));return function(e){return t.apply(this,arguments)}}(),ae=function(e,t){var o=n(e);o&&t&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=G.dom.getPointerPosition(a,n).x;G.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function ue(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var de=[],ce=0,ve=null;function me(e,n,i){var l,r,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];oe=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.apiVersion)||"v1";var c=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(e.currentTime()),m=Math.floor(e.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,f=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,w=Math.floor(e.currentTime()),g=d?100:Math.floor(v/m*100),y={};h?function(e,n,t){var i=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),l=pe(i),r=(new Date).getTime(),a=o(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ue(ue({},e),{},F({},n,s[n]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===te}));d<0?l.push(ue(ue({content:u},e),{},{addedDate:r,updateDate:r})):l[d]=ue(ue(ue({},l[d]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(y={completed:d,watchedTime:w,watchedPercentage:g},c,n.siteOwner):("v1"==oe?y={videoId:te,watchedTime:w,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==oe&&(y=ue(ue({videoId:te,watchedTime:w,watchedPercentage:g,doneWatching:d,profileId:c},ve&&{seriesId:ve}),f&&{originalObjectId:f})),t(y,oe).then((function(e){})).catch((function(e){}))),ce=v+i}function pe(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function fe(e,n,t){var o=pe(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var he=function(e,t,o){var i=n(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var l=parseFloat(t)/100;i.volume(l),o&&o({status:!0,msg:"Volume set to ".concat(t,"%")})}else o&&o({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else o({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},we=function(e){var t=n(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ge=!1,ye=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!ge){var a=be(e,"videoAssets","secondaryVideoAssets"),s=i(a,n);return s&&l(n,s),ge=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function be(e,n,t){if(Array.isArray(e))return e.map((function(e){return be(e,n,t)}));if(null!==e&&"object"===K(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=be(e[i],n,t)})),o}return e}function ke(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ke(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ke(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ie=function(e,t,i,l){var d,c,v=l.res,m=l.sres,p=n(e),f=(null==v?void 0:v.contentType)||"video",h=(null==v||null===(d=v[f])||void 0===d||null===(c=d.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;r(v),p&&(p.on("loadstart",(function(){h?i.resolve({status:!0,msg:"Video Loaded",response:v}):i.resolve(Oe({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:v}:{response:v}))})),p.on("loadeddata",(function(){var i,l;(null==p||!p.muted())&&he(e,sessionStorage.getItem("volume")||"100");var r=o();if(a(),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.saveOffline)){var s,u,d=Oe(Oe({},t),v);!function(e,t,o){var i,l,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(ve=null==t||null===(l=t.series)||void 0===l?void 0:l.id),de=[],ce=0,te=o;var a=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=n(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());de.includes(ce)||(e==ce?(de.push(e),me(s,t,a)):e>ce&&(ce=e+a))})),s.one("ended",(function(){me(s,t,a,!0)})))}(e,d,null==r||null===(s=r.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id)}})),p.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];p.trigger("subtitlechanged",n)})),p.on("subtitlechanged",(function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,h=p.getMediaSession(),w=h.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([w[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(f)}})),p.tech_.on("retryplaylist",(function(){h&&ye(v,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&h)?ye(v,e):(s(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:v}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,l,r=null===(n=o())||void 0===n||null===(i=n.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,a=u(),s=(null==a?void 0:a.get(r))||{t:0,p:0},d=s.t,c=s.p;d&&c<95&&setTimeout((function(){p.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),p.on("volumechange",(function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),p.on("chromecastDisconnected",(function(){if(h){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))},je=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-7f6aef3a.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-b8c55eac.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-f30551f3.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-acfeca76.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-58452f4b.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-bdf32d57.js").then((function(t){t.initialiseSkin(e,n)}))};var Te,Pe=function(){var e=z(J.mark((function e(){return J.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){G.getPlugin("eme")||G.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(G)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(G)}))},importIMA:function(){import("videojs-contrib-ads"),import("ima"),ie("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadEMELibrary:Pe}),De=function(e,n){var t=new Map;d({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),c(t)})).catch((function(e){return console.log(e)}))};function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function xe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ce(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Re=function(e,t,o,r){var a,u,d,c,v,m,p,f,h,w,g,y,b,k,O,I,T,P,S,D,C,x,R,E,A,_,N,U,q,K,Q,X,W,Y=t.res,Z=void 0===Y?null:Y,$=t.sres,ee=void 0===$?null:$;null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(d=u.framework)||void 0===d||null===(c=d.CastContext)||void 0===c||null===(v=c.getInstance())||void 0===v||v.S;var ne=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=Z)||void 0===m?void 0:m.contentType)||"video",oe=V(null===(p=Z)||void 0===p||null===(f=p[te])||void 0===f||null===(h=f.gist)||void 0===h?void 0:h.videoImageUrl)||V(null===(w=Z)||void 0===w||null===(g=w[te])||void 0===g||null===(y=g.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),ie=(null===(k=Z)||void 0===k||null===(O=k[te])||void 0===O||null===(I=O.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,le=(null===(T=Z)||void 0===T||null===(P=T[te])||void 0===P||null===(S=P.streamingInfo)||void 0===S?void 0:S.isLiveStream)||!0,se=(null===(D=Z)||void 0===D||null===(C=D.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(R=x.adTags)||void 0===R||null===(E=R.web)||void 0===E?void 0:E.active)&&(null===(A=Z)||void 0===A||null===(_=A.ads)||void 0===_||null===(N=_.preRoll)||void 0===N||null===(U=N.adTags)||void 0===U||null===(q=U.web)||void 0===q?void 0:q.url);Z=xe(xe({},Z),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var ue=(W={controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==o.skin,liveui:!0},F(W,"autoplay",null==o?void 0:o.autoplay),F(W,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!se),F(W,"loop",(null==o?void 0:o.loop)||!1),F(W,"audioPosterMode",null==o?void 0:o.audioPosterMode),F(W,"html5",xe(xe({vhs:xe(xe({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==o||null===(K=o.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(X=o.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),F(W,"poster",oe),F(W,"techOrder",ne),F(W,"chromecast",{requestCustomDataFn:function(t){var o=n(e),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,l,r,a,s,u,d,c,v,m=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){p.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;p.licenseUrl=f;var h=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=h}var w=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=w;var g=null==e||null===(l=e[m])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=y;var b=null==e||null===(u=e[m])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=b,p.subTitles=t,p.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Z,t,i)}}),W);if(!G.getPlayers()[e])var de=G(e,ue,function(){var n=z(J.mark((function n(){var t,a,u,d,c,v,m,p,f,h,w,g,y,b,k,O,I,T,P,S,D,C,x;return J.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(de),n.next=3,re(o);case 3:if(le&&r.resolve(xe({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),M(e),/Android/i.test(navigator.userAgent)&&(G.options.vhs.overrideNative=!0),b=null===(t=Z)||void 0===t||null===(a=t[te])||void 0===a?void 0:a.drmEnabled,k=null===(u=Z)||void 0===u||null===(d=u[te])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,!b){n.next=11;break}return n.next=11,Pe();case 11:ie&&ae(e,k),!se||null!=o&&null!==(v=o.customData)&&void 0!==v&&v.disableAds||H(e,se,Z),O=i(Z,e),console.log(O),null!=o&&o.nearestClusterUrl&&(O=B(O,o.nearestClusterUrl)),O?l(e,O):(r.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),s(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Z)||void 0===m||null===(p=m[te])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(h=f.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(w=Z)||void 0===w||null===(g=w[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(x=(null===(T=Z)||void 0===T||null===(P=T[te])||void 0===P||null===(S=P.contentDetails)||void 0===S?void 0:S.closedCaptions)||(null===(D=Z)||void 0===D||null===(C=D[te])||void 0===C?void 0:C.closedCaptions),I=x.filter((function(e){return"VTT"===e.format})),L(e,I)),null!=o&&o.disableControls?j(e):je(e,xe(xe(xe({},o),ue),{},{liveVideo:le,isDvrEnabled:ie,res:Z,sres:ee})),Ie(e,xe(xe(xe({},o),ue),{},{liveVideo:le}),r,{res:Z,sres:ee});case 20:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ee(){return{loadVideoInstantly:v,onTimeUpdate:Q,getVideoDuration:X,onVideoEnded:W,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var t=z(J.mark((function t(o,i){var l,a,s,u,d,c,v,m,p,f,h,g,y,b,k,O,I,j,T,V,H,B,L,M,z,F,G,K,Q,X;return J.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!w(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(g=(null==n?void 0:n.videoSourceUrl)||!1,y=null==n?void 0:n.asat,b=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,k=null==n?void 0:n.videoId,O=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=k,I=null==n?void 0:n.token,!R(n)){t.next=15;break}if(E().set(null==n?void 0:n.refreshToken),I&&!A(I)){t.next=14;break}return i({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}}),t.abrupt("return");case 14:Te=JSON.parse(atob(I.split(".")[1]));case 15:window.siteId=null===(s=Te)||void 0===s?void 0:s.siteId,window.siteName=null===(u=Te)||void 0===u?void 0:u.site,n.isAnonymousUser=!(null===(d=Te)||void 0===d||!d.anonymousId),n.siteOwner=(null===(c=Te)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=Te)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=Te)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,sessionStorage.setItem("vlp_token",I),j=null==n?void 0:n.playerId,T=n.chromecastReceiverId=null!=n&&n.series?null:null==n?void 0:n.chromecastReceiverId,n.chromecastReceiverId=T,V=null==n?void 0:n.airplay,H=null==n?void 0:n.apiBaseUrl,B=(null==n||null===(p=n.analytics)||void 0===p?void 0:p.gaId)||null,(L=null==n?void 0:n.errors)&&(window.customErrors=L),window.customData=null==n?void 0:n.customData,ne(null==n||null===(f=n.customData)||void 0===f?void 0:f.localisation),H&&(window.playerEntitlementUrl=H),null!=n&&n.skin&&!P(n.skin)||(n.skin="VL_ONE"),Promise.resolve().then((function(){return Se})).then((function(e){e.importIMA()})),V&&"Safari"==e()&&Promise.resolve().then((function(){return Se})).then((function(e){e.importAirplay()})),B&&ie("https://www.googletagmanager.com/gtag/js?id=".concat(B)).then((function(){return S(B)})).catch((function(e){})),(M=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&M.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g?(F={directPlaybackUrl:g,id:z="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?D(z,I).then((function(e){Re(j,{res:xe(xe({},e),F)},n,{resolve:o,reject:i})})).catch((function(e){x(e,j,i,z)})):Re(j,{res:F},n,{resolve:o,reject:i})):O?(K=sessionStorage.getItem("season-idx")||0,U.set(parseInt(K)),Q=null==n||null===(G=n.series)||void 0===G?void 0:G.id,_(Q,I).then((function(e){var t,l,a,s=e.data,u=e.data.seasons;q(u);var d=k||(null==u||null===(t=u[0])||void 0===t||null===(l=t.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);De(Q,I),D(d,I).then((function(e){var t,l,a;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(l=t.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(e.data),Re(j,{res:null==e?void 0:e.data,sres:s},n,{resolve:o,reject:i})})).catch((function(e){x(e,j,i,k)}))})).catch((function(e){x(e,j,i)}))):b?(X=null==n?void 0:n.epg,N(X,I).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==X?void 0:X.channelId,Re(j,{res:t},n,{resolve:o,reject:i})})).catch((function(e){x(e,j,i,k)}))):D(k,I).then((function(e){var t,l,a,s;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(l=t.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(null==e?void 0:e.data);var u,d=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(s=n.watchHistory)&&void 0!==s&&s.enable)if((null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,m,p=fe((null===(c=n.watchHistory)||void 0===c?void 0:c.profileId)||"",k,null==n?void 0:n.siteOwner);if(p&&p.length)n.watchHistoryResumeTime=(null===(v=p[0])||void 0===v?void 0:v.watchedTime)||null,n.watchedPercentage=(null===(m=p[0])||void 0===m?void 0:m.watchedPercentage)||null;d.contentType="video",Re(j,{res:d},n,{resolve:o,reject:i})}else C(k,I).then((function(e){var t,l,r,a,s,u;null!==(t=window)&&void 0!==t&&null!==(l=t.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,n.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",Re(j,{res:d},n,{resolve:o,reject:i})})).catch((function(e){var t,l,r,a;null!==(t=window)&&void 0!==t&&null!==(l=t.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(e)),Re(j,{res:d},n,{resolve:o,reject:i})}));else Re(j,{res:d},n,{resolve:o,reject:i})})).catch((function(e){x(e,j,i,k)}));case 41:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},getRenditions:$,skip:m,getPlayer:n,play:p,pause:f,detectBrowser:e,rewind:h,loadVideo:l,seekToTimeStamp:Y,isPlayerInitialised:w,load:g,authenticateLC:y,dispose:b,enableCaptions:k,disableCaptions:O,getCaptions:I,playSelectedResolution:ee,getSource:i,setVolume:he,getVolume:we,disableControls:j,setPlaybackSpeed:Z,getEntitlementData:T}}export{Ee as default};
|
|
1
|
+
import"video.js/dist/video-js.min.css";import{d as e,g as n,s as t,a as o,b as i,l,c as r,e as a,h as s,f as u,i as d,j as c,k as v,m,p,n as f,r as h,o as w,q as g,t as y,u as b,v as k,w as O,x as I,y as j,z as T,A as P,B as S,C as D,D as C,E as x,F as R,G as E,H as A,I as V,J as H,K as B,L,M,N as _,O as N,P as U,Q as q}from"./beacon-053a96a3.js";import z from"@babel/runtime/helpers/asyncToGenerator";import F from"@babel/runtime/helpers/defineProperty";import J from"@babel/runtime/regenerator";import G from"video.js";import"videojs-contrib-quality-menu";import K from"@babel/runtime/helpers/typeof";import{o as Q,g as X,a as W,s as Y,b as Z}from"./util-c2a374ed.js";import{g as $}from"./renditions-1bc0052e.js";import{playSelectedResolution as ee}from"./resolution-af32e7a6.js";import{s as ne}from"./localisation-0bf399a1.js";import"axios";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";var te,oe,ie=function(e){return new Promise((function(n,t){if(le(e))t("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!0,o.src=e,o.onload=function(){n()},o.onerror=function(n){t("Error while loading script ".concat(e," : ").concat(n))},document.head.appendChild(o)}}))},le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},re=function(){var t=z(J.mark((function t(o){var i,l,r,a;return J.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=n(null==o?void 0:o.playerId),console.log(o),null!=o&&null!==(i=o.series)&&void 0!==i&&i.enable||null==o||!o.chromecastReceiverId){t.next=21;break}return t.next=5,import("@silvermine/videojs-chromecast");case 5:return a=t.sent,t.prev=6,t.next=9,ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(6),console.log("Error",t.t0);case 14:return t.prev=14,a.default(G),t.finish(14);case 17:null!==(r=window)&&void 0!==r&&r.cast?null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}):window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==o?void 0:o.chromecastReceiverId,addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},t.next=22;break;case 21:console.log("Chromecast plugin is not available");case 22:null!=o&&o.airplay&&"Safari"==e()?null==l||l.airPlay({addButtonToControlBar:"new"==o.skin||"defaultV2"==o.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 23:case"end":return t.stop()}}),t,null,[[6,11,14,17]])})));return function(e){return t.apply(this,arguments)}}(),ae=function(e,t){var o=n(e);o&&t&&o.controlBar&&o.controlBar.progressControl.seekBar.on("click",(function(n){var t,o,i,l,r,a=this.el(),s=G.dom.getPointerPosition(a,n).x;G.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,d=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S;if(console.log(u),u&&"CONNECTED"===d){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function ue(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var de=[],ce=0,ve=null;function me(e,n,i){var l,r,a,s,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];oe=(null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.apiVersion)||"v1";var c=null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.profileId,v=Math.floor(e.currentTime()),m=Math.floor(e.duration()),p=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,f=(null==n||null===(s=n.video)||void 0===s?void 0:s.originalObjectId)||null,h=(null==n||null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1,w=Math.floor(e.currentTime()),g=d?100:Math.floor(v/m*100),y={};h?function(e,n,t){var i=n?"watchhistory-data-".concat(n):"watchhistory-data-guest-".concat(t),l=pe(i),r=(new Date).getTime(),a=o(),s=(null==a?void 0:a.video)||{},u=["id","title","gist","categories","tags","status","publishDate","plans","isVerticalVideo","monetizationBadgeIdentifier","runtime"].reduce((function(e,n){return ue(ue({},e),{},F({},n,s[n]))}),{}),d=l.findIndex((function(e){var n;return(null==e||null===(n=e.content)||void 0===n?void 0:n.id)===te}));d<0?l.push(ue(ue({content:u},e),{},{addedDate:r,updateDate:r})):l[d]=ue(ue(ue({},l[d]),e),{},{updateDate:r});localStorage.setItem("".concat(i),JSON.stringify(l))}(y={completed:d,watchedTime:w,watchedPercentage:g},c,n.siteOwner):("v1"==oe?y={videoId:te,watchedTime:w,watchedPercentage:g,siteOwner:n.siteOwner,userId:n.userId,xApiKey:p}:"v2"==oe&&(y=ue(ue({videoId:te,watchedTime:w,watchedPercentage:g,doneWatching:d,profileId:c},ve&&{seriesId:ve}),f&&{originalObjectId:f})),t(y,oe).then((function(e){})).catch((function(e){}))),ce=v+i}function pe(e){var n=[];return e&&(n=JSON.parse(localStorage.getItem("".concat(e))||"[]")),n}function fe(e,n,t){var o=pe(e?"watchhistory-data-".concat(e):"watchhistory-data-guest-".concat(t)),i=[];return o&&Array.isArray(o)&&(i=o.filter((function(e){var t;return(null==e||null===(t=e.content)||void 0===t?void 0:t.id)===n}))),i}var he=function(e,t,o){var i=n(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var l=parseFloat(t)/100;i.volume(l),o&&o({status:!0,msg:"Volume set to ".concat(t,"%")})}else o&&o({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else o({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},we=function(e){var t=n(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")},ge=!1,ye=function(e,n){var t,o,r=(null==e?void 0:e.contentType)||"video";if(((null==e||null===(t=e[r])||void 0===t||null===(o=t.streamingInfo)||void 0===o?void 0:o.secondaryVideoAssets)||null)&&!ge){var a=be(e,"videoAssets","secondaryVideoAssets"),s=i(a,n);return s&&l(n,s),ge=!0,console.log("switching to secondary source"),!0}return console.log("secondary source is either corrupted / not available"),!1};function be(e,n,t){if(Array.isArray(e))return e.map((function(e){return be(e,n,t)}));if(null!==e&&"object"===K(e)){var o={};return Object.keys(e).forEach((function(i){i===n&&void 0!==e[t]?o[i]=e[t]:i===t&&void 0!==e[n]?o[i]=e[n]:o[i]=be(e[i],n,t)})),o}return e}function ke(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ke(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ke(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ie=function(e,t,i,l){var d,c,v=l.res,m=l.sres,p=n(e),f=(null==v?void 0:v.contentType)||"video",h=(null==v||null===(d=v[f])||void 0===d||null===(c=d.streamingInfo)||void 0===c?void 0:c.isLiveStream)||!1;r(v),p&&(p.on("loadstart",(function(){h?i.resolve({status:!0,msg:"Video Loaded",response:v}):i.resolve(Oe({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:v}:{response:v}))})),p.on("loadeddata",(function(){var i,l;(null==p||!p.muted())&&he(e,sessionStorage.getItem("volume")||"100");var r=o();if(a(),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&(!t.isAnonymousUser||null!=t&&null!==(l=t.watchHistory)&&void 0!==l&&l.saveOffline)){var s,u,d=Oe(Oe({},t),v);!function(e,t,o){var i,l,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(ve=null==t||null===(l=t.series)||void 0===l?void 0:l.id),de=[],ce=0,te=o;var a=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=n(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());de.includes(ce)||(e==ce?(de.push(e),me(s,t,a)):e>ce&&(ce=e+a))})),s.one("ended",(function(){me(s,t,a,!0)})))}(e,d,null==r||null===(s=r.video)||void 0===s||null===(u=s.gist)||void 0===u?void 0:u.id)}})),p.textTracks().on("change",(function(e){var n=this.tracks_.filter((function(e){if(("subtitles"===e.kind||"captions"===e.kind)&&"showing"===e.mode)return!0}))[0];p.trigger("subtitlechanged",n)})),p.on("subtitlechanged",(function(e,n){var t,o,i,l,r,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(o=t.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(l=i.CastContext)||void 0===l||null===(r=l.getInstance())||void 0===r?void 0:r.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(u=s.framework)||void 0===u||null===(d=u.CastContext)||void 0===d||null===(c=d.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var f,h=p.getMediaSession(),w=h.media.tracks.filter((function(e){return"TEXT"==e.type}));f=n?new chrome.cast.media.EditTracksInfoRequest([w[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),h.editTracksInfo(f)}})),p.tech_.on("retryplaylist",(function(){h&&ye(v,e)})),p.on("error",(function(){var n,t;(console.log("ERROR",p.error(),p.error().code),4===p.error().code&&h)?ye(v,e):(s(e,(null==p||null===(n=p.error())||void 0===n?void 0:n.message)||"Some error occured"),i.reject({status:!1,msg:(null==p||null===(t=p.error())||void 0===t?void 0:t.message)||"Some error occured",response:v}))})),p.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,l,r=null===(n=o())||void 0===n||null===(i=n.video)||void 0===i||null===(l=i.gist)||void 0===l?void 0:l.id,a=u(),s=(null==a?void 0:a.get(r))||{t:0,p:0},d=s.t,c=s.p;d&&c<95&&setTimeout((function(){p.currentTime(d)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){p.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),p.on("volumechange",(function(){var e=100*p.volume().toFixed(2);p.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),p.on("chromecastDisconnected",(function(){if(h){p.currentSource();for(var e=p.textTracks(),n=e.length-1;n>=0;n--)p.removeRemoteTextTrack(e[n])}})))},je=function(e,n){var t=null==n?void 0:n.skin;"default"==t?import("./skin-7f6aef3a.js").then((function(t){t.initialiseSkin(e,n)})):"carousel"==t?import("./skin-b8c55eac.js").then((function(n){n.initaliseSkin(e)})):"defaultV2"==t?import("./skin-f30551f3.js").then((function(t){t.initialiseSkin(e,n)})):"multiplayer"==t?import("./skin-acfeca76.js").then((function(t){t.initialiseSkin(e,n)})):"minimalist"==t?import("./skin-58452f4b.js").then((function(t){t.initaliseSkin(e,n)})):"VL_ONE"==t&&import("./skin-bdf32d57.js").then((function(t){t.initialiseSkin(e,n)}))};var Te,Pe=function(){var e=z(J.mark((function e(){return J.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme").then((function(e){G.getPlugin("eme")||G.registerPlugin("eme",e.default)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ie("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(G)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(G)}))},importIMA:function(){import("videojs-contrib-ads"),import("ima"),ie("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadEMELibrary:Pe}),De=function(e,n){var t=new Map;d({videoId:e,token:n}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),c(t)})).catch((function(e){return console.log(e)}))};function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function xe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ce(Object(t),!0).forEach((function(n){F(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Re=function(e,t,o,r){var a,u,d,c,v,m,p,f,h,w,g,y,b,k,O,I,T,P,S,D,C,x,R,E,A,_,N,U,q,K,Q,X,W,Y=t.res,Z=void 0===Y?null:Y,$=t.sres,ee=void 0===$?null:$;null===(a=window)||void 0===a||null===(u=a.cast)||void 0===u||null===(d=u.framework)||void 0===d||null===(c=d.CastContext)||void 0===c||null===(v=c.getInstance())||void 0===v||v.S;var ne=null!=o&&o.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(m=Z)||void 0===m?void 0:m.contentType)||"video",oe=V(null===(p=Z)||void 0===p||null===(f=p[te])||void 0===f||null===(h=f.gist)||void 0===h?void 0:h.videoImageUrl)||V(null===(w=Z)||void 0===w||null===(g=w[te])||void 0===g||null===(y=g.gist)||void 0===y||null===(b=y.imageGist)||void 0===b?void 0:b.r16x9),ie=(null===(k=Z)||void 0===k||null===(O=k[te])||void 0===O||null===(I=O.liveDetails)||void 0===I?void 0:I.isDvrEnabled)||!1,le=(null===(T=Z)||void 0===T||null===(P=T[te])||void 0===P||null===(S=P.streamingInfo)||void 0===S?void 0:S.isLiveStream)||!0,se=(null===(D=Z)||void 0===D||null===(C=D.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(R=x.adTags)||void 0===R||null===(E=R.web)||void 0===E?void 0:E.active)&&(null===(A=Z)||void 0===A||null===(_=A.ads)||void 0===_||null===(N=_.preRoll)||void 0===N||null===(U=N.adTags)||void 0===U||null===(q=U.web)||void 0===q?void 0:q.url);Z=xe(xe({},Z),{},{audioAssetSource:null==o?void 0:o.audioAssetSource});var ue=(W={controls:0!=(null==o?void 0:o.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==o?void 0:o.muted)||!1,autoplay:(null==o?void 0:o.autoplay)||!1,controlBar:{volumePanel:{inline:!1},fullscreenToggle:!0,audioTrackButton:!0,pictureInPictureToggle:!0},muteToggle:"multiplayer"==o.skin,liveui:ie},F(W,"autoplay",null==o?void 0:o.autoplay),F(W,"normalizeAutoplay",(null==o?void 0:o.autoplay)&&!se),F(W,"loop",(null==o?void 0:o.loop)||!1),F(W,"audioPosterMode",null==o?void 0:o.audioPosterMode),F(W,"html5",xe(xe({vhs:xe(xe({liveRangeSafeTimeDelta:0,maxPlaylistRetries:3,smoothQualityChange:!0,useDevicePixelRatio:!0,experimentalLLHLS:(null==o?void 0:o.lowLatency)||!1,limitRenditionByPlayerDimensions:!1,useNetworkInformationApi:!1},(null==o||null===(K=o.customData)||void 0===K?void 0:K.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:!0,experimentalBufferBasedABR:!0})},0==(null==o||null===(Q=o.customData)||void 0===Q?void 0:Q.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==o||null===(X=o.customData)||void 0===X?void 0:X.nativeVideoTracks)&&{nativeVideoTracks:!1})),F(W,"poster",oe),F(W,"techOrder",ne),F(W,"chromecast",{requestCustomDataFn:function(t){var o=n(e),i=((null==o?void 0:o.textTracksJson_)||o.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,n,t){var o,i,l,r,a,s,u,d,c,v,m=(null==e?void 0:e.contentType)||"video",p={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){p.isDrmEnabled=!0;var f=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.serverURL;p.licenseUrl=f;var h=n.keySystemOptions&&n.keySystemOptions[0]&&n.keySystemOptions[0].options&&n.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=h}var w=(null==e||null===(o=e[m])||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=w;var g=null==e||null===(l=e[m])||void 0===l||null===(r=l.gist)||void 0===r?void 0:r.runtime;p.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=y;var b=null==e||null===(u=e[m])||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=b,p.subTitles=t,p.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(Z,t,i)}}),W);if(!G.getPlayers()[e])var de=G(e,ue,function(){var n=z(J.mark((function n(){var t,a,u,d,c,v,m,p,f,h,w,g,y,b,k,O,I,T,P,S,D,C,x;return J.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(de),n.next=3,re(o);case 3:if(le&&r.resolve(xe({status:!0,msg:"Player Initialised"},ee?{seriesResponse:ee,response:Z}:{response:Z})),M(e),/Android/i.test(navigator.userAgent)&&(G.options.vhs.overrideNative=!0),b=null===(t=Z)||void 0===t||null===(a=t[te])||void 0===a?void 0:a.drmEnabled,k=null===(u=Z)||void 0===u||null===(d=u[te])||void 0===d||null===(c=d.liveDetails)||void 0===c?void 0:c.startOverTime,!b){n.next=11;break}return n.next=11,Pe();case 11:ie&&ae(e,k),!se||null!=o&&null!==(v=o.customData)&&void 0!==v&&v.disableAds||H(e,se,Z),O=i(Z,e),console.log(O),null!=o&&o.nearestClusterUrl&&(O=B(O,o.nearestClusterUrl)),O?l(e,O):(r.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:Z}),s(e,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=Z)||void 0===m||null===(p=m[te])||void 0===p||null===(f=p.contentDetails)||void 0===f||null===(h=f.closedCaptions)||void 0===h?void 0:h.length)>0||(null===(w=Z)||void 0===w||null===(g=w[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(x=(null===(T=Z)||void 0===T||null===(P=T[te])||void 0===P||null===(S=P.contentDetails)||void 0===S?void 0:S.closedCaptions)||(null===(D=Z)||void 0===D||null===(C=D[te])||void 0===C?void 0:C.closedCaptions),I=x.filter((function(e){return"VTT"===e.format})),L(e,I)),null!=o&&o.disableControls?j(e):je(e,xe(xe(xe({},o),ue),{},{liveVideo:le,isDvrEnabled:ie,res:Z,sres:ee})),Ie(e,xe(xe(xe({},o),ue),{},{liveVideo:le}),r,{res:Z,sres:ee});case 20:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}())};function Ee(){return{loadVideoInstantly:v,onTimeUpdate:Q,getVideoDuration:X,onVideoEnded:W,init:function(n){return console.log("%c VIDEOJS-8 ","background: #bdf369; color: #000"),new Promise(function(){var t=z(J.mark((function t(o,i){var l,a,s,u,d,c,v,m,p,f,h,g,y,b,k,O,I,j,T,V,H,B,L,M,z,F,G,K,Q,X;return J.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!w(null==n?void 0:n.playerId)){t.next=2;break}return t.abrupt("return");case 2:if(g=(null==n?void 0:n.videoSourceUrl)||!1,y=null==n?void 0:n.asat,b=(null==n||null===(l=n.epg)||void 0===l?void 0:l.enable)||!1,k=null==n?void 0:n.videoId,O=(null==n||null===(a=n.series)||void 0===a?void 0:a.enable)||!1,window.videoId=k,I=null==n?void 0:n.token,!R(n)){t.next=15;break}if(E().set(null==n?void 0:n.refreshToken),I&&!A(I)){t.next=14;break}return i({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}}),t.abrupt("return");case 14:Te=JSON.parse(atob(I.split(".")[1]));case 15:window.siteId=null===(s=Te)||void 0===s?void 0:s.siteId,window.siteName=null===(u=Te)||void 0===u?void 0:u.site,n.isAnonymousUser=!(null===(d=Te)||void 0===d||!d.anonymousId),n.siteOwner=(null===(c=Te)||void 0===c?void 0:c.site)||null,n.userId=(null===(v=Te)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=Te)||void 0===m?void 0:m.userId),window.watchHistory=n.watchHistory||null,sessionStorage.setItem("vlp_token",I),j=null==n?void 0:n.playerId,T=n.chromecastReceiverId=null!=n&&n.series?null:null==n?void 0:n.chromecastReceiverId,n.chromecastReceiverId=T,V=null==n?void 0:n.airplay,H=null==n?void 0:n.apiBaseUrl,B=(null==n||null===(p=n.analytics)||void 0===p?void 0:p.gaId)||null,(L=null==n?void 0:n.errors)&&(window.customErrors=L),window.customData=null==n?void 0:n.customData,ne(null==n||null===(f=n.customData)||void 0===f?void 0:f.localisation),H&&(window.playerEntitlementUrl=H),null!=n&&n.skin&&!P(n.skin)||(n.skin="VL_ONE"),Promise.resolve().then((function(){return Se})).then((function(e){e.importIMA()})),V&&"Safari"==e()&&Promise.resolve().then((function(){return Se})).then((function(e){e.importAirplay()})),B&&ie("https://www.googletagmanager.com/gtag/js?id=".concat(B)).then((function(){return S(B)})).catch((function(e){})),(M=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(j)))&&M.addEventListener("contextmenu",(function(e){return e.preventDefault()})),g?(F={directPlaybackUrl:g,id:z="c09576ca-8202-4e8e-ba1e-06d1ab0ce063"},y?D(z,I).then((function(e){Re(j,{res:xe(xe({},e),F)},n,{resolve:o,reject:i})})).catch((function(e){x(e,j,i,z)})):Re(j,{res:F},n,{resolve:o,reject:i})):O?(K=sessionStorage.getItem("season-idx")||0,U.set(parseInt(K)),Q=null==n||null===(G=n.series)||void 0===G?void 0:G.id,_(Q,I).then((function(e){var t,l,a,s=e.data,u=e.data.seasons;q(u);var d=k||(null==u||null===(t=u[0])||void 0===t||null===(l=t.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);De(Q,I),D(d,I).then((function(e){var t,l,a;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(l=t.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(e.data),Re(j,{res:null==e?void 0:e.data,sres:s},n,{resolve:o,reject:i})})).catch((function(e){x(e,j,i,k)}))})).catch((function(e){x(e,j,i)}))):b?(X=null==n?void 0:n.epg,N(X,I).then((function(e){var t=null==e?void 0:e.data;t.contentType="linearchannel",t.channelId=null==X?void 0:X.channelId,Re(j,{res:t},n,{resolve:o,reject:i})})).catch((function(e){x(e,j,i,k)}))):D(k,I).then((function(e){var t,l,a,s;window.contentType=null==e||null===(t=e.data)||void 0===t||null===(l=t.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,r(null==e?void 0:e.data);var u,d=null==e?void 0:e.data;if(null!=n&&n.watchHistory&&null!=n&&null!==(s=n.watchHistory)&&void 0!==s&&s.enable)if((null===(u=n.watchHistory)||void 0===u?void 0:u.saveOffline)||!1){var c,v,m,p=fe((null===(c=n.watchHistory)||void 0===c?void 0:c.profileId)||"",k,null==n?void 0:n.siteOwner);if(p&&p.length)n.watchHistoryResumeTime=(null===(v=p[0])||void 0===v?void 0:v.watchedTime)||null,n.watchedPercentage=(null===(m=p[0])||void 0===m?void 0:m.watchedPercentage)||null;d.contentType="video",Re(j,{res:d},n,{resolve:o,reject:i})}else C(k,I).then((function(e){var t,l,r,a,s,u;null!==(t=window)&&void 0!==t&&null!==(l=t.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(null==e?void 0:e.data)),n.watchHistoryResumeTime=(null==e||null===(s=e.data)||void 0===s?void 0:s.watchedTime)||null,n.watchedPercentage=(null==e||null===(u=e.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",Re(j,{res:d},n,{resolve:o,reject:i})})).catch((function(e){var t,l,r,a;null!==(t=window)&&void 0!==t&&null!==(l=t.watchHistory)&&void 0!==l&&l.cb&&(null===(r=window)||void 0===r||null===(a=r.watchHistory)||void 0===a||a.cb(e)),Re(j,{res:d},n,{resolve:o,reject:i})}));else Re(j,{res:d},n,{resolve:o,reject:i})})).catch((function(e){x(e,j,i,k)}));case 41:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},getRenditions:$,skip:m,getPlayer:n,play:p,pause:f,detectBrowser:e,rewind:h,loadVideo:l,seekToTimeStamp:Y,isPlayerInitialised:w,load:g,authenticateLC:y,dispose:b,enableCaptions:k,disableCaptions:O,getCaptions:I,playSelectedResolution:ee,getSource:i,setVolume:he,getVolume:we,disableControls:j,setPlaybackSpeed:Z,getEntitlementData:T}}export{Ee as default};
|