<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"use strict";(self.webpackChunkPeerTube=self.webpackChunkPeerTube||[]).push([[4128],{54128:(y,f,d)=&gt;{d.r(f),d.d(f,{Html5Hlsjs:()=&gt;E});var p=d(99525),o=d.n(p),_=d(1296),c=d.n(_),h=d(84820);let v=!1;const R=c().getPlugin("plugin");c().registerPlugin("hlsjs",class m extends R{constructor(r,a){super(r,a),a&amp;&amp;(r.srOptions_||(r.srOptions_={}),r.srOptions_.hlsjsConfig||(r.srOptions_.hlsjsConfig=a.hlsjsConfig),a.levelLabelHandler&amp;&amp;!r.srOptions_.levelLabelHandler&amp;&amp;(r.srOptions_.levelLabelHandler=a.levelLabelHandler),function(u){if(!o().isSupported())return void h.Q.info("Hls.js is not supported in this browser.");const r=u.getTech("Html5");r?v||(v=!0,r.registerSourceHandler({canHandleSource:function(a){return/^application\/x-mpegURL|application\/vnd\.apple\.mpegurl$/i.test(a.type)?"probably":/\.m3u8/i.test(a.src)?"maybe":""},handleSource:function(a,e){return e.hlsProvider&amp;&amp;e.hlsProvider.dispose(),e.hlsProvider=new E(u,a,e),e.hlsProvider}},0),u.Html5Hlsjs=E):h.Q.error('No "Html5" tech found in videojs')}(c()))}dispose(){this.player.srOptions_=void 0;const r=this.player.tech(!0);r.hlsProvider&amp;&amp;(r.hlsProvider.dispose(),r.hlsProvider=void 0),super.dispose()}});let E=(()=&gt;{class r{constructor(e,t,s){this.errorCounts={},this.maxNetworkErrorRecovery=5,this.hlsjsConfig=null,this._duration=null,this.metadata=null,this.isLive=null,this.dvrDuration=null,this.edgeMargin=null,this.handlers={play:null,error:null},this.vjs=e,this.source=t,this.tech=s,this.tech.name_="Hlsjs",this.videoElement=s.el(),this.player=e(s.options_.playerId),this.handlers.error=n=&gt;{let i;const l=(n.currentTarget||n.target).error;if(l){switch(h.Q.info(l),l.code){case l.MEDIA_ERR_ABORTED:i="You aborted the video playback";break;case l.MEDIA_ERR_DECODE:i="The video playback was aborted due to a corruption problem or because the video used features your browser did not support",this._handleMediaError(l);break;case l.MEDIA_ERR_NETWORK:i="A network error caused the video download to fail part-way";break;case l.MEDIA_ERR_SRC_NOT_SUPPORTED:i="The video could not be loaded, either because the server or network failed or because the format is not supported";break;default:i=l.message}h.Q.error(`MEDIA_ERROR: ${i}`)}},this.videoElement.addEventListener("error",this.handlers.error),this.initialize()}duration(){return this._duration===1/0?1/0:isNaN(this.videoElement.duration)?this._duration||0:this.videoElement.duration}seekable(){if(this.hls.media){if(!this.isLive)return this.vjs.createTimeRanges(0,this.hls.media.duration);const e=Math.round(this.hls.media.duration-this.dvrDuration),t=Math.round(this.hls.media.duration-this.edgeMargin);return this.vjs.createTimeRanges(e,t)}return this.vjs.createTimeRanges()}dispose(){this.videoElement.removeEventListener("play",this.handlers.play),this.videoElement.removeEventListener("error",this.handlers.error);const e=this.hls;e.log=e.warn=()=&gt;{},this.hls.destroy()}static addHook(e,t){r.hooks[e]=this.hooks[e]||[],r.hooks[e].push(t)}static removeHook(e,t){if(void 0===r.hooks[e])return!1;const s=r.hooks[e].indexOf(t);return-1!==s&amp;&amp;(r.hooks[e].splice(s,1),!0)}static removeAllHooks(){r.hooks={}}_executeHooksFor(e){if(void 0!==r.hooks[e])for(let t=0;t&lt;r.hooks[e].length;t++)r.hooks[e][t](this.player,this.hls)}_getHumanErrorMsg(e){return e.message}_handleUnrecovarableError(e){this.hls.levels.filter(t=&gt;t.id&gt;-1).length&gt;1?this._removeQuality(this.hls.loadLevel):(this.hls.destroy(),h.Q.info("bubbling error up to VIDEOJS"),this.tech.error=()=&gt;({...e,message:this._getHumanErrorMsg(e)}),this.tech.trigger("error"))}_handleMediaError(e){return 1===this.errorCounts[o().ErrorTypes.MEDIA_ERROR]?(h.Q.info("trying to recover media error"),void this.hls.recoverMediaError()):2===this.errorCounts[o().ErrorTypes.MEDIA_ERROR]?(h.Q.info("2nd try to recover media error (by swapping audio codec"),this.hls.swapAudioCodec(),void this.hls.recoverMediaError()):void(this.errorCounts[o().ErrorTypes.MEDIA_ERROR]&gt;2&amp;&amp;this._handleUnrecovarableError(e))}_handleNetworkError(e){if(!1!==navigator.onLine){if(this.errorCounts[o().ErrorTypes.NETWORK_ERROR]&lt;=this.maxNetworkErrorRecovery)return h.Q.info("trying to recover network error"),setTimeout(()=&gt;this.hls.startLoad(),1e3),void this.hls.once(o().Events.FRAG_LOADED,()=&gt;{this.errorCounts[o().ErrorTypes.NETWORK_ERROR]=0});this._handleUnrecovarableError(e)}}_onError(e,t){const s={message:`HLS.js error: ${t.type} - fatal: ${t.fatal} - ${t.details}`};this.errorCounts[t.type]?this.errorCounts[t.type]+=1:this.errorCounts[t.type]=1,t.fatal?h.Q.error(s.message,{currentTime:this.player.currentTime(),data:t}):h.Q.warn(s.message),t.type===o().ErrorTypes.NETWORK_ERROR?(s.code=2,this._handleNetworkError(s)):t.fatal&amp;&amp;t.type===o().ErrorTypes.MEDIA_ERROR&amp;&amp;"manifestIncompatibleCodecsError"!==t.details?(s.code=3,this._handleMediaError(s)):t.fatal&amp;&amp;this._handleUnrecovarableError(s)}buildLevelLabel(e){return this.player.srOptions_.levelLabelHandler?this.player.srOptions_.levelLabelHandler(e):e.height?e.height+"p":e.width?Math.round(9*e.width/16)+"p":e.bitrate?e.bitrate/1e3+"kbps":"0"}_removeQuality(e){this.hls.removeLevel(e),this.player.peertubeResolutions().remove(e),this.hls.currentLevel=-1}_notifyVideoQualities(){if(!this.metadata)return;const e=[];this.metadata.levels.forEach((t,s)=&gt;{e.push({id:s,height:t.height,width:t.width,bitrate:t.bitrate,label:this.buildLevelLabel(t),selected:t.id===this.hls.manualLevel,selectCallback:()=&gt;{this.hls.currentLevel=s}})}),e.push({id:-1,label:this.player.localize("Auto"),selected:!0,selectCallback:()=&gt;this.hls.currentLevel=-1}),this.player.peertubeResolutions().add(e)}_startLoad(){this.hls.startLoad(-1),this.videoElement.removeEventListener("play",this.handlers.play)}_oneLevelObjClone(e){const t={},s=Object.keys(e);for(let n=0;n&lt;s.length;n++)t[s[n]]=e[s[n]];return t}_onMetaData(e,t){this.metadata=t,this._notifyVideoQualities()}_initHlsjs(){const t=this.player.srOptions_,s=(null==t?void 0:t.hlsjsConfig)||this.tech.options_.hlsjsConfig;this.hlsjsConfig=s?this._oneLevelObjClone(s):{},["","auto"].includes(this.videoElement.preload)&amp;&amp;!this.videoElement.autoplay&amp;&amp;void 0===this.hlsjsConfig.autoStartLoad&amp;&amp;(this.hlsjsConfig.autoStartLoad=!1),!1===this.hlsjsConfig.autoStartLoad&amp;&amp;(this.handlers.play=this._startLoad.bind(this),this.videoElement.addEventListener("play",this.handlers.play)),this.hls=new(o())(this.hlsjsConfig),this._executeHooksFor("beforeinitialize"),this.hls.on(o().Events.ERROR,(n,i)=&gt;this._onError(n,i)),this.hls.on(o().Events.MANIFEST_PARSED,(n,i)=&gt;this._onMetaData(n,i)),this.hls.on(o().Events.LEVEL_LOADED,(n,i)=&gt;{this.hlsjsConfig.liveSyncDuration?this.edgeMargin=this.hlsjsConfig.liveSyncDuration:this.hlsjsConfig.liveSyncDurationCount&amp;&amp;(this.edgeMargin=this.hlsjsConfig.liveSyncDurationCount*i.details.targetduration),this.isLive=i.details.live,this.dvrDuration=i.details.totalduration,this._duration=this.isLive?1/0:i.details.totalduration,this.isLive&amp;&amp;(this.maxNetworkErrorRecovery=30)}),this.hls.once(o().Events.FRAG_LOADED,()=&gt;{this.tech.trigger("loadedmetadata")}),this.hls.on(o().Events.LEVEL_SWITCHING,(n,i)=&gt;{const l=this.hls.autoLevelEnabled?-1:i.level,b=this.hls.autoLevelEnabled?i.level:-1;this.player.peertubeResolutions().select({id:l,autoResolutionChosenId:b,fireCallback:!1})}),this.hls.attachMedia(this.videoElement),this.hls.loadSource(this.source.src)}initialize(){this._initHlsjs()}}return r.hooks={},r})()}}]);
//# sourceMappingURL=4128.665bf6f2efa4f4be.js.map</pre></body></html>