'use strict';var holostreamReleaseVersion="2021.1.10c";console.log("HoloStream Build: "+holostreamReleaseVersion+"-20220906073903");var holoStreamDecoderRequest=new XMLHttpRequest;holoStreamDecoderRequest.open("get","https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/Decoder.js",!1);holoStreamDecoderRequest.send(null); var holoStreamDecoderBlob=new Blob([holoStreamDecoderRequest.responseText],{type:"application/javascript"}),holostreamConfiguration={config:"remote",imageLocations:{emptyImageURL:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-blank.svg#plyr-blank",playButton:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-play.svg#plyr-play",pauseButton:"https://static.holostream.arcturus.studio/release/"+ holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-pause.svg#plyr-pause",bufferingSymbol:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-progress.svg#plyr-progress",jumboPlayButton:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-large-play.svg#plyr-large-play",enterFullscreen:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-enter-fullscreen.svg#plyr-enter-fullscreen", exitFullscreen:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-exit-fullscreen.svg#plyr-exit-fullscreen",audioDisabled:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-audio-disabled.svg#plyr-audio-disabled",audioEnabled:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/img/hsp-controls/plyr-audio-enabled.svg#plyr-audio-enabled",holostreamLogo:"https://static.holostream.arcturus.studio/release/"+ holostreamReleaseVersion+"/remote/img/HoloStream.svg"},shaderLocations:{vertexShader:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/shaders/vertex_shader.glsl",fragmentShader:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/shaders/fragment_shader.glsl",vertexShaderiOS:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/shaders/vertex_shader_yuv_to_rgb.glsl",fragmentShaderiOS:"https://static.holostream.arcturus.studio/release/"+ holostreamReleaseVersion+"/remote/shaders/fragment_shader_yuv_to_rgb.glsl",vertexShaderShadow:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/shaders/vertex_shader_shadow.glsl",fragmentShaderShadow:"https://static.holostream.arcturus.studio/release/"+holostreamReleaseVersion+"/remote/shaders/fragment_shader_shadow.glsl"},decoderLocation:URL.createObjectURL(holoStreamDecoderBlob)};holoStreamDecoderBlob=holoStreamDecoderRequest=void 0; (function(){const b={type:"change"},a={type:"start"},f={type:"end"};class k extends THREE.EventDispatcher{constructor(h,d){function l(){return Math.pow(.95,q.zoomSpeed)}function c(a){q.object.isPerspectiveCamera?P/=a:q.object.isOrthographicCamera?(q.object.zoom=Math.max(q.minZoom,Math.min(q.maxZoom,q.object.zoom*a)),q.object.updateProjectionMatrix(),U=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),q.enableZoom=!1)}function p(a){q.object.isPerspectiveCamera? P*=a:q.object.isOrthographicCamera?(q.object.zoom=Math.max(q.minZoom,Math.min(q.maxZoom,q.object.zoom/a)),q.object.updateProjectionMatrix(),U=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),q.enableZoom=!1)}function v(){1===H.length?T.set(H[0].pageX,H[0].pageY):T.set(.5*(H[0].pageX+H[1].pageX),.5*(H[0].pageY+H[1].pageY))}function k(){1===H.length?R.set(H[0].pageX,H[0].pageY):R.set(.5*(H[0].pageX+H[1].pageX),.5*(H[0].pageY+H[1].pageY))}function e(){const a= H[0].pageX-H[1].pageX,c=H[0].pageY-H[1].pageY;V.set(0,Math.sqrt(a*a+c*c))}function g(a){if(1==H.length)O.set(a.pageX,a.pageY);else{const c=F(a);O.set(.5*(a.pageX+c.x),.5*(a.pageY+c.y))}X.subVectors(O,T).multiplyScalar(q.rotateSpeed);a=q.domElement;M.theta-=2*Math.PI*X.x/a.clientHeight;M.phi-=2*Math.PI*X.y/a.clientHeight;T.copy(O)}function t(a){if(1===H.length)ca.set(a.pageX,a.pageY);else{const c=F(a);ca.set(.5*(a.pageX+c.x),.5*(a.pageY+c.y))}Y.subVectors(ca,R).multiplyScalar(q.panSpeed);Z(Y.x,Y.y); R.copy(ca)}function m(a){const e=F(a),g=a.pageX-e.x;a=a.pageY-e.y;aa.set(0,Math.sqrt(g*g+a*a));S.set(0,Math.pow(aa.y/V.y,q.zoomSpeed));c(S.y);V.copy(aa)}function B(a){!1!==q.enabled&&(0===H.length&&(q.domElement.setPointerCapture(a.pointerId),q.domElement.addEventListener("pointermove",N),q.domElement.addEventListener("pointerup",L)),H.push(a),"touch"===a.pointerType?r(a):n(a))}function N(a){if(!1!==q.enabled)if("touch"===a.pointerType)switch(G(a),E){case C.TOUCH_ROTATE:if(!1===q.enableRotate)break; g(a);q.update();break;case C.TOUCH_PAN:if(!1===q.enablePan)break;t(a);q.update();break;case C.TOUCH_DOLLY_PAN:if(!1===q.enableZoom&&!1===q.enablePan)break;q.enableZoom&&m(a);q.enablePan&&t(a);q.update();break;case C.TOUCH_DOLLY_ROTATE:if(!1===q.enableZoom&&!1===q.enableRotate)break;q.enableZoom&&m(a);q.enableRotate&&g(a);q.update();break;default:E=C.NONE}else a:switch(E){case C.ROTATE:if(!1===q.enableRotate)break a;O.set(a.clientX,a.clientY);X.subVectors(O,T).multiplyScalar(q.rotateSpeed);a=q.domElement; M.theta-=2*Math.PI*X.x/a.clientHeight;M.phi-=2*Math.PI*X.y/a.clientHeight;T.copy(O);q.update();break;case C.DOLLY:if(!1===q.enableZoom)break a;aa.set(a.clientX,a.clientY);S.subVectors(aa,V);0S.y&&p(l());V.copy(aa);q.update();break;case C.PAN:!1!==q.enablePan&&(ca.set(a.clientX,a.clientY),Y.subVectors(ca,R).multiplyScalar(q.panSpeed),Z(Y.x,Y.y),R.copy(ca),q.update())}}function L(a){J(a);0===H.length&&(q.domElement.releasePointerCapture(a.pointerId),q.domElement.removeEventListener("pointermove", N),q.domElement.removeEventListener("pointerup",L));q.dispatchEvent(f);E=C.NONE}function D(a){J(a)}function n(c){let e;switch(c.button){case 0:e=q.mouseButtons.LEFT;break;case 1:e=q.mouseButtons.MIDDLE;break;case 2:e=q.mouseButtons.RIGHT;break;default:e=-1}switch(e){case THREE.MOUSE.DOLLY:if(!1===q.enableZoom)return;V.set(c.clientX,c.clientY);E=C.DOLLY;break;case THREE.MOUSE.ROTATE:if(c.ctrlKey||c.metaKey||c.shiftKey){if(!1===q.enablePan)return;R.set(c.clientX,c.clientY);E=C.PAN}else{if(!1===q.enableRotate)return; T.set(c.clientX,c.clientY);E=C.ROTATE}break;case THREE.MOUSE.PAN:if(c.ctrlKey||c.metaKey||c.shiftKey){if(!1===q.enableRotate)return;T.set(c.clientX,c.clientY);E=C.ROTATE}else{if(!1===q.enablePan)return;R.set(c.clientX,c.clientY);E=C.PAN}break;default:E=C.NONE}E!==C.NONE&&q.dispatchEvent(a)}function A(e){!1!==q.enabled&&!1!==q.enableZoom&&E===C.NONE&&(e.preventDefault(),q.dispatchEvent(a),0>e.deltaY?p(l()):0Math.PI&&(t-=d),l<-Math.PI?l+=d:l>Math.PI&&(l-=d),I.theta=t<=l?Math.max(t,Math.min(l,I.theta)):I.theta>(t+l)/2?Math.max(t,I.theta):Math.min(l,I.theta));I.phi=Math.max(q.minPolarAngle,Math.min(q.maxPolarAngle,I.phi));I.makeSafe();I.radius*=P;I.radius=Math.max(q.minDistance,Math.min(q.maxDistance,I.radius)); !0===q.enableDamping?q.target.addScaledVector(K,q.dampingFactor):q.target.add(K);a.setFromSpherical(I);a.applyQuaternion(e);p.copy(q.target).add(a);q.object.lookAt(q.target);!0===q.enableDamping?(M.theta*=1-q.dampingFactor,M.phi*=1-q.dampingFactor,K.multiplyScalar(1-q.dampingFactor)):(M.set(0,0,0),K.set(0,0,0));P=1;return U||1E-6= g);)++e;if(16m?g+=String.fromCharCode(m):(m-=65536,g+=String.fromCharCode(55296|m>>10,56320|m&1023))}}else g+=String.fromCharCode(m)}return g}function e(a){for(;0>2]=a);return a}function n(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function A(a){function c(){if(!r.calledRun&&(r.calledRun=!0,!U)){H||(H=!0,e(V));e(aa);if(r.onRuntimeInitialized)r.onRuntimeInitialized();if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)S.unshift(r.postRun.shift());e(S)}} if(!(0z&&K("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+z+"! (TOTAL_STACK\x3d5242880)");if(r.buffer)z= r.buffer;else if("object"===typeof WebAssembly&&"function"===typeof WebAssembly.Memory){var ca=new WebAssembly.Memory({initial:z/65536,maximum:z/65536});z=ca.buffer}else z=new ArrayBuffer(z);r.HEAP8=O=new Int8Array(z);r.HEAP16=new Int16Array(z);r.HEAP32=R=new Int32Array(z);r.HEAPU8=X=new Uint8Array(z);r.HEAPU16=new Uint16Array(z);r.HEAPU32=new Uint32Array(z);r.HEAPF32=new Float32Array(z);r.HEAPF64=new Float64Array(z);R[2788]=5254064;var Y=[],V=[],aa=[],S=[],H=!1,W=0,ea=null,da=null;r.preloadedImages= {};r.preloadedAudios={};var Z="avc.wasm";g(Z)||(Z=p(Z));r.asm=function(a,c,e){c.memory=ca;c.table=new WebAssembly.Table({initial:9,maximum:9,element:"anyfunc"});return l(c)};V.push({func:function(){na()}});var Q={buffers:[null,[],[]],printChar:function(a,c){var e=Q.buffers[a];0===c||10===c?((1===a?P:K)(b(e,0)),e.length=0):e.push(c)},varargs:0,get:function(a){Q.varargs+=4;return R[Q.varargs-4>>2]},getStr:function(){var a=Q.get();return a?b(X,a,void 0):""},get64:function(){var a=Q.get();Q.get();return a}, getZero:function(){Q.get()}};r._broadwayOnHeadersDecoded=f;r._broadwayOnPictureDecoded=h;z=r.asm({},{e:function(a,c){Q.varargs=c;try{return Q.getStreamFromFD(),Q.get(),Q.get(),Q.get(),Q.get(),0}catch(fa){return"undefined"!==typeof FS&&fa instanceof FS.ErrnoError||y(fa),-fa.errno}},b:function(a,c){Q.varargs=c;try{var e=Q.get(),g=Q.get(),m=Q.get();for(c=a=0;c>2],p=R[g+(8*c+4)>>2],t=0;t(g|0))return y("OOM"),0,D(12),-1;if((g|0)>(c|0))return y("OOM"),D(12),-1;R[2788]=g|0;return e|0}},z);r.asm=z;var na=r.___wasm_call_ctors=function(){return r.asm.i.apply(null, arguments)};r._broadwayCreateStream=function(){return r.asm.j.apply(null,arguments)};r._broadwayPlayStream=function(){return r.asm.k.apply(null,arguments)};r._broadwayInit=function(){return r.asm.l.apply(null,arguments)};r._broadwayExit=function(){return r.asm.m.apply(null,arguments)};r._broadwayGetMajorVersion=function(){return r.asm.n.apply(null,arguments)};r._broadwayGetMinorVersion=function(){return r.asm.o.apply(null,arguments)};r.asm=z;r.then=function(a){if(r.calledRun)a(r);else{var c=r.onRuntimeInitialized; r.onRuntimeInitialized=function(){c&&c();a(r)}}return r};n.prototype=Error();n.prototype.constructor=n;da=function La(){r.calledRun||A();r.calledRun||(da=La)};r.run=A;r.abort=y;if(r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0>10|0;g=((a-e|0)-t|0)>>10|0;a=(a+b|0)>>10|0;(c&255|0)!=(c|0)|0&&(c=d(255, p(0,c|0)|0)|0);(g&255|0)!=(g|0)|0&&(g=d(255,p(0,g|0)|0)|0);(a&255|0)!=(a|0)|0&&(a=d(255,p(0,a|0)|0)|0);a=((65280+a|0)<<8|0)+g|0;a=a<<8|0;a=a+c|0;return a|0}"use asm";var m=a.Math.imul,d=a.Math.min,p=a.Math.max,t=a.Math.pow;new a.Uint8Array(e);new a.Uint32Array(e);var b=new a.Uint8Array(e);new a.Uint8Array(e);var l=new a.Uint32Array(e),B=0,f=0,N=0,h=0,v=0,k=0,w=0,L=0,D=0,n=0;return{init:function(a,c){a|=0;c|=0;B=a;D=m(a,4)|0;f=c;N=m(B|0,f|0)|0;h=(N|0)>>2;k=m(m(B,f)|0,4)|0;v=N+h|0+h|0;L=0;w=L+k|0;n= w+v|0;c=~~+t(2,24);c=m(c,4)|0;for(a=0;(a|0)<(c|0)|0;a=a+4|0)l[(n+a|0)>>2]=0},doit:function(){var a,c;var e=L|0;var m=w|0;var d=m+N|0;var p=d+h|0;for(a=0;(a|0)<(f|0);a=a+2|0){for(c=0;(c|0)<(B|0);c=c+2|0){var t=b[m>>0]|0;var v=b[(m+B|0)>>0]|0;var k=b[d>>0]|0;var r=b[p>>0]|0;var x=((t<<16|0)+(k<<8|0)|0)+r|0;var q=l[(n+x|0)>>2]|0;q||(q=g(t,k,r)|0,l[(n+x|0)>>2]=q|0);l[e>>2]=q;x=((v<<16|0)+(k<<8|0)|0)+r|0;q=l[(n+x|0)>>2]|0;q||(q=g(v,k,r)|0,l[(n+x|0)>>2]=q|0);l[(e+D|0)>>2]=q;e=e+4|0;m=m+1|0;t=b[m>>0]|0; v=b[(m+B|0)>>0]|0;x=((t<<16|0)+(k<<8|0)|0)+r|0;q=l[(n+x|0)>>2]|0;q||(q=g(t,k,r)|0,l[(n+x|0)>>2]=q|0);l[e>>2]=q;x=((v<<16|0)+(k<<8|0)|0)+r|0;q=l[(n+x|0)>>2]|0;q||(q=g(v,k,r)|0,l[(n+x|0)>>2]=q|0);l[(e+D|0)>>2]=q;e=e+4|0;m=m+1|0;d=d+1|0;p=p+1|0}e=e+D|0;m=m+B|0}}}}var k=function(){return(new Date).getTime()};"undefined"!=typeof performance&&performance.now&&(k=function(){return performance.now()});var h=function(c){this.options=c||{};this.now=k;var e,g,m;c=function(a,c,m){var d=this.pictureBuffers[a]; d||(d=this.pictureBuffers[a]=g(a,c*m*3/2));a=!1;if(this.infoAr.length){a=!0;var p=this.infoAr}this.infoAr=[];if(this.options.rgb){if(!e){var t=""+c+"x"+m;if(n[t])e=n[t];else{var l=c*m,B=(l|0)>>2;l=l+B+B;B=c*m*4;for(var N=l+B+4*Math.pow(2,24),h=Math.pow(2,24),v=h;vb;++b)d.push(a[b]);t[0].sliceInfoAr=d;this.onPictureDecoded(p,c,e,t)}.bind(this));c=a.apply({},[function(){},c]);var d=this;this.onPictureDecoded= function(a,c,e,g){};this.onDecoderReady=function(){};var p=[];this.decode=function(a,c,e){p.push([a,c,e])};c(function(a){var c=a.HEAPU8;a._broadwayInit();g=function(a,e){return c.subarray(a,a+e)};m=function(a,e){return new Uint32Array(c.buffer,a,e)};d.streamBuffer=g(a._broadwayCreateStream(1048576),1048576);d.pictureBuffers={};d.infoAr=[];var e=0;d.options.sliceMode?(e=d.options.sliceNum,d.decode=function(c,g,m){d.infoAr.push(g);g.startDecoding=k();var p=g.nals;if(!p){p=[];g.nals=p;var t=c.length, b=!1,l=0,B=0;for(g=0;gd;++d){var p=e+g*d;c.set(a.subarray(p,m+g*d),p)}};var d=function(e,m){var d;for(d=0;8>d;++d){var p=e+g/2*d;c.set(a.subarray(p,m+g/2*d),p)}},p=function(e,g){c.set(a.subarray(e,g),e)},t=e[0],b=e[1];0a.data.infos[0].timeDecoding&&(a.data.infos[0].timeDecoding=D),a.data.infos[0].timeCopy+=k()-b);postMessage(a.data,[a.data.slice]);--m;if(0===m&&B.length){var f= B.shift();l.decode(new Uint8Array(f.buf,f.offset||0,f.length),f.info,function(){p&&v!==e&&postMessage(f,[f.buf])})}}else a.data.setSliceCnt&&(w=a.data.sliceCnt,e=w-1);else a.data&&"Broadway.js - Worker init"===a.data.type&&(d=!0,l=new h(a.data.options),a.data.options.sliceMode?(p=c=!0,v=a.data.options.sliceNum,w=a.data.options.sliceCnt,e=w-1,l.onPictureDecoded=function(a,c,e,d){var p=new Uint8Array(A(a.length));y(a,p,d[0].sliceInfoAr,c,e);N=d[0].startDecoding;L=d[0].finishDecoding;D=L-N;d[0].timeDecoding= D;d[0].timeCopy=0;postMessage({slice:p.buffer,sliceNum:v,width:c,height:e,infos:d},[p.buffer]);m=w-1;t=a;g=d[0].sliceInfoAr}):a.data.options.reuseMemory?(c=!0,l.onPictureDecoded=function(a,c,e,g){var m=new Uint8Array(A(a.length));m.set(a,0,a.length);postMessage({buf:m.buffer,length:a.length,width:c,height:e,infos:g},[m.buffer])}):l.onPictureDecoded=function(a,c,e,g){a&&(a=new Uint8Array(a));var m=new Uint8Array(a.length);m.set(a,0,a.length);postMessage({buf:m.buffer,length:a.length,width:c,height:e, infos:g},[m.buffer])},postMessage({consoleLog:"broadway worker initialized"}))},!1)}h.nowValue=k;return h}()}); (function(b,a){"function"===typeof define&&define.amd?define(["./Decoder","./YUVCanvas"],a):"object"===typeof exports?module.exports=a(require("./Decoder"),require("./YUVCanvas")):b.Player=a(b.Decoder,b.YUVCanvas)})(this,function(b,a){var f=b.nowValue;a=function(a){var h=this;this._config=a||{};this.render=!0;!1===this._config.render&&(this.render=!1);this.chunk=a.chunk;this.chunkIndex=a.chunkIndex;this.nowValue=f;this._config.workerFile=this._config.workerFile||"Decoder.js";this._config.preserveDrawingBuffer&& (this._config.contextOptions=this._config.contextOptions||{},this._config.contextOptions.preserveDrawingBuffer=!0);var k="auto";!0===this._config.webgl?k=!0:!1===this._config.webgl&&(k=!1);if("auto"==k){k=!0;try{window.WebGLRenderingContext||(k=!1)}catch(l){k=!1}}this.webgl=k;this.onCompletedVideo=void 0;var d=function(a,c,d,b){h.onPictureDecoded(a,c,d,b);if(void 0!==h.currentChunk&&void 0!==this.chunk&&(f(),this.chunk.cachedFrames.push({data:new Uint8Array(a.buf,0,a.length),dimensions:this.chunk.dimensions}), a.buf=null,b[0].currentFrame>=b[0].frameCount-1&&this.onCompletedVideo))this.onCompletedVideo()};this._config.size||(this._config.size={});this._config.size.width=this._config.size.width||200;this._config.size.height=this._config.size.height||200;this.initializedWorkers=!1;this.initializedWorkersCount=2;if(this._config.useWorker){this.workerIndex=0;this.workers=a.workers;let b=this;for(let c=0;c>>1,this.h>>>1)},length:function(){return this.w*this.h}};return b}(),Bytestream=function(){function b(a,b,k){this.bytes=new Uint8Array(a);this.pos=this.start=b||0;this.end=b+k||this.bytes.length}b.prototype={get length(){return this.end-this.start},get position(){return this.pos},get remaining(){return this.end-this.pos},readU8Array:function(a){if(this.pos> this.end-a)return null;var b=this.bytes.subarray(this.pos,this.pos+a);this.pos+=a;return b},readU32Array:function(a,b,k){b=b||1;if(this.pos>this.end-a*b*4)return null;if(1==b)for(var f=new Uint32Array(a),n=0;n>24},readU8:function(){return this.pos>=this.end?null: this.bytes[this.pos++]},read16:function(){return this.readU16()<<16>>16},readU16:function(){if(this.pos>=this.end-1)return null;var a=this.bytes[this.pos+0]<<8|this.bytes[this.pos+1];this.pos+=2;return a},read24:function(){return this.readU24()<<8>>8},readU24:function(){var a=this.pos,b=this.bytes;if(a>this.end-3)return null;a=b[a+0]<<16|b[a+1]<<8|b[a+2];this.pos+=3;return a},peek32:function(a){var b=this.pos,k=this.bytes;if(b>this.end-4)return null;b=k[b+0]<<24|k[b+1]<<16|k[b+2]<<8|k[b+3];a&&(this.pos+= 4);return b},read32:function(){return this.peek32(!0)},readU32:function(){return this.peek32(!0)>>>0},read4CC:function(){var a=this.pos;if(a>this.end-4)return null;for(var b="",k=0;4>k;k++)b+=String.fromCharCode(this.bytes[a+k]);this.pos+=4;return b},readFP16:function(){return this.read32()/65536},readFP8:function(){return this.read16()/256},readISO639:function(){for(var a=this.readU16(),b="",k=0;3>k;k++)b+=String.fromCharCode((a>>>5*(2-k)&31)+96);return b},readUTF8:function(a){for(var b="",k=0;k< a;k++)b+=String.fromCharCode(this.readU8());return b},readPString:function(a){var b=this.readU8();assert(b<=a);var k=this.readUTF8(b);this.reserved(a-b-1,0);return k},skip:function(a){this.seek(this.pos+a)},reserved:function(a,b){for(var f=0;fa||a>this.end)&&error("Index out of bounds (bounds: [0, "+this.end+"], index: "+a+").");this.pos=a},subStream:function(a,b){return new Bytestream(this.bytes.buffer,a,b)}};return b}(),PARANOID=!0,MP4Reader= function(){function b(a){this.stream=a;this.tracks={}}b.prototype={readBoxes:function(a,b){for(;a.peek32();){var f=this.readBox(a);if(f.type in b){var h=b[f.type];h instanceof Array||(b[f.type]=[h]);b[f.type].push(f)}else b[f.type]=f}},readBox:function(a){function b(){h.version=a.readU8();h.flags=a.readU24()}function k(){return h.size-(a.position-h.offset)}var h={offset:a.position},n=function(){var d=a.subStream(a.position,k());this.readBoxes(d,h);a.skip(d.length)}.bind(this);h.size=a.readU32();h.type= a.read4CC();switch(h.type){case "ftyp":h.name="File Type Box";h.majorBrand=a.read4CC();h.minorVersion=a.readU32();h.compatibleBrands=Array((h.size-16)/4);for(n=0;n>>16;assert(0==h.version);n();break;case "esds":h.name="Elementary Stream Descriptor";b();a.skip(k());break;case "avcC":h.name="AVC Configuration Box";h.configurationVersion=a.readU8();h.avcProfileIndication=a.readU8();h.profileCompatibility=a.readU8();h.avcLevelIndication=a.readU8();h.lengthSizeMinusOne=a.readU8()&3;assert(3==h.lengthSizeMinusOne,"TODO"); var d=a.readU8()&31;h.sps=[];for(n=0;nn;n++){var d=a.sampleToOffset(k),l=b.sampleToOffset(h),c=a.sampleToSize(k,1),p=b.sampleToSize(h,1);d=c){if(a-=c,n==b.length-1)return{index:h+l+Math.floor(a/k.samplesPerChunk),offset:a%k.samplesPerChunk}}else return{index:h+Math.floor(a/d.samplesPerChunk),offset:a%d.samplesPerChunk};h+=l}assert(!1)},chunkToOffset:function(a){return this.trak.mdia.minf.stbl.stco.table[a]},sampleToOffset:function(a){var b=this.sampleToChunk(a); return this.chunkToOffset(b.index)+this.sampleToSize(a-b.offset,b.offset)},timeToSample:function(a){for(var b=this.trak.mdia.minf.stbl.stts.table,k=0,h=0;h=n)a-=n,k+=b[h].count;else return k+Math.floor(a/b[h].delta)}},getTotalTime:function(){if(PARANOID){for(var a=this.trak.mdia.minf.stbl.stts.table,b=0,k=0;kb))if(a.windowStartTime){if(1E3a.fpsMax&&(a.fpsMax=e);a.fps=e}e=a.videoPictureCounter/b*1E3;a.fpsSinceStart=e;c.onStatisticsUpdated(c.statistics)}else a.windowStartTime= d}}b.prototype={readAll:function(a){this.stream.readAll(null,function(b){this.reader=new MP4Reader(new Bytestream(b));this.reader.read();b=this.reader.tracks[1];this.size=new Size(b.trak.tkhd.width,b.trak.tkhd.height);a&&a()}.bind(this))},readSourceData:function(a){this.reader?(this.reader.stream=new Bytestream(a),this.reader.tracks={}):this.reader=new MP4Reader(new Bytestream(a));this.reader.read();a=this.reader.tracks[1];this.size=new Size(a.trak.tkhd.width,a.trak.tkhd.height)},play:function(a){var b= this.reader;if(b){void 0!==a&&Date.now();var k=b.tracks[1];b=b.tracks[1].trak.mdia.minf.stbl.stsd.avc1.avcC;var h=b.pps[0];this.avc.decode(b.sps[0]);this.avc.decode(h);var n=this.chunk,d=this.chunkIndex;this.avc.onCompletedVideo=this.onCompletedVideo;var l=k.getSampleCount(),c=0;setTimeout(function v(){var b=this.avc;k.getSampleNALUnits(c).forEach(function(e){b.currentFrame=c;b.currentChunk=n;b.decode(e,{currentFrame:c,chunkIndex:d,frameCount:l,startTime:a})});c++;ca.videoPictureCounter?this.score=1200-a.videoPictureCounter:1200==a.videoPictureCounter&&(this.score=a.fpsSinceStart.toFixed(2));this.info.innerHTML= d+c}}.bind(this);this.decodeFrame=function(a){};this.loadNewVideo=function(a,c,d,b,f){this.chunk=c;this.player&&void 0!==this.player.chunk?this.player&&(this.player.setNewChunk(this.chunk),this.player.chunkIndex=d):this.player=new MP4Player(null,h,this.webgl,n,this.chunk,d,this.workers);this.player.readSourceData(a);this.player.onCompletedVideo=()=>{b()};this.player.play(f.startTime)}}b.prototype={play:function(){this.player.play()}};return b}(),OMSModule=function(){var b="undefined"!==typeof document&& document.currentScript?document.currentScript.src:void 0;return function(a){function f(a){return u.locateFile?u.locateFile(a,ia):ia+a}function k(a,c){a||sa("Assertion failed: "+c)}function h(a){var c=u["_"+a];k(c,"Cannot call unknown function "+a+", make sure it is exported");return c}function n(a,c,e,g,m){m={string:function(a){var c=0;if(null!==a&&void 0!==a&&0!==a){var e=(a.length<<2)+1;c=Va(e);l(a,ba,c,e)}return c},array:function(a){var c=Va(a.length);Ba.set(a,c);return c}};var b=h(a),p=[];a=0; if(g)for(var t=0;t=g);)++e;if(16m?g+=String.fromCharCode(m):(m-=65536,g+=String.fromCharCode(55296|m>>10,56320|m&1023))}}else g+=String.fromCharCode(m)}return g}function l(a,c,e,g){if(!(0=b){var p=a.charCodeAt(++d);b=65536+((b&1023)<<10)|p&1023}if(127>=b){if(e>=g)break;c[e++]=b}else{if(2047>=b){if(e+1>=g)break;c[e++]=192|b>>6}else{if(65535>=b){if(e+2>=g)break;c[e++]=224|b>>12}else{if(e+3>=g)break;c[e++]=240|b>>18; c[e++]=128|b>>12&63}c[e++]=128|b>>6&63}c[e++]=128|b&63}}c[e]=0;return e-m}function c(a,c){0=c?"_"+a:a}function L(a,c){a=N(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(c)}function D(a,c){var e= L(c,function(a){this.name=c;this.message=a;a=Error(a).stack;void 0!==a&&(this.stack=this.toString()+"\n"+a.replace(/^Error(:[^\n]*)?\n/,""))});e.prototype=Object.create(a.prototype);e.prototype.constructor=e;e.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return e}function x(a){throw new ya(a);}function A(a){throw new $a(a);}function y(a,c,e){function g(c){c=e(c);c.length!==a.length&&A("Mismatched type converter count");for(var g=0;g>2])}function R(a,c,e){if(c===e)return a;if(void 0===e.baseClass)return null;a=R(a,c,e.baseClass);return null===a?null:e.downcast(a)}function ca(a,c){for(void 0===c&&x("ptr should not be undefined");a.baseClass;)c= a.upcast(c),a=a.baseClass;return Ga[c]}function Y(a,c){c.ptrType&&c.ptr||A("makeClassHandle requires ptr and ptrType");!!c.smartPtrType!==!!c.smartPtr&&A("Both smartPtrType and smartPtr must be specified");c.count={value:1};return q(Object.create(a,{$$:{value:c}}))}function V(a,c,e,g,m,d,b,p,t,l,B){this.name=a;this.registeredClass=c;this.isReference=e;this.isConst=g;this.isSmartPointer=m;this.pointeeType=d;this.sharingPolicy=b;this.rawGetPointee=p;this.rawConstructor=t;this.rawShare=l;this.rawDestructor= B;m||void 0!==c.baseClass?this.toWireType=T:(this.toWireType=g?U:O,this.destructorFunction=null)}function aa(a,c,e){u.hasOwnProperty(a)||A("Replacing nonexistant public symbol");void 0!==u[a].overloadTable&&void 0!==e?u[a].overloadTable[e]=c:(u[a]=c,u[a].argCount=e)}function S(a,c){a=B(a);if(void 0!==u["FUNCTION_TABLE_"+a])var e=u["FUNCTION_TABLE_"+a][c];else if("undefined"!==typeof FUNCTION_TABLE)e=FUNCTION_TABLE[c];else{e=u["dynCall_"+a];void 0===e&&(e=u["dynCall_"+a.replace(/f/g,"d")],void 0=== e&&x("No dynCall invoker for signature: "+a));for(var g=[],m=1;m>2)+g]);return e}function da(a){for(;a.length;){var c=a.pop();a.pop()(c)}}function Z(a,c,e){a instanceof Object||x(e+' with invalid "this": '+a);a instanceof c.registeredClass.constructor||x(e+' incompatible with "this" of type '+a.constructor.name);a.$$.ptr||x("cannot call emscripten binding method "+e+" on deleted object");return K(a.$$.ptr,a.$$.ptrType.registeredClass, c.registeredClass)}function Q(a){switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var c=Qa.length?Qa.pop():ja.length;ja[c]={refcount:1,value:a};return c}}function na(a){if(null===a)return"null";var c=typeof a;return"object"===c||"array"===c||"function"===c?a.toString():""+a}function ra(a,c){switch(c){case 2:return function(a){return this.fromWireType(Xa[a>>2])};case 3:return function(a){return this.fromWireType(Ya[a>>3])};default:throw new TypeError("Unknown float type: "+ a);}}function La(a,c){if(!(a instanceof Function))throw new TypeError("new_ called with constructor type "+typeof a+" which is not a function");var e=L(a.name||"unknownFunctionName",function(){});e.prototype=a.prototype;e=new e;a=a.apply(e,c);return a instanceof Object?a:e}function fa(a,c,e){switch(c){case 0:return e?function(a){return Ba[a]}:function(a){return ba[a]};case 1:return e?function(a){return Ma[a>>1]}:function(a){return Na[a>>1]};case 2:return e?function(a){return wa[a>>2]}:function(a){return ma[a>> 2]};default:throw new TypeError("Unknown integer type: "+a);}}function va(){return Ba.length}function kb(a){a=c(a,65536);var e=ha.byteLength;try{return-1!==Ha.grow((a-e)/65536)?(ha=Ha.buffer,!0):!1}catch(wb){return!1}}function ka(a){function c(){if(!u.calledRun&&(u.calledRun=!0,!bb)){v(cb);v(sb);if(u.onRuntimeInitialized)u.onRuntimeInitialized();if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)db.unshift(u.postRun.shift());v(db)}}if(!(0c;++c)a[c]=String.fromCharCode(c);Za=a})();ya=u.BindingError=D(Error,"BindingError");$a=u.InternalError=D(Error,"InternalError");E.prototype.isAliasOf=function(a){if(!(this instanceof E&&a instanceof E))return!1;var c=this.$$.ptrType.registeredClass,e=this.$$.ptr,g=a.$$.ptrType.registeredClass;for(a=a.$$.ptr;c.baseClass;)e=c.upcast(e),c=c.baseClass;for(;g.baseClass;)a=g.upcast(a),g=g.baseClass;return c===g&&e===a};E.prototype.clone=function(){this.$$.ptr|| J(this);if(this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var a=q(Object.create(Object.getPrototypeOf(this),{$$:{value:z(this.$$)}}));a.$$.count.value+=1;a.$$.deleteScheduled=!1;return a};E.prototype["delete"]=function(){this.$$.ptr||J(this);this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&x("Object already scheduled for deletion");G(this);F(this.$$);this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)};E.prototype.isDeleted=function(){return!this.$$.ptr}; E.prototype.deleteLater=function(){this.$$.ptr||J(this);this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&x("Object already scheduled for deletion");Fa.push(this);1===Fa.length&&Ia&&Ia(C);this.$$.deleteScheduled=!0;return this};V.prototype.getPointee=function(a){this.rawGetPointee&&(a=this.rawGetPointee(a));return a};V.prototype.destructor=function(a){this.rawDestructor&&this.rawDestructor(a)};V.prototype.argPackAdvance=8;V.prototype.readValueFromPointer=X;V.prototype.deleteObject=function(a){if(null!== a)a["delete"]()};V.prototype.fromWireType=function(a){function c(){return this.isSmartPointer?Y(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:a}):Y(this.registeredClass.instancePrototype,{ptrType:this,ptr:a})}var e=this.getPointee(a);if(!e)return this.destructor(a),null;var g=ca(this.registeredClass,e);if(void 0!==g){if(0===g.$$.count.value)return g.$$.ptr=e,g.$$.smartPtr=a,g.clone();g=g.clone();this.destructor(a);return g}g=this.registeredClass.getActualType(e); g=hb[g];if(!g)return c.call(this);g=this.isConst?g.constPointerType:g.pointerType;var m=R(e,this.registeredClass,g.registeredClass);return null===m?c.call(this):this.isSmartPointer?Y(g.registeredClass.instancePrototype,{ptrType:g,ptr:m,smartPtrType:this,smartPtr:a}):Y(g.registeredClass.instancePrototype,{ptrType:g,ptr:m})};u.getInheritedInstanceCount=function(){return Object.keys(Ga).length};u.getLiveInheritedInstances=function(){var a=[],c;for(c in Ga)Ga.hasOwnProperty(c)&&a.push(Ga[c]);return a}; u.flushPendingDeletes=C;u.setDelayFunction=function(a){Ia=a;Fa.length&&Ia&&Ia(C)};ab=u.UnboundTypeError=D(Error,"UnboundTypeError");u.count_emval_handles=function(){for(var a=0,c=5;c>2]=a);return a},m:function(a,c,e,g,d){var b=m(e);c=B(c);r(a,{name:c,fromWireType:function(a){return!!a}, toWireType:function(a,c){return c?g:d},argPackAdvance:8,readValueFromPointer:function(a){if(1===e)var g=Ba;else if(2===e)g=Ma;else if(4===e)g=wa;else throw new TypeError("Unknown boolean type size: "+c);return this.fromWireType(g[a>>b])},destructorFunction:null})},h:function(a,c,e,g,m,d,b,p,t,l,f,h,v){f=B(f);d=S(m,d);p&&(p=S(b,p));l&&(l=S(t,l));v=S(h,v);var k=N(f);M(k,function(){W("Cannot construct "+f+" due to unbound types",[g])});y([a,c,e],g?[g]:[],function(c){c=c[0];if(g){var e=c.registeredClass; var m=e.instancePrototype}else m=E.prototype;c=L(k,function(){if(Object.getPrototypeOf(this)!==b)throw new ya("Use 'new' to construct "+f);if(void 0===t.constructor_body)throw new ya(f+" has no accessible constructor");var a=t.constructor_body[arguments.length];if(void 0===a)throw new ya("Tried to invoke ctor of "+f+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(t.constructor_body).toString()+") parameters instead!");return a.apply(this,arguments)});var b=Object.create(m, {constructor:{value:c}});c.prototype=b;var t=new P(f,c,b,v,e,d,p,l);e=new V(f,t,!0,!1,!1);m=new V(f+"*",t,!1,!1,!1);var B=new V(f+" const*",t,!1,!0,!1);hb[a]={pointerType:m,constPointerType:B};aa(k,c);return[e,m,B]})},g:function(a,c,e,g,m,d){var b=ea(c,e);m=S(g,m);y([],[a],function(a){a=a[0];var e="constructor "+a.name;void 0===a.registeredClass.constructor_body&&(a.registeredClass.constructor_body=[]);if(void 0!==a.registeredClass.constructor_body[c-1])throw new ya("Cannot register multiple constructors with identical number of parameters ("+ (c-1)+") for class '"+a.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");a.registeredClass.constructor_body[c-1]=function(){W("Cannot construct "+a.name+" due to unbound types",b)};y([],b,function(g){a.registeredClass.constructor_body[c-1]=function(){arguments.length!==c-1&&x(e+" called with "+arguments.length+" arguments, expected "+(c-1));var a=[],b=Array(c);b[0]=d;for(var p=1;pt&&x("argTypes array size mismatch! Must at least get return value and 'this' types!"); for(var l=null!==g[1]&&!1,B=!1,f=1;f>>t}}var l=-1!=c.indexOf("unsigned");r(a,{name:c,fromWireType:p,toWireType:function(a,e){if("number"!==typeof e&&"boolean"!==typeof e)throw new TypeError('Cannot convert "'+ na(e)+'" to '+this.name);if(ed)throw new TypeError('Passing a number "'+na(e)+'" from JS side to C/C++ side to an argument of type "'+c+'", which is outside the valid range ['+g+", "+d+"]!");return l?e>>>0:e|0},argPackAdvance:8,readValueFromPointer:fa(c,b,0!==g),destructorFunction:null})},c:function(a,c,e){function g(a){a>>=2;var c=ma;return new m(c.buffer,c[a+1],c[a])}var m=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][c];e=B(e);r(a,{name:e, fromWireType:g,argPackAdvance:8,readValueFromPointer:g},{ignoreDuplicateRegistrations:!0})},j:function(a,c){c=B(c);var e="std::string"===c;r(a,{name:c,fromWireType:function(a){var c=ma[a>>2];if(e){var g=ba[a+4+c],m=0;0!=g&&(m=g,ba[a+4+c]=0);var b=a+4;for(g=0;g<=c;++g){var p=a+4+g;if(0==ba[p]){b=b?d(ba,b,void 0):"";if(void 0===t)var t=b;else t+=String.fromCharCode(0),t+=b;b=p+1}}0!=m&&(ba[a+4+c]=m)}else{t=Array(c);for(g=0;g=m&&(m=65536+((m&1023)<<10)|a.charCodeAt(++g)&1023);127>=m?++e:e=2047>=m?e+2:65535>=m?e+3:e+4}return e}:function(){return c.length})(),d=ib(4+m+1);ma[d>>2]=m;if(e&&g)l(c,ba,d+4,m+1);else if(g)for(g=0;g< m;++g){var b=c.charCodeAt(g);255>2],d=Array(e),b=a+4>>m,p=0;p>2]=b;for(var t=p+4>>m,l=0;l=e?c(2*e,65536):Math.min(c((3*e+2147483648)/4,65536),2147418112);if(!kb(e))return!1;p();return!0},n:function(a){sa("OOM")},a:6032},ha);u.asm=jb;u.___embind_register_native_and_builtin_types=function(){return u.asm.t.apply(null,arguments)};u.___errno_location=function(){return u.asm.u.apply(null,arguments)};var rb=u.___getTypeName=function(){return u.asm.v.apply(null,arguments)},pa=u._free=function(){return u.asm.w.apply(null,arguments)},ib=u._malloc=function(){return u.asm.x.apply(null, arguments)};u._parseOMS=function(){return u.asm.y.apply(null,arguments)};u._parseOMSSingle=function(){return u.asm.z.apply(null,arguments)};var vb=u.globalCtors=function(){return u.asm.L.apply(null,arguments)},Va=u.stackAlloc=function(){return u.asm.M.apply(null,arguments)},pb=u.stackRestore=function(){return u.asm.N.apply(null,arguments)},ob=u.stackSave=function(){return u.asm.O.apply(null,arguments)};u.dynCall_i=function(){return u.asm.A.apply(null,arguments)};u.dynCall_ii=function(){return u.asm.B.apply(null, arguments)};u.dynCall_iii=function(){return u.asm.C.apply(null,arguments)};u.dynCall_iiii=function(){return u.asm.D.apply(null,arguments)};u.dynCall_v=function(){return u.asm.E.apply(null,arguments)};u.dynCall_vi=function(){return u.asm.F.apply(null,arguments)};u.dynCall_vii=function(){return u.asm.G.apply(null,arguments)};u.dynCall_viii=function(){return u.asm.H.apply(null,arguments)};u.dynCall_viiii=function(){return u.asm.I.apply(null,arguments)};u.dynCall_viiiii=function(){return u.asm.J.apply(null, arguments)};u.dynCall_viiiiii=function(){return u.asm.K.apply(null,arguments)};u.asm=jb;u.ccall=n;u.cwrap=function(a,c,e,g){e=e||[];var m=e.every(function(a){return"number"===a});return"string"!==c&&m&&!g?h(a):function(){return n(a,c,e,arguments,g)}};u.then=function(a){if(u.calledRun)a(u);else{var c=u.onRuntimeInitialized;u.onRuntimeInitialized=function(){c&&c();a(u)}}return u};Ea=function mb(){u.calledRun||ka();u.calledRun||(Ea=mb)};u.run=ka;u.abort=sa;if(u.preInit)for("function"==typeof u.preInit&& (u.preInit=[u.preInit]);0=g);)++e;if(16m?g+=String.fromCharCode(m):(m-=65536,g+=String.fromCharCode(55296|m>>10,56320|m&1023))}}else g+=String.fromCharCode(m)}return g}function h(a,c){0 P&&G("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+P+"! (TOTAL_STACK\x3d5242880)");if(m.buffer)var K=m.buffer;else{if("object"===typeof WebAssembly&&"function"===typeof WebAssembly.Memory){var U=new WebAssembly.Memory({initial:P/65536});K=U.buffer}else K=new ArrayBuffer(P);m.buffer=K}n();I[2068]=5251408;var T=[],O=[],X=[],R=[],ca=!1,Y=0,V=null,aa=null;m.preloadedImages={};m.preloadedAudios={};var S="crunch.wasm";l(S)||(S=f(S));m.asm=function(a,c,e){c.memory=U;c.table=new WebAssembly.Table({initial:35, maximum:35,element:"anyfunc"});c.__memory_base=1024;c.__table_base=0;return v(c)};var H={buffers:[null,[],[]],printChar:function(a,c){var e=H.buffers[a];0===c||10===c?((1===a?J:G)(k(e,0)),e.length=0):e.push(c)},varargs:0,get:function(a){H.varargs+=4;return I[H.varargs-4>>2]},getStr:function(){var a=H.get();return a?k(E,a,void 0):""},get64:function(){var a=H.get();H.get();return a},getZero:function(){H.get()}},W={},ea=1;B=m.asm({},{b:t,d:function(a){m.___errno_location&&(I[m.___errno_location()>>2]= a);return a},k:function(a,c){H.varargs=c;try{var e=H.getStreamFromFD();H.get();var g=H.get(),m=H.get(),d=H.get();FS.llseek(e,g,d);I[m>>2]=e.position;e.getdents&&0===g&&0===d&&(e.getdents=null);return 0}catch(va){return"undefined"!==typeof FS&&va instanceof FS.ErrnoError||t(va),-va.errno}},c:function(a,c){H.varargs=c;try{var e=H.get(),g=H.get(),m=H.get();for(c=a=0;c>2],b=I[g+(8*c+4)>>2],p=0;p=c?h(2*c,65536):Math.min(h((3*c+2147483648)/4,65536),2147418112);var e= h(c,65536);var g=m.buffer.byteLength;try{var d=-1!==U.grow((e-g)/65536)?m.buffer=U.buffer:null}catch(fa){d=null}if(!d||d.byteLength!=c)return!1;m.buffer=K=d;n();P=c;M[2068]=a;return!0},p:function(a){return W[a]||0},o:function(a,c){if(0==a)return 22;I[a>>2]=ea;W[ea]=0;ea++;return 0},n:w,m:function(a,c){if(!(a in W))return 22;W[a]=c;return 0},l:function(a){t("Cannot enlarge memory arrays to size "+a+" bytes. Either (1) compile with -s TOTAL_MEMORY\x3dX with X higher than the current value "+P+", (2) compile with -s ALLOW_MEMORY_GROWTH\x3d1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC\x3d0 ")}, a:8272},K);m.asm=B;m._crn_decompress=function(){return m.asm.q.apply(null,arguments)};m._crn_get_dxt_format=function(){return m.asm.r.apply(null,arguments)};m._crn_get_height=function(){return m.asm.s.apply(null,arguments)};m._crn_get_levels=function(){return m.asm.t.apply(null,arguments)};m._crn_get_uncompressed_size=function(){return m.asm.u.apply(null,arguments)};m._crn_get_width=function(){return m.asm.v.apply(null,arguments)};m._free=function(){return m.asm.w.apply(null,arguments)};m._malloc= function(){return m.asm.x.apply(null,arguments)};var da=m.dynCall_v=function(){return m.asm.y.apply(null,arguments)};m.dynCall_vi=function(){return m.asm.z.apply(null,arguments)};m.asm=B;m.then=function(a){if(m.calledRun)a(m);else{var c=m.onRuntimeInitialized;m.onRuntimeInitialized=function(){c&&c();a(m)}}return m};e.prototype=Error();e.prototype.constructor=e;aa=function Q(){m.calledRun||g();m.calledRun||(aa=Q)};m.run=g;m.abort=t;if(m.preInit)for("function"==typeof m.preInit&&(m.preInit=[m.preInit]);0< m.preInit.length;)m.preInit.pop()();m.noExitRuntime=!0;g();return a}}();"object"===typeof exports&&"object"===typeof module?module.exports=CrunchModule:"function"===typeof define&&define.amd?define([],function(){return CrunchModule}):"object"===typeof exports&&(exports.CrunchModule=CrunchModule); !function(b,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{a=a();for(var f in a)("object"==typeof exports?exports:b)[f]=a[f]}}("undefined"!=typeof self?self:this,function(){return function(b){function a(k){if(f[k])return f[k].exports;var h=f[k]={i:k,l:!1,exports:{}};return b[k].call(h.exports,h,h.exports,a),h.l=!0,h.exports}var f={};return a.m=b,a.c=f,a.d=function(b,f,n){a.o(b,f)||Object.defineProperty(b,f, {enumerable:!0,get:n})},a.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});Object.defineProperty(a,"__esModule",{value:!0})},a.t=function(b,f){if((1&f&&(b=a(b)),8&f)||4&f&&"object"==typeof b&&b&&b.__esModule)return b;var h=Object.create(null);if(a.r(h),Object.defineProperty(h,"default",{enumerable:!0,value:b}),2&f&&"string"!=typeof b)for(var d in b)a.d(h,d,function(a){return b[a]}.bind(null,d));return h},a.n=function(b){var f= b&&b.__esModule?function(){return b.default}:function(){return b};return a.d(f,"a",f),f},a.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},a.p="",a(a.s=10)}([function(b,a,f){Object.defineProperty(a,"__esModule",{value:!0});a.setMatrixArrayType=function(b){a.ARRAY_TYPE=b};a.toRadian=function(a){return a*h};a.equals=function(a,d){return Math.abs(a-d)<=k*Math.max(1,Math.abs(a),Math.abs(d))};var k=a.EPSILON=1E-6;a.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array;a.RANDOM= Math.random;var h=Math.PI/180},function(b,a,f){function k(){var a=new w.ARRAY_TYPE(4);return w.ARRAY_TYPE!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0),a}function h(a,c,d){return a[0]=c[0]-d[0],a[1]=c[1]-d[1],a[2]=c[2]-d[2],a[3]=c[3]-d[3],a}function n(a,c,d){return a[0]=c[0]*d[0],a[1]=c[1]*d[1],a[2]=c[2]*d[2],a[3]=c[3]*d[3],a}function d(a,c,d){return a[0]=c[0]/d[0],a[1]=c[1]/d[1],a[2]=c[2]/d[2],a[3]=c[3]/d[3],a}function l(a,c){var e=c[0]-a[0],g=c[1]-a[1],d=c[2]-a[2];a=c[3]-a[3];return Math.sqrt(e* e+g*g+d*d+a*a)}function c(a,c){var e=c[0]-a[0],g=c[1]-a[1],d=c[2]-a[2];a=c[3]-a[3];return e*e+g*g+d*d+a*a}function p(a){var c=a[0],e=a[1],m=a[2];a=a[3];return Math.sqrt(c*c+e*e+m*m+a*a)}function v(a){var c=a[0],e=a[1],m=a[2];a=a[3];return c*c+e*e+m*m+a*a}Object.defineProperty(a,"__esModule",{value:!0});a.forEach=a.sqrLen=a.len=a.sqrDist=a.dist=a.div=a.mul=a.sub=void 0;a.create=k;a.clone=function(a){var c=new w.ARRAY_TYPE(4);return c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c};a.fromValues=function(a, c,d,m){var e=new w.ARRAY_TYPE(4);return e[0]=a,e[1]=c,e[2]=d,e[3]=m,e};a.copy=function(a,c){return a[0]=c[0],a[1]=c[1],a[2]=c[2],a[3]=c[3],a};a.set=function(a,c,d,m,b){return a[0]=c,a[1]=d,a[2]=m,a[3]=b,a};a.add=function(a,c,d){return a[0]=c[0]+d[0],a[1]=c[1]+d[1],a[2]=c[2]+d[2],a[3]=c[3]+d[3],a};a.subtract=h;a.multiply=n;a.divide=d;a.ceil=function(a,c){return a[0]=Math.ceil(c[0]),a[1]=Math.ceil(c[1]),a[2]=Math.ceil(c[2]),a[3]=Math.ceil(c[3]),a};a.floor=function(a,c){return a[0]=Math.floor(c[0]), a[1]=Math.floor(c[1]),a[2]=Math.floor(c[2]),a[3]=Math.floor(c[3]),a};a.min=function(a,c,d){return a[0]=Math.min(c[0],d[0]),a[1]=Math.min(c[1],d[1]),a[2]=Math.min(c[2],d[2]),a[3]=Math.min(c[3],d[3]),a};a.max=function(a,c,d){return a[0]=Math.max(c[0],d[0]),a[1]=Math.max(c[1],d[1]),a[2]=Math.max(c[2],d[2]),a[3]=Math.max(c[3],d[3]),a};a.round=function(a,c){return a[0]=Math.round(c[0]),a[1]=Math.round(c[1]),a[2]=Math.round(c[2]),a[3]=Math.round(c[3]),a};a.scale=function(a,c,d){return a[0]=c[0]*d,a[1]= c[1]*d,a[2]=c[2]*d,a[3]=c[3]*d,a};a.scaleAndAdd=function(a,c,d,m){return a[0]=c[0]+d[0]*m,a[1]=c[1]+d[1]*m,a[2]=c[2]+d[2]*m,a[3]=c[3]+d[3]*m,a};a.distance=l;a.squaredDistance=c;a.length=p;a.squaredLength=v;a.negate=function(a,c){return a[0]=-c[0],a[1]=-c[1],a[2]=-c[2],a[3]=-c[3],a};a.inverse=function(a,c){return a[0]=1/c[0],a[1]=1/c[1],a[2]=1/c[2],a[3]=1/c[3],a};a.normalize=function(a,c){var e=c[0],g=c[1],d=c[2];c=c[3];var b=e*e+g*g+d*d+c*c;0c?Math.PI:Math.acos(c)};a.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"};a.exactEquals=function(a,c){return a[0]===c[0]&&a[1]===c[1]&&a[2]===c[2]};a.equals=function(a,c){var e=a[0],d=a[1];a=a[2];var g=c[0],b=c[1];c=c[2];return Math.abs(e-g)<=t.EPSILON*Math.max(1,Math.abs(e),Math.abs(g))&&Math.abs(d-b)<=t.EPSILON* Math.max(1,Math.abs(d),Math.abs(b))&&Math.abs(a-c)<=t.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))};var t=function(a){if(a&&a.__esModule)return a;var c={};if(null!=a)for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(c[e]=a[e]);return c.default=a,c}(f(0));a.sub=d;a.mul=l;a.div=c;a.dist=p;a.sqrDist=v;a.len=h;a.sqrLen=w;a.forEach=function(){var a=k();return function(c,e,d,g,b,p){e||(e=3);d||(d=0);for(g=g?Math.min(g*e+d,c.length):c.length;d(v=g*l+b*t+m*f+c*e)&&(v=-v,l=-l,t=-t,f=-f,e=-e),1-v>p.EPSILON?(h=Math.acos(v),B=Math.sin(h),k=Math.sin((1-d)*h)/B,w=Math.sin(d*h)/B):(k=1-d,w=d),a[0]=k*g+w*l,a[1]=k*b+w*t,a[2]=k*m+w*f,a[3]=k*c+w*e,a}function c(a,c){var e=c[0]+c[4]+c[8];if(0c[0]&&(d=1);c[8]>c[3*d+d]&&(d=2);var g=(d+1)%3,b=(d+2)%3;e=Math.sqrt(c[3*d+d]-c[3*g+g]-c[3*b+b]+1);a[d]=.5*e;e=.5/e;a[3]=(c[3*g+b]-c[3*b+g])*e;a[g]=(c[3*g+d]+c[3*d+g])*e;a[b]=(c[3*b+d]+c[3*d+b])*e}return a}Object.defineProperty(a,"__esModule",{value:!0});a.setAxes=a.sqlerp=a.rotationTo=a.equals=a.exactEquals=a.normalize=a.sqrLen=a.squaredLength=a.len=a.length=a.lerp=a.dot=a.scale=a.mul=a.add=a.set=a.copy=a.fromValues= a.clone=void 0;a.create=h;a.identity=function(a){return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a};a.setAxisAngle=n;a.getAxisAngle=function(a,c){var e=2*Math.acos(c[3]),d=Math.sin(e/2);d>p.EPSILON?(a[0]=c[0]/d,a[1]=c[1]/d,a[2]=c[2]/d):(a[0]=1,a[1]=0,a[2]=0);return e};a.multiply=d;a.rotateX=function(a,c,e){e*=.5;var d=c[0],b=c[1],g=c[2];c=c[3];var p=Math.sin(e);e=Math.cos(e);return a[0]=d*e+c*p,a[1]=b*e+g*p,a[2]=g*e-b*p,a[3]=c*e-d*p,a};a.rotateY=function(a,c,e){e*=.5;var d=c[0],b=c[1],g=c[2];c=c[3];var p=Math.sin(e); e=Math.cos(e);return a[0]=d*e-g*p,a[1]=b*e+c*p,a[2]=g*e+d*p,a[3]=c*e-b*p,a};a.rotateZ=function(a,c,e){e*=.5;var d=c[0],b=c[1],g=c[2];c=c[3];var p=Math.sin(e);e=Math.cos(e);return a[0]=d*e+b*p,a[1]=b*e-d*p,a[2]=g*e+c*p,a[3]=c*e-g*p,a};a.calculateW=function(a,c){var e=c[0],d=c[1];c=c[2];return a[0]=e,a[1]=d,a[2]=c,a[3]=Math.sqrt(Math.abs(1-e*e-d*d-c*c)),a};a.slerp=l;a.random=function(a){var c=p.RANDOM(),e=p.RANDOM(),d=p.RANDOM(),b=Math.sqrt(1-c);c=Math.sqrt(c);return a[0]=b*Math.sin(2*Math.PI*e),a[1]= b*Math.cos(2*Math.PI*e),a[2]=c*Math.sin(2*Math.PI*d),a[3]=c*Math.cos(2*Math.PI*d),a};a.invert=function(a,c){var e=c[0],d=c[1],b=c[2];c=c[3];var g=e*e+d*d+b*b+c*c;g=g?1/g:0;return a[0]=-e*g,a[1]=-d*g,a[2]=-b*g,a[3]=c*g,a};a.conjugate=function(a,c){return a[0]=-c[0],a[1]=-c[1],a[2]=-c[2],a[3]=c[3],a};a.fromMat3=c;a.fromEuler=function(a,c,e,d){var b=.5*Math.PI/180;c*=b;e*=b;d*=b;b=Math.sin(c);c=Math.cos(c);var g=Math.sin(e);e=Math.cos(e);var p=Math.sin(d);d=Math.cos(d);return a[0]=b*e*d-c*g*p,a[1]=c* g*d+b*e*p,a[2]=c*e*p-b*g*d,a[3]=c*e*d+b*g*p,a};a.str=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"};var p=k(f(0)),v=k(f(5)),w=k(f(2));b=k(f(1));a.clone=b.clone;a.fromValues=b.fromValues;a.copy=b.copy;a.set=b.set;a.add=b.add;a.mul=d;a.scale=b.scale;a.dot=b.dot;a.lerp=b.lerp;f=a.length=b.length;f=(a.len=f,a.squaredLength=b.squaredLength);var e=(a.sqrLen=f,a.normalize=b.normalize);a.exactEquals=b.exactEquals;a.equals=b.equals;a.rotationTo=function(){var a=w.create(),c=w.fromValues(1, 0,0),d=w.fromValues(0,1,0);return function(b,g,p){var l=w.dot(g,p);return-.999999>l?(w.cross(a,c,g),1E-6>w.len(a)&&w.cross(a,d,g),w.normalize(a,a),n(b,a,Math.PI),b):.999999d[5]&&d[0]>d[10]?(b=2*Math.sqrt(1+d[0]-d[5]-d[10]),a[3]=(d[6]-d[9])/b,a[0]=.25*b,a[1]=(d[1]+d[4])/b,a[2]=(d[8]+d[2])/b):d[5]>d[10]?(b=2*Math.sqrt(1+d[5]-d[0]-d[10]),a[3]=(d[8]-d[2])/b,a[0]=(d[1]+d[4])/b,a[1]=.25*b,a[2]=(d[6]+d[9])/b):(b=2*Math.sqrt(1+d[10]-d[0]-d[5]),a[3]=(d[1]-d[4])/b, a[0]=(d[8]+d[2])/b,a[1]=(d[6]+d[9])/b,a[2]=.25*b);return a};a.fromRotationTranslationScale=function(a,d,b,l){var c=d[0],g=d[1],f=d[2],m=d[3],p=c+c,h=g+g,k=f+f;d=c*p;var n=c*h;c*=k;var v=g*h;g*=k;f*=k;p*=m;h*=m;m*=k;k=l[0];var w=l[1];l=l[2];return a[0]=(1-(v+f))*k,a[1]=(n+m)*k,a[2]=(c-h)*k,a[3]=0,a[4]=(n-m)*w,a[5]=(1-(d+f))*w,a[6]=(g+p)*w,a[7]=0,a[8]=(c+h)*l,a[9]=(g-p)*l,a[10]=(1-(d+v))*l,a[11]=0,a[12]=b[0],a[13]=b[1],a[14]=b[2],a[15]=1,a};a.fromRotationTranslationScaleOrigin=function(a,d,b,l,e){var c= d[0],f=d[1],m=d[2],p=d[3],h=c+c,k=f+f,n=m+m;d=c*h;var v=c*k,w=c*n;c=f*k;f*=n;var y=m*n;m=p*h;k*=p;var r=p*n,z=l[0],J=l[1];n=l[2];l=e[0];p=e[1];e=e[2];h=(1-(c+y))*z;var G=(v+r)*z;z*=w-k;v=(v-r)*J;y=(1-(d+y))*J;J*=f+m;w=(w+k)*n;f=(f-m)*n;d=(1-(d+c))*n;return a[0]=h,a[1]=G,a[2]=z,a[3]=0,a[4]=v,a[5]=y,a[6]=J,a[7]=0,a[8]=w,a[9]=f,a[10]=d,a[11]=0,a[12]=b[0]+l-(h*l+v*p+w*e),a[13]=b[1]+p-(G*l+y*p+f*e),a[14]=b[2]+e-(z*l+J*p+d*e),a[15]=1,a};a.fromQuat=function(a,d){var c=d[0],b=d[1],e=d[2];d=d[3];var g=c+c, l=b+b,m=e+e;c*=g;var f=b*g;b*=l;var p=e*g,h=e*l;e*=m;g*=d;l*=d;d*=m;return a[0]=1-b-e,a[1]=f+d,a[2]=p-l,a[3]=0,a[4]=f-d,a[5]=1-c-e,a[6]=h+g,a[7]=0,a[8]=p+l,a[9]=h-g,a[10]=1-c-b,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a};a.frustum=function(a,d,b,l,e,g,f){var c=1/(b-d),p=1/(e-l),h=1/(g-f);return a[0]=2*g*c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*g*p,a[6]=0,a[7]=0,a[8]=(b+d)*c,a[9]=(e+l)*p,a[10]=(f+g)*h,a[11]=-1,a[12]=0,a[13]=0,a[14]=f*g*2*h,a[15]=0,a};a.perspective=function(a,d,b,l,e){d=1/Math.tan(d/2); var c=void 0;a[0]=d/b;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=d;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[11]=-1;a[12]=0;a[13]=0;a[15]=0;null!=e&&e!==1/0?(c=1/(l-e),a[10]=(e+l)*c,a[14]=2*e*l*c):(a[10]=-1,a[14]=-2*l);return a};a.perspectiveFromFieldOfView=function(a,d,b,l){var c=Math.tan(d.upDegrees*Math.PI/180),g=Math.tan(d.downDegrees*Math.PI/180),f=Math.tan(d.leftDegrees*Math.PI/180);d=Math.tan(d.rightDegrees*Math.PI/180);var m=2/(f+d),p=2/(c+g);return a[0]=m,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=p,a[6]=0,a[7]=0,a[8]= -(f-d)*m*.5,a[9]=(c-g)*p*.5,a[10]=l/(b-l),a[11]=-1,a[12]=0,a[13]=0,a[14]=l*b/(b-l),a[15]=0,a};a.ortho=function(a,d,b,l,e,g,f){var c=1/(d-b),p=1/(l-e),h=1/(g-f);return a[0]=-2*c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*p,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*h,a[11]=0,a[12]=(d+b)*c,a[13]=(e+l)*p,a[14]=(f+g)*h,a[15]=1,a};a.lookAt=function(a,d,b,f){var c=d[0],g=d[1];d=d[2];var p=f[0];var m=f[1];var h=f[2];var n=b[0];f=b[1];var v=b[2];if(Math.abs(c-n)b?Math.PI:Math.acos(b)};a.str=function(a){return"vec2("+a[0]+", "+a[1]+")"};a.exactEquals=function(a,c){return a[0]===c[0]&&a[1]===c[1]};a.equals=function(a,c){var b=a[0];a=a[1];var d=c[0];c=c[1]; return Math.abs(b-d)<=w.EPSILON*Math.max(1,Math.abs(b),Math.abs(d))&&Math.abs(a-c)<=w.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))};var w=function(a){if(a&&a.__esModule)return a;var c={};if(null!=a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(c[b]=a[b]);return c.default=a,c}(f(0));a.len=p;a.sub=h;a.mul=n;a.div=d;a.dist=l;a.sqrDist=c;a.sqrLen=v;a.forEach=function(){var a=k();return function(c,b,d,e,f,l){b||(b=2);d||(d=0);for(e=e?Math.min(e*b+d,c.length):c.length;dv(c,b)&&(d=-d);return a[0]=c[0]*e+b[0]*d,a[1]=c[1]*e+b[1]*d,a[2]=c[2]*e+b[2]*d,a[3]=c[3]*e+b[3]*d,a[4]=c[4]*e+b[4]*d,a[5]=c[5]*e+b[5]*d,a[6]=c[6]*e+b[6]*d,a[7]=c[7]*e+b[7]*d,a};a.invert=function(a,c){var b=w(c);return a[0]=-c[0]/b,a[1]=-c[1]/b,a[2]=-c[2]/b,a[3]=c[3]/b,a[4]=-c[4]/b,a[5]=-c[5]/b,a[6]=-c[6]/b,a[7]=c[7]/b,a};a.conjugate=function(a,c){return a[0]=-c[0],a[1]=-c[1],a[2]=-c[2],a[3]=c[3],a[4]=-c[4],a[5]=-c[5],a[6]=-c[6],a[7]=c[7],a};a.normalize=function(a,c){var b=w(c); if(0>3|5*l+3*v>>3&2016|5*c+3*w>>3&63488,h[3]=5*p+3*d>>3|5*v+3*l>>3&2016|5*w+3*c>>3&63488,d=b[k+2],l=4*t*f+4*m,n[l]=h[d&3],n[l+1]=h[d>>2&3],n[l+2]=h[d>>4&3],n[l+3]=h[d>>6&3],l+=f,n[l]=h[d>>8&3],n[l+1]=h[d>>10&3],n[l+2]=h[d>>12&3],n[l+3]=h[d>>14],d=b[k+ 3],l+=f,n[l]=h[d&3],n[l+1]=h[d>>2&3],n[l+2]=h[d>>4&3],n[l+3]=h[d>>6&3],l+=f,n[l]=h[d>>8&3],n[l+1]=h[d>>10&3],n[l+2]=h[d>>12&3],n[l+3]=h[d>>14];return n} function dxtToRgb565Unoptimized(b,a,f,k){var h=new Uint16Array(4),n=new Uint16Array(f*k),d=f/4;k/=4;for(var l=0;lv;v++){var w=b[p+4+v],e=(4*l+v)*f+4*c;n[e++]=h[w&3];n[e++]=h[w>>2&3];n[e++]=h[w>> 4&3];n[e++]=h[w>>6&3]}}return n} var OMS=function(){this.sequence=this.heapPtr=this.sequenceTable=this.heapBytes=this.uint8Array=this.liboms=0;this.lastIndex=-1;this.onLibOMSReady=0;this.onLibOMSInitialize=this.onLibOMSInitialize.bind(this);this.initialize=this.initialize.bind(this);this._arrayToHeap=this._arrayToHeap.bind(this);this._freeArray=this._freeArray.bind(this);this.parseNext=this.parseNext.bind(this);this.parse=this.parse.bind(this);this.destroyOMS=this.destroyOMS.bind(this);this.heapOffset=0;this.initialized=!1}; OMS.prototype.onLibOMSInitialize=function(){0!=this.onLibOMSReady?(this.onLibOMSReady(),this.initialized=!0):console.log("Failed to initialize")};OMS.prototype.initialize=function(){let b=this;OMSModule().then(async a=>{b.liboms=a;await b.liboms.ready;b.onLibOMSInitialize()})}; OMS.prototype.clearOMS=function(){if(0!==this.sequence){this.sequence.vertices=null;this.sequence.uvs=null;this.sequence.indices=null;this.sequence.bone_indices=null;this.sequence.bone_weights=null;for(let b=0;bthis.heapBytes.length&&(this._freeArray(),this.heapPtr=this.liboms._malloc(a),this.heapBytes=new Uint8Array(this.liboms.HEAPU8.buffer,this.heapPtr,a));this.heapBytes.set(new Uint8Array(b.buffer))};OMS.prototype._freeArray=function(){this.liboms._free(this.heapPtr)}; OMS.prototype.parseNext=function(b){if(this.lastIndex===b)return this.sequence;if(0!==this.sequence){this.sequence.vertices=null;this.sequence.uvs=null;this.sequence.indices=null;this.sequence.bone_indices=null;this.sequence.bone_weights=null;for(var a=0;a=b.vertex_count?new Uint16Array(this.liboms.HEAPU16.buffer, a.indices,a.index_count):new Uint32Array(this.liboms.HEAPU32.buffer,a.indices,a.index_count);if(1this.omsLoadProgress?!1:!0}; OMSPlayer.prototype.loadFrame=function(b,a,f){if(void 0===this.frameTable||0===this.frameTable.length){if(void 0===this.frameTable)return console.log("No Frame Table -- undefined"),!1;if(void 0!==a&&-1!==this.activeSequence)this.activeSequence.parse(a);else return!1}a=this.frameTable[b];if(void 0===a)return console.log("No Frame Pair"),!1;if(this.activeSequence!=a[0]||0=b.width||1440>=b.height)?this.iOSPath&&b.id.endsWith("-iOS")&&(1024>=b.width||1024>=b.height)&&this.manifest.profiles.push(b):this.manifest.profiles.push(b);this.manifest.profiles=this.manifest.profiles.sort((a,b)=>parseInt(a.bandwidth)parseInt(b.bandwidth)?-1:a.idb.id?-1:0);this.totalSegments=this.manifest.profiles[0].segments.length;return this.loadedManifest=!0}}; RequestWorker.prototype.openManifest=async function(b){this.manifest.url=b;this.manifest.originalURL=b;this.manifest.profiles=[];this.activeDownload=this.manifest.duration=0;this.segmentIndex=-1;this.segmentQueue=[];this.downloadedInitSegment=!1;this.downloadSpeed=this.totalSegmentsDownloaded=this.totalSegments=0;this.downloadSpeedHistory=[];this.lastPlayedSegment=0;this.loadedInitSegment=!1;var a=new DOMParser,f=await fetch(b).catch(a=>console.error(`Error in fetch from: ${b}`,a.message));if(void 0=== f||200!==f.status&&"200"!==f.status)return console.error(`Manifest request to ${b} returned status ${f.status}`),!1;var k=await f.text();a=a.parseFromString(k,"text/xml").children[0];var h=void 0;k=void 0;var n=b.match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12})/);this.manifest.uuid=n[1]?n[1]:"N/A";for(n=0;n=n.width||1440>=n.height)&&this.manifest.profiles.push(n)}this.manifest.profiles=this.manifest.profiles.sort((a,b)=>parseInt(a.bandwidth)parseInt(b.bandwidth)?-1:a.idb.id?-1:0);if(0===this.manifest.profiles.length)return console.error("No valid profiles found in manifest for browser playback."),!1;this.totalSegments=this.manifest.profiles[0].segments.length;return this.loadedManifest=!0}}; RequestWorker.prototype.parseProfile=function(b,a){let f={codecs:0,height:0,width:0,bandwidth:0,duration:0,timescale:0,initializationSegment:0,id:0,displayName:0,segments:[]},k=a.children[0];for(var h=0;hb||b>=this.manifest.profiles.length)&&this.loadedInitSegment&&(this.adaptiveStreaming=a,this.activeProfile=b,0!==this.onQualityChanged))this.onQualityChanged(this.manifest.profiles[this.activeProfile])}; RequestWorker.prototype.getDuration=function(){var b=this.getActiveProfile(),a=b.duration/b.timescale;return this.manifest.duration>a?this.manifest.duration:(b.segments.length-2)*a}; RequestWorker.prototype.getNextSegmentDownload=function(){let b=this.manifest.profiles[this.activeProfile];this.segmentIndex+=1;this.segmentIndex>=b.segments.length?(this.segmentIndex=0,b.segments[this.segmentIndex].initSegment&&this.downloadedInitSegment&&(this.segmentIndex=1)):0>this.segmentIndex&&(this.segmentIndex=0);let a=b.segments[this.segmentIndex];a.width=b.width;a.height=b.height;a.downloadMarker=this.manifest.activeDownloadMarker;return a}; RequestWorker.prototype.beginSegmentDownload=function(b){if(0!==this.activeDownload){var a=this.activeDownload;a.startTime=Date.now();fetch(a.url).then(async function(b){a.data=await b.arrayBuffer();a.finished=!0})}}; RequestWorker.prototype.update=function(){if(this.loadedManifest){var b=this.getSegmentCountToPlay(this.lastPlayedSegment);this.lastDownloadSegment=Math.max(this.segmentIndex,0);for(var a=0,f=this.lastPlayedSegment;!isNaN(f)&&f!==this.lastDownloadSegment&&a=this.segmentsToBuffer&&0>=this.seekDownloadCount&&!this.forceUpdate&&0===this.activeDownload||(0===this.activeDownload?(b=this.getNextSegmentDownload(), b.downloadMarker===this.activeDownloadMarker&&(this.activeDownload={url:b.url,segment:b,data:0,finished:!1,startTime:0,endTime:0,downloadMarker:b.downloadMarker},this.seekDownloadCount--,this.beginSegmentDownload())):this.activeDownload.finished&&this.segmentQueue.length=this.totalSegmentsDownloaded&&(this.totalSegmentsDownloaded=this.activeDownload.segment.index+ 1),this.activeDownload.endTime=Date.now(),this.updateAdaptiveQuality(this.activeDownload),this.segmentQueue.push(this.activeDownload),this.activeDownload=0))}};RequestWorker.prototype.clearRequestWorker=async function(){this.loadedManifest=!1;this.segmentQueue=[];this.manifest={url:"",responseURL:"",profiles:[],duration:0}};RequestWorker.prototype.getNextPlaybackSegment=function(){if(0this.maximumDownloadSpeedHistory;)this.downloadSpeedHistory.shift();var a=0;for(b=0;b=this.manifest.profiles[b].bandwidth){a= b;break}this.adaptiveStreaming&&this.setActiveProfile(a,!0)};RequestWorker.prototype.canPlayFromSegment=function(b){return 0>=this.getSegmentCountToPlay(b)?!0:!1}; RequestWorker.prototype.getSegmentCountToPlay=function(b){b=this.getActiveProfile();if(0=this.segmentsToBuffer||h===this.lastPlayedSegment? -this.segmentsToBuffer:Math.min(Math.floor((f/this.downloadSpeed*a-a*k)/k),b.segments.length)}return b.segments.length};RequestWorker.prototype.setLastPlayedSegment=function(b){this.lastPlayedSegment=b};RequestWorker.prototype.seekTo=function(b){this.seekDownloadCount=3;var a=this.getActiveProfile().segments.length;this.segmentIndex=Math.floor(a*b)-2;this.lastPlayedSegment=this.segmentIndex+2;this.lastDownloadSegment=this.segmentIndex+2}; RequestWorker.prototype.destroy=function(){this.clearRequestWorker();this.activeDownload=0}; var VideoWorkerCommon=function(b){VideoWorkerCommon.prototype.decodeFrameIndex=function(a){let b="";for(var k=0;128>k;k+=16)b=128h;h+=16)k=128b;b+=16)h=128=this.sourceBuffer.buffered.start(b)&&this.videoPlayer.currentTime<=this.sourceBuffer.buffered.end(b))return!0;return!1}; VideoWorker.prototype.update=function(){if(this.loadedVideo&&this.canUpdate){this.updating=!0;this.canPlayFromCurrentTime()?!this.isPlaying&&this.autoPaused&&(this.autoPaused=!1,this.play()):this.isPlaying&&(this.autoPaused=!0,this.pause());if(this.sourceBufferReady&&01E3/15&&(this.videoPlayer.currentTime===this.previousVideoPlayerTime&&b>=this.totalSegments-1?this.videoPlayer.currentTime=0:this.videoPlayer.currentTime===this.previousVideoPlayerTime&&this.videoPlayerCanPlay&&(this.isBuffering=!0),this.previousVideoPlayerClock= Date.now(),this.previousVideoPlayerTime=this.videoPlayer.currentTime));this.updating=!1}};VideoWorker.prototype.isReady=function(){return this.mediaSourceOpen&&this.canUpdate?!0:!1};VideoWorker.prototype.addToVideoBuffer=function(b,a,f){this.videoDataBuffer.push({index:b,data:a,url:f})};VideoWorker.prototype.onSourceBufferUpdateEnd=function(b){this.sourceBufferReady=!0};VideoWorker.prototype.onSourceBufferError=function(b){console.log("Source Buffer Error: ");console.log(b)}; VideoWorker.prototype.play=function(){this.isPlaying=!0;this.videoPlayer.play()};VideoWorker.prototype.pause=function(){this.isPlaying=!1;this.videoPlayer.pause()};VideoWorker.prototype.seekTo=function(b){this.isSeeking=!0;this.videoPlayer.currentTime=this.mediaSource.duration*b};VideoWorker.prototype.setTotalSegments=function(b){this.totalSegments=b;this.bufferedSegments=[];for(b=0;bMath.abs(30*this.videoPlayer.currentTime-this.decodedFrameIndex)? (this.gl.bindTexture(this.gl.TEXTURE_2D,b),this.gl.copyTexImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,0,0,this.videoPlayer.videoWidth,this.videoPlayer.videoHeight,0),this.lastDecodedFrameIndex=this.decodedFrameIndex):this.decodedFrameIndex=this.lastDecodedFrameIndex;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null)}};VideoWorker.prototype.setFrameInformation=function(b,a){this.framesPerSegment=b;this.framesPerSecond=a}; VideoWorker.prototype.destroy=function(){this.createdVideoPlayer&&(this.videoPlayer.parentNode.removeChild(this.videoPlayer),this.videoPlayer=0);this.clearWorker()}; var VideoWorkerHLS=function(b){this.gl=b;this.videoWorkerCommon=new VideoWorkerCommon;this.openVideo=this.openVideo.bind(this);this.update=this.update.bind(this);this.isReady=this.isReady.bind(this);this.play=this.play.bind(this);this.pause=this.pause.bind(this);this.seekTo=this.seekTo.bind(this);this.setTotalSegments=this.setTotalSegments.bind(this);this.getCurrentSegment=this.getCurrentSegment.bind(this);this.getPlaybackPercentage=this.getPlaybackPercentage.bind(this);this.updateVideoTexture=this.updateVideoTexture.bind(this); this.clearWorker=this.clearWorker.bind(this);this.canPlayFromCurrentTime=this.canPlayFromCurrentTime.bind(this);this.readFramePixels=this.readFramePixels.bind(this);this.onVideoPlayerError=this.onVideoPlayerError.bind(this);this.onVideoPlayerCanPlay=this.onVideoPlayerCanPlay.bind(this);this.onVideoPlayerLoadedMetaData=this.onVideoPlayerLoadedMetaData.bind(this);this.onVideoPlayerSeeked=this.onVideoPlayerSeeked.bind(this);this.previousVideoPlayerClock=this.previousVideoPlayerTime=0;this.isSeeking= this.isPlaying=!1;this.frameBufferTexture=this.frameBuffer=this.lastDecodedFrameIndex=this.decodedFrameIndex=0;this.videoPlayerCanPlay=this.loadedVideo=!1;this.videoPlayer=0;this.mimeCodec="";this.duration=0;this.videoDataBuffer=[];this.totalSegments=this.lastAddedVideoIndex=0;this.isBuffering=!1;this.framesPerSecond=this.framesPerSegment=0;this.autoPaused=!1;this.bufferedSegments=[];this.canvasPath=!1;b=this.detectOSVersion();this.shouldUseCanvasPath(b)&&(this.canvasPath=!0,this.videoCanvas=document.createElement("canvas"), this.videoCanvas.setAttribute("id","videoCanvas"),this.videoCanvas.setAttribute("width","1024"),this.videoCanvas.setAttribute("height","1024"),this.videoCanvas.setAttribute("style","position: absolute; top: 0; z-index: -999; display: none;"),this.videoCanvasContext=this.videoCanvas.getContext("2d"),document.body.appendChild(this.videoCanvas));this.preventedHLSInvalidTexture=this.begunPreventingInvalidHLSTexture=this.detectedValidTexture=this.createdVideoPlayer=!1}; VideoWorkerHLS.prototype.onVideoPlayerError=function(b){console.log("Video Player Error: ");console.log(b)};VideoWorkerHLS.prototype.onVideoPlayerCanPlay=function(){this.videoPlayerCanPlay=!0;this.isSeeking=!1};VideoWorkerHLS.prototype.onVideoPlayerLoadedMetaData=async function(){for(;!this.videoPlayerCanPlay;)await new Promise(b=>setTimeout(b,100)),this.videoPlayer.play().catch(b=>{}),this.videoPlayer.pause()}; VideoWorkerHLS.prototype.onVideoPlayerSeeked=function(){!this.preventedHLSInvalidTexture&&this.detectedValidTexture&&(this.preventedHLSInvalidTexture=!0)};VideoWorkerHLS.prototype.clearWorker=function(){};VideoWorkerHLS.prototype.canPlayFromCurrentTime=function(){return this.isReady()};VideoWorkerHLS.prototype.hasBufferedSegmentForCurrentTime=function(){return!0}; VideoWorkerHLS.prototype.openVideo=function(b,a,f=0,k){this.videoPlayerCanPlay=this.loadedVideo=!1;this.mimeCodec="";this.duration=a;this.sourceBuffer=0;this.videoDataBuffer=[];this.sourceBufferReady=!1;this.totalSegments=this.lastAddedVideoIndex=0;0===this.videoPlayer&&(0===f?(this.videoPlayer=document.createElement("video"),this.videoPlayer.setAttribute("id","videoPlayer"),this.videoPlayer.setAttribute("width","1"),this.videoPlayer.setAttribute("height","1"),this.videoPlayer.setAttribute("style", "position: absolute; top: 0; z-index: 0"),this.videoPlayer.setAttribute("controls",null),this.videoPlayer.setAttribute("autoplay",!0),this.videoPlayer.setAttribute("playsinline",!0),this.videoPlayer.setAttribute("loop",!0),this.videoPlayer.setAttribute("preload","auto"),this.videoPlayer.setAttribute("crossorigin","anonymous"),document.body.appendChild(this.videoPlayer),this.createdVideoPlayer=!0):this.videoPlayer=document.getElementById(f));this.mimeCodec=b;this.duration=a;this.videoPlayer.addEventListener("error", this.onVideoPlayerError);this.videoPlayer.addEventListener("canplay",this.onVideoPlayerCanPlay);this.videoPlayer.addEventListener("loadedmetadata",this.onVideoPlayerLoadedMetaData);this.videoPlayer.addEventListener("seeked",this.onVideoPlayerSeeked);this.videoPlayer.src=k;this.videoPlayer.currentTime=0;this.loadedVideo=!0;this.isPlaying=this.autoPaused=!1}; VideoWorkerHLS.prototype.readFramePixels=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!0);if(0==this.frameBuffer||0==this.frameBufferTexture)this.frameBuffer=this.gl.createFramebuffer(),this.frameBufferTexture=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this.frameBufferTexture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,1,1,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,new Uint8Array([255,0,255,255])),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER, this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.frameBuffer),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this.frameBufferTexture,0),this.gl.checkFramebufferStatus(this.gl.FRAMEBUFFER)!=this.gl.FRAMEBUFFER_COMPLETE&&console.log("WebGL Error: framebuffer cannot be read.");this.gl.bindTexture(this.gl.TEXTURE_2D,this.frameBufferTexture);this.gl.texImage2D(this.gl.TEXTURE_2D, 0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.videoPlayer);this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this.frameBuffer);let b=[],a=0;for(var f=0;3>f;f++)for(var k=0;3>k;k++){let a=new Uint8Array(4),n=parseInt(this.videoPlayer.videoWidth/(3*f)),d=parseInt(this.videoPlayer.videoHeight/(3*k));this.gl.readPixels(n,d,1,1,this.gl.RGBA,this.gl.UNSIGNED_BYTE,a);b.push(a)}for(f=1;f=videoPlayer.duration&&(videoPlayer.currentTime=0),this.omsBuffer&&this.getCurrentSegment()in this.omsBuffer?this.isBuffering=!1:this.isBuffering=!0):this.waitFrames--)}};VideoWorkerHLS.prototype.isReady=function(){return 3<=this.videoPlayer.readyState&&this.preventedHLSInvalidTexture}; VideoWorkerHLS.prototype.play=function(){if(this.detectedValidTexture)return this.isPlaying=!0,this.videoPlayer.play().catch(b=>{}),!0;console.log("Cannot play, HoloStream is not ready.");return!1};VideoWorkerHLS.prototype.pause=function(){if(this.detectedValidTexture)return this.isPlaying=!1,this.videoPlayer.pause(),!0;console.log("Cannot pause, HoloStream is not ready.");return!1};VideoWorkerHLS.prototype.seekTo=function(b){this.videoPlayer.currentTime=this.videoPlayer.duration*b}; VideoWorkerHLS.prototype.setTotalSegments=function(b){this.totalSegments=b;this.bufferedSegments=[];for(b=0;bMath.abs(30*this.videoPlayer.currentTime-this.decodedFrameIndex)? (this.gl.bindTexture(this.gl.TEXTURE_2D,b),this.gl.copyTexImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,0,0,this.videoPlayer.videoWidth,this.videoPlayer.videoHeight,0),this.lastDecodedFrameIndex=this.decodedFrameIndex):this.decodedFrameIndex=this.lastDecodedFrameIndex;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null)}};VideoWorkerHLS.prototype.setFrameInformation=function(b,a){this.framesPerSegment=b;this.framesPerSecond=a}; VideoWorkerHLS.prototype.detectOSVersion=function(){var b=navigator.userAgent;let a="",f="";b.match(/Safari/i)&&(f="Safari");if(b.match(/iPad/i)||b.match(/iPhone/i)){a="iOS";var k=b.indexOf("OS ")}b="iOS"===a&&-1void 0===a||null===a))return!1;b=(b+1)%this.cachedFrames.length}return!0}; VideoWorkerSoftware.prototype.openVideo=function(b,a,f=0,k,h={src:"",type:""}){this.textureWidth=k.width;this.textureHeight=k.height;this.videoPlayerCanPlay=this.loadedVideo=!1;this.mediaSource=0;this.mimeCodec="";this.duration=a;this.mediaSourceOpen=!1;this.sourceBuffer=0;this.videoDataBuffer=[];this.sourceBufferReady=!1;this.totalSegments=this.lastAddedVideoIndex=0;0===this.videoPlayer&&(0!==f&&(this.videoPlayer=document.getElementById(f)),void 0===this.videoPlayer||null===this.videoPlayer)&&(this.videoPlayer= document.createElement("video"),this.videoPlayer.setAttribute("id","videoPlayer"),this.videoPlayer.setAttribute("width","1"),this.videoPlayer.setAttribute("height","1"),this.videoPlayer.setAttribute("style","position: absolute;"),this.videoPlayer.setAttribute("playsinline",null),this.videoPlayer.setAttribute("loop",null),document.body.appendChild(this.videoPlayer));if(0===this.broadwayInstances.length)for(f=0;fa.hasHandler=!1),this.broadwayInstances[f].workers.forEach(a=>a.terminate()),this.broadwayInstances[f].workers=[new Worker(holostreamConfiguration.decoderLocation)],this.broadwayInstances[f].player= void 0;this.mimeCodec=b;this.duration=a;this.videoPlayer.addEventListener("error",this.onVideoPlayerError);this.videoPlayer.src=h.src;this.videoPlayer.setAttribute("type",h.type);this.videoPlayer.currentTime=0;this.loadedVideo=!0;this.cachedFrames=[];this.previousFrame=this.lastSegmentToFree=void 0}; VideoWorkerSoftware.prototype.processData=async function(b,a){let f=this.broadwayInstances[this.activeBroadwayInstance],k=this.activeBroadwayInstance,h=Date.now();await new Promise((k,d)=>{f.loadNewVideo(b.videoData,a[b.index],b.index,k,{offset:this.activeBroadwayInstance,total:this.broadwayInstanceCount,startTime:h})});b.videoData=null;Date.now();this.broadwayInstances[k].lockVideoProcessing=!1;a[b.index]&&a[b.index].cachedFrames.every(a=>void 0!==a)||(console.log("Did not unlock broadway instance "+ k+" which processed "+b.index),a[b.index]?console.log(a[b.index].cachedFrames):(console.log(a),console.log("No cached frames for "+b.index)))}; VideoWorkerSoftware.prototype.update=function(b,a){if(this.loadedVideo){if(this.canPlayFromCurrentTime(b,a)){if(!this.isPlaying&&this.autoPaused){this.lookAheadSegmentCount=1;this.play();return}if(!this.videoPlayerCanPlay)this.onVideoPlayerCanPlay()}else this.isPlaying&&(this.autoPaused=!0,this.lookAheadSegmentCount=3,this.pause());for(var f=0;fvoid 0===a))k[f.index]={cachedFrames:[]},this.broadwayInstances[this.activeBroadwayInstance].lockVideoProcessing=!0,k[f.index].dimensions=f.dimensions,this.processData(f,k),this.activeBroadwayInstance=(this.activeBroadwayInstance+1)%this.broadwayInstanceCount}this.isPlaying&&(f=this.getCurrentSegment(),this.videoPlayer.currentTime==this.previousVideoPlayerTime&& f>=this.totalSegments-1&&(this.videoPlayer.currentTime=0),this.previousVideoPlayerTime=this.videoPlayer.currentTime);if(null!==this.cachedFrames[this.lastSegment]){if(this.lastSegment!==a&&null!==this.cachedFrames[this.lastSegment]&&void 0!==this.cachedFrames[this.lastSegment]&&null!==this.cachedFrames[this.lastSegment].cachedFrames&&void 0!==this.cachedFrames[this.lastSegment]&&4=k;k++)if((this.lastSegment+ k)%this.cachedFrames.length===a){f=!1;break}if(f&&this.lastSegment{f.includes(k)?b[k].source||(b[k].source=a,b[k].width=0,b[k].height=0):b[k]={source:holostreamConfiguration.imageLocations[k],width:18,height:18}});f.includes("bufferingSymbol")?b.bufferingSymbol.source||(b.bufferingSymbol.source=a,b.bufferingSymbol.width=0,b.bufferingSymbol.height= 0):b.bufferingSymbol={source:holostreamConfiguration.imageLocations.bufferingSymbol,width:150,height:150};f.includes("jumboPlayButton")?b.jumboPlayButton.source||(b.jumboPlayButton.source=a,b.jumboPlayButton.width=0,b.jumboPlayButton.height=0):b.jumboPlayButton={source:holostreamConfiguration.imageLocations.jumboPlayButton,width:150,height:150};return b};PlayerUI.prototype.setAttributes=function(b,a){Object.keys(a).forEach(f=>{b.setAttribute(f,a[f])})}; PlayerUI.prototype.createElement=function(b,a,f){b=document.createElement(b);b.setAttribute("class",f);a.appendChild(b);return b};PlayerUI.prototype.resetLargePlayButtonStatus=function(){this.jumboPlayButton.showedOnce=!1}; PlayerUI.prototype.showLargePlayButton=function(){!1===this.jumboPlayButton.showedOnce&&(this.jumboPlayButton.setAttribute("class","hsp-large-play-container"),this.jumboPlayButton.playIcon.setAttribute("class","hsp-play-control hsp-control hsp-large-play-button"),this.jumboPlayButton.showedOnce=!0)}; PlayerUI.prototype.createSVGButton=async function(b,a,f,k,h){let n=await fetch(h).then(async a=>await a.text());n=n.replace("http://www.w3.org/2000/svg",`"${"http://www.w3.org/2000/svg"}" height="${k}" width="${f}"`);h=`\n`;n=n.replace("\x3c/svg\x3e",h);h=document.createElement("div");h.innerHTML=n;b.appendChild(h);this.setAttributes(h,{class:a,role:"presentation",focusable:"false"});h.setAttribute("style", `width: ${f}px; height: ${k}px`);return h}; PlayerUI.prototype.constructLargePlayContainer=function(b){b=this.createElement("div",b,"hsp-large-play-container hsp-transparent");let a=this.uiImages.jumboPlayButton.height,f=this.createElement("button",b,"hsp-play-control hsp-control hsp-large-play-button hsp-large-play-button-inactive");f.setAttribute("type","button");f.setAttribute("width",a);f.setAttribute("height",a);f.onclick=()=>this.updatePlayState(!0);this.createSVGButton(f,"",a,a,this.uiImages.jumboPlayButton.source);this.jumboPlayButton= b;this.jumboPlayButton.playIcon=f};PlayerUI.prototype.constructBufferingContainer=async function(b){b=this.createElement("div",b,"hsp-buffering-container");let a=this.uiImages.bufferingSymbol.height,f=await this.createSVGButton(b,"hsp-buffering-icon",a,a,this.uiImages.bufferingSymbol.source);b.setAttribute("width",a);b.setAttribute("height",a);this.bufferingSpinner=b;this.bufferingSpinner.bufferingImage=f}; PlayerUI.prototype.constructPlayPauseContainer=function(b){let a=this.uiImages.playButton.height;b.style.height=a;b=this.createElement("button",b,"hsp-play-control hsp-control");b.setAttribute("type","button");b.onclick=()=>this.updatePlayState();this.createSVGButton(b,"hsp-control-play-icon hsp-icon",a,a,this.uiImages.playButton.source);this.createSVGButton(b,"hsp-hide-element hsp-control-pause-icon hsp-icon",a,a,this.uiImages.pauseButton.source)};PlayerUI.prototype.handleSeek=function(b){}; PlayerUI.prototype.constructSeekContainer=function(b){let a=this.createElement("input",b,"hsp-control-seek hsp-control");this.setAttributes(a,{type:"range",id:"hsp-control-seek",min:"0",max:"1",step:"0.05",value:"0"});a.oninput=()=>{this.onSeek(a.value);this.updateProgressStyle(a)}};PlayerUI.prototype.constructTimeContainer=function(b){b.innerHTML="00:00";b.setAttribute("id","hsp-time-container")}; PlayerUI.prototype.constructAudioContainer=function(b){var a=this.uiImages.audioEnabled.height;b=this.createElement("div",b,"hsp-audio-grid");var f=this.createElement("div",b,"hsp-audio-grid-cell");f=this.createElement("div",f,"hsp-control-container");f.style.height=a;f=this.createElement("button",f,"hsp-audio-enable-control hsp-control");f.setAttribute("type","button");this.createSVGButton(f,"hsp-control-audio-enabled-icon hsp-icon",a,a,this.uiImages.audioEnabled.source);this.createSVGButton(f,"hsp-hide-element hsp-control-audio-disabled-icon hsp-icon", a,a,this.uiImages.audioDisabled.source);a=this.createElement("div",b,"hsp-audio-grid-cell");a=this.createElement("div",a,"hsp-control-volume-container hsp-control-container");let k=this.createElement("input",a,"hsp-control-volume hsp-control");this.setAttributes(k,{type:"range",min:0,max:1,step:.05,value:.5,autocomplete:"off",role:"slider",style:"--value:55.00000000000001%;",aria:"55.0%",id:"hsp-control-volume"});f.onclick=()=>{this.toggleAudioEnabled();this.updateProgressStyle(k)};k.oninput=()=> {const a=document.getElementById("hsp-control-volume");videoPlayer.volume=a.value;this.updateProgressStyle(k)};this.updateProgressStyle(k)}; PlayerUI.prototype.constructFullscreenContainer=function(b){let a=this.createElement("button",b,"hsp-fullscreen-control hsp-control"),f=this.uiImages.enterFullscreen.height;a.setAttribute("type","button");a.onclick=()=>this.toggleFullscreen(".hsp-player");this.createSVGButton(a,"hsp-control-maximizeFullScreen-icon hsp-icon",f,f,this.uiImages.enterFullscreen.source);this.createSVGButton(a,"hsp-hide-element hsp-control-minimizeFullScreen-icon hsp-icon",f,f,this.uiImages.exitFullscreen.source);b.style.height= f+"px"}; PlayerUI.prototype.constructDefaultUI=function(b){let a=document.createElement("div");a.classList.add("hsp-controls-container");b.appendChild(a);let f=document.createElement("div");f.classList.add("hsp-controls-grid");a.appendChild(f);let k={hspPlayPauseArea:void 0,hspSeekArea:void 0,hspTimeArea:void 0,hspAudioArea:void 0,hspFullscreenArea:void 0};Object.keys(k).forEach(a=>{k[a]=this.createElement("div",f,"hsp-control-container")});k.hspSeekArea.classList.add("hsp-control-seek-container");k.hspTimeArea.classList.add("hsp-time-container"); this.constructPlayPauseContainer(k.hspPlayPauseArea);this.constructSeekContainer(k.hspSeekArea);this.constructTimeContainer(k.hspTimeArea);this.constructAudioContainer(k.hspAudioArea);this.constructFullscreenContainer(k.hspFullscreenArea);this.constructLargePlayContainer(b);this.constructBufferingContainer(b)};PlayerUI.prototype.updateProgressStyle=function(b){const a=(b.value-b.min)/(b.max-b.min)*100;b.style.background="linear-gradient(to right, #aeaeae 0%, #aeaeae "+a+"%, #5d5a5e "+a+"%, #5d5a5e 100%)"}; PlayerUI.prototype.toggleIconVisibility=function(b,a){a.classList.remove("hsp-display-element");a.classList.add("hsp-hide-element");b.classList.remove("hsp-hide-element");b.classList.add("hsp-display-element")};PlayerUI.prototype.convertSecondsToMinsSecondsString=function(b,a){b=Math.abs(a-b);return"-"+Math.floor(b/60).toString().padStart(2,"0")+":"+Math.floor(b%60).toString().padStart(2,"0")}; PlayerUI.prototype.toggleFullscreen=function(b){const a=document.querySelector(".hsp-control-maximizeFullScreen-icon"),f=document.querySelector(".hsp-control-minimizeFullScreen-icon");"visible"===getComputedStyle(a).visibility?this.toggleIconVisibility(f,a):this.toggleIconVisibility(a,f);b=(b=document.querySelector(b))||document.documentElement;document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?document.exitFullscreen?document.exitFullscreen(): document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():b.requestFullscreen?b.requestFullscreen():b.msRequestFullscreen?b.msRequestFullscreen():b.mozRequestFullScreen?b.mozRequestFullScreen():b.webkitRequestFullscreen&&b.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}; PlayerUI.prototype.toggleAudioEnabled=function(){const b=document.querySelector(".hsp-control-audio-enabled-icon"),a=document.querySelector(".hsp-control-audio-disabled-icon"),f=document.getElementById("hsp-control-volume"),k=document.getElementById("videoPlayer");"visible"==getComputedStyle(b).visibility?(this.hspCurrentAudioVolume=f.value,k.volume=0,f.value=0,this.toggleIconVisibility(a,b)):(k.volume=this.hspCurrentAudioVolume,f.value=this.hspCurrentAudioVolume,this.toggleIconVisibility(b,a))}; PlayerUI.prototype.isReady=function(){return this.uiLoaded};PlayerUI.prototype.initializeLoadedSegmentDisplay=function(b){this.loadedSegments.forEach(a=>{a=this.ui.displayObjects.indexOf(a);0<=a&&this.ui.displayObjects.splice(a,1)});this.loadedSegments=[];for(let a=0;ab?b=0:1f;f++)a.push(0);this.boneTex=new THREE.DataTexture(new Float32Array(a),512,1,THREE.RGBAFormat,THREE.FloatType);this.boneTex.needsUpdate=!0}this.boneTex.image.data=b;this.boneTex.needsUpdate=!0}}; ThreeWrapper.prototype.getShader=function(b){var a=null;a=new XMLHttpRequest;a.open("GET",b,!1);a.send(null);return a.responseText.replace(/\/\/\s?chunk\(\s?(\w+)\s?\);/g,function(a,b){return THREE.ShaderChunk[b]+"\n"})}; ThreeWrapper.prototype.startRender=function(){var b=new Float32Array(31E4),a=new Float32Array(213E3),f=new Float32Array(142E3),k=new Float32Array(284E3),h=new Float32Array(284E3);b=new Uint32Array(b);this.geometry.setIndex(new THREE.BufferAttribute(b,1));this.geometry.setAttribute("position",new THREE.Float32BufferAttribute(a,3));this.geometry.setAttribute("uvs",new THREE.Float32BufferAttribute(f,2));this.geometry.setAttribute("skinIndex",new THREE.Float32BufferAttribute(k,4));this.geometry.setAttribute("skinWeight", new THREE.Float32BufferAttribute(h,4));for(a=0;128>a;++a)this.boneArray.push(new THREE.Matrix4);if(0===this.boneTex){a=[];for(f=0;2048>f;f++)a.push(0);this.boneTex=new THREE.DataTexture(new Float32Array(a),512,1,THREE.RGBAFormat,THREE.FloatType);this.boneTex.needsUpdate=!0}a=new Uint8Array(4);a[0]=255;a[1]=0;a[2]=255;a[3]=255;this.texture=new THREE.DataTexture(a,1,1,THREE.RGBAFormat);this.texture.update=()=>{};this.texture.isVideoTexture=!0;this.texture.minFilter=THREE.LinearFilter;this.texture.magFilter= THREE.LinearFilter;this.texture.needsUpdate=!0;a=THREE.UniformsUtils.merge([THREE.UniformsLib.ambient,THREE.UniformsLib.lights]);a.mainTex={value:this.texture};a.boneTex={value:this.boneTex};this.iOSPath?(0===this.yuvTextures&&this.initializeYUVTexture(0,0),this.YUV2RGB=[1.16438,0,1.59603,-.87079,1.16438,-.39176,-.81297,.52959,1.16438,2.01723,0,-1.08139,0,0,0,1],this.material=new THREE.ShaderMaterial({uniforms:{mainTex:{value:this.texture},boneTex:{value:this.boneTex},yTex:{value:this.yuvTextures[0]}, uTex:{value:this.yuvTextures[1]},vTex:{value:this.yuvTextures[2]},yTexturePos:{value:new Float32Array(4)},uTexturePos:{value:new Float32Array(4)},vTexturePos:{value:new Float32Array(4)},YUV2RGB:{value:this.YUV2RGB}},vertexShader:this.getShader(holostreamConfiguration.shaderLocations.vertexShaderiOS),fragmentShader:this.getShader(holostreamConfiguration.shaderLocations.fragmentShaderiOS)})):this.material=new THREE.ShaderMaterial({uniforms:a,vertexShader:this.getShader(holostreamConfiguration.shaderLocations.vertexShader), fragmentShader:this.getShader(holostreamConfiguration.shaderLocations.fragmentShader),lights:!0});this.customDepthMaterial=new THREE.ShaderMaterial({uniforms:a,vertexShader:this.getShader(holostreamConfiguration.shaderLocations.vertexShaderShadow),fragmentShader:THREE.ShaderLib.basic.fragmentShader});this.material.side=THREE.DoubleSide;this.mesh=new THREE.Mesh(this.geometry,this.material);this.mesh.castShadow=!0;this.mesh.receiveShadow=!0;this.mesh.customDistanceMaterial=this.customDepthMaterial; this.mesh.customDepthMaterial=this.customDepthMaterial;this.mesh.frustumCulled=!1;this.scene.add(this.mesh)};ThreeWrapper.prototype.render=function(){this.overrideRender||(this.renderer.render&&this.renderer.render(this.scene,this.camera),this.renderer.autoClear=!1)}; ThreeWrapper.prototype.initializeYUVTexture=function(b,a){var f=b/2,k=a/2;f=[b,f,f];k=[a,k,k];this.yuvTextures=[];for(let a=0;3>a;a++){let b=[];for(let d=0;d{getJSON(this.baseProfileURL+this.defaultProfile,async function(b,k){if(null===b){var f=(new URL(window.location.href)).searchParams.get("playlist");let a=k;await new Promise((b,c)=>{null!==f&&void 0!==f?this.getJSON(this.baseProfileURL+f+".json",(c,d)=>{null===c&&(a=d);b()}):b()});var n=document.createDocumentFragment(), d=document.createDocumentFragment();let h=0;b=document.getElementById("clipPreviewGroupHook");k=document.getElementById("clipPreviewGroupHook-mobile-portrait");var l=b.getElementsByClassName("ClipPreview");for(var c=l.length-1;0<=c;c--)l[c].remove();l=k.getElementsByClassName("ClipPreview");for(c=l.length-1;0<=c;c--)l[c].remove();let w=function(b,c,d){let e=a[b];e.id=c;b=document.createElement("button");b.id="clipPreview"+c;b.className="ClipPreview";b.onclick=function(){arcturusHoloStreamInstance.openURL(e.manifestURL)}; d.appendChild(b);d=document.createElement("img");d.id="clipPreviewImage"+c;d.className="ClipPreviewImage";d.src=e.previewURL;b.appendChild(d);d=document.createElement("div");d.id="clipPreviewName"+c;d.className="ClipPreviewName";d.innerHTML=e.name;b.appendChild(d)};Object.keys(a).forEach(a=>{w(a,h,n);w(a,h,d);h++});b.appendChild(n);k.appendChild(d)}else console.log("Could not load default playlist"),console.log(b),a()})})} function onClickQualityButton(b,a){arcturusHoloStreamInstance.setQualityProfile(a);a=document.getElementById("ProfileContainer").getElementsByTagName("button");for(let f=a.length-1;0<=f;f--)a[f].className="ProfileButton",a[f]===b&&(a[f].className+=" SelectedProfileButton"),arcturusHoloStreamInstance.getActiveProfile()===a[f].profile&&(a[f].className+=" AutoSelectedProfileButton")} function populateProfileButtons(b){let a=document.getElementById("ProfileContainer");var f=a.getElementsByTagName("button");for(let a=f.length-1;0<=a;a--)f[a].id.includes("AdaptiveButton")?(arcturusHoloStreamInstance.requestWorker.adaptiveStreaming&&(f[a].className+=" SelectedProfileButton"),f[a].onclick=()=>{onClickQualityButton(f[a],void 0)}):f[a].remove();b.forEach(b=>{if(b.displayName){var f=b.displayName,k=document.createElement("button");k.id="ProfileButton";k.className="ProfileButton";k.innerHTML= f;k.profile=b;k.onclick=()=>{onClickQualityButton(k,b)};a.appendChild(k);f="ProfileButton";arcturusHoloStreamInstance.getActiveProfile()===b&&(f+=" AutoSelectedProfileButton",arcturusHoloStreamInstance.requestWorker.adaptiveStreaming||(f+=" SelectedProfileButton"));k.className=f}})}function onURLOpened(){populateProfileButtons(arcturusHoloStreamInstance.getQualityProfiles())} function onQualityChanged(b){b=b.displayName;var a=document.getElementById("ProfileContainer").getElementsByTagName("button");for(let f=a.length-1;0<=f;f--)a[f].id.includes("AdaptiveButton")||(a[f].className=a[f].className.replace(" AutoSelectedProfileButton",""),a[f].innerHTML===b&&(a[f].className+=" AutoSelectedProfileButton"))} function initializeScene(b){var a=b.getThreeScene(),f=b.getHoloStreamCanvas(),k=b.getThreeRenderer(),h=b.getThreeCamera();arcturusHoloStreamInstance=b;document.body.Arcturus={};var n=new THREE.Color("#aaa");a.background=n;a.fog=new THREE.FogExp2(n,.05);n=new THREE.PlaneGeometry(7,7,32);n.rotateX(-90/57.2958);var d=new THREE.TextureLoader,l=new THREE.PointLight(16777215,1,100);l.position.set(-10,10,10);l.castShadow=!0;l.shadow.mapSize.width=2048;l.shadow.mapSize.height=2048;a.add(l);d=new THREE.MeshBasicMaterial({map:d.load("https://volumetric-webplayer-development.s3.amazonaws.com/img/3d_Grid.png"), side:THREE.DoubleSide,opacity:1,transparent:!0,blendSrc:THREE.OneMinusDstAlphaFactor,blendDst:THREE.OneFactor});n=new THREE.Mesh(n,d);n.receiveShadow=!0;a.add(n);n=new THREE.ShadowMaterial({opacity:.5});d=new THREE.PlaneGeometry(7,7,32);d.rotateX(-90/57.2958);n=new THREE.Mesh(d,n);n.castShadow=!0;n.receiveShadow=!0;a.add(n);n=new THREE.PlaneGeometry(100,100,32);n.translate(0,0,-.05);n.rotateX(-90/57.2958);d=new THREE.MeshPhongMaterial({color:new THREE.Color("#444")});n=new THREE.Mesh(n,d);a.add(n); let c=new THREE.OrbitControls(h,k.domElement);c.enableDamping=!0;c.dampingFactor=.09;c.enableKeys=!0;c.autoRotate=!1;c.autoRotateSpeed=2;c.target=new THREE.Vector3(0,1,0);c.maxPolarAngle=.6*Math.PI;c.minPolarAngle=.25*Math.PI;c.update();document.body.Arcturus.controls=c;document.body.Arcturus.autoRotateDelay=3E3;f.lastInputTime=Date.now();f.addEventListener("click",()=>{c.autoRotate=!1});f.addEventListener("mouseup",function(){f.lastInputTime=Date.now()});b.preUpdateFunctions.push({update:()=>{let a= Date.now();!1===c.autoRotate&&a-f.lastInputTime>document.body.Arcturus.autoRotateDelay&&(c.autoRotate=!0);c.update()}})}function createThreeScene(){return new THREE.Scene}function createThreeCamera(){let b=new THREE.PerspectiveCamera(45,1,.001,1E3);b.position.z=3.5;b.position.y=2;return b} var HoloStream=function(b){"holostreamConfiguration"in window||this.populateDevelopmentConfiguration();this.debugEnabled=!0;if(void 0===b||void 0===b.debugEnabled||0==b.debugEnabled)this.debugEnabled=!1;this.containerDiv=void 0;this.createdContainerDiv=!1;b&&b.targetContainerDivID?this.containerDiv=document.getElementById(b.targetContainerDivID):(this.containerDiv=document.createElement("div"),this.containerDiv.setAttribute("id","holostreamContainer"),this.containerDiv.setAttribute("style","position: relative; width: 100%; height: 100%;"), document.body.appendChild(this.containerDiv),this.createdContainerDiv=!0);this.createdHolostreamCanvas=!1;if(b&&b.targetCanvasID)var a=document.getElementById(b.targetCanvasID);else a=document.createElement("canvas"),a.setAttribute("id","holostreamCanvas"),a.setAttribute("oncontextmenu","return false;"),a.setAttribute("style","width: 0; height: 0; position: absolute; left: 0; top: 0; z-index: 0;"),this.containerDiv.appendChild(a),this.createdHolostreamCanvas=!0;this.holostreamCanvas=a;this.preUpdateFunctions= [];this.postUpdateFunctions=[];this.sequenceReadyFunctions=[];this.openURL=this.openURL.bind(this);this.update=this.update.bind(this);this.parsePlaybackSegment=this.parsePlaybackSegment.bind(this);this.clearCurrentContent=this.clearCurrentContent.bind(this);this.addToOMSBuffer=this.addToOMSBuffer.bind(this);this.getQualityProfiles=this.getQualityProfiles.bind(this);this.getActiveProfile=this.getActiveProfile.bind(this);this.setQualityProfile=this.setQualityProfile.bind(this);this.isMobileAppleDevice= this.isMobileAppleDevice.bind(this);this.isAppleDevice=this.isAppleDevice.bind(this);this.destroyHoloStream=this.destroyHoloStream.bind(this);this.appleDevice=this.isAppleDevice();this.useSoftwareDecoding=!1;this.lastOpenURLTime=this.minimumOpenURLTime=this.onQualityChanged=this.onURLOpened=0;this.playedOnce=this.openURLLock=!1;this.handleResize=this.handleResize.bind(this);this.handleOMSPlayerReady=this.handleOMSPlayerReady.bind(this);this.handleOMSPlaybackReady=this.handleOMSPlaybackReady.bind(this); this.handleKeyframeReady=this.handleKeyframeReady.bind(this);this.handleFrameReady=this.handleFrameReady.bind(this);this.handleQualityChanged=this.handleQualityChanged.bind(this);this.handlePlay=this.handlePlay.bind(this);this.handleSeek=this.handleSeek.bind(this);this.threeWrapper=new ThreeWrapper(a,b);this.requestWorker=new RequestWorker;this.requestWorker.player=this.HoloStream;this.requestWorker.ui=this.playerUI;this.requestWorker.onQualityChanged=this.handleQualityChanged;a=void 0===b||void 0=== b.uiImages?{}:b.uiImages;void 0!==b&&b.hideUI||(this.playerUI=new PlayerUI(a,b.targetContainerDivID),this.playerUI.onPlay=this.handlePlay,this.playerUI.onSeek=this.handleSeek);this.appleDevice?(this.requestWorker.iOSPath=!0,this.videoWorker=this.useSoftwareDecoding?new VideoWorkerSoftware:new VideoWorkerHLS(this.threeWrapper.getWebGLContext())):this.videoWorker=new VideoWorker(this.threeWrapper.getWebGLContext());this.omsPlayer=new OMSPlayer(this.handleOMSPlayerReady,!1);this.omsPlayer.onPlaybackReady= this.handleOMSPlaybackReady;this.omsPlayer.onKeyframeReady=this.handleKeyframeReady;this.omsPlayer.onFrameReady=this.handleFrameReady;this.omsBuffer={};this.firstSegmentLoad=!0;this.currentOMSFrame=this.currentOMSSegment=0;this.showingLoadingScreen=!0;this.previousTime=Date.now();this.videoPlayerHasBeenReady=this.updatedVideoTexture=this.firedSequenceReadyEvent=this.playing=!1;window.addEventListener("resize",this.handleResize,!1);this.debugEnabled&&(this.stats=new Stats,this.stats.showPanel(0),document.body.appendChild(this.stats.dom)); this.threeWrapper.startRender();this.update();this.startTime=Date.now();this.lastTime=Date.now();this.fps=30;this.fpsInterval=1E3/this.fps}; HoloStream.prototype.populateDevelopmentConfiguration=function(){holostreamConfiguration={config:"development",imageLocations:{emptyImageURL:"img/hsp-controls/plyr-blank.svg#plyr-blank",playButton:"img/hsp-controls/plyr-play.svg#plyr-play",pauseButton:"img/hsp-controls/plyr-pause.svg#plyr-pause",bufferingSymbol:"img/hsp-controls/plyr-progress.svg#plyr-progress",jumboPlayButton:"img/hsp-controls/plyr-large-play.svg#plyr-large-play",enterFullscreen:"img/hsp-controls/plyr-enter-fullscreen.svg#plyr-enter-fullscreen", exitFullscreen:"img/hsp-controls/plyr-exit-fullscreen.svg#plyr-exit-fullscreen",audioDisabled:"img/hsp-controls/plyr-audio-disabled.svg#plyr-audio-disabled",audioEnabled:"img/hsp-controls/plyr-audio-enabled.svg#plyr-audio-enabled",holostreamLogo:"img/HoloStream.svg"},shaderLocations:{vertexShader:"shaders/vertex_shader.glsl",fragmentShader:"shaders/fragment_shader.glsl",vertexShaderiOS:"shaders/vertex_shader_yuv_to_rgb.glsl",fragmentShaderiOS:"shaders/fragment_shader_yuv_to_rgb.glsl",vertexShaderShadow:"shaders/vertex_shader_shadow.glsl", fragmentShaderShadow:"shaders/fragment_shader_shadow.glsl"},decoderLocation:"src/Decoder.js"}}; HoloStream.prototype.openURL=async function(b){if(this.openURLLock)return!1;this.openURLLock=!0;this.url=b;this.videoWorker.initializationFrames=0;this.isAppleDevice()&&(this.videoWorker.initializationFrames=0);this.videoWorker.canUpdate=!1;if(this.videoWorker.updating){let a=this.videoWorker,b=f=>{a.updating?setTimeout(()=>b(f),100):f()};await new Promise(a=>{b(a)})}Date.now()-this.lastOpenURLTime{setTimeout(a,this.minimumOpenURLTime)});await this.requestWorker.clearRequestWorker(); this.clearCurrentContent();this.lastOpenURLTime=Date.now();this.playedOnce=!1;this.videoWorker.canUpdate=!0;this.openURLLock=!1;this.omsBuffer={};this.firstSegmentLoad=!0;this.currentOMSFrame=this.currentOMSSegment=-1;this.showingLoadingScreen=!0;this.videoPlayerHasBeenReady=this.updatedVideoTexture=this.firedSequenceReadyEvent=!1;if(await this.requestWorker.openManifest(b)){b=this.requestWorker.getActiveProfile();let a={};void 0!==this.requestWorker.manifest.audioURL&&(a.src=this.requestWorker.manifest.url, a.src=a.src.replace("manifest.mpd",this.requestWorker.manifest.audioURL),a.type="audio/aac");this.useSoftwareDecoding?this.videoWorker.openVideo('video/mp4; codecs\x3d"'+b.codecs+'"',this.requestWorker.getDuration(),"omsAudio",b,a):this.videoWorker.openVideo('video/mp4; codecs\x3d"'+b.codecs+'"',this.requestWorker.getDuration(),0,this.requestWorker.manifest.hlsURL);this.videoWorker.setFrameInformation(b.duration,b.timescale);this.playerUI&&(this.playerUI.resetLargePlayButtonStatus(),this.playerUI.initializeLoadedSegmentDisplay(this.requestWorker.totalSegments)); if(0!==this.onURLOpened)this.onURLOpened(this.requestWorker.manifest);return!0}return!1}; HoloStream.prototype.update=function(){if(!this.openURLLock){var b=Date.now(),a=b-this.lastTime;if(a>this.fpsInterval&&(this.lastTime=b-a%this.fpsInterval,this.preUpdateFunctions.forEach(a=>{a.update&&a.update()}),this.debugEnabled&&this.stats.begin(),!this.omsPlayer.omsInstances.some(a=>!a.initialized))){var f=this.requestWorker.getActiveProfile();b=60;a=30;void 0!==f&&(b=f.duration,a=f.timescale);a=Math.floor(this.videoWorker.videoPlayer.currentTime*a);var k=Math.floor(a/b);1{a.update&&a.update()})),this.showingLoadingScreen&&(this.showingLoadingScreen=!1));this.playerUI&&(this.playerUI.isBuffering=this.videoWorker.isBuffering,this.playerUI.updatePlaybackPercentage(this.videoWorker.getPlaybackPercentage(),this.videoWorker.videoPlayer.currentTime),this.useSoftwareDecoding?this.playerUI.updateLoadedSegmentDisplay(this.requestWorker.totalSegmentsDownloaded, this.requestWorker.totalSegments):this.playerUI.updateLoadedSegmentDisplay(this.requestWorker.totalSegmentsDownloaded-1,this.requestWorker.totalSegments));this.threeWrapper.render();this.playerUI&&this.playerUI.update();this.debugEnabled&&this.stats.end();this.postUpdateFunctions.forEach(a=>{a.update&&a.update()})}}}requestAnimationFrame(this.update)};HoloStream.prototype.getQualityProfiles=function(){return this.requestWorker.manifest.profiles};HoloStream.prototype.getActiveProfile=function(){return this.getQualityProfiles()[this.requestWorker.activeProfile]}; HoloStream.prototype.setQualityProfile=function(b){if(void 0===b)this.requestWorker.setActiveProfile(this.requestWorker.activeProfile,!0);else for(var a=this.getQualityProfiles(),f=0;f{setTimeout(b,this.minimumOpenURLTime)});this.videoWorker.videoPlayer.width=512;this.videoWorker.videoPlayer.height=512;this.videoWorker.videoPlayer.style.zIndex=9999}; HoloStream.prototype.isMobileAppleDevice=function(){return"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};HoloStream.prototype.isAppleDevice=function(){let b=this.isMobileAppleDevice(),a=navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome");return b||a?!0:!1}; HoloStream.prototype.destroyHoloStream=function(){this.openURLLock=!0;this.createdContainerDiv&&this.containerDiv.parentNode.removeChild(this.containerDiv);this.createdHolostreamCanvas&&this.holostreamCanvas.parentNode.removeChild(this.holostreamCanvas);this.omsBuffer=null;this.videoWorker.destroy();this.videoWorker=null;this.omsPlayer.destroy();this.omsPlayer=null;this.playerUI&&(this.playerUI.destroy(),this.playerUI=null);this.threeWrapper.destroy();this.threeWrapper=null;this.requestWorker.destroy(); this.requestWorker=null};HoloStream.prototype.getHoloStreamCanvas=function(){return this.holostreamCanvas};HoloStream.prototype.getThreeScene=function(){return this.threeWrapper.getThreeScene()};HoloStream.prototype.getThreeMesh=function(){return this.threeWrapper.getThreeMesh()};HoloStream.prototype.getThreeRenderer=function(){return this.threeWrapper.getThreeRenderer()};HoloStream.prototype.getThreeCamera=function(){return this.threeWrapper.getThreeCamera()}; HoloStream.prototype.addDefaultEventHandler=function(b){this.playerUI.ui.defaultEventListener=b};