jessibuca-pro-mp4-recorder-demo.js 22.9 KB
!function(r){"function"==typeof define&&define.amd?define(r):r()}(function(){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function t(r,e){return r(e={exports:{}},e.exports),e.exports}var n=Object.freeze({__proto__:null,commonjsGlobal:r,commonjsRequire:function(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")},unwrapExports:e,createCommonjsModule:t,getCjsExportFromNamespace:function(r){return r&&r.default||r}});function o(r,e){var t=a();return(o=function(r,e){return t[r-=256]})(r,e)}function a(){var r=["17109EmLaYl","default","10HPjHgK","23859055xzvrrb","__esModule","42980MCEcbw","484BYGzhh","2752614wQMSfg","186cyXVvn","334FNnSgl","772136uVXDlw","3671ZfYPZB","8503600QJNvzR","exports"];return(a=function(){return r})()}!function(r){for(var e=o,t=r();;)try{if(741312===-parseInt(e(263))/1*(-parseInt(e(261))/2)+-parseInt(e(266))/3*(parseInt(e(258))/4)+-parseInt(e(257))/5*(-parseInt(e(260))/6)+-parseInt(e(264))/7+-parseInt(e(262))/8+parseInt(e(259))/9*(-parseInt(e(268))/10)+parseInt(e(269))/11)break;t.push(t.shift())}catch(r){t.push(t.shift())}}(a);var i=e(t(function(r){var e=o;r[e(265)]=function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")},r[e(265)][e(256)]=!0,r[e(265)][e(267)]=r[e(265)]})),s=p;function u(){var r=["__esModule","createCommonjsModule","7XGyiyY","writable","27FXSBcx","exports","3BrkiQW","1739990hOhRyY","641596kuVdck","prototype","configurable","key","unwrapExports","defineProperty","545IkeLag","default","785172oXfgIa","550790yGkZzi","enumerable","1073484BEzqXY","38FopUHR","569808GRaUlL","11GTinnW"];return(u=function(){return r})()}!function(r){for(var e=p,t=r();;)try{if(148170===parseInt(e(334))/1*(-parseInt(e(340))/2)+parseInt(e(326))/3*(-parseInt(e(328))/4)+-parseInt(e(337))/5+parseInt(e(336))/6*(parseInt(e(345))/7)+-parseInt(e(341))/8*(-parseInt(e(347))/9)+parseInt(e(327))/10+parseInt(e(342))/11*(-parseInt(e(339))/12))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(u);var c=n[s(344)](function(r){var e=s;function t(r,e){for(var t=p,n=0;n<e.length;n++){var o=e[n];o[t(338)]=o[t(338)]||!1,o[t(330)]=!0,"value"in o&&(o[t(346)]=!0),Object[t(333)](r,o[t(331)],o)}}r[e(325)]=function(r,e,n){var o=p;return e&&t(r[o(329)],e),n&&t(r,n),Object[o(333)](r,"prototype",{writable:!1}),r},r.exports[e(343)]=!0,r[e(325)][e(335)]=r.exports}),f=n[s(332)](c);function p(r,e){var t=u();return(p=function(r,e){return t[r-=325]})(r,e)}var d=I;!function(r){for(var e=I,t=r();;)try{if(486637===-parseInt(e(427))/1+-parseInt(e(420))/2+parseInt(e(431))/3+-parseInt(e(421))/4+parseInt(e(425))/5+-parseInt(e(430))/6*(parseInt(e(428))/7)+parseInt(e(433))/8)break;t.push(t.shift())}catch(r){t.push(t.shift())}}(l);var v=n[d(432)](function(r){var e=d;function t(e){var n=I;return r[n(418)]=t=n(429)==typeof Symbol&&n(419)==typeof Symbol[n(423)]?function(r){return typeof r}:function(r){var e=n;return r&&e(429)==typeof Symbol&&r[e(422)]===Symbol&&r!==Symbol[e(426)]?e(419):typeof r},r[n(418)][n(424)]=!0,r.exports[n(417)]=r[n(418)],t(e)}r.exports=t,r[e(418)][e(424)]=!0,r[e(418)][e(417)]=r[e(418)]}),h=n[d(434)](v);function l(){var r=["12120024iSsPWG","unwrapExports","default","exports","symbol","787096lQzVMd","2483028mQhvcI","constructor","iterator","__esModule","2546810cFysVy","prototype","873447ERlfzS","1266762bIGxpo","function","6nVtoXo","1592970wKKChG","createCommonjsModule"];return(l=function(){return r})()}function I(r,e){var t=l();return(I=function(r,e){return t[r-=417]})(r,e)}function b(){var r=["1pVqiLy","__esModule","unwrapExports","this hasn't been initialised - super() hasn't been called","4743630ZjklTv","388436SzyGCk","default","412980JOiVzX","exports","3481584doEYjg","27xaYnyk","1369254keTNdx","743165kGFyTE","24GORtiQ","992495ABurFO"];return(b=function(){return r})()}var y=m;function m(r,e){var t=b();return(m=function(r,e){return t[r-=229]})(r,e)}!function(r){for(var e=m,t=r();;)try{if(680133===-parseInt(e(238))/1*(-parseInt(e(234))/2)+-parseInt(e(233))/3*(parseInt(e(243))/4)+parseInt(e(235))/5*(parseInt(e(236))/6)+parseInt(e(237))/7+-parseInt(e(232))/8+parseInt(e(242))/9+parseInt(e(230))/10)break;t.push(t.shift())}catch(r){t.push(t.shift())}}(b);var g=t(function(r){var e=m;r[e(231)]=function(r){if(void 0===r)throw new ReferenceError(m(241));return r},r[e(231)][e(239)]=!0,r.exports[e(229)]=r[e(231)]});n[y(240)](g);var w=_;function k(){var r=["function","19xXawLp","12uCwgIE","6VOoyer","11VArNrv","42764hDYQhr","object","unwrapExports","default","219GEFnyY","45TpxQxu","16779971uphigO","135420YSApRJ","868880LHgGnp","7342660atOuJT","createCommonjsModule","exports","Derived constructors may only return object or undefined","__esModule","32774LmPNFc","4266059SdDayJ"];return(k=function(){return r})()}!function(r){for(var e=_,t=r();;)try{if(430540===-parseInt(e(148))/1*(-parseInt(e(145))/2)+parseInt(e(135))/3*(-parseInt(e(131))/4)+parseInt(e(138))/5+parseInt(e(150))/6*(-parseInt(e(146))/7)+-parseInt(e(139))/8*(parseInt(e(136))/9)+-parseInt(e(140))/10*(-parseInt(e(130))/11)+-parseInt(e(149))/12*(-parseInt(e(137))/13))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(k);var E=n[w(141)](function(r){var e=w,t=v[e(134)];r[e(142)]=function(r,n){var o=e;if(n&&(t(n)===o(132)||typeof n===o(147)))return n;if(void 0!==n)throw new TypeError(o(143));return g(r)},r[e(142)][e(144)]=!0,r[e(142)][e(134)]=r.exports}),R=n[w(133)](E);function _(r,e){var t=k();return(_=function(r,e){return t[r-=130]})(r,e)}function x(){var r=["2128689eGQVZz","__proto__","4767eobldq","9081PzHGIg","17930XgeTNE","347642zDhPCL","__esModule","getPrototypeOf","892650PXXFdl","603474Bbveit","setPrototypeOf","unwrapExports","5624oHiEJd","1156425NshrHk","default","createCommonjsModule","bind","exports","8OPqbEf"];return(x=function(){return r})()}var T=j;function j(r,e){var t=x();return(j=function(r,e){return t[r-=348]})(r,e)}!function(r){for(var e=j,t=r();;)try{if(916485===parseInt(e(350))/1+-parseInt(e(353))/2+-parseInt(e(364))/3+-parseInt(e(363))/4*(parseInt(e(358))/5)+-parseInt(e(354))/6+parseInt(e(366))/7*(parseInt(e(357))/8)+-parseInt(e(348))/9*(-parseInt(e(349))/10))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(x);var A=n[T(360)](function(r){var e=T;function t(e){var n=j;return r[n(362)]=t=Object[n(355)]?Object[n(352)][n(361)]():function(r){var e=n;return r[e(365)]||Object[e(352)](r)},r[n(362)][n(351)]=!0,r[n(362)].default=r.exports,t(e)}r[e(362)]=t,r[e(362)][e(351)]=!0,r[e(362)][e(359)]=r[e(362)]}),M=n[T(356)](A);function G(){var r=["exports","6EUtvbG","382629ysjTkh","4213PHUbIT","3730560MKsTiZ","29IPAZyQ","16swxwUh","bind","79676cJfUNg","7772751cnGCgM","setPrototypeOf","default","5565480wPOPjt","882468TqiIOd","34990gEdoWy"];return(G=function(){return r})()}function O(r,e){var t=G();return(O=function(r,e){return t[r-=102]})(r,e)}!function(r){for(var e=O,t=r();;)try{if(888257===parseInt(e(103))/1*(-parseInt(e(106))/2)+-parseInt(e(115))/3+parseInt(e(110))/4+parseInt(e(102))/5+parseInt(e(114))/6*(-parseInt(e(107))/7)+-parseInt(e(104))/8*(parseInt(e(111))/9)+parseInt(e(112))/10*(parseInt(e(116))/11))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(G);var P=t(function(r){var e=O;function t(e,n){var o=O;return r[o(113)]=t=Object[o(108)]?Object[o(108)][o(105)]():function(r,e){return r.__proto__=e,r},r[o(113)].__esModule=!0,r[o(113)][o(109)]=r[o(113)],t(e,n)}r[e(113)]=t,r[e(113)].__esModule=!0,r[e(113)][e(109)]=r[e(113)]});e(P);var S=F;function N(){var r=["3434000HULfQg","9808050kqilcb","5503PpfybS","function","Super expression must either be null or a function","createCommonjsModule","298beeJDk","366XKwzNu","__esModule","create","1221776FPjuQZ","10473363rvwGqJ","20195wmxjjA","defineProperty","11xPlBjZ","unwrapExports","2992050ZbjSJR","exports","7ehYOcp","default","prototype"];return(N=function(){return r})()}function F(r,e){var t=N();return(F=function(r,e){return t[r-=261]})(r,e)}!function(r){for(var e=F,t=r();;)try{if(759344===parseInt(e(270))/1*(-parseInt(e(274))/2)+parseInt(e(263))/3+parseInt(e(268))/4+parseInt(e(280))/5*(-parseInt(e(275))/6)+parseInt(e(265))/7*(parseInt(e(278))/8)+-parseInt(e(279))/9+parseInt(e(269))/10*(parseInt(e(261))/11))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(N);var L=n[S(273)](function(r){var e=S;r[e(264)]=function(r,e){var t=F;if(typeof e!==t(271)&&null!==e)throw new TypeError(t(272));r[t(267)]=Object[t(277)](e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object[t(281)](r,"prototype",{writable:!1}),e&&P(r,e)},r[e(264)][e(276)]=!0,r[e(264)][e(266)]=r[e(264)]}),C=n[S(262)](L);!function(r){for(var e=V,t=r();;)try{if(937097===-parseInt(e(181))/1*(parseInt(e(174))/2)+-parseInt(e(186))/3*(-parseInt(e(173))/4)+-parseInt(e(177))/5*(-parseInt(e(172))/6)+parseInt(e(183))/7*(parseInt(e(190))/8)+-parseInt(e(185))/9+parseInt(e(188))/10*(-parseInt(e(180))/11)+-parseInt(e(175))/12*(-parseInt(e(178))/13))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(W);var D,J=f(function r(){i(this,r)},[{key:"on",value:function(r,e,t){var n=this.e||(this.e={});return(n[r]||(n[r]=[])).push({fn:e,ctx:t}),this}},{key:(D=V)(192),value:function(r,e,t){var n=this;function o(){var a=V;n[a(179)](r,o);for(var i=arguments.length,s=new Array(i),u=0;u<i;u++)s[u]=arguments[u];e[a(176)](t,s)}return o._=e,this.on(r,o,t)}},{key:D(187),value:function(r){for(var e=D,t=((this.e||(this.e={}))[r]||[])[e(193)](),n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];for(var i=0;i<t[e(184)];i+=1)t[i].fn[e(176)](t[i].ctx,o);return this}},{key:D(179),value:function(r,e){var t=D,n=this.e||(this.e={});if(!r)return Object[t(191)](n)[t(182)](function(r){delete n[r]}),void delete this.e;var o=n[r],a=[];if(o&&e)for(var i=0,s=o.length;i<s;i+=1)o[i].fn!==e&&o[i].fn._!==e&&a[t(189)](o[i]);return a[t(184)]?n[r]=a:delete n[r],this}}]);function V(r,e){var t=W();return(V=function(r,e){return t[r-=172]})(r,e)}function W(){var r=["forEach","28ncWOmk","length","776880hdPieo","763953PGwQFR","emit","38540oFrLeB","push","3411832WJoEGF","keys","once","slice","4300512aSkVtO","12EDbCFd","9414iLSbCe","12QIieSt","apply","10WTgMzg","1625221fsBFcU","off","4103zWGqEU","333ZcEkLl"];return(W=function(){return r})()}var Q=U;function U(r,e){var t=H();return(U=function(r,e){return t[r-=493]})(r,e)}!function(r){for(var e=U,t=r();;)try{if(276190===-parseInt(e(506))/1+-parseInt(e(511))/2*(-parseInt(e(505))/3)+-parseInt(e(500))/4*(-parseInt(e(498))/5)+-parseInt(e(503))/6+-parseInt(e(497))/7+-parseInt(e(501))/8+-parseInt(e(507))/9*(-parseInt(e(509))/10))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(H);var z={debug:Q(494),warn:"warn"},B={debug:!1,debugLevel:z[Q(496)],debugUuid:"",decoder:Q(499)},X={init:Q(510),startRecord:"startRecord",stopRecord:"stopRecord",videoFrame:"videoFrame",audioFrame:"audioFrame",destroy:"destroy"};function H(){var r=["3LHTgeN","13906kfmvjx","252WnqOpH","load","255590UpRQRe","init","56402PrjbDW","startRecordSuccess","stopRecordError","recordingTimestamp","debug","recordTimestamp","warn","1006999wwEvJj","5qLdwrP","jessibuca-pro-mp4-recorder-decoder.js","299528IQVhVS","2023504RDkrHn","startRecordError","791064nENZhz","recordEnd"];return(H=function(){return r})()}var Z={init:Q(510),startRecordError:"startRecordError",startRecordSuccess:"startRecordSuccess",recordEnd:Q(504),stopRecordError:Q(513),recordTimestamp:Q(495),destroyEnd:"destroyEnd"},Y={load:Q(508),workerError:"workerError",startRecordSuccess:Q(512),startRecordError:Q(502),stopRecordError:Q(513),recordEnd:Q(504),recordingTimestamp:Q(493)};function q(r,e){var t=er();return(q=function(r,e){return t[r-=142]})(r,e)}function K(r){return null==r}function $(){return function(r){var e=q,t="";if(h(r)===e(143))try{t=JSON.stringify(r),t=JSON.parse(t)}catch(e){t=r}else t=r;return t}(B)}function rr(r){return!0!==r&&"true"!==r}function er(){var r=["1673316kRdDNH","12173ILTyiT","5758555wOfkGy","true","333QCZTHe","144DsEFvC","201KSoPnk","929625pSZTpA","10noVCNb","514ByJpPb","object","3020djpkMP","901956QRtBvv"];return(er=function(){return r})()}function tr(r,e){var t=or();return(tr=function(r,e){return t[r-=250]})(r,e)}!function(r){for(var e=q,t=r();;)try{if(103534===parseInt(e(150))/1*(parseInt(e(142))/2)+-parseInt(e(152))/3*(-parseInt(e(144))/4)+parseInt(e(153))/5+parseInt(e(145))/6+parseInt(e(147))/7*(-parseInt(e(151))/8)+parseInt(e(146))/9+parseInt(e(154))/10*(-parseInt(e(148))/11))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(er),function(r){for(var e=tr,t=r();;)try{if(321358===-parseInt(e(256))/1+-parseInt(e(258))/2*(-parseInt(e(251))/3)+-parseInt(e(252))/4+-parseInt(e(265))/5*(-parseInt(e(273))/6)+parseInt(e(270))/7+parseInt(e(259))/8*(-parseInt(e(250))/9)+-parseInt(e(269))/10)break;t.push(t.shift())}catch(r){t.push(t.shift())}}(or);var nr=f(function r(e){var t=tr;i(this,r),this.log=function(r){var t=tr;if(e[t(268)][t(263)]&&e[t(268)][t(260)]==z[t(263)]){for(var n,o=e[t(268)].debugUuid?"["[t(253)](e[t(268)][t(261)],"]"):"",a=arguments[t(262)],i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];(n=console)[t(264)][t(257)](n,[t(254)[t(253)](o,t(271))[t(253)](r,"]")][t(253)](i))}},this.warn=function(r){var t=tr;if(e[t(268)][t(263)]&&(e[t(268)][t(260)]==z[t(263)]||e[t(268)].debugLevel==z[t(267)])){for(var n,o=e[t(268)][t(261)]?"[".concat(e[t(268)][t(261)],"]"):"",a=arguments.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];(n=console)[t(264)][t(257)](n,[t(254)[t(253)](o,t(266))[t(253)](r,"]")][t(253)](i))}},this[t(255)]=function(r){for(var n,o=t,a=e[o(268)][o(261)]?"[".concat(e._opt.debugUuid,"]"):"",i=arguments[o(262)],s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];(n=console).error[o(257)](n,["JbPro"[o(253)](a,o(272)).concat(r,"]")].concat(s))}});function or(){var r=["32HBUXGx","debugLevel","debugUuid","length","debug","log","436385jgBQhB","[❗❗❗][wasmMp4Recorder][","warn","_opt","4951870kywdto","1181390EcmVzV","[✅✅✅][wasmMp4Recorder][","[❌❌❌][wasmMp4Recorder][","42xGAVhK","379548uKNdSx","1773BVLKfJ","579948lTGXwr","concat","JbPro","error","105150ZIKppE","apply","1542wtoQUn"];return(or=function(){return r})()}function ar(r,e){var t=ir();return(ar=function(r,e){return t[r-=378]})(r,e)}function ir(){var r=["off","construct","startRecord","sendAudioFrame","18QtOlFT","onmessage","988680CEEWas","stopRecord","startRecordError","debugLog","5823041hPblww","stringify","_opt","3165768fomGwt","_initDecoderWorker","destroy","data","stopRecordError","_initWorker","init","TAG_NAME","500853VtguRL","videoFrame","postMessage","emit","cmd","sendVideoFrame","debug","onmessageerror:","apply","mp4Recorder","500213LUqzxA","2TAyvlC","DecoderWorker","prototype","debugUuid","onerror","decoderWorker","recordEnd","onmessageerror","call","workerError","20mmCULh","8276052CljXoo","debugError","msg","buildTime","22625690anRovv","recordingTimestamp","startRecordSuccess"];return(ir=function(){return r})()}function sr(){var r=ar;try{var e=!Boolean[r(381)].valueOf[r(387)](Reflect[r(398)](Boolean,[],function(){}))}catch(r){}return(sr=function(){return!!e})()}!function(r){for(var e=ar,t=r();;)try{if(876884===-parseInt(e(378))/1*(parseInt(e(379))/2)+-parseInt(e(418))/3*(-parseInt(e(389))/4)+-parseInt(e(403))/5+parseInt(e(390))/6+parseInt(e(407))/7+parseInt(e(410))/8*(parseInt(e(401))/9)+-parseInt(e(394))/10)break;t.push(t.shift())}catch(r){t.push(t.shift())}}(ir);var ur=function(r){var e=ar;function t(r){var e,n,o,a,s,u=ar;i(this,t),n=this,s=ar,o=M(o=t),(e=R(n,sr()?Reflect[s(398)](o,a||[],M(n).constructor):o[s(426)](n,a)))[u(427)]=r,e[u(417)]=u(380);var c=r[u(409)].decoder;return e[u(384)]=new Worker(c),e._initDecoderWorker(),r[u(406)](e[u(417)],"init"),e}return C(t,r),f(t,[{key:"destroy",value:function(){var r=ar;this[r(397)](),this[r(384)]&&(this[r(384)][r(420)]({cmd:X.destroy}),this[r(384)][r(402)]=null,this[r(384)].onerror=null,this[r(384)][r(386)]=null,this[r(384)].terminate(),this[r(384)]=null),this[r(427)].debugLog(this.TAG_NAME,r(412))}},{key:e(411),value:function(){var r=e,t=this;this[r(427)][r(424)],this[r(384)][r(383)]=function(e){var n=r;t[n(427)].debugError(t[n(417)],"onerror:",e),t[n(421)](Y[n(388)],e)},this[r(384)][r(386)]=function(e){var n=r;t[n(427)][n(391)](t.TAG_NAME,n(425),e)},this[r(384)][r(402)]=function(e){var n=r,o=e[n(413)];switch(o[n(422)]){case Z[n(416)]:t[n(427)][n(406)](t[n(417)],"onmessage:",Z[n(416)]),t.decoderWorker&&t[n(415)](),t[n(421)](Y.load);break;case Z[n(405)]:t[n(421)](Y[n(405)]);break;case Z[n(396)]:t.emit(Y[n(396)]);break;case Z.stopRecordError:t[n(421)](Y[n(414)]);break;case Z[n(385)]:t[n(421)](Y.recordEnd,o.data);break;case Z.recordTimestamp:t.emit(Y[n(395)],o[n(392)])}}}},{key:"_initWorker",value:function(){var r=e,t={debug:this[r(427)]._opt.debug,debugLevel:this.mp4Recorder[r(409)].debugLevel,debugUuid:this[r(427)][r(409)][r(382)]};this.decoderWorker[r(420)]({cmd:X[r(416)],opt:JSON[r(408)](t)})}},{key:e(423),value:function(r,t,n,o){var a=e;this[a(384)].postMessage({cmd:X[a(419)],data:r,isIFrame:t,dts:n,pts:o},[r.buffer])}},{key:e(400),value:function(r,t){var n=e;this[n(384)][n(420)]({cmd:X.audioFrame,data:r,ts:t},[r.buffer])}},{key:e(399),value:function(r){var t=e;this[t(384)][t(420)]({cmd:X[t(399)],streamInfo:r,buildTime:this[t(427)][t(393)]})}},{key:"stopRecord",value:function(){var r=e;this.decoderWorker.postMessage({cmd:X[r(404)]})}}])}(J),cr=dr;function fr(){var r=["warn","6608YCCyZx","startTimestamp","now","recordEnd","sendVideoFrame","init","debugLog","video type can not be undefined","originalOptions","debugError","  ","stringify","length","recordingTimestamp","buffer","sendAudioFrame","name","audio","worker","10518gERgzG","assign","45avQbXM","keys","once","2091288ffYjuj","sampleRate","error","prototype","_opt",'JbProMp4Recorder option "',"height","debug","channels",'" can not be undefined',"type","video extraData can not be undefined","width","startRecordError","_destroyWorker","video and audio can not be false at the same time","24023650GgijQG","video width can not be undefined","video/mp4","audio type can not be undefined","1711199wYGzHt","3veIiXj","buildTime","126466aVSauU","extraData","6847024xFqObv","11ktUowD","startRecord","emit","constructor","_reset","Recorder","isRecording is false","log","1318300beSfyr","construct","audio depth can not be undefined","stopRecord","call","startRecordSuccess","load","apply","concat","stopRecordError","audio extraData can not be undefined","JessibucaProMp4Recorder","TAG_NAME","destroy","debugWarn","isRecording","video","_startRecord"];return(fr=function(){return r})()}function pr(){var r=dr;try{var e=!Boolean[r(319)].valueOf[r(277)](Reflect[r(274)](Boolean,[],function(){}))}catch(r){}return(pr=function(){return!!e})()}function dr(r,e){var t=fr();return(dr=function(r,e){return t[r-=252]})(r,e)}!function(r){for(var e=dr,t=r();;)try{if(886972===-parseInt(e(259))/1+parseInt(e(262))/2*(parseInt(e(260))/3)+parseInt(e(264))/4+parseInt(e(273))/5+-parseInt(e(311))/6*(-parseInt(e(292))/7)+-parseInt(e(316))/8*(-parseInt(e(313))/9)+-parseInt(e(255))/10*(parseInt(e(265))/11))break;t.push(t.shift())}catch(r){t.push(t.shift())}}(fr);var vr=function(r){var e=dr;function t(){var r,e,n,o,a,s=dr,u=arguments[s(304)]>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),e=this,a=dr,n=M(n=t),(r=R(e,pr()?Reflect[a(274)](n,o||[],M(e)[a(268)]):n[a(280)](e,o)))._opt={},Object[s(314)](u).forEach(function(r){var e=s;if(void 0===u[r])throw new Error(e(321).concat(r,e(325)))}),r[s(300)]=u;var c=$(),f=Object[s(312)]({},c,u);return r[s(320)]=f,r.isRecording=!1,r[s(261)]=f[s(308)]+"-"+f[s(261)],r.debug=new nr(r),r[s(310)]=null,r[s(293)]=null,r[s(285)]=s(270),r.debugLog(r.TAG_NAME,s(297),JSON.stringify(r[s(320)])),console[s(272)]("JbPro wasm mp4 recorder version is "[s(281)](u.buildTime,":").concat('"1.0.0"',s(302))),r}return C(t,r),f(t,[{key:e(286),value:function(){var r=e;this._reset(),this[r(253)]()}},{key:e(269),value:function(){var r=e;this.isRecording=!1,this[r(293)]=null}},{key:"_destroyWorker",value:function(){var r=e;this[r(310)]&&(this[r(310)][r(286)](),this[r(310)]=null)}},{key:e(266),value:function(){var r=e,t=this,n=arguments[r(304)]>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(e,o){var a=r;t[a(298)](t.TAG_NAME,a(266),JSON[a(303)](n));var i=!!n.audio,s=!!n[a(289)];if(rr(s)&&rr(i))return t.debugError(t.TAG_NAME,a(254)),void o("video and audio can not be false at the same time");if(i){if(K(n[a(309)][a(326)]))return t[a(301)](t.TAG_NAME,a(258)),void o(a(258));if(K(n[a(309)].extraData))return t.debugError(t[a(285)],a(283)),void o(a(283));if(K(n[a(309)][a(317)]))return t[a(301)](t[a(285)],a(283)),void o("audio extraData can not be undefined");if(K(n[a(309)][a(324)]))return t[a(301)](t[a(285)],"audio channels can not be undefined"),void o("audio channels can not be undefined");if(K(n.audio.depth))return t[a(301)](t[a(285)],a(275)),void o(a(275))}if(s){if(K(n[a(289)][a(326)]))return t[a(301)](t.TAG_NAME,a(299)),void o(a(299));if(K(n.video[a(263)]))return t.debugError(t.TAG_NAME,"video extraData can not be undefined"),void o(a(327));if(K(n[a(289)][a(328)]))return t[a(301)](t[a(285)],a(256)),void o(a(256));if(K(n.video[a(322)]))return t[a(301)](t[a(285)],"video height can not be undefined"),void o("video height can not be undefined")}t[a(310)]?t[a(290)](n,e,o):(t[a(310)]=new ur(t),t[a(310)].once(Y[a(279)],function(){t[a(290)](n,e,o),t.startTimestamp=Date.now()}),t[a(310)].once(Y.workerError,function(r){o(r)}),t[a(310)].on(Y.recordingTimestamp,function(r){var e=a;t[e(267)](Y[e(305)],r)}))})}},{key:e(290),value:function(){var r=e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;this[r(310)][r(266)](n),this[r(310)][r(315)](Y[r(252)],function(e){var n=r;t.debugError(t[n(285)],n(252),e),a(e)}),this[r(310)][r(315)](Y[r(278)],function(){var e=r;t[e(288)]=!0,t[e(298)](t.TAG_NAME,e(278)),o()})}},{key:e(276),value:function(){var r=this;return new Promise(function(e,t){var n=dr;r[n(298)](r[n(285)],n(276)),rr(r.isRecording)&&(r[n(253)](),r[n(301)](r.TAG_NAME,"isRecording is false"),t(n(271))),r.isRecording=!1,r[n(310)][n(276)](),r[n(310)][n(315)](Y[n(282)],function(e){var o=n;r[o(253)](),r[o(301)](r[o(285)],o(282),e),t(e)}),r[n(310)][n(315)](Y[n(295)],function(t){var o=n;r[o(253)](),r[o(298)](r[o(285)],o(295));var a=new Blob([t[o(306)]],{type:o(257)});e(a)})})}},{key:e(296),value:function(r,t,n,o){var a=e;if(this[a(288)]&&this[a(310)]){if(Date[a(294)]()-this.startTimestamp>6e5)return;var i=n+o;this[a(310)][a(296)](r,t,n,i)}}},{key:"sendAudioFrame",value:function(r,t){var n=e;if(this[n(288)]&&this[n(310)]){if(Date[n(294)]()-this[n(293)]>6e5)return;this.worker[n(307)](r,t)}}},{key:e(298),value:function(r){var t=e;if(this[t(320)][t(323)]&&this[t(323)]){for(var n,o=arguments[t(304)],a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];(n=this[t(323)])[t(272)].apply(n,[r].concat(a))}}},{key:e(287),value:function(r){var t=e;if(this._opt[t(323)]&&this[t(323)]){for(var n,o=arguments[t(304)],a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];(n=this[t(323)])[t(291)][t(280)](n,[r][t(281)](a))}}},{key:e(301),value:function(r){var t=e;if(this.debug){for(var n,o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];(n=this[t(323)])[t(318)][t(280)](n,[r][t(281)](a))}}}])}(J);window[cr(284)]=vr});