!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";function n(e){return(n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}if(r.r(t),"undefined"==typeof o)var o={};o.MD5=function(e){function t(e){var t=(e>>>0).toString(16);return"00000000".substr(0,8-t.length)+t}function r(e,t,r){return e&t|~e&r}function o(e,t,r){return r&e|~r&t}function a(e,t,r){return e^t^r}function i(e,t,r){return t^(e|~r)}function u(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function c(e){for(var t=[],r=0;r>>32-a),g=i}var n=f.length;f.push(128);var c=f.length%64;if(c>56){for(var s=0;s<64-c;s++)f.push(0);c=f.length%64}for(s=0;s<56-c;s++)f.push(0);f=f.concat(function(e){for(var t=[],r=0;r<8;r++)t.push(255&e),e>>>=8;return t}(8*n));var p=1732584193,d=4023233417,y=2562383102,h=271733878,g=0,m=0,v=0,b=0;for(s=0;s=0;c--)i=255&(u=arguments[c]),i<<=8,i|=255&(u>>>=8),i<<=8,i|=255&(u>>>=8),i<<=8,a+=t(i|=u>>>=8);return a}(h,y,d,p).toUpperCase()}()};var a={log:function(){},error:function(){},count:function(){},info:function(){}};(function(){function e(){}e.createFromElementId=function(t){for(var r=document.getElementById(t),n="",o=r.firstChild;o;)3===o.nodeType&&(n+=o.textContent),o=o.nextSibling;var a=new e;return a.type=r.type,a.source=n,a},e.createFromSource=function(t,r){var n=new e;return n.type=t,n.source=r,n}})(),function(){function e(e){this.gl=e,this.program=this.gl.createProgram()}e.prototype={attach:function(e){this.gl.attachShader(this.program,e.shader)},link:function(){this.gl.linkProgram(this.program)},use:function(){this.gl.useProgram(this.program)},getAttributeLocation:function(e){return this.gl.getAttribLocation(this.program,e)},setMatrixUniform:function(e,t){var r=this.gl.getUniformLocation(this.program,e);this.gl.uniformMatrix4fv(r,!1,t)}}}(),function(){var e=null;function t(e,t,r){this.gl=e,this.size=t,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),this.format=r||e.LUMINANCE,e.texImage2D(e.TEXTURE_2D,0,this.format,t.w,t.h,0,this.format,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}t.prototype={fill:function(e,t){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),t?r.texSubImage2D(r.TEXTURE_2D,0,0,0,this.size.w,this.size.h,this.format,r.UNSIGNED_BYTE,e):r.texImage2D(r.TEXTURE_2D,0,this.format,this.size.w,this.size.h,0,this.format,r.UNSIGNED_BYTE,e)},bind:function(t,r,n){var o=this.gl;e||(e=[o.TEXTURE0,o.TEXTURE1,o.TEXTURE2]),o.activeTexture(e[t]),o.bindTexture(o.TEXTURE_2D,this.texture),o.uniform1i(o.getUniformLocation(r.program,n),t)}}}();function i(){var e=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384],t=function(e,t,r){var n=0,o=0;for(n=0;n0?r:8191&-r,e,15)-6)+(n>>6&15)-13,u=(0===o?32:a>=0?o>>a:o<<-a)*(n&parseInt("077",8))+48>>4,c=i>=0?u<>-i,(r^n)<0?-c:c};this.g726InitState=function(){var e={},t=0;for(e.pp=new Array(2),e.zp=new Array(6),e.pk=new Array(2),e.dq=new Array(6),e.sr=new Array(2),e.yl=34816,e.yu=544,e.dms=0,e.dml=0,e.ppp=0,t=0;t<2;t++)e.pp[t]=0,e.pk[t]=0,e.sr[t]=32;for(t=0;t<6;t++)e.zp[t]=0,e.dq[t]=32;return e.td=0,e},this.predictorZero=function(e){var t=0,n=0;for(n=r(e.zp[0]>>2,e.dq[0]),t=1;t<6;t++)n+=r(e.zp[t]>>2,e.dq[t]);return n},this.predictorPole=function(e){return r(e.pp[1]>>2,e.sr[1])+r(e.pp[0]>>2,e.sr[0])},this.stepSize=function(e){var t=0,r=0,n=0;return e.ppp>=256?e.yu:(t=e.yl>>6,r=e.yu-t,n=e.ppp>>2,r>0?t+=r*n>>6:r<0&&(t+=r*n+63>>6),t)},this.quantize=function(r,n,o,a){var i,u,c;return i=Math.abs(r),u=t(i>>1,e,15),c=t((u<<7)+(i<<7>>u&127)-(n>>2),o,a),r<0?1+(a<<1)-c:0===c?1+(a<<1):c},this.reconstruct=function(e,t,r){var n,o=0;return(n=t+(r>>2))<0?e?-32768:0:(o=128+(127&n)<<7>>14-(n>>7&15),e?o-32768:o)},this.update=function(r,n,o,a,i,u,c,s){var f,p,l,d,y,h=0,g=0,m=0,v=0,b=0,T=0,w=0,A=0;if(y=c<0?1:0,g=32767&i,f=s.yl>>15,d=s.yl>>10&31,l=(p=f>9?31744:32+d<>1)>>1,A=0===s.td?0:g<=l?0:1,s.yu=n+(o-n>>5),s.yu<544?s.yu=544:s.yu>5120&&(s.yu=5120),s.yl+=s.yu+(-s.yl>>6),1===A)s.pp[0]=0,s.pp[1]=0,s.zp[0]=0,s.zp[1]=0,s.zp[2]=0,s.zp[3]=0,s.zp[4]=0,s.zp[5]=0,v=0;else for(T=y^s.pk[0],v=s.pp[1]-(s.pp[1]>>7),0!==c&&((w=T?s.pp[0]:-s.pp[0])<-8191?v-=256:v+=w>8191?255:w>>5,y^s.pk[1]?v<=-12160?v=-12288:v>=12416?v=12288:v-=128:v<=-12416?v=-12288:v>=12160?v=12288:v+=128),s.pp[1]=v,s.pp[0]-=s.pp[0]>>8,0!==c&&(0===T?s.pp[0]+=192:s.pp[0]-=192),b=15360-v,s.pp[0]<-b?s.pp[0]=-b:s.pp[0]>b&&(s.pp[0]=b),h=0;h<6;h++)s.zp[h]-=5===r?s.zp[h]>>9:s.zp[h]>>8,32767&i&&((i^s.dq[h])>=0?s.zp[h]+=128:s.zp[h]-=128);for(h=5;h>0;h--)s.dq[h]=s.dq[h-1];return 0===g?s.dq[0]=i>=0?32:64544:(m=t(g,e,15),s.dq[0]=i>=0?(m<<6)+(g<<6>>m):(m<<6)+(g<<6>>m)-1024),s.sr[1]=s.sr[0],0===u?s.sr[0]=32:u>0?(m=t(u,e,15),s.sr[0]=(m<<6)+(u<<6>>m)):u>-32768?(m=t(g=-u,e,15),s.sr[0]=(m<<6)+(g<<6>>m)-1024):s.sr[0]=64544,s.pk[1]=s.pk[0],s.pk[0]=y,s.td=1===A?0:v<-11776?1:0,s.dms+=a-s.dms>>5,s.dml+=(a<<2)-s.dml>>7,1===A?s.ppp=256:n<1536?s.ppp+=512-s.ppp>>4:1===s.td?s.ppp+=512-s.ppp>>4:Math.abs((s.dms<<2)-s.dml)>=s.dml>>3?s.ppp+=512-s.ppp>>4:s.ppp+=-s.ppp>>4,s}}var u=function(e){var t=132,r=128,n=15,o=4,a=112;function i(e){var i=0,u=~e;return i=((u&n)<<3)+t,i<<=(u&a)>>o,u&r?t-i:i-t}function u(e){var t,i=0;switch(i=((e^=85)&n)<<4,t=(e&a)>>o){case 0:i+=8;break;case 1:i+=264;break;default:i+=264,i<<=t-1}return e&r?i:-i}function c(){}return c.prototype={decode:function(t){var r=new Uint8Array(t),n=new Int16Array(r.length),o=0;if("G.711A"==e)for(o=0;o>1,f=c+a.predictorPole(o)>>1,p=a.stepSize(o),y=(d=(l=a.reconstruct(2&h,t[h],p))<0?f-(16383&l):f+l)-f+s,o=a.update(2,p,r[h],n[h],l,d,y,o),g){case e:return d<<2;default:return-1}}function c(){a=new i,o=a.g726InitState()}return c.prototype={decode:function(t){for(var r=new Int16Array(4*t.length),n=0,o=0;n>6,e),r[o]=65280&a,o++,a=u(t[n]>>4,e),r[o]=65280&a,o++,a=u(t[n]>>2,e),r[o]=65280&a,o++,a=u(t[n],e),r[o]=65280&a,o++}return r}},new c}function s(){var e=3,t=[-2048,135,273,373,373,273,135,-2048],r=[-128,960,4384,18624,18624,4384,960,-128],n=[0,512,1024,3584,3584,1024,512,0],o={},a=null;function u(i,u){var c,s,f,p,l,d,y,h=i,g=u;switch(h&=7,s=(c=a.predictorZero(o))>>1,f=c+a.predictorPole(o)>>1,p=a.stepSize(o),y=(d=(l=a.reconstruct(4&h,t[h],p))<0?f-(16383&l):f+l)-f+s,o=a.update(3,p,r[h],n[h],l,d,y,o),g){case e:return d<<2;default:return-1}}function c(){a=new i,o=a.g726InitState()}return c.prototype={decode:function(t){for(var r=new Int16Array(8*t.length/3),n=0,o=0;n>5,e),r[o]=65280&a,o++,a=u(t[n]>>2,e),r[o]=65280&a,o++,a=u(t[n]<<1|t[n+1]>>7,e),r[o]=65280&a,o++,a=u(t[n+1]>>4,e),r[o]=65280&a,o++,a=u(t[n+1]>>1,e),r[o]=65280&a,o++,a=u(t[n+1]<<2|t[n+2]>>6,e),r[o]=65280&a,o++,a=u(t[n+2]>>3,e),r[o]=65280&a,o++,a=u(t[n+2]>>0,e),r[o]=65280&a,o++}return r}},new c}function f(){var e=3,t=[-2048,4,135,213,273,323,373,425,425,373,323,273,213,135,4,-2048],r=[-12,18,41,64,112,198,355,1122,1122,355,198,112,64,41,18,-12],n=[0,0,0,512,512,512,1536,3584,3584,1536,512,512,512,0,0,0],o={},a=null;function u(i,u){var c,s,f,p,l,d,y,h=0,g=i,m=u;switch(g&=15,s=(c=a.predictorZero(o))>>1,f=c+a.predictorPole(o)>>1,p=a.stepSize(o),y=(d=(l=a.reconstruct(8&g,t[g],p))<0?f-(16383&l):f+l)-f+s,o=a.update(4,p,r[g]<<5,n[g],l,d,y,o),m){case e:return h=(h=(h=d<<2)>32767?32767:h)<-32768?-32768:h;default:return-1}}function c(){a=new i,o=a.g726InitState()}return c.prototype={decode:function(t){for(var r=new Int16Array(2*t.length),n=0,o=0;n>4,e),r[o]=65280&a,o++,a=u(15&t[n],e),r[o]=65280&a,o++}return r}},new c}function p(){var e=3,t=[-2048,-66,28,104,169,224,274,318,358,395,429,459,488,514,539,566,566,539,514,488,459,429,395,358,318,274,224,169,104,28,-66,-2048],r=[448,448,768,1248,1280,1312,1856,3200,4512,5728,7008,8960,11456,14080,16928,22272,22272,16928,14080,11456,8960,7008,5728,4512,3200,1856,1312,1280,1248,768,448,448],n=[0,0,0,0,0,512,512,512,512,512,1024,1536,2048,2560,3072,3072,3072,3072,2560,2048,1536,1024,512,512,512,512,512,0,0,0,0,0],o={},a=null;function u(i,u){var c,s,f,p,l,d,y,h=i,g=u;switch(h&=31,s=(c=a.predictorZero(o))>>1,f=c+a.predictorPole(o)>>1,p=a.stepSize(o),y=(l=(d=a.reconstruct(16&h,t[h],p))<0?f-(32767&d):f+d)-f+s,o=a.update(5,p,r[h],n[h],d,l,y,o),g){case e:return l<<2;default:return-1}}function c(){a=new i,o=a.g726InitState()}return c.prototype={decode:function(t){for(var r=new Int16Array(1.6*t.length),n=0,o=0;n>3,e),r[o]=65280&a,o++,a=u(t[n]<<2|t[n+1]>>6,e),r[o]=65280&a,o++,a=u(t[n+1]>>1,e),r[o]=65280&a,o++,a=u(t[n+1]<<4|t[n+2]>>4,e),r[o]=65280&a,o++,a=u(t[n+2]<<1|t[n+3]>>7,e),r[o]=65280&a,o++,a=u(t[n+3]>>2,e),r[o]=65280&a,o++,a=u(t[n+3]<<3|t[n+4]>>5,e),r[o]=65280&a,o++,a=u(t[n+4]>>0,e),r[o]=65280&a,o++}return r}},new c}var l=function(e){var t=null;switch(e){case 16:t=new c;break;case 24:t=new s;break;case 32:t=new f;break;case 40:t=new p;break;default:debug.log("wrong bits")}return t},d={"mpeg4-generic":86018,"G.723":86068,"G.729":86069,mpeg2:86016,"G.722.1":69660};function y(e){e=new Int16Array(e.buffer);for(var t=new Float32Array(e.length),r=0;r>>0),p=Date.UTC("20"+(f>>26),(f>>22&15)-1,f>>17&31,f>>12&31,f>>6&63,63&f)/1e3;if(p-=28800,0==this.firstTime)this.firstTime=p,this.lastMSW=0,o=(t[21]<<8)+t[20],i.seconds=p,i.useconds=0;else{var l,d=(t[21]<<8)+t[20];l=d>o?d-o:d+65535-o,this.lastMSW+=l,p>this.firstTime&&(this.lastMSW-=1e3),this.firstTime=p,i.seconds=p,i.useconds=this.lastMSW,o=d}var y=u.decode(s);return{codec:"AAC",audio_type:a.audio_type,bufferData:y,rtpTimeStamp:1e3*i.seconds+i.useconds,samplingRate:r}},setCodecInfo:function(e){a.log("Set codec info. for AAC"),e.config,n=e.bitrate,r=e.ClockFreq},getCodecInfo:function(){return{bitrate:n,clockFreq:r}}},new c};importScripts("./../module/ffmpegasm.js"),Module.onRuntimeInitialized=function(){Module._RegisterAll(),w("WorkerReady")},addEventListener("message",function(e){var t=e.data;switch(t.type){case"sdpInfo":v=t.data.sdpInfo;t.data.aacCodecInfo;!function(e,t){for(var r=e,n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r={type:e,codec:t.codec,audio_type:t.audio_type,data:t.bufferData,rtpTimeStamp:t.rtpTimeStamp,samplingRate:t.samplingRate||8e3};if("render"===e)postMessage(r,[t.bufferData.buffer]);else if("backup"===e){postMessage({type:e,data:t})}else postMessage(r)}}]);