@viewlift/player-backup 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("./generic-8b99b151.js"),r=require("./util-fa21734a.js"),l=require("./renditions-bc841552.js"),a=require("./resolution-6a9adf54.js"),s=require("./skin-84083352.js");function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function d(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?u(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}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 c,v,p=function(e,t){var n=i.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,r,l,a,s=this.el(),u=o.dom.getPointerPosition(s,t).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.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 m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var f=[],y=0,w=null;function h(e,n,o){var r,l,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];v=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var u=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,d=Math.floor(e.currentTime()),p=Math.floor(e.duration()),f=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,h={};"v1"==v?h={videoId:c,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(d/p*100),siteOwner:n.siteOwner,userId:n.userId,xApiKey:f}:"v2"==v&&(h=function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?m(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({videoId:c,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(d/p*100),doneWatching:s,profileId:u},w&&{seriesId:w})),i.saveWatchHistory(h,n.token,v).then((function(e){})).catch((function(e){})),y=d+o}var g=function(e,t,n){var o=i.getPlayer(e);if(o)if(t>=0&&t<=100){o.muted()&&o.muted(!1);var r=parseFloat(t)/100;o.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var t=i.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var O=function(e,n,o,r){var l,a,s=r.res,u=r.sres,d=i.getPlayer(e),v=(null==s||null===(l=s.video)||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;i.setCurrentVideo(s),d.on("loadstart",(function(){v&&o.resolve({status:!0,msg:"Video Loaded",response:s})})),d.on("loadeddata",(function(){var r;(null==d||!d.muted())&&g(e,sessionStorage.getItem("volume")||"100");var l,a,v=i.getCurrentVideo();(i.clearError(),o.resolve(function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?k(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):k(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({status:!0,msg:"Player Initialised"},u?{seriesResponse:u,response:s}:{response:s})),null!=n&&n.watchHistory&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.enable&&!n.isAnonymousUser)&&function(e,t,n){var o,r;null!=t&&t.series&&(w=null==t||null===(o=t.series)||void 0===o?void 0:o.id),f=[],y=0,c=n;var l=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,a=i.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());f.includes(y)||(e==y?(f.push(e),h(a,t,l)):e>y&&(y=e+l))})),a.on("ended",(function(){h(a,t,l,!0)})))}(e,n,null==v||null===(l=v.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.id)})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,o,i,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(n=window)||void 0===n||null===(o=n.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.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,y=m.getMediaSession(),w=y.media.tracks.filter((function(e){return"TEXT"==e.type}));f=t?new chrome.cast.media.EditTracksInfoRequest([w[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(f)}})),d.on("loadedmetadata",(function(){})),d.one("error",(function(){var t,n;i.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==d||null===(n=d.error())||void 0===n?void 0:n.message)||"Some error occured"})})),d.one("play",(function(){var e;if(null!=n&&null!==(e=n.series)&&void 0!==e&&e.enable){var t,o,r,l=null===(t=i.getCurrentVideo())||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id,a=i.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&d.currentTime(null==n?void 0:n.watchHistoryResumeTime)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},P=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-93a3e5ae.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-39ab30e2.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-ec49b877.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-83edff36.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&Promise.resolve().then((function(){return require("./skin-fb394911.js")})).then((function(n){n.initialiseSkin(e,t)}))},j=function(e){return new Promise((function(t,n){if(I(e))n("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!1,o.src=e,o.onload=function(){t()},o.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(o)}}))},I=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0};function S(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}var C=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var T,D=function(){var t=e(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:j("https://cdn.dashjs.org/v4.7.3/dash.all.min.js").then((function(){})).catch((function(e){return console.log(e)}));case 3:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),E=function(){var t=e(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),R=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){j("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("videojs-ima"),j("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:D,loadEMELibrary:E});function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function x(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?V(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):V(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var q=function(r,l,a,s){var u,c,v,m,f,y,w,h,g,b,k,j,I,S,T,R,V,q,B,A,H,L,M,_=l.res,N=void 0===_?null:_,U=l.sres,F=void 0===U?null:U,W=(null===(u=window)||void 0===u||null===(c=u.cast)||void 0===c||null===(v=c.framework)||void 0===v||null===(m=v.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f?void 0:f.S)||void 0,z=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==W&&"NOT_CONNECTED"!==W?["html5","chromecast"]:["chromecast","html5"]:["html5"],J=null==N||null===(y=N.video)||void 0===y||null===(w=y.gist)||void 0===w?void 0:w.videoImageUrl,K=(null==N||null===(h=N.video)||void 0===h||null===(g=h.liveDetails)||void 0===g?void 0:g.isDvrEnabled)||!1,X=function(e){var t,n={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(t=window)&&void 0!==t&&t.cast&&(n={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==i.detectBrowser()&&(n=d(d({},n),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),n}(a),G=(null==N||null===(b=N.video)||void 0===b||null===(k=b.streamingInfo)||void 0===k?void 0:k.isLiveStream)||!1,Q=(null==a?void 0:a.drmLibrary)||!1,Y=(null==N||null===(j=N.ads)||void 0===j||null===(I=j.preRoll)||void 0===I||null===(S=I.adTags)||void 0===S||null===(T=S.web)||void 0===T?void 0:T.active)&&(null==N||null===(R=N.ads)||void 0===R||null===(V=R.preRoll)||void 0===V||null===(q=V.adTags)||void 0===q||null===(B=q.web)||void 0===B?void 0:B.url),Z=(M={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:K},t(M,"autoplay",null==a?void 0:a.autoplay),t(M,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!Y),t(M,"loop",(null==a?void 0:a.loop)||!1),t(M,"html5",x(x({dash:{updateSettings:{streaming:{lowLatencyEnabled:!0,delay:{liveDelay:3},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},vhs:x(x({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(A=a.customData)||void 0===A?void 0:A.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(H=a.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(L=a.customData)||void 0===L?void 0:L.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(M,"poster",J),t(M,"techOrder",z),t(M,"chromecast",{requestCustomDataFn:function(e){var t=i.getPlayer(r);console.log(t.textTracksJson_);var n=t.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,t,n){var o,i,r,l,a,s,u,d,c,v,p={};if(e&&e.video&&e.video.drmEnabled){p.isDrmEnabled=!0;var m=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;p.licenseUrl=m;var f=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=f}var y=(null==e||null===(o=e.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=y;var w=null==e||null===(r=e.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;p.duration=w;var h=null==e||null===(a=e.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=h;var g=null==e||null===(u=e.video)||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=g,p.subTitles=n,p.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(N,e,n)}}),t(M,"plugins",X),M),$=o(r,Z,function(){var t=e(n.mark((function e(){var t,l,u,d,c,v,m,f,y,w,h,g,b,k,j,I,S;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G&&s.resolve(x({status:!0,msg:"Player Initialised"},F?{seriesResponse:F,response:N}:{response:N})),"white"!==window.controlsColor&&C(window.controlsColor,$),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),w=null==N||null===(t=N.video)||void 0===t?void 0:t.drmEnabled,h=null==N||null===(l=N.video)||void 0===l||null===(u=l.liveDetails)||void 0===u?void 0:u.startOverTime,!w&&!Q){e.next=13;break}if("Safari"!==i.detectBrowser()){e.next=11;break}return e.next=9,E();case 9:e.next=13;break;case 11:return e.next=13,Promise.all([E(),D()]);case 13:K&&p(r,h),!Y||null!=a&&null!==(d=a.customData)&&void 0!==d&&d.disableAds||i.initialiseAdvertisement(r,Y,N),g=i.getSource(N,r),"IN"==a.countryCode&&(o.Vhs.xhr.beforeRequest=function(e){e.uri=e.uri.replace("us-e","a-m")}),g?i.loadVideo(r,g):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:N}),i.handleError(r,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==N||null===(c=N.video)||void 0===c||null===(v=c.contentDetails)||void 0===v||null===(m=v.closedCaptions)||void 0===m?void 0:m.length)>0||(null==N||null===(f=N.video)||void 0===f||null===(y=f.closedCaptions)||void 0===y?void 0:y.length)>0)&&(S=(null==N||null===(k=N.video)||void 0===k||null===(j=k.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null==N||null===(I=N.video)||void 0===I?void 0:I.closedCaptions),b=S.filter((function(e){return"VTT"===e.format})),i.addCaptions(r,b)),null!=a&&a.disableControls?i.disableControls(r):P(r,x(x(x({},a),Z),{},{liveVideo:G,isDvrEnabled:K,res:N,sres:F})),O(r,x(x(x({},a),Z),{},{liveVideo:G}),s,{res:N,sres:F});case 21:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:i.loadVideoInstantly,onTimeUpdate:r.onTimeUpdate,getVideoDuration:r.getVideoDuration,onVideoEnded:r.onVideoEnded,init:function(e){return new Promise((function(t,n){var o,r,l,a,u,d,c,v,p;if(!i.isPlayerInitialised(null==e?void 0:e.playerId)){var m=null==e?void 0:e.videoId,f=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=m;var y=null==e?void 0:e.token;if(y&&!i.isTokenExpired(y)){T=JSON.parse(atob(y.split(".")[1])),window.siteId=null===(r=T)||void 0===r?void 0:r.siteId,window.siteName=null===(l=T)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=T)||void 0===a||!a.anonymousId),e.siteOwner=(null===(u=T)||void 0===u?void 0:u.site)||null,e.userId=(null===(d=T)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=T)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",y);var w=null==e?void 0:e.playerId,h=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,g=null==e?void 0:e.airplay,b=null==e?void 0:e.apiBaseUrl,k=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,O=null==e?void 0:e.errors;O&&(window.customErrors=O),window.customData=null==e?void 0:e.customData,b&&(window.playerEntitlementUrl=b),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!s.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return R})).then((function(e){e.importIMA()})),!h||null!=e&&e.series||Promise.resolve().then((function(){return R})).then((function(e){e.importChromecast()})),g&&"Safari"==i.detectBrowser()&&Promise.resolve().then((function(){return R})).then((function(e){e.importAirplay()})),k&&j("https://www.googletagmanager.com/gtag/js?id=".concat(k)).then((function(){return e=k,window.dataLayer=window.dataLayer||[],S("js",new Date),void S("config",e);var e})).catch((function(e){}));var P=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(w));if(P&&P.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f){var I,C=null==e||null===(I=e.series)||void 0===I?void 0:I.id;i.getSeriesDetails(C,y).then((function(o){var r,l,a,s=o.data,u=o.data.seasons;i.setCurrentSeries(u);var d=m||(null==u||null===(r=u[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;i.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),i.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(C,y),i.getVideoDetails(d,y).then((function(o){var r,l,a;window.contentType=null==o||null===(r=o.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,i.setCurrentVideo(o.data),q(w,{res:null==o?void 0:o.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){i.initiateErrorHandling(e,w,n,m)}))})).catch((function(e){i.initiateErrorHandling(e,w,n)}))}else i.getVideoDetails(m,y).then((function(o){var r,l,a,s;window.contentType=null==o||null===(r=o.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,i.setCurrentVideo(null==o?void 0:o.data);var u=null==o?void 0:o.data;null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable?i.getVideoInfo(m,y).then((function(o){var i,r,l,a,s,d;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==o?void 0:o.data)),e.watchHistoryResumeTime=(null==o||null===(s=o.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==o||null===(d=o.data)||void 0===d?void 0:d.watchedPercentage)||null,q(w,{res:u},e,{resolve:t,reject:n})})).catch((function(o){var i,r,l,a;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(o)),q(w,{res:u},e,{resolve:t,reject:n})})):q(w,{res:u},e,{resolve:t,reject:n})})).catch((function(e){i.initiateErrorHandling(e,w,n,m)}))}else n({status:!1,msg:"".concat(y?"Token is expired !":"Missing Authorization Token"),response:{token:y}})}}))},getRenditions:l.getRenditions,skip:i.skip,getPlayer:i.getPlayer,play:i.play,pause:i.pause,detectBrowser:i.detectBrowser,rewind:i.rewind,loadVideo:i.loadVideo,seekToTimeStamp:r.seekToTimeStamp,isPlayerInitialised:i.isPlayerInitialised,load:i.load,dispose:i.dispose,enableCaptions:i.enableCaptions,disableCaptions:i.disableCaptions,getCaptions:i.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:i.getSource,setVolume:g,getVolume:b,disableControls:i.disableControls,setPlaybackSpeed:r.setPlaybackSpeed}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/defineProperty"),n=require("@babel/runtime/regenerator"),o=require("video.js"),i=require("./generic-8b99b151.js"),r=require("./util-fa21734a.js"),l=require("./renditions-bc841552.js"),a=require("./resolution-6a9adf54.js"),s=require("./skin-84083352.js");function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function d(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?u(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}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 c,v,p=function(e,t){var n=i.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,r,l,a,s=this.el(),u=o.dom.getPointerPosition(s,t).x;o.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.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 m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var f=[],y=0,w=null;function h(e,n,o){var r,l,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];v=(null==n||null===(r=n.watchHistory)||void 0===r?void 0:r.apiVersion)||"v1";var u=null==n||null===(l=n.watchHistory)||void 0===l?void 0:l.profileId,d=Math.floor(e.currentTime()),p=Math.floor(e.duration()),f=null==n||null===(a=n.watchHistory)||void 0===a?void 0:a.xapiKey,h={};"v1"==v?h={videoId:c,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(d/p*100),siteOwner:n.siteOwner,userId:n.userId,xApiKey:f}:"v2"==v&&(h=function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?m(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({videoId:c,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(d/p*100),doneWatching:s,profileId:u},w&&{seriesId:w})),i.saveWatchHistory(h,n.token,v).then((function(e){})).catch((function(e){})),y=d+o}var g=function(e,t,n){var o=i.getPlayer(e);if(o)if(t>=0&&t<=100){o.muted()&&o.muted(!1);var r=parseFloat(t)/100;o.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},b=function(e){var t=i.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var O=function(e,n,o,r){var l,a,s=r.res,u=r.sres,d=i.getPlayer(e),v=(null==s||null===(l=s.video)||void 0===l||null===(a=l.streamingInfo)||void 0===a?void 0:a.isLiveStream)||!1;i.setCurrentVideo(s),d.on("loadstart",(function(){v&&o.resolve({status:!0,msg:"Video Loaded",response:s})})),d.on("loadeddata",(function(){var r;(null==d||!d.muted())&&g(e,sessionStorage.getItem("volume")||"100");var l,a,v=i.getCurrentVideo();(i.clearError(),o.resolve(function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?k(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):k(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({status:!0,msg:"Player Initialised"},u?{seriesResponse:u,response:s}:{response:s})),null!=n&&n.watchHistory&&null!=n&&null!==(r=n.watchHistory)&&void 0!==r&&r.enable&&!n.isAnonymousUser)&&function(e,t,n){var o,r;null!=t&&t.series&&(w=null==t||null===(o=t.series)||void 0===o?void 0:o.id),f=[],y=0,c=n;var l=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,a=i.getPlayer(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());f.includes(y)||(e==y?(f.push(e),h(a,t,l)):e>y&&(y=e+l))})),a.on("ended",(function(){h(a,t,l,!0)})))}(e,n,null==v||null===(l=v.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.id)})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,o,i,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,p=null===(n=window)||void 0===n||null===(o=n.cast)||void 0===o||null===(i=o.framework)||void 0===i||null===(r=i.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,y=m.getMediaSession(),w=y.media.tracks.filter((function(e){return"TEXT"==e.type}));f=t?new chrome.cast.media.EditTracksInfoRequest([w[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),y.editTracksInfo(f)}})),d.on("loadedmetadata",(function(){})),d.one("error",(function(){var t,n;i.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),o.reject({status:!1,msg:(null==d||null===(n=d.error())||void 0===n?void 0:n.message)||"Some error occured"})})),d.one("play",(function(){var e;if(null!=n&&null!==(e=n.series)&&void 0!==e&&e.enable){var t,o,r,l=null===(t=i.getCurrentVideo())||void 0===t||null===(o=t.video)||void 0===o||null===(r=o.gist)||void 0===r?void 0:r.id,a=i.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=n&&n.watchHistoryResumeTime&&(null==n?void 0:n.watchedPercentage)<95&&d.currentTime(null==n?void 0:n.watchHistoryResumeTime)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},P=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-93a3e5ae.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-39ab30e2.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-ec49b877.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-095cc078.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&Promise.resolve().then((function(){return require("./skin-fb394911.js")})).then((function(n){n.initialiseSkin(e,t)}))},j=function(e){return new Promise((function(t,n){if(I(e))n("".concat(e," is alread initialised"));else{var o=document.createElement("script");o.async=!1,o.src=e,o.onload=function(){t()},o.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(o)}}))},I=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0};function S(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}var C=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var T,D=function(){var t=e(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:j("https://cdn.dashjs.org/v4.7.3/dash.all.min.js").then((function(){})).catch((function(e){return console.log(e)}));case 3:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),E=function(){var t=e(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),R=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){j("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("videojs-ima"),j("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:D,loadEMELibrary:E});function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function x(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?V(Object(o),!0).forEach((function(n){t(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):V(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var q=function(r,l,a,s){var u,c,v,m,f,y,w,h,g,b,k,j,I,S,T,R,V,q,B,A,H,L,M,_=l.res,N=void 0===_?null:_,U=l.sres,F=void 0===U?null:U,W=(null===(u=window)||void 0===u||null===(c=u.cast)||void 0===c||null===(v=c.framework)||void 0===v||null===(m=v.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f?void 0:f.S)||void 0,z=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==W&&"NOT_CONNECTED"!==W?["html5","chromecast"]:["chromecast","html5"]:["html5"],J=null==N||null===(y=N.video)||void 0===y||null===(w=y.gist)||void 0===w?void 0:w.videoImageUrl,K=(null==N||null===(h=N.video)||void 0===h||null===(g=h.liveDetails)||void 0===g?void 0:g.isDvrEnabled)||!1,X=function(e){var t,n={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(t=window)&&void 0!==t&&t.cast&&(n={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==i.detectBrowser()&&(n=d(d({},n),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),n}(a),G=(null==N||null===(b=N.video)||void 0===b||null===(k=b.streamingInfo)||void 0===k?void 0:k.isLiveStream)||!1,Q=(null==a?void 0:a.drmLibrary)||!1,Y=(null==N||null===(j=N.ads)||void 0===j||null===(I=j.preRoll)||void 0===I||null===(S=I.adTags)||void 0===S||null===(T=S.web)||void 0===T?void 0:T.active)&&(null==N||null===(R=N.ads)||void 0===R||null===(V=R.preRoll)||void 0===V||null===(q=V.adTags)||void 0===q||null===(B=q.web)||void 0===B?void 0:B.url),Z=(M={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:K},t(M,"autoplay",null==a?void 0:a.autoplay),t(M,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!Y),t(M,"loop",(null==a?void 0:a.loop)||!1),t(M,"html5",x(x({dash:{updateSettings:{streaming:{delay:{liveDelay:3},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},vhs:x(x({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(A=a.customData)||void 0===A?void 0:A.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(H=a.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(L=a.customData)||void 0===L?void 0:L.nativeVideoTracks)&&{nativeVideoTracks:!1})),t(M,"poster",J),t(M,"techOrder",z),t(M,"chromecast",{requestCustomDataFn:function(e){var t=i.getPlayer(r);console.log(t.textTracksJson_);var n=t.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,t,n){var o,i,r,l,a,s,u,d,c,v,p={};if(e&&e.video&&e.video.drmEnabled){p.isDrmEnabled=!0;var m=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;p.licenseUrl=m;var f=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];p.licenseToken=f}var y=(null==e||null===(o=e.video)||void 0===o||null===(i=o.gist)||void 0===i?void 0:i.contentType)||"VIDEO";p.contentType=y;var w=null==e||null===(r=e.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;p.duration=w;var h=null==e||null===(a=e.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;p.mediaTitle=h;var g=null==e||null===(u=e.video)||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return p.mediaImage=g,p.subTitles=n,p.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(p),p}(N,e,n)}}),t(M,"plugins",X),M),$=o(r,Z,function(){var t=e(n.mark((function e(){var t,l,u,d,c,v,m,f,y,w,h,g,b,k,j,I,S;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G&&s.resolve(x({status:!0,msg:"Player Initialised"},F?{seriesResponse:F,response:N}:{response:N})),"white"!==window.controlsColor&&C(window.controlsColor,$),/Android/i.test(navigator.userAgent)&&(o.options.vhs.overrideNative=!0),w=null==N||null===(t=N.video)||void 0===t?void 0:t.drmEnabled,h=null==N||null===(l=N.video)||void 0===l||null===(u=l.liveDetails)||void 0===u?void 0:u.startOverTime,!w&&!Q){e.next=13;break}if("Safari"!==i.detectBrowser()){e.next=11;break}return e.next=9,E();case 9:e.next=13;break;case 11:return e.next=13,Promise.all([E(),D()]);case 13:K&&p(r,h),!Y||null!=a&&null!==(d=a.customData)&&void 0!==d&&d.disableAds||i.initialiseAdvertisement(r,Y,N),g=i.getSource(N,r),"IN"==a.countryCode&&(o.Vhs.xhr.beforeRequest=function(e){e.uri=e.uri.replace("us-e","a-m")}),g?i.loadVideo(r,g):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:N}),i.handleError(r,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==N||null===(c=N.video)||void 0===c||null===(v=c.contentDetails)||void 0===v||null===(m=v.closedCaptions)||void 0===m?void 0:m.length)>0||(null==N||null===(f=N.video)||void 0===f||null===(y=f.closedCaptions)||void 0===y?void 0:y.length)>0)&&(S=(null==N||null===(k=N.video)||void 0===k||null===(j=k.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null==N||null===(I=N.video)||void 0===I?void 0:I.closedCaptions),b=S.filter((function(e){return"VTT"===e.format})),i.addCaptions(r,b)),null!=a&&a.disableControls?i.disableControls(r):P(r,x(x(x({},a),Z),{},{liveVideo:G,isDvrEnabled:K,res:N,sres:F})),O(r,x(x(x({},a),Z),{},{liveVideo:G}),s,{res:N,sres:F});case 21:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:i.loadVideoInstantly,onTimeUpdate:r.onTimeUpdate,getVideoDuration:r.getVideoDuration,onVideoEnded:r.onVideoEnded,init:function(e){return new Promise((function(t,n){var o,r,l,a,u,d,c,v,p;if(!i.isPlayerInitialised(null==e?void 0:e.playerId)){var m=null==e?void 0:e.videoId,f=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=m;var y=null==e?void 0:e.token;if(y&&!i.isTokenExpired(y)){T=JSON.parse(atob(y.split(".")[1])),window.siteId=null===(r=T)||void 0===r?void 0:r.siteId,window.siteName=null===(l=T)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=T)||void 0===a||!a.anonymousId),e.siteOwner=(null===(u=T)||void 0===u?void 0:u.site)||null,e.userId=(null===(d=T)||void 0===d?void 0:d.userId)||null,window.sessionStorage.setItem("uid",null===(c=T)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",y);var w=null==e?void 0:e.playerId,h=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,g=null==e?void 0:e.airplay,b=null==e?void 0:e.apiBaseUrl,k=(null==e||null===(v=e.analytics)||void 0===v?void 0:v.gaId)||null,O=null==e?void 0:e.errors;O&&(window.customErrors=O),window.customData=null==e?void 0:e.customData,b&&(window.playerEntitlementUrl=b),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!s.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return R})).then((function(e){e.importIMA()})),!h||null!=e&&e.series||Promise.resolve().then((function(){return R})).then((function(e){e.importChromecast()})),g&&"Safari"==i.detectBrowser()&&Promise.resolve().then((function(){return R})).then((function(e){e.importAirplay()})),k&&j("https://www.googletagmanager.com/gtag/js?id=".concat(k)).then((function(){return e=k,window.dataLayer=window.dataLayer||[],S("js",new Date),void S("config",e);var e})).catch((function(e){}));var P=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(w));if(P&&P.addEventListener("contextmenu",(function(e){return e.preventDefault()})),f){var I,C=null==e||null===(I=e.series)||void 0===I?void 0:I.id;i.getSeriesDetails(C,y).then((function(o){var r,l,a,s=o.data,u=o.data.seasons;i.setCurrentSeries(u);var d=m||(null==u||null===(r=u[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;i.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),i.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(C,y),i.getVideoDetails(d,y).then((function(o){var r,l,a;window.contentType=null==o||null===(r=o.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,i.setCurrentVideo(o.data),q(w,{res:null==o?void 0:o.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){i.initiateErrorHandling(e,w,n,m)}))})).catch((function(e){i.initiateErrorHandling(e,w,n)}))}else i.getVideoDetails(m,y).then((function(o){var r,l,a,s;window.contentType=null==o||null===(r=o.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,i.setCurrentVideo(null==o?void 0:o.data);var u=null==o?void 0:o.data;null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable?i.getVideoInfo(m,y).then((function(o){var i,r,l,a,s,d;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==o?void 0:o.data)),e.watchHistoryResumeTime=(null==o||null===(s=o.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==o||null===(d=o.data)||void 0===d?void 0:d.watchedPercentage)||null,q(w,{res:u},e,{resolve:t,reject:n})})).catch((function(o){var i,r,l,a;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(o)),q(w,{res:u},e,{resolve:t,reject:n})})):q(w,{res:u},e,{resolve:t,reject:n})})).catch((function(e){i.initiateErrorHandling(e,w,n,m)}))}else n({status:!1,msg:"".concat(y?"Token is expired !":"Missing Authorization Token"),response:{token:y}})}}))},getRenditions:l.getRenditions,skip:i.skip,getPlayer:i.getPlayer,play:i.play,pause:i.pause,detectBrowser:i.detectBrowser,rewind:i.rewind,loadVideo:i.loadVideo,seekToTimeStamp:r.seekToTimeStamp,isPlayerInitialised:i.isPlayerInitialised,load:i.load,dispose:i.dispose,enableCaptions:i.enableCaptions,disableCaptions:i.disableCaptions,getCaptions:i.getCaptions,playSelectedResolution:a.playSelectedResolution,getSource:i.getSource,setVolume:g,getVolume:b,disableControls:i.disableControls,setPlaybackSpeed:r.setPlaybackSpeed}};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./features-164c3cc6.js"),t=require("./icons-7afb9c13.js"),n=require("./generic-8b99b151.js"),i=require("./skin-84083352.js"),l=require("./renditions-bc841552.js"),o=require("@babel/runtime/helpers/toConsumableArray"),a=require("./autoNextVideo-823821e8.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-fa21734a.js");var d=n.getCurrentSeries(),r=[];null==d||d.map((function(e){return r.push.apply(r,o(e.episodes))}));var s,u,v,c=function(e,t){var i;null==t||null===(i=t.series)||void 0===i||i.cb;var l=n.getPlayer(e);l.on("timeupdate",(function(){var e,t=Math.floor(l.currentTime()),i=l.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-t<=10&&n.getVideoIdx()<=(null==r?void 0:r.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,a=r.filter((function(e,t){return t==n.getVideoIdx()}));if((null==a?void 0:a.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var d,s,u,v,c,g,p,f,y,h,b;(null===(d=document.getElementsByClassName("next-ep-preview"))||void 0===d?void 0:d[0]).style.visibility="hidden";var C=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],w=null===(u=document.getElementsByClassName("next-ep-img"))||void 0===u?void 0:u[0],x=null===(v=document.getElementsByClassName("next-ep-content"))||void 0===v?void 0:v[0],E=null===(c=a[0])||void 0===c?void 0:c.title;(null===(g=E)||void 0===g?void 0:g.length)>60&&(E=E.substr(0,60)+"..."),C.innerHTML="".concat(E),w.src=(null===(p=a[0])||void 0===p||null===(f=p.gist)||void 0===f||null===(y=f.imageGist)||void 0===y?void 0:y.r16x9)||(null===(h=window)||void 0===h||null===(b=h.customData)||void 0===b?void 0:b.fallbackImage),x.onclick=function(){return m(e)}}else{var N,B,S,V,q,j,M,P=document.createElement("div");P.className="next-ep-preview",P.style.visibility="hidden",document.getElementById(e).append(P);var k=document.createElement("div");k.className="next-ep-header",k.innerHTML="Next up";var T=null===(N=a[0])||void 0===N?void 0:N.title,L=document.createElement("img");L.className="next-ep-img",L.src=(null===(B=a[0])||void 0===B||null===(S=B.gist)||void 0===S||null===(V=S.imageGist)||void 0===V?void 0:V.r16x9)||(null===(q=window)||void 0===q||null===(j=q.customData)||void 0===j?void 0:j.fallbackImage);var H=document.createElement("div");H.className="next-ep-title",(null===(M=T)||void 0===M?void 0:M.length)>60&&(T=T.substr(0,60)+"..."),H.innerHTML="".concat(T);var I=document.createElement("div");I.className="next-ep-content",I.append(L),I.append(H),I.onclick=function(){return m(e)},P.append(k),P.append(I)}},m=function(e,t){var i=n.getPlayer(e),l=Math.floor(i.currentTime());if(Math.floor(i.duration())!=l){i.pause(e);var o=n.getVideoIdx();a.switchToNext(o,e,r,sessionStorage.getItem("token"))}},g=function(e){var t=e/v,n=document.getElementsByClassName("bandwidth-container");null!=n&&n.length&&(n[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Connecton Speed </div><div class="debug-value-item">'.concat((t/125).toFixed(2)," kbps</div></div>"),s=(new Date).getTime())},p=function(e){var t=n.getPlayer(e);u=(new Date).getTime(),v=(u-s)/1e3;var i,l,o=t.src();i=o,(l=new XMLHttpRequest).open("HEAD",i,!0),l.onreadystatechange=function(){if(4==l.readyState&&(200==l.status||206==l.status)){var e=l.getResponseHeader("Content-Length");g(e)}},l.send(null)};function f(e){for(var t=n.getPlayer(e),i=t.buffered(),l=t.currentTime(),o=0,a=0;a<i.length;a++)i.start(a)<=l&&i.end(a)>o&&(o=i.end(a));var d=o-l,r=document.getElementsByClassName("buffer-container");r.length&&(r[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Buffer Health </div><div class="debug-value-item">'.concat(d.toFixed(2)," seconds</div></div>"))}var y=function(e){var t=document.getElementsByClassName("debug-container");if(null!=t&&t.length){var n=t[0].getElementsByClassName("volume-container");n.length&&(n[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Volume </div><div class="debug-value-item">'.concat(e,"%</div></div>"))}},h=function(e){n.getPlayer(e).on("loadstart",(function(){s=(new Date).getTime()}))};function b(t,i){var o=n.getPlayer(t);o.on("loadeddata",(function(){var a,d,r;(null===(a=l.getRenditions(t))||void 0===a?void 0:a.length)>0&&e.addSettingsButtonV2(t,i),(null===(d=n.getCaptions(t))||void 0===d?void 0:d.length)>0&&e.addCaptionButton(t,i),null!=i&&null!==(r=i.series)&&void 0!==r&&r.enable&&c(t,i),function(e){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px")}(o.duration());var s=document.getElementsByClassName("vjs-live-control")[0],u=document.getElementsByClassName("vjs-time-control");null!=i&&i.liveVideo&&s.classList.value.includes("vjs-hidden")&&(u[0].style.display="block")})),o.one("play",(function(){var n,i,l,o;null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o?void 0:o.iframeOverlayUrl)})),o.on("loadeddata",(function(){!function(e){var t=n.getPlayer(e),i=t.el().clientWidth,l=t.el().clientHeight,o=document.getElementsByClassName("viewport-container");o.length&&(o[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Viewport </div><div class="debug-value-item">'.concat(i,"x").concat(l,"</div></div>"))}(t),p(t)})),o.on("timeupdate",(function(){p(t),f(t),function(e){var t=n.getPlayer(e),i=(null==t?void 0:t.el().querySelector("video")).getVideoPlaybackQuality(),l=i?i.droppedVideoFrames/t.duration():"Unknown",o=document.getElementsByClassName("drop-frames-container");null!=o&&o.length&&(o[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Dropped FPS </div><div class="debug-value-item">'.concat(parseInt(l),"/s</div></div>"))}(t)})),o.on("waiting",(function(){return f(t)})),o.on("volumechange",(function(){var e=100*o.volume().toFixed(2);y(e)})),h(t)}exports.initialiseSkin=function(l,o){Promise.resolve().then((function(){return require("./skin-afbec6d7.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)})),b(l,o),function(e,l){var o=n.getPlayer(e);o.controlBar.getChild("FullscreenToggle").el().appendChild(i.createIconMarkup(t.MinimizeSvg(window.controlsColor))),o.controlBar.getChild("FullscreenToggle").el().appendChild(i.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var a=document.getElementsByClassName("vjs-time-control");l.liveVideo&&(a[0].style.display="none")}(l,o),function(n,i){var l,o,a,d,r,s;0==(null==i?void 0:i.liveVideo)&&0==(null==i?void 0:i.liveui)&&e.addSkipButton(n,"defaultV2",t.SkipSvgV2());(0==(null==i?void 0:i.liveVideo)&&0==(null==i?void 0:i.liveui)||1==(null==i?void 0:i.liveui))&&e.addRewindButton(n,"defaultV2",t.RewindSvgV2());i.liveVideo||e.addSlowMotion(n);(null==i||null===(l=i.relatedVideos)||void 0===l||null===(o=l.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(n,null==i?void 0:i.relatedVideos);(null==i||null===(a=i.streams)||void 0===a?void 0:a.length)>1&&e.addMulticamSelector(n,null==i?void 0:i.streams);(null==i||null===(d=i.playlist)||void 0===d||null===(r=d.content)||void 0===r?void 0:r.length)>0&&e.addPlaylistSelector(n,null==i?void 0:i.playlist);null!=i&&null!==(s=i.series)&&void 0!==s&&s.enable&&e.addSeriesSelectorV2(n,i);null!=i&&i.debugStats&&e.addDebugSelector(n,i)}(l,o),function(e,t){var i=n.getPlayer(e),l=null==t?void 0:t.tvProviderLogoUrl;if(!l)return;var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(l),a.alt="Provider Image",o.append(a),i.el().appendChild(o),i.on("useractive",(function(){o.classList.remove("vjs-fade")})),i.on("userinactive",(function(){i.paused()||o.classList.add("vjs-fade")})),i.on("fullscreenchange",(function(){i.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(l,o)};
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/asyncToGenerator";import o from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/regenerator";import n from"video.js";import{d as i,g as r,s as l,c as a,h as s,a as u,b as d,e as c,f as v,i as m,l as p,j as f,p as w,k as y,r as h,m as g,n as b,o as k,q as O,t as j,u as P,v as I,w as T,x as S,y as C,z as D,A as E,B as R,C as x,D as B,E as A,F as V}from"./generic-7c43020f.js";import{o as L,g as H,a as _,s as M,b as N}from"./util-d9f5a7be.js";import{g as q}from"./renditions-97276745.js";import{playSelectedResolution as U}from"./resolution-38cd4f5c.js";import{i as F}from"./skin-665ec17e.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";function z(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}var K,X,G=function(e,o){var t=r(e);t&&o&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(o){var t,i,r,l,a,s=this.el(),u=n.dom.getPointerPosition(s,o).x;n.getPlayer(e).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),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*u,v.seek()}}))};function W(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}var Q=[],Y=0,Z=null;function $(e,t,n){var i,r,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];X=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var u=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,d=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(a=t.watchHistory)||void 0===a?void 0:a.xapiKey,m={};"v1"==X?m={videoId:K,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(d/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==X&&(m=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}({videoId:K,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(d/c*100),doneWatching:s,profileId:u},Z&&{seriesId:Z})),l(m,t.token,X).then((function(e){})).catch((function(e){})),Y=d+n}var ee=function(e,o,t){var n=r(e);if(n)if(o>=0&&o<=100){n.muted()&&n.muted(!1);var i=parseFloat(o)/100;n.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(o,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},oe=function(e){var o=r(e);return o?parseInt(100*o.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function te(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}var ne=function(e,t,n,i){var l,v,m=i.res,p=i.sres,f=r(e),w=(null==m||null===(l=m.video)||void 0===l||null===(v=l.streamingInfo)||void 0===v?void 0:v.isLiveStream)||!1;d(m),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:m})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&ee(e,sessionStorage.getItem("volume")||"100");var l,s,d=u();(a(),n.resolve(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:m}:{response:m})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser)&&function(e,o,t){var n,i;null!=o&&o.series&&(Z=null==o||null===(n=o.series)||void 0===n?void 0:n.id),Q=[],Y=0,K=t;var l=(null==o||null===(i=o.watchHistory)||void 0===i?void 0:i.interval)||30,a=r(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());Q.includes(Y)||(e==Y?(Q.push(e),$(a,o,l)):e>Y&&(Y=e+l))})),a.on("ended",(function(){$(a,o,l,!0)})))}(e,t,null==d||null===(l=d.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.id)})),f.textTracks().on("change",(function(e){var o=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",o)})),f.on("subtitlechanged",(function(e,o){var t,n,i,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(n=t.cast)||void 0===n||null===(i=n.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(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,w=p.getMediaSession(),y=w.media.tracks.filter((function(e){return"TEXT"==e.type}));f=o?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(f)}})),f.on("loadedmetadata",(function(){})),f.one("error",(function(){var o,t;s(e,(null==f||null===(o=f.error())||void 0===o?void 0:o.message)||"Some error occured"),n.reject({status:!1,msg:(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"})})),f.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,n,i,r=null===(o=u())||void 0===o||null===(n=o.video)||void 0===n||null===(i=n.gist)||void 0===i?void 0:i.id,l=c().get(r)||{t:0,p:0},a=l.t,s=l.p;a&&s<95&&setTimeout((function(){f.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&f.currentTime(null==t?void 0:t.watchHistoryResumeTime)})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},ie=function(e,o){var t=null==o?void 0:o.skin;"live"==t?import("./skin-6093bfb3.js").then((function(t){t.initialiseSkin(e,o)})):"default"==t?import("./skin-b939c35e.js").then((function(t){t.initialiseSkin(e,o)})):"carousel"==t?import("./skin-42c2f81d.js").then((function(o){o.initaliseSkin(e)})):"defaultV2"==t?import("./skin-d6b00653.js").then((function(t){t.initialiseSkin(e,o)})):"multiplayer"==t&&import("./skin-5e2fa9d4.js").then((function(t){t.initialiseSkin(e,o)}))},re=function(e){return new Promise((function(o,t){if(le(e))t("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){o()},n.onerror=function(o){t("Error while loading script ".concat(e," : ").concat(o))},document.head.appendChild(n)}}))},le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0};function ae(){var e,o;null===(e=window)||void 0===e||null===(o=e.dataLayer)||void 0===o||o.push(arguments)}var se=function(e,o){o.controlBar.el_.style.color=e,o.controlBar.el_.querySelector(".vjs-play-progress")&&(o.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),o.controlBar.el_.querySelector(".vjs-volume-level")&&(o.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var ue,de=function(){var o=e(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:re("https://cdn.dashjs.org/v4.7.3/dash.all.min.js").then((function(){})).catch((function(e){return console.log(e)}));case 3:case"end":return e.stop()}}),e)})));return function(){return o.apply(this,arguments)}}(),ce=function(){var o=e(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return o.apply(this,arguments)}}(),ve=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){re("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(n)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(n)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),re("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:de,loadEMELibrary:ce});function me(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}var fe=function(l,a,u,d){var c,v,m,p,f,w,y,h,b,k,O,j,P,I,C,D,E,R,x,V,L,H,_,M=a.res,N=void 0===M?null:M,q=a.sres,U=void 0===q?null:q,F=(null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(p=m.CastContext)||void 0===p||null===(f=p.getInstance())||void 0===f?void 0:f.S)||void 0,z=null!=u&&u.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==F&&"NOT_CONNECTED"!==F?["html5","chromecast"]:["chromecast","html5"]:["html5"],K=null==N||null===(w=N.video)||void 0===w||null===(y=w.gist)||void 0===y?void 0:y.videoImageUrl,X=(null==N||null===(h=N.video)||void 0===h||null===(b=h.liveDetails)||void 0===b?void 0:b.isDvrEnabled)||!1,W=function(e){var o,t={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(o=window)&&void 0!==o&&o.cast&&(t={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==i()&&(t=J(J({},t),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),t}(u),Q=(null==N||null===(k=N.video)||void 0===k||null===(O=k.streamingInfo)||void 0===O?void 0:O.isLiveStream)||!1,Y=(null==u?void 0:u.drmLibrary)||!1,Z=(null==N||null===(j=N.ads)||void 0===j||null===(P=j.preRoll)||void 0===P||null===(I=P.adTags)||void 0===I||null===(C=I.web)||void 0===C?void 0:C.active)&&(null==N||null===(D=N.ads)||void 0===D||null===(E=D.preRoll)||void 0===E||null===(R=E.adTags)||void 0===R||null===(x=R.web)||void 0===x?void 0:x.url),$=(_={controls:0!=(null==u?void 0:u.controls),playsinline:!0,fluid:!0,muted:(null==u?void 0:u.muted)||!1,autoplay:(null==u?void 0:u.autoplay)||!1,controlBar:{volumePanel:("default"==u.skin||"defaultV2"==u.skin||"live"==(null==u?void 0:u.skin))&&{inline:!1},fullscreenToggle:"default"==u.skin||"defaultV2"==u.skin,audioTrackButton:!1,pictureInPictureToggle:(u.skin,!1)},muteToggle:"multiplayer"==u.skin,liveui:X},o(_,"autoplay",null==u?void 0:u.autoplay),o(_,"normalizeAutoplay",(null==u?void 0:u.autoplay)&&!Z),o(_,"loop",(null==u?void 0:u.loop)||!1),o(_,"html5",pe(pe({dash:{updateSettings:{streaming:{lowLatencyEnabled:!0,delay:{liveDelay:3},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},vhs:pe(pe({experimentalLLHLS:(null==u?void 0:u.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==u||null===(V=u.customData)||void 0===V?void 0:V.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==u?void 0:u.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==u?void 0:u.experimentalBufferBasedABR)||!1})},0==(null==u||null===(L=u.customData)||void 0===L?void 0:L.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==u||null===(H=u.customData)||void 0===H?void 0:H.nativeVideoTracks)&&{nativeVideoTracks:!1})),o(_,"poster",K),o(_,"techOrder",z),o(_,"chromecast",{requestCustomDataFn:function(e){var o=r(l);console.log(o.textTracksJson_);var t=o.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,o,t){var n,i,r,l,a,s,u,d,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var p=o.keySystemOptions&&o.keySystemOptions[0]&&o.keySystemOptions[0].options&&o.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var f=o.keySystemOptions&&o.keySystemOptions[0]&&o.keySystemOptions[0].options&&o.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=f}var w=(null==e||null===(n=e.video)||void 0===n||null===(i=n.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=w;var y=null==e||null===(r=e.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=y;var h=null==e||null===(a=e.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=h;var g=null==e||null===(u=e.video)||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=g,m.subTitles=t,m.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(N,e,t)}}),o(_,"plugins",W),_),ee=n(l,$,function(){var o=e(t.mark((function e(){var o,r,a,c,v,m,p,f,w,y,h,b,k,O,j,P,I;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q&&d.resolve(pe({status:!0,msg:"Player Initialised"},U?{seriesResponse:U,response:N}:{response:N})),"white"!==window.controlsColor&&se(window.controlsColor,ee),/Android/i.test(navigator.userAgent)&&(n.options.vhs.overrideNative=!0),y=null==N||null===(o=N.video)||void 0===o?void 0:o.drmEnabled,h=null==N||null===(r=N.video)||void 0===r||null===(a=r.liveDetails)||void 0===a?void 0:a.startOverTime,!y&&!Y){e.next=13;break}if("Safari"!==i()){e.next=11;break}return e.next=9,ce();case 9:e.next=13;break;case 11:return e.next=13,Promise.all([ce(),de()]);case 13:X&&G(l,h),!Z||null!=u&&null!==(c=u.customData)&&void 0!==c&&c.disableAds||B(l,Z,N),b=T(N,l),"IN"==u.countryCode&&(n.Vhs.xhr.beforeRequest=function(e){e.uri=e.uri.replace("us-e","a-m")}),b?g(l,b):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:N}),s(l,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==N||null===(v=N.video)||void 0===v||null===(m=v.contentDetails)||void 0===m||null===(p=m.closedCaptions)||void 0===p?void 0:p.length)>0||(null==N||null===(f=N.video)||void 0===f||null===(w=f.closedCaptions)||void 0===w?void 0:w.length)>0)&&(I=(null==N||null===(O=N.video)||void 0===O||null===(j=O.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null==N||null===(P=N.video)||void 0===P?void 0:P.closedCaptions),k=I.filter((function(e){return"VTT"===e.format})),A(l,k)),null!=u&&u.disableControls?S(l):ie(l,pe(pe(pe({},u),$),{},{liveVideo:Q,isDvrEnabled:X,res:N,sres:U})),ne(l,pe(pe(pe({},u),$),{},{liveVideo:Q}),d,{res:N,sres:U});case 21:case"end":return e.stop()}}),e)})));return function(){return o.apply(this,arguments)}}())};function we(){return{loadVideoInstantly:p,onTimeUpdate:L,getVideoDuration:H,onVideoEnded:_,init:function(e){return new Promise((function(o,t){var n,r,l,a,s,u,c,p,f;if(!b(null==e?void 0:e.playerId)){var w=null==e?void 0:e.videoId,y=(null==e||null===(n=e.series)||void 0===n?void 0:n.enable)||!1;window.videoId=w;var h=null==e?void 0:e.token;if(h&&!C(h)){ue=JSON.parse(atob(h.split(".")[1])),window.siteId=null===(r=ue)||void 0===r?void 0:r.siteId,window.siteName=null===(l=ue)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=ue)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=ue)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=ue)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=ue)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",h);var g=null==e?void 0:e.playerId,k=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,j=null==e?void 0:e.apiBaseUrl,P=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,I=null==e?void 0:e.errors;I&&(window.customErrors=I),window.customData=null==e?void 0:e.customData,j&&(window.playerEntitlementUrl=j),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!F(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return ve})).then((function(e){e.importIMA()})),!k||null!=e&&e.series||Promise.resolve().then((function(){return ve})).then((function(e){e.importChromecast()})),O&&"Safari"==i()&&Promise.resolve().then((function(){return ve})).then((function(e){e.importAirplay()})),P&&re("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return e=P,window.dataLayer=window.dataLayer||[],ae("js",new Date),void ae("config",e);var e})).catch((function(e){}));var T=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(g));if(T&&T.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var S,B=null==e||null===(S=e.series)||void 0===S?void 0:S.id;D(B,h).then((function(n){var i,r,l,a=n.data,s=n.data.seasons;V(s);var u=w||(null==s||null===(i=s[0])||void 0===i||null===(r=i.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,o){var t=new Map;v({videoId:e,token:o}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),m(t)})).catch((function(e){return console.log(e)}))}(B,h),E(u,h).then((function(n){var i,r,l;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(r=i.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,d(n.data),fe(g,{res:null==n?void 0:n.data,sres:a},e,{resolve:o,reject:t})})).catch((function(e){R(e,g,t,w)}))})).catch((function(e){R(e,g,t)}))}else E(w,h).then((function(n){var i,r,l,a;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(r=i.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,d(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?x(w,h).then((function(n){var i,r,l,a,u,d;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedTime)||null,e.watchedPercentage=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedPercentage)||null,fe(g,{res:s},e,{resolve:o,reject:t})})).catch((function(n){var i,r,l,a;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),fe(g,{res:s},e,{resolve:o,reject:t})})):fe(g,{res:s},e,{resolve:o,reject:t})})).catch((function(e){R(e,g,t,w)}))}else t({status:!1,msg:"".concat(h?"Token is expired !":"Missing Authorization Token"),response:{token:h}})}}))},getRenditions:q,skip:f,getPlayer:r,play:w,pause:y,detectBrowser:i,rewind:h,loadVideo:g,seekToTimeStamp:M,isPlayerInitialised:b,load:k,dispose:O,enableCaptions:j,disableCaptions:P,getCaptions:I,playSelectedResolution:U,getSource:T,setVolume:ee,getVolume:oe,disableControls:S,setPlaybackSpeed:N}}export{we as default};
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/asyncToGenerator";import o from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/regenerator";import n from"video.js";import{d as i,g as r,s as l,c as a,h as s,a as u,b as d,e as c,f as v,i as m,l as p,j as f,p as w,k as y,r as h,m as g,n as b,o as k,q as O,t as j,u as P,v as I,w as T,x as S,y as C,z as D,A as E,B as R,C as x,D as B,E as A,F as V}from"./generic-7c43020f.js";import{o as H,g as L,a as _,s as M,b as N}from"./util-d9f5a7be.js";import{g as q}from"./renditions-97276745.js";import{playSelectedResolution as U}from"./resolution-38cd4f5c.js";import{i as F}from"./skin-665ec17e.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";function z(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}var K,X,G=function(e,o){var t=r(e);t&&o&&t.controlBar&&t.controlBar.progressControl.seekBar.on("click",(function(o){var t,i,r,l,a,s=this.el(),u=n.dom.getPointerPosition(s,o).x;n.getPlayer(e).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),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*u,v.seek()}}))};function W(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}var Q=[],Y=0,Z=null;function $(e,t,n){var i,r,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];X=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var u=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,d=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(a=t.watchHistory)||void 0===a?void 0:a.xapiKey,m={};"v1"==X?m={videoId:K,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(d/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==X&&(m=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}({videoId:K,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(d/c*100),doneWatching:s,profileId:u},Z&&{seriesId:Z})),l(m,t.token,X).then((function(e){})).catch((function(e){})),Y=d+n}var ee=function(e,o,t){var n=r(e);if(n)if(o>=0&&o<=100){n.muted()&&n.muted(!1);var i=parseFloat(o)/100;n.volume(i),t&&t({status:!0,msg:"Volume set to ".concat(o,"%")})}else t&&t({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else t({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},oe=function(e){var o=r(e);return o?parseInt(100*o.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function te(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}var ne=function(e,t,n,i){var l,v,m=i.res,p=i.sres,f=r(e),w=(null==m||null===(l=m.video)||void 0===l||null===(v=l.streamingInfo)||void 0===v?void 0:v.isLiveStream)||!1;d(m),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:m})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&ee(e,sessionStorage.getItem("volume")||"100");var l,s,d=u();(a(),n.resolve(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}({status:!0,msg:"Player Initialised"},p?{seriesResponse:p,response:m}:{response:m})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser)&&function(e,o,t){var n,i;null!=o&&o.series&&(Z=null==o||null===(n=o.series)||void 0===n?void 0:n.id),Q=[],Y=0,K=t;var l=(null==o||null===(i=o.watchHistory)||void 0===i?void 0:i.interval)||30,a=r(e);a&&(a.on("timeupdate",(function(){var e=Math.floor(a.currentTime());Q.includes(Y)||(e==Y?(Q.push(e),$(a,o,l)):e>Y&&(Y=e+l))})),a.on("ended",(function(){$(a,o,l,!0)})))}(e,t,null==d||null===(l=d.video)||void 0===l||null===(s=l.gist)||void 0===s?void 0:s.id)})),f.textTracks().on("change",(function(e){var o=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",o)})),f.on("subtitlechanged",(function(e,o){var t,n,i,r,l,a,s,u,d,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(t=window)||void 0===t||null===(n=t.cast)||void 0===n||null===(i=n.framework)||void 0===i||null===(r=i.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,p=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(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,w=p.getMediaSession(),y=w.media.tracks.filter((function(e){return"TEXT"==e.type}));f=o?new chrome.cast.media.EditTracksInfoRequest([y[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(f)}})),f.on("loadedmetadata",(function(){})),f.one("error",(function(){var o,t;s(e,(null==f||null===(o=f.error())||void 0===o?void 0:o.message)||"Some error occured"),n.reject({status:!1,msg:(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"})})),f.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var o,n,i,r=null===(o=u())||void 0===o||null===(n=o.video)||void 0===n||null===(i=n.gist)||void 0===i?void 0:i.id,l=c().get(r)||{t:0,p:0},a=l.t,s=l.p;a&&s<95&&setTimeout((function(){f.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&f.currentTime(null==t?void 0:t.watchHistoryResumeTime)})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},ie=function(e,o){var t=null==o?void 0:o.skin;"live"==t?import("./skin-6093bfb3.js").then((function(t){t.initialiseSkin(e,o)})):"default"==t?import("./skin-b939c35e.js").then((function(t){t.initialiseSkin(e,o)})):"carousel"==t?import("./skin-42c2f81d.js").then((function(o){o.initaliseSkin(e)})):"defaultV2"==t?import("./skin-60a41d44.js").then((function(t){t.initialiseSkin(e,o)})):"multiplayer"==t&&import("./skin-5e2fa9d4.js").then((function(t){t.initialiseSkin(e,o)}))},re=function(e){return new Promise((function(o,t){if(le(e))t("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){o()},n.onerror=function(o){t("Error while loading script ".concat(e," : ").concat(o))},document.head.appendChild(n)}}))},le=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0};function ae(){var e,o;null===(e=window)||void 0===e||null===(o=e.dataLayer)||void 0===o||o.push(arguments)}var se=function(e,o){o.controlBar.el_.style.color=e,o.controlBar.el_.querySelector(".vjs-play-progress")&&(o.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),o.controlBar.el_.querySelector(".vjs-volume-level")&&(o.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var ue,de=function(){var o=e(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:re("https://cdn.dashjs.org/v4.7.3/dash.all.min.js").then((function(){})).catch((function(e){return console.log(e)}));case 3:case"end":return e.stop()}}),e)})));return function(){return o.apply(this,arguments)}}(),ce=function(){var o=e(t.mark((function e(){return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return o.apply(this,arguments)}}(),ve=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){re("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(n)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(n)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),re("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:de,loadEMELibrary:ce});function me(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o&&(n=n.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),t.push.apply(t,n)}return t}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}var fe=function(l,a,u,d){var c,v,m,p,f,w,y,h,b,k,O,j,P,I,C,D,E,R,x,V,H,L,_,M=a.res,N=void 0===M?null:M,q=a.sres,U=void 0===q?null:q,F=(null===(c=window)||void 0===c||null===(v=c.cast)||void 0===v||null===(m=v.framework)||void 0===m||null===(p=m.CastContext)||void 0===p||null===(f=p.getInstance())||void 0===f?void 0:f.S)||void 0,z=null!=u&&u.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==F&&"NOT_CONNECTED"!==F?["html5","chromecast"]:["chromecast","html5"]:["html5"],K=null==N||null===(w=N.video)||void 0===w||null===(y=w.gist)||void 0===y?void 0:y.videoImageUrl,X=(null==N||null===(h=N.video)||void 0===h||null===(b=h.liveDetails)||void 0===b?void 0:b.isDvrEnabled)||!1,W=function(e){var o,t={};return null!=e&&e.series||null!=e&&e.chromecastReceiverId&&null!==(o=window)&&void 0!==o&&o.cast&&(t={chromecast:{receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0}}),null!=e&&e.airplay&&"Safari"==i()&&(t=J(J({},t),{},{airPlay:{addButtonToControlBar:"default"==e.skin,buttonPositionIndex:-6}})),t}(u),Q=(null==N||null===(k=N.video)||void 0===k||null===(O=k.streamingInfo)||void 0===O?void 0:O.isLiveStream)||!1,Y=(null==u?void 0:u.drmLibrary)||!1,Z=(null==N||null===(j=N.ads)||void 0===j||null===(P=j.preRoll)||void 0===P||null===(I=P.adTags)||void 0===I||null===(C=I.web)||void 0===C?void 0:C.active)&&(null==N||null===(D=N.ads)||void 0===D||null===(E=D.preRoll)||void 0===E||null===(R=E.adTags)||void 0===R||null===(x=R.web)||void 0===x?void 0:x.url),$=(_={controls:0!=(null==u?void 0:u.controls),playsinline:!0,fluid:!0,muted:(null==u?void 0:u.muted)||!1,autoplay:(null==u?void 0:u.autoplay)||!1,controlBar:{volumePanel:("default"==u.skin||"defaultV2"==u.skin||"live"==(null==u?void 0:u.skin))&&{inline:!1},fullscreenToggle:"default"==u.skin||"defaultV2"==u.skin,audioTrackButton:!1,pictureInPictureToggle:(u.skin,!1)},muteToggle:"multiplayer"==u.skin,liveui:X},o(_,"autoplay",null==u?void 0:u.autoplay),o(_,"normalizeAutoplay",(null==u?void 0:u.autoplay)&&!Z),o(_,"loop",(null==u?void 0:u.loop)||!1),o(_,"html5",pe(pe({dash:{updateSettings:{streaming:{delay:{liveDelay:3},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}},vhs:pe(pe({experimentalLLHLS:(null==u?void 0:u.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==u||null===(V=u.customData)||void 0===V?void 0:V.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==u?void 0:u.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==u?void 0:u.experimentalBufferBasedABR)||!1})},0==(null==u||null===(H=u.customData)||void 0===H?void 0:H.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==u||null===(L=u.customData)||void 0===L?void 0:L.nativeVideoTracks)&&{nativeVideoTracks:!1})),o(_,"poster",K),o(_,"techOrder",z),o(_,"chromecast",{requestCustomDataFn:function(e){var o=r(l);console.log(o.textTracksJson_);var t=o.textTracksJson_.filter((function(e){return"subtitles"==e.kind}));return function(e,o,t){var n,i,r,l,a,s,u,d,c,v,m={};if(e&&e.video&&e.video.drmEnabled){m.isDrmEnabled=!0;var p=o.keySystemOptions&&o.keySystemOptions[0]&&o.keySystemOptions[0].options&&o.keySystemOptions[0].options.serverURL;m.licenseUrl=p;var f=o.keySystemOptions&&o.keySystemOptions[0]&&o.keySystemOptions[0].options&&o.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];m.licenseToken=f}var w=(null==e||null===(n=e.video)||void 0===n||null===(i=n.gist)||void 0===i?void 0:i.contentType)||"VIDEO";m.contentType=w;var y=null==e||null===(r=e.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;m.duration=y;var h=null==e||null===(a=e.video)||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;m.mediaTitle=h;var g=null==e||null===(u=e.video)||void 0===u||null===(d=u.gist)||void 0===d?void 0:d.videoImageUrl;return m.mediaImage=g,m.subTitles=t,m.DVR=(null==e||null===(c=e.video)||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(m),m}(N,e,t)}}),o(_,"plugins",W),_),ee=n(l,$,function(){var o=e(t.mark((function e(){var o,r,a,c,v,m,p,f,w,y,h,b,k,O,j,P,I;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q&&d.resolve(pe({status:!0,msg:"Player Initialised"},U?{seriesResponse:U,response:N}:{response:N})),"white"!==window.controlsColor&&se(window.controlsColor,ee),/Android/i.test(navigator.userAgent)&&(n.options.vhs.overrideNative=!0),y=null==N||null===(o=N.video)||void 0===o?void 0:o.drmEnabled,h=null==N||null===(r=N.video)||void 0===r||null===(a=r.liveDetails)||void 0===a?void 0:a.startOverTime,!y&&!Y){e.next=13;break}if("Safari"!==i()){e.next=11;break}return e.next=9,ce();case 9:e.next=13;break;case 11:return e.next=13,Promise.all([ce(),de()]);case 13:X&&G(l,h),!Z||null!=u&&null!==(c=u.customData)&&void 0!==c&&c.disableAds||B(l,Z,N),b=T(N,l),"IN"==u.countryCode&&(n.Vhs.xhr.beforeRequest=function(e){e.uri=e.uri.replace("us-e","a-m")}),b?g(l,b):(d.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:N}),s(l,"Incompatible Source, only hls,mp4,drm content is allowed")),((null==N||null===(v=N.video)||void 0===v||null===(m=v.contentDetails)||void 0===m||null===(p=m.closedCaptions)||void 0===p?void 0:p.length)>0||(null==N||null===(f=N.video)||void 0===f||null===(w=f.closedCaptions)||void 0===w?void 0:w.length)>0)&&(I=(null==N||null===(O=N.video)||void 0===O||null===(j=O.contentDetails)||void 0===j?void 0:j.closedCaptions)||(null==N||null===(P=N.video)||void 0===P?void 0:P.closedCaptions),k=I.filter((function(e){return"VTT"===e.format})),A(l,k)),null!=u&&u.disableControls?S(l):ie(l,pe(pe(pe({},u),$),{},{liveVideo:Q,isDvrEnabled:X,res:N,sres:U})),ne(l,pe(pe(pe({},u),$),{},{liveVideo:Q}),d,{res:N,sres:U});case 21:case"end":return e.stop()}}),e)})));return function(){return o.apply(this,arguments)}}())};function we(){return{loadVideoInstantly:p,onTimeUpdate:H,getVideoDuration:L,onVideoEnded:_,init:function(e){return new Promise((function(o,t){var n,r,l,a,s,u,c,p,f;if(!b(null==e?void 0:e.playerId)){var w=null==e?void 0:e.videoId,y=(null==e||null===(n=e.series)||void 0===n?void 0:n.enable)||!1;window.videoId=w;var h=null==e?void 0:e.token;if(h&&!C(h)){ue=JSON.parse(atob(h.split(".")[1])),window.siteId=null===(r=ue)||void 0===r?void 0:r.siteId,window.siteName=null===(l=ue)||void 0===l?void 0:l.site,e.isAnonymousUser=!(null===(a=ue)||void 0===a||!a.anonymousId),e.siteOwner=(null===(s=ue)||void 0===s?void 0:s.site)||null,e.userId=(null===(u=ue)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(c=ue)||void 0===c?void 0:c.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("token",h);var g=null==e?void 0:e.playerId,k=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,j=null==e?void 0:e.apiBaseUrl,P=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,I=null==e?void 0:e.errors;I&&(window.customErrors=I),window.customData=null==e?void 0:e.customData,j&&(window.playerEntitlementUrl=j),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!F(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return ve})).then((function(e){e.importIMA()})),!k||null!=e&&e.series||Promise.resolve().then((function(){return ve})).then((function(e){e.importChromecast()})),O&&"Safari"==i()&&Promise.resolve().then((function(){return ve})).then((function(e){e.importAirplay()})),P&&re("https://www.googletagmanager.com/gtag/js?id=".concat(P)).then((function(){return e=P,window.dataLayer=window.dataLayer||[],ae("js",new Date),void ae("config",e);var e})).catch((function(e){}));var T=null===(f=document)||void 0===f?void 0:f.getElementById("".concat(g));if(T&&T.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var S,B=null==e||null===(S=e.series)||void 0===S?void 0:S.id;D(B,h).then((function(n){var i,r,l,a=n.data,s=n.data.seasons;V(s);var u=w||(null==s||null===(i=s[0])||void 0===i||null===(r=i.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,o){var t=new Map;v({videoId:e,token:o}).then((function(e){e.data.map((function(e){t.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),m(t)})).catch((function(e){return console.log(e)}))}(B,h),E(u,h).then((function(n){var i,r,l;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(r=i.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,d(n.data),fe(g,{res:null==n?void 0:n.data,sres:a},e,{resolve:o,reject:t})})).catch((function(e){R(e,g,t,w)}))})).catch((function(e){R(e,g,t)}))}else E(w,h).then((function(n){var i,r,l,a;window.contentType=null==n||null===(i=n.data)||void 0===i||null===(r=i.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,d(null==n?void 0:n.data);var s=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?x(w,h).then((function(n){var i,r,l,a,u,d;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedTime)||null,e.watchedPercentage=(null==n||null===(d=n.data)||void 0===d?void 0:d.watchedPercentage)||null,fe(g,{res:s},e,{resolve:o,reject:t})})).catch((function(n){var i,r,l,a;null!==(i=window)&&void 0!==i&&null!==(r=i.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),fe(g,{res:s},e,{resolve:o,reject:t})})):fe(g,{res:s},e,{resolve:o,reject:t})})).catch((function(e){R(e,g,t,w)}))}else t({status:!1,msg:"".concat(h?"Token is expired !":"Missing Authorization Token"),response:{token:h}})}}))},getRenditions:q,skip:f,getPlayer:r,play:w,pause:y,detectBrowser:i,rewind:h,loadVideo:g,seekToTimeStamp:M,isPlayerInitialised:b,load:k,dispose:O,enableCaptions:j,disableCaptions:P,getCaptions:I,playSelectedResolution:U,getSource:T,setVolume:ee,getVolume:oe,disableControls:S,setPlaybackSpeed:N}}export{we as default};
@@ -0,0 +1 @@
1
+ import{i as e,j as t,k as n,g as i,h as l,d as o,l as a,m as s,n as d,o as r,p as u}from"./features-f86404ce.js";import{M as v,a as c,c as m,d as p}from"./icons-c18c70b7.js";import{G as g,g as f,H as h,v as b}from"./generic-7c43020f.js";import{c as y}from"./skin-665ec17e.js";import{g as C}from"./renditions-97276745.js";import E from"@babel/runtime/helpers/toConsumableArray";import{s as w}from"./autoNextVideo-1672740e.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"./util-d9f5a7be.js";var N=g(),x=[];null==N||N.map((function(e){return x.push.apply(x,E(e.episodes))}));var j,B,T,k=function(e,t){var n;null==t||null===(n=t.series)||void 0===n||n.cb;var i=f(e);i.on("timeupdate",(function(){var e,t=Math.floor(i.currentTime()),n=i.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-t<=10&&h()<=(null==x?void 0:x.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}));var l,o=x.filter((function(e,t){return t==h()}));if((null==o?void 0:o.length)>0)if(null!==(l=document.getElementsByClassName("next-ep-preview"))&&void 0!==l&&l[0]){var a,s,d,r,u,v,c,m,p,g,b;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var y=null===(s=document.getElementsByClassName("next-ep-title"))||void 0===s?void 0:s[0],C=null===(d=document.getElementsByClassName("next-ep-img"))||void 0===d?void 0:d[0],E=null===(r=document.getElementsByClassName("next-ep-content"))||void 0===r?void 0:r[0],w=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=w)||void 0===v?void 0:v.length)>60&&(w=w.substr(0,60)+"..."),y.innerHTML="".concat(w),C.src=(null===(c=o[0])||void 0===c||null===(m=c.gist)||void 0===m||null===(p=m.imageGist)||void 0===p?void 0:p.r16x9)||(null===(g=window)||void 0===g||null===(b=g.customData)||void 0===b?void 0:b.fallbackImage),E.onclick=function(){return H(e)}}else{var N,j,B,T,k,L,M,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(e).append(V);var D=document.createElement("div");D.className="next-ep-header",D.innerHTML="Next up";var F=null===(N=o[0])||void 0===N?void 0:N.title,I=document.createElement("img");I.className="next-ep-img",I.src=(null===(j=o[0])||void 0===j||null===(B=j.gist)||void 0===B||null===(T=B.imageGist)||void 0===T?void 0:T.r16x9)||(null===(k=window)||void 0===k||null===(L=k.customData)||void 0===L?void 0:L.fallbackImage);var P=document.createElement("div");P.className="next-ep-title",(null===(M=F)||void 0===M?void 0:M.length)>60&&(F=F.substr(0,60)+"..."),P.innerHTML="".concat(F);var S=document.createElement("div");S.className="next-ep-content",S.append(I),S.append(P),S.onclick=function(){return H(e)},V.append(D),V.append(S)}},H=function(e,t){var n=f(e),i=Math.floor(n.currentTime());if(Math.floor(n.duration())!=i){n.pause(e);var l=h();w(l,e,x,sessionStorage.getItem("token"))}},L=function(e){var t=e/T,n=document.getElementsByClassName("bandwidth-container");null!=n&&n.length&&(n[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Connecton Speed </div><div class="debug-value-item">'.concat((t/125).toFixed(2)," kbps</div></div>"),j=(new Date).getTime())},M=function(e){var t=f(e);B=(new Date).getTime(),T=(B-j)/1e3;var n,i,l=t.src();n=l,(i=new XMLHttpRequest).open("HEAD",n,!0),i.onreadystatechange=function(){if(4==i.readyState&&(200==i.status||206==i.status)){var e=i.getResponseHeader("Content-Length");L(e)}},i.send(null)};function V(e){for(var t=f(e),n=t.buffered(),i=t.currentTime(),l=0,o=0;o<n.length;o++)n.start(o)<=i&&n.end(o)>l&&(l=n.end(o));var a=l-i,s=document.getElementsByClassName("buffer-container");s.length&&(s[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Buffer Health </div><div class="debug-value-item">'.concat(a.toFixed(2)," seconds</div></div>"))}var D=function(e){var t=document.getElementsByClassName("debug-container");if(null!=t&&t.length){var n=t[0].getElementsByClassName("volume-container");n.length&&(n[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Volume </div><div class="debug-value-item">'.concat(e,"%</div></div>"))}},F=function(e){f(e).on("loadstart",(function(){j=(new Date).getTime()}))};function I(i,l){var o=f(i);o.on("loadeddata",(function(){var n,a,s;(null===(n=C(i))||void 0===n?void 0:n.length)>0&&e(i,l),(null===(a=b(i))||void 0===a?void 0:a.length)>0&&t(i,l),null!=l&&null!==(s=l.series)&&void 0!==s&&s.enable&&k(i,l),function(e){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px")}(o.duration());var d=document.getElementsByClassName("vjs-live-control")[0],r=document.getElementsByClassName("vjs-time-control");null!=l&&l.liveVideo&&d.classList.value.includes("vjs-hidden")&&(r[0].style.display="block")})),o.one("play",(function(){var e,t,l,o;null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.iframeOverlayUrl&&n(i,null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o?void 0:o.iframeOverlayUrl)})),o.on("loadeddata",(function(){!function(e){var t=f(e),n=t.el().clientWidth,i=t.el().clientHeight,l=document.getElementsByClassName("viewport-container");l.length&&(l[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Viewport </div><div class="debug-value-item">'.concat(n,"x").concat(i,"</div></div>"))}(i),M(i)})),o.on("timeupdate",(function(){M(i),V(i),function(e){var t=f(e),n=(null==t?void 0:t.el().querySelector("video")).getVideoPlaybackQuality(),i=n?n.droppedVideoFrames/t.duration():"Unknown",l=document.getElementsByClassName("drop-frames-container");null!=l&&l.length&&(l[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Dropped FPS </div><div class="debug-value-item">'.concat(parseInt(i),"/s</div></div>"))}(i)})),o.on("waiting",(function(){return V(i)})),o.on("volumechange",(function(){var e=100*o.volume().toFixed(2);D(e)})),F(i)}function P(e,t){import("./skin-93e320fc.js").then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)})),I(e,t),function(e,t){var n=f(e);n.controlBar.getChild("FullscreenToggle").el().appendChild(y(v(window.controlsColor))),n.controlBar.getChild("FullscreenToggle").el().appendChild(y(c(window.controlsColor)));var i=document.getElementsByClassName("vjs-time-control");t.liveVideo&&(i[0].style.display="none")}(e,t),function(e,t){var n,v,c,g,f,h;0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)&&i(e,"defaultV2",m());(0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)||1==(null==t?void 0:t.liveui))&&l(e,"defaultV2",p());t.liveVideo||o(e);(null==t||null===(n=t.relatedVideos)||void 0===n||null===(v=n.content)||void 0===v?void 0:v.length)>0&&a(e,null==t?void 0:t.relatedVideos);(null==t||null===(c=t.streams)||void 0===c?void 0:c.length)>1&&s(e,null==t?void 0:t.streams);(null==t||null===(g=t.playlist)||void 0===g||null===(f=g.content)||void 0===f?void 0:f.length)>0&&d(e,null==t?void 0:t.playlist);null!=t&&null!==(h=t.series)&&void 0!==h&&h.enable&&r(e,t);null!=t&&t.debugStats&&u(e,t)}(e,t),function(e,t){var n=f(e),i=null==t?void 0:t.tvProviderLogoUrl;if(!i)return;var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",l.append(o),n.el().appendChild(l),n.on("useractive",(function(){l.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||l.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"}))}(e,t)}export{P as initialiseSkin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- "use strict";var e=require("./features-164c3cc6.js"),t=require("./icons-7afb9c13.js"),n=require("./generic-8b99b151.js"),i=require("./skin-84083352.js"),l=require("./renditions-bc841552.js"),o=require("@babel/runtime/helpers/toConsumableArray"),a=require("./autoNextVideo-823821e8.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("video.js"),require("axios"),require("js-cookie"),require("ua-parser-js"),require("./util-fa21734a.js");var d=n.getCurrentSeries(),r=[];null==d||d.map((function(e){return r.push.apply(r,o(e.episodes))}));var u,s,v,c=function(e,t){var i;null==t||null===(i=t.series)||void 0===i||i.cb;var l=n.getPlayer(e);l.on("timeupdate",(function(){var e,t=Math.floor(l.currentTime()),i=l.duration(),o=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];i-t<=10&&n.getVideoIdx()<=(null==r?void 0:r.length)-1?o&&(o.style.visibility="visible"):o&&(o.style.visibility="hidden")}));var o,a=r.filter((function(e,t){return t==n.getVideoIdx()}));if((null==a?void 0:a.length)>0)if(null!==(o=document.getElementsByClassName("next-ep-preview"))&&void 0!==o&&o[0]){var d,u,s,v,c,g,p,f,h,y,b;(null===(d=document.getElementsByClassName("next-ep-preview"))||void 0===d?void 0:d[0]).style.visibility="hidden";var C=null===(u=document.getElementsByClassName("next-ep-title"))||void 0===u?void 0:u[0],w=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],x=null===(v=document.getElementsByClassName("next-ep-content"))||void 0===v?void 0:v[0],E=null===(c=a[0])||void 0===c?void 0:c.title;(null===(g=E)||void 0===g?void 0:g.length)>60&&(E=E.substr(0,60)+"..."),C.innerHTML="".concat(E),w.src=(null===(p=a[0])||void 0===p||null===(f=p.gist)||void 0===f||null===(h=f.imageGist)||void 0===h?void 0:h.r16x9)||(null===(y=window)||void 0===y||null===(b=y.customData)||void 0===b?void 0:b.fallbackImage),x.onclick=function(){return m(e)}}else{var N,B,S,q,V,M,P,j=document.createElement("div");j.className="next-ep-preview",j.style.visibility="hidden",document.getElementById(e).append(j);var k=document.createElement("div");k.className="next-ep-header",k.innerHTML="Next up";var T=null===(N=a[0])||void 0===N?void 0:N.title,H=document.createElement("img");H.className="next-ep-img",H.src=(null===(B=a[0])||void 0===B||null===(S=B.gist)||void 0===S||null===(q=S.imageGist)||void 0===q?void 0:q.r16x9)||(null===(V=window)||void 0===V||null===(M=V.customData)||void 0===M?void 0:M.fallbackImage);var L=document.createElement("div");L.className="next-ep-title",(null===(P=T)||void 0===P?void 0:P.length)>60&&(T=T.substr(0,60)+"..."),L.innerHTML="".concat(T);var I=document.createElement("div");I.className="next-ep-content",I.append(H),I.append(L),I.onclick=function(){return m(e)},j.append(k),j.append(I)}},m=function(e,t){var i=n.getPlayer(e),l=Math.floor(i.currentTime());if(Math.floor(i.duration())!=l){i.pause(e);var o=n.getVideoIdx();a.switchToNext(o,e,r,sessionStorage.getItem("token"))}},g=function(e){var t=e/v,n=document.getElementsByClassName("bandwidth-container");null!=n&&n.length&&(n[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Connecton Speed </div><div class="debug-value-item">'.concat((t/125).toFixed(2)," kbps</div></div>"),u=(new Date).getTime())},p=function(e){var t=n.getPlayer(e);s=(new Date).getTime(),v=(s-u)/1e3;var i,l,o=t.src();i=o,(l=new XMLHttpRequest).open("HEAD",i,!0),l.onreadystatechange=function(){if(4==l.readyState&&(200==l.status||206==l.status)){var e=l.getResponseHeader("Content-Length");g(e)}},l.send(null)};function f(e){for(var t=n.getPlayer(e),i=t.buffered(),l=t.currentTime(),o=0,a=0;a<i.length;a++)i.start(a)<=l&&i.end(a)>o&&(o=i.end(a));var d=o-l,r=document.getElementsByClassName("buffer-container");r.length&&(r[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Buffer Health </div><div class="debug-value-item">'.concat(d.toFixed(2)," seconds</div></div>"))}var h=function(e){var t=document.getElementsByClassName("debug-container");if(null!=t&&t.length){var n=t[0].getElementsByClassName("volume-container");n.length&&(n[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Volume </div><div class="debug-value-item">'.concat(e,"%</div></div>"))}},y=function(e){n.getPlayer(e).on("loadstart",(function(){u=(new Date).getTime()}))};function b(t,i){var o=n.getPlayer(t);o.on("loadeddata",(function(){var a,d,r;(null===(a=l.getRenditions(t))||void 0===a?void 0:a.length)>0&&e.addSettingsButtonV2(t,i),(null===(d=n.getCaptions(t))||void 0===d?void 0:d.length)>0&&e.addCaptionButton(t,i),null!=i&&null!==(r=i.series)&&void 0!==r&&r.enable&&c(t,i),function(e){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px")}(o.duration())})),o.one("play",(function(){var n,i,l,o;null!==(n=window)&&void 0!==n&&null!==(i=n.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o?void 0:o.iframeOverlayUrl)})),o.on("loadeddata",(function(){!function(e){var t=n.getPlayer(e),i=t.el().clientWidth,l=t.el().clientHeight,o=document.getElementsByClassName("viewport-container");o.length&&(o[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Viewport </div><div class="debug-value-item">'.concat(i,"x").concat(l,"</div></div>"))}(t),p(t)})),o.on("timeupdate",(function(){p(t),f(t),function(e){var t=n.getPlayer(e),i=(null==t?void 0:t.el().querySelector("video")).getVideoPlaybackQuality(),l=i?i.droppedVideoFrames/t.duration():"Unknown",o=document.getElementsByClassName("drop-frames-container");null!=o&&o.length&&(o[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Dropped FPS </div><div class="debug-value-item">'.concat(parseInt(l),"/s</div></div>"))}(t)})),o.on("waiting",(function(){return f(t)})),o.on("volumechange",(function(){var e=100*o.volume().toFixed(2);h(e)})),y(t)}exports.initialiseSkin=function(l,o){Promise.resolve().then((function(){return require("./skin-afbec6d7.js")})).then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)})),b(l,o),function(e,l){var o=n.getPlayer(e);o.controlBar.getChild("FullscreenToggle").el().appendChild(i.createIconMarkup(t.MinimizeSvg(window.controlsColor))),o.controlBar.getChild("FullscreenToggle").el().appendChild(i.createIconMarkup(t.MaximizeSvg(window.controlsColor)));var a=document.getElementsByClassName("vjs-time-control");l.liveVideo&&(a[0].style.display="none")}(l,o),function(n,i){var l,o,a,d,r,u;0==(null==i?void 0:i.liveVideo)&&0==(null==i?void 0:i.liveui)&&e.addSkipButton(n,"defaultV2",t.SkipSvgV2());(0==(null==i?void 0:i.liveVideo)&&0==(null==i?void 0:i.liveui)||1==(null==i?void 0:i.liveui))&&e.addRewindButton(n,"defaultV2",t.RewindSvgV2());i.liveVideo||e.addSlowMotion(n);(null==i||null===(l=i.relatedVideos)||void 0===l||null===(o=l.content)||void 0===o?void 0:o.length)>0&&e.addVideoSelector(n,null==i?void 0:i.relatedVideos);(null==i||null===(a=i.streams)||void 0===a?void 0:a.length)>1&&e.addMulticamSelector(n,null==i?void 0:i.streams);(null==i||null===(d=i.playlist)||void 0===d||null===(r=d.content)||void 0===r?void 0:r.length)>0&&e.addPlaylistSelector(n,null==i?void 0:i.playlist);null!=i&&null!==(u=i.series)&&void 0!==u&&u.enable&&e.addSeriesSelectorV2(n,i);null!=i&&i.debugStats&&e.addDebugSelector(n,i)}(l,o),function(e,t){var i=n.getPlayer(e),l=null==t?void 0:t.tvProviderLogoUrl;if(!l)return;var o=document.createElement("div");o.className="tvProviderImage";var a=document.createElement("img");a.src="".concat(l),a.alt="Provider Image",o.append(a),i.el().appendChild(o),i.on("useractive",(function(){o.classList.remove("vjs-fade")})),i.on("userinactive",(function(){i.paused()||o.classList.add("vjs-fade")})),i.on("fullscreenchange",(function(){i.isFullscreen_?o.style.top="3.2rem":o.style.top="1rem"}))}(l,o)};
@@ -1 +0,0 @@
1
- import{i as e,j as t,k as n,g as i,h as l,d as o,l as a,m as d,n as s,o as r,p as u}from"./features-f86404ce.js";import{M as v,a as c,c as m,d as p}from"./icons-c18c70b7.js";import{G as g,g as f,H as h,v as b}from"./generic-7c43020f.js";import{c as y}from"./skin-665ec17e.js";import{g as C}from"./renditions-97276745.js";import w from"@babel/runtime/helpers/toConsumableArray";import{s as E}from"./autoNextVideo-1672740e.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"video.js";import"axios";import"js-cookie";import"ua-parser-js";import"./util-d9f5a7be.js";var x=g(),N=[];null==x||x.map((function(e){return N.push.apply(N,w(e.episodes))}));var j,B,T,H=function(e,t){var n;null==t||null===(n=t.series)||void 0===n||n.cb;var i=f(e);i.on("timeupdate",(function(){var e,t=Math.floor(i.currentTime()),n=i.duration(),l=null===(e=document.getElementsByClassName("next-ep-preview"))||void 0===e?void 0:e[0];n-t<=10&&h()<=(null==N?void 0:N.length)-1?l&&(l.style.visibility="visible"):l&&(l.style.visibility="hidden")}));var l,o=N.filter((function(e,t){return t==h()}));if((null==o?void 0:o.length)>0)if(null!==(l=document.getElementsByClassName("next-ep-preview"))&&void 0!==l&&l[0]){var a,d,s,r,u,v,c,m,p,g,b;(null===(a=document.getElementsByClassName("next-ep-preview"))||void 0===a?void 0:a[0]).style.visibility="hidden";var y=null===(d=document.getElementsByClassName("next-ep-title"))||void 0===d?void 0:d[0],C=null===(s=document.getElementsByClassName("next-ep-img"))||void 0===s?void 0:s[0],w=null===(r=document.getElementsByClassName("next-ep-content"))||void 0===r?void 0:r[0],E=null===(u=o[0])||void 0===u?void 0:u.title;(null===(v=E)||void 0===v?void 0:v.length)>60&&(E=E.substr(0,60)+"..."),y.innerHTML="".concat(E),C.src=(null===(c=o[0])||void 0===c||null===(m=c.gist)||void 0===m||null===(p=m.imageGist)||void 0===p?void 0:p.r16x9)||(null===(g=window)||void 0===g||null===(b=g.customData)||void 0===b?void 0:b.fallbackImage),w.onclick=function(){return M(e)}}else{var x,j,B,T,H,k,L,V=document.createElement("div");V.className="next-ep-preview",V.style.visibility="hidden",document.getElementById(e).append(V);var D=document.createElement("div");D.className="next-ep-header",D.innerHTML="Next up";var F=null===(x=o[0])||void 0===x?void 0:x.title,I=document.createElement("img");I.className="next-ep-img",I.src=(null===(j=o[0])||void 0===j||null===(B=j.gist)||void 0===B||null===(T=B.imageGist)||void 0===T?void 0:T.r16x9)||(null===(H=window)||void 0===H||null===(k=H.customData)||void 0===k?void 0:k.fallbackImage);var P=document.createElement("div");P.className="next-ep-title",(null===(L=F)||void 0===L?void 0:L.length)>60&&(F=F.substr(0,60)+"..."),P.innerHTML="".concat(F);var S=document.createElement("div");S.className="next-ep-content",S.append(I),S.append(P),S.onclick=function(){return M(e)},V.append(D),V.append(S)}},M=function(e,t){var n=f(e),i=Math.floor(n.currentTime());if(Math.floor(n.duration())!=i){n.pause(e);var l=h();E(l,e,N,sessionStorage.getItem("token"))}},k=function(e){var t=e/T,n=document.getElementsByClassName("bandwidth-container");null!=n&&n.length&&(n[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Connecton Speed </div><div class="debug-value-item">'.concat((t/125).toFixed(2)," kbps</div></div>"),j=(new Date).getTime())},L=function(e){var t=f(e);B=(new Date).getTime(),T=(B-j)/1e3;var n,i,l=t.src();n=l,(i=new XMLHttpRequest).open("HEAD",n,!0),i.onreadystatechange=function(){if(4==i.readyState&&(200==i.status||206==i.status)){var e=i.getResponseHeader("Content-Length");k(e)}},i.send(null)};function V(e){for(var t=f(e),n=t.buffered(),i=t.currentTime(),l=0,o=0;o<n.length;o++)n.start(o)<=i&&n.end(o)>l&&(l=n.end(o));var a=l-i,d=document.getElementsByClassName("buffer-container");d.length&&(d[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Buffer Health </div><div class="debug-value-item">'.concat(a.toFixed(2)," seconds</div></div>"))}var D=function(e){var t=document.getElementsByClassName("debug-container");if(null!=t&&t.length){var n=t[0].getElementsByClassName("volume-container");n.length&&(n[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Volume </div><div class="debug-value-item">'.concat(e,"%</div></div>"))}},F=function(e){f(e).on("loadstart",(function(){j=(new Date).getTime()}))};function I(i,l){var o=f(i);o.on("loadeddata",(function(){var n,a,d;(null===(n=C(i))||void 0===n?void 0:n.length)>0&&e(i,l),(null===(a=b(i))||void 0===a?void 0:a.length)>0&&t(i,l),null!=l&&null!==(d=l.series)&&void 0!==d&&d.enable&&H(i,l),function(e){var t,n=Math.floor(e/60),i=null===(t=document.getElementsByClassName("vjs-progress-holder vjs-slider vjs-slider-horizontal"))||void 0===t?void 0:t[0];i&&(i.style.marginRight=n>60?"56px":"41px")}(o.duration())})),o.one("play",(function(){var e,t,l,o;null!==(e=window)&&void 0!==e&&null!==(t=e.customData)&&void 0!==t&&t.iframeOverlayUrl&&n(i,null===(l=window)||void 0===l||null===(o=l.customData)||void 0===o?void 0:o.iframeOverlayUrl)})),o.on("loadeddata",(function(){!function(e){var t=f(e),n=t.el().clientWidth,i=t.el().clientHeight,l=document.getElementsByClassName("viewport-container");l.length&&(l[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Viewport </div><div class="debug-value-item">'.concat(n,"x").concat(i,"</div></div>"))}(i),L(i)})),o.on("timeupdate",(function(){L(i),V(i),function(e){var t=f(e),n=(null==t?void 0:t.el().querySelector("video")).getVideoPlaybackQuality(),i=n?n.droppedVideoFrames/t.duration():"Unknown",l=document.getElementsByClassName("drop-frames-container");null!=l&&l.length&&(l[0].innerHTML='<div class="debug-item"><div class="debug-title-item">Dropped FPS </div><div class="debug-value-item">'.concat(parseInt(i),"/s</div></div>"))}(i)})),o.on("waiting",(function(){return V(i)})),o.on("volumechange",(function(){var e=100*o.volume().toFixed(2);D(e)})),F(i)}function P(e,t){import("./skin-93e320fc.js").then((function(e){var t=document.createElement("style");t.id="default_v2",t.append("".concat(e.default)),document.head.appendChild(t)})),I(e,t),function(e,t){var n=f(e);n.controlBar.getChild("FullscreenToggle").el().appendChild(y(v(window.controlsColor))),n.controlBar.getChild("FullscreenToggle").el().appendChild(y(c(window.controlsColor)));var i=document.getElementsByClassName("vjs-time-control");t.liveVideo&&(i[0].style.display="none")}(e,t),function(e,t){var n,v,c,g,f,h;0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)&&i(e,"defaultV2",m());(0==(null==t?void 0:t.liveVideo)&&0==(null==t?void 0:t.liveui)||1==(null==t?void 0:t.liveui))&&l(e,"defaultV2",p());t.liveVideo||o(e);(null==t||null===(n=t.relatedVideos)||void 0===n||null===(v=n.content)||void 0===v?void 0:v.length)>0&&a(e,null==t?void 0:t.relatedVideos);(null==t||null===(c=t.streams)||void 0===c?void 0:c.length)>1&&d(e,null==t?void 0:t.streams);(null==t||null===(g=t.playlist)||void 0===g||null===(f=g.content)||void 0===f?void 0:f.length)>0&&s(e,null==t?void 0:t.playlist);null!=t&&null!==(h=t.series)&&void 0!==h&&h.enable&&r(e,t);null!=t&&t.debugStats&&u(e,t)}(e,t),function(e,t){var n=f(e),i=null==t?void 0:t.tvProviderLogoUrl;if(!i)return;var l=document.createElement("div");l.className="tvProviderImage";var o=document.createElement("img");o.src="".concat(i),o.alt="Provider Image",l.append(o),n.el().appendChild(l),n.on("useractive",(function(){l.classList.remove("vjs-fade")})),n.on("userinactive",(function(){n.paused()||l.classList.add("vjs-fade")})),n.on("fullscreenchange",(function(){n.isFullscreen_?l.style.top="3.2rem":l.style.top="1rem"}))}(e,t)}export{P as initialiseSkin};