PageSourceSearch

https://app.sundancetv.com/code/js/chunks/instant-replay.d56fae0a89fd9bfdef71.js

js sundancetv.com collected 2026-09-24 20:33:37 UTC 11,216 bytes, 3 lines download raw bytes

1(()=>{(function(){try{var _=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{},E=new _.Error().stack;E&&(_._sentryDebugIds=_._sentryDebugIds||{},_._sentryDebugIds[E]="bd95497b-6185-4b49-94d5-f30772a48e7b",_._sentryDebugIdIdentifier="sentry-dbid-bd95497b-6185-4b49-94d5-f30772a48e7b")}catch(l){}})();(self.webpackChunkdice_web=self.webpackChunkdice_web||[]).push([[70334],{15428:((_,E,l)=>{l.r(E),l.d(E,{default:()=>C});var o=l(96540),y=l(68393),b=l(15660),A=l(85477),S=l(26504),R=l(58562),T=l(2275);const C=()=>{const{player:N}=o.useContext(y.T),[k,f]=o.useState(0),[P,I]=o.useState(!1);o.useEffect(()=>{let m;const p=N.getPluginByType(b.V),D=()=>{f(a=>a-1),m=setTimeout(D,1e3)},i=()=>{(p==null?void 0:p.getState())===A.R.PLAYING?(f(30),I(!0),m=setTimeout(D,1e3)):(clearTimeout(m),I(!1))};return p==null||p.on(S.B.REPLAY_STATE_CHANGED,i),()=>{clearTimeout(m),p==null||p.off(S.B.REPLAY_STATE_CHANGED,i)}},[]);const M=(0,T.AH)("dice-player-replay-title",P&&"dice-player-replay-title__showing"),{replayPuginTitle:O}=(0,R.b0)(["replayPuginTitle"]);return o.createElement("div",{className:M},o.createElement("div",{className:"replay-progress"},o.createElement("div",{className:"replay-half replay-half-one"}),o.createElement("div",{className:"replay-half replay-half-two"}),o.createElement("span",null,k)),O.value)}}),15660:((_,E,l)=>{l.d(E,{V:()=>D});var o=l(31635),y=l(33559),b=l(57659),A=l(91829),S=l(24547),R=l(49855),T=l(25564),w=l(41510),C=l.n(w),N=l(30228),k=l(77986),f=l(85477),P=l(26504),I=function(i,a){return function(e){e===void 0&&(e={});var n=e.requestModifier;return{load:function(t){var r=new Date,s=t.request,h=i.get({url:s.url});if(h!=null&&h.dash){var c=h.dash,u=c.xhr,g=c.args;if(u.response)return t.response=u,void t.onload.apply(t,(0,o.fX)([],(0,o.zs)(g),!1))}var d=new XMLHttpRequest;d.open(t.method,t.url,!0),s.responseType&&(d.responseType=s.responseType),s.range&&d.setRequestHeader("Range","bytes="+s.range),s.requestStartDate||(s.requestStartDate=r),n&&(d=n.modifyRequestHeader(d)),d.withCredentials=t.withCredentials,d.onload=function(){for(var v=[],L=0;L<arguments.length;L++)v[L]=arguments[L];i.set({url:s.url},{dash:{xhr:d,args:v}}),t.onload.apply(t,(0,o.fX)([],(0,o.zs)(v),!1))},d.onloadend=t.onend,d.onerror=t.onerror,d.onprogress=t.progress,d.onabort=t.onabort,d.send(),t.response=d}}}},M=(function(){function i(a){C()(this),this._cache=[],this._config=a}return i.prototype.delete=function(a){var e=this.findIndex(a);return e>=0&&(this._cache.splice(e,1),!0)},i.prototype.get=function(a){var e,n=this.findIndex(a);return(e=this._cache[n])===null||e===void 0?void 0:e[1]},i.prototype.getTotalSize=function(){var a=this;return this._cache.map((function(e){return a._config.getAssetSize(e[1])})).reduce((function(e,n){return e+n}),0)},i.prototype.release=function(a){if(typeof a=="number")for(var e=0;e<a&&this._cache.length>0;){var n=this._cache.shift();n&&(e+=this._config.getAssetSize(n[1]))}else this._cache=[]},i.prototype.set=function(a,e){this.delete(a),this._cache.push([a,e]);var n=this.getTotalSize();n>this._config.maxCacheSize&&this.release(n-this._config.maxCacheSize)},i.prototype.findIndex=function(a){return this._cache.findIndex((function(e){return(0,o.zs)(e,1)[0].url===a.url}))},i})(),O=(function(){function i(a){var e;C()(this),this._shakaLib=a.shakaLib,this._shakaPlayer=a.shakaPlayer,this._cache=a.cache,this._options=a.options,this._options.readFromCache&&(this._shakaLib.net.NetworkingEngine.registerScheme("http",this.shakaRequestPlugin),this._shakaLib.net.NetworkingEngine.registerScheme("https",this.shakaRequestPlugin)),this._options.writeToCache&&((e=this._shakaPlayer.getNetworkingEngine())===null||e===void 0||e.registerResponseFilter(this.handleShakaResponse))}return i.prototype.destroy=function(){var a;this._options.writeToCache&&((a=this._shakaPlayer.getNetworkingEngine())===null||a===void 0||a.unregisterResponseFilter(this.handleShakaResponse))},i.prototype.handleShakaResponse=function(a,e){a===this._shakaLib.net.NetworkingEngine.RequestType.SEGMENT&&this._cache.set({url:e.uri},{shaka:e})},i.prototype.shakaRequestPlugin=function(a,e,n,t){var r=this._cache.get({url:a});if(r!=null&&r.shaka){var s=Promise.resolve(r.shaka);return new this._shakaLib.util.AbortableOperation(s,(function(){return Promise.resolve()}))}return this._shakaLib.net.HttpFetchPlugin(a,e,n,t)},i})(),m=(function(){function i(a){this._buffer=new M({getAssetSize:function(e){var n,t,r;if(e.dash){var s=(n=e.dash.xhr.response)===null||n===void 0?void 0:n.length;return isNaN(s)?(r=(t=e.dash)===null||t===void 0?void 0:t.args[0].total)!==null&&r!==void 0?r:0:s}if(e.shaka){var h=e.shaka.data.byteLength;return isNaN(h)?0:h}},maxCacheSize:a})}return i.prototype.configureDash=function(a,e){a.extend("XHRLoader",I(this._buffer,e),!0)},i.prototype.configureShaka=function(a,e,n){var t;(t=this._shakaCacheController)===null||t===void 0||t.destroy(),this._shakaCacheController=new O({shakaLib:a,shakaPlayer:e,cache:this._buffer,options:n})},i.prototype.release=function(){var a;(a=this._shakaCacheController)===null||a===void 0||a.destroy(),this._buffer.release()},i})(),p=function(i){return new Promise((function(a){return window.setTimeout((function(){return a()}),i)}))},D=(function(i){function a(e,n){n===void 0&&(n={});var t=i.call(this)||this;t._parentPlayerWasMuted=!1,t._state=f.R.NOT_AVAILABLE,C()(t);var r=e.getServices().log;return t._logger=r.createLogger("ReplayPlugin"),t._config=n,t._parentPlayer=e,t._internalPlayer=t.createInternalPlayer(n,e),t._cacheController=n.maxCacheSize?new m(n.maxCacheSize):void 0,t._context=t._parentPlayer.createSubscriptionContext().on(y.w.DESTROYING,t.destroy).on(y.w.LOAD_REQUEST,(function(s,h){return(0,o.sH)(t,void 0,void 0,(function(){return(0,o.YH)(this,(function(c){switch(c.label){case 0:return this._mediaInfo=h.mediaInfo,this._internalPlayer?[4,this.loadMedia(this._internalPlayer,h.mediaInfo)]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2]}}
1))}))})).on(y.w.HANDLER_DESTROYING,(function(){t._mediaInfo=void 0,t._internalPlayer&&(t._internalPlayer.reset(),t.setState(f.R.NOT_AVAILABLE))})).on(y.w.HANDLER_CREATED,(function(s,h){var c,u,g=h.handler;R.J!=null&&(0,R.J)(g)?(c=t._cacheController)===null||c===void 0||c.configureDash(g.getEngine(),{writeToCache:!0}):T.J!=null&&(0,T.J)(g)&&((u=t._cacheController)===null||u===void 0||u.configureShaka(g.getShaka(),g.getEngine(),{writeToCache:!0}))})).on(y.w.VOLUME_CHANGE,(function(s,h){t.setVolume(h.volume)})).on(y.w.AUDIO_TRACK_CHANGE,(function(s,h){var c,u=h.currentAudioTrack;u&&t._parentPlayer&&!t.getIsCastConnected()&&((c=t._internalPlayer)===null||c===void 0||c.setCurrentAudioTrack(u))})),t}return(0,o.C6)(a,i),a.prototype.cancelReplay=function(){this._internalPlayer&&this.finishReplay(this._internalPlayer)},a.prototype.getId=function(){return k.K},a.prototype.getInternalPlayer=function(){return this._internalPlayer},a.prototype.getState=function(){return this._state},a.prototype.setRootElement=function(e){var n;this._config.rootEl===e&&this._internalPlayer!==void 0||(this._config.rootEl=e,(n=this._internalPlayer)===null||n===void 0||n.destroy(),this._internalPlayer=this.createInternalPlayer(this._config,this._parentPlayer))},a.prototype.startReplay=function(e,n){return(0,o.sH)(this,void 0,void 0,(function(){var t,r,s,h,c;return(0,o.YH)(this,(function(u){switch(u.label){case 0:if(t=this._internalPlayer,r=this._parentPlayer,t===void 0||this.getState()===f.R.NOT_AVAILABLE)throw new Error("Replay is not available!");(s=this.getState()!==f.R.IDLE)&&this.emit(P.B.REPLAY_INTERRUPTED),h={},u.label=1;case 1:return u.trys.push([1,,5,7]),this._replayReference=h,this.setState(f.R.LOADING),[4,t.seekTo(e)];case 2:return u.sent(),this._textTrack=r.getCurrentTextTrack(),r.setCurrentTextTrack(void 0),t.setCurrentTextTrack(this._textTrack),s||(this._parentPlayerWasMuted=r.getIsMuted(),t.setIsMuted(this._parentPlayerWasMuted),r.setIsMuted(!0)),[4,t.play()];case 3:return u.sent(),this.setState(f.R.PLAYING),c={startFrom:e,duration:n},this.emit(P.B.REPLAY_STARTED,c),[4,p(1e3*n)];case 4:return u.sent(),[3,7];case 5:return[4,this.finishReplay(t,h)];case 6:return u.sent(),[7];case 7:return[2]}}
1))}))},a.prototype.createInternalPlayer=function(e,n){var t=this,r=n.getConfig(),s=this.getElementFromReference(e.rootEl);if(s!==void 0){this._logger.info("Root element has been set to: ",s);var h=new b.a(s,{capLevelToPlayerSize:!0,debug:r.debug,defaultAutoplay:A.O.NO,handlers:r.handlers,muted:!0,useHtmlTextTracks:r.useHtmlTextTracks});return this.setVolume(n.getVolume()),h.getServices().sourceManager=n.getServices().sourceManager,h.on(y.w.HANDLER_CREATED,(function(c,u){var g,d,v=u.handler;R.J!=null&&(0,R.J)(v)?(g=t._cacheController)===null||g===void 0||g.configureDash(v.getEngine(),{readFromCache:!0}):T.J!=null&&(0,T.J)(v)&&((d=t._cacheController)===null||d===void 0||d.configureShaka(v.getShaka(),v.getEngine(),{readFromCache:!0}))})),this.loadMedia(h),h}e.rootEl?this._logger.warn("Root element '".concat(e.rootEl,"' cannot be found.")):this._logger.info("No root element provided.")},a.prototype.destroy=function(){var e,n;this._context.unsubscribe(),(e=this._internalPlayer)===null||e===void 0||e.destroy(),(n=this._cacheController)===null||n===void 0||n.release(),this.setState(f.R.NOT_AVAILABLE),this.getState()===f.R.PLAYING&&(this.emit
1(P.B.REPLAY_ENDED),delete this._replayReference)},a.prototype.finishReplay=function(e,n){return(0,o.sH)(this,void 0,void 0,(function(){var t;return(0,o.YH)(this,(function(r){switch(r.label){case 0:return n!=null||(n=this._replayReference),(this.getState()===f.R.LOADING||this.getState()===f.R.PLAYING)&&this._replayReference===n?(this._parentPlayer.setIsMuted(this._parentPlayerWasMuted),e.setIsMuted(!0),this.setState(f.R.IDLE),this.emit(P.B.REPLAY_ENDED),(t=this._config.pauseDelay)?[4,p(t)]:[3,2]):[3,3];case 1:r.sent(),r.label=2;case 2:this._replayReference===n&&(e.pause(),delete this._replayReference),this._parentPlayer.setCurrentTextTrack(this._textTrack),e.setCurrentTextTrack(void 0),r.label=3;case 3:return[2]}}))}))},a.prototype.getElementFromReference=function(e){var n;return typeof e=="string"?(n=document.getElementById(e))!==null&&n!==void 0?n:void 0:e},a.prototype.getIsCastConnected=function(){return this._parentPlayer.getCastState()===S.Q.CONNECTED},a.prototype.loadMedia=function(e,n){var t,r;return(0,o.sH)(this,void 0,void 0,(function(){return(0,o.YH)(this,(function(s){switch(s.label){case 0:return this._logger.debug("Loading media",n),(t=this._cacheController)===null||t===void 0||t.release(),(n=(r=n!=null?n:this._parentPlayer.getMediaInfo())!==null&&r!==void 0?r:this._mediaInfo)?[4,e.load((0,o.Cl)((0,o.Cl)({},n),{autoplay:A.O.NO}))]:[3,2];case 1:s.sent(),this.setState(f.R.IDLE),s.label=2;case 2:return[2]}}
1))}))},a.prototype.setState=function(e){if(this._state!==e){this._logger.debug("Setting state to ".concat(e)),this._state=e;var n={state:e};this.emit(P.B.REPLAY_STATE_CHANGED,n)}},a.prototype.setVolume=function(e){var n;try{(n=this._internalPlayer)===null||n===void 0||n.setVolume(e)}catch(t){}},a})(N.EventEmitter)})}]);})();
2
3//# sourceMappingURL=instant-replay.d56fae0a89fd9bfdef71.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.