trtc-sdk-v5 5.9.0-beta.4 → 5.9.0-wasm.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/av_processing.wasm +0 -0
- package/assets/videodec.wasm +0 -0
- package/assets/videodec_simd.wasm +0 -0
- package/assets/worker.js +17 -0
- package/index.d.ts +0 -1
- package/package.json +4 -6
- package/plugins/cdn-streaming/package.json +1 -1
- package/plugins/cross-room/package.json +1 -1
- package/plugins/custom-encryption/custom-encryption.esm.d.ts +34 -0
- package/plugins/custom-encryption/custom-encryption.esm.js +36 -0
- package/plugins/custom-encryption/custom-encryption.iife.js +36 -0
- package/plugins/custom-encryption/package.json +7 -0
- package/plugins/device-detector/package.json +1 -1
- package/plugins/video-decoder/package.json +1 -1
- package/plugins/video-decoder/video-decoder.esm.js +1 -1
- package/plugins/video-decoder/video-decoder.iife.js +1 -1
- package/plugins/video-effect/basic-beauty/package.json +1 -1
- package/plugins/video-effect/beauty/package.json +1 -1
- package/plugins/video-effect/virtual-background/package.json +1 -1
- package/plugins/video-effect/watermark/package.json +1 -1
- package/trtc.esm.js +64 -41
- package/trtc.js +1 -1
|
@@ -40,4 +40,4 @@ return ret;
|
|
|
40
40
|
`;for(var E=0;E<i-1;++E)c[E+1].deleteObject&&(B+=" argType"+E+".deleteObject(arg"+E+`);
|
|
41
41
|
`);m.isVoid||(B+=` return retType.toWireType(destructors, rv);
|
|
42
42
|
`),B+=`};
|
|
43
|
-
`,T.push(B);var Y=Ot(Function,T).apply(null,b);return w=zn(Y),Gt[v]=w,w}var qn=()=>{or("")},qt;qt=()=>performance.now();var Xn=(i,o,c)=>J.copyWithin(i,o,o+c),Kn=i=>{or("OOM")},Jn=i=>{var o=J.length;i>>>=0,Kn(i)},Yn=[null,[],[]],Zn=(i,o)=>{var c=Yn[i];o===0||o===10?((i===1?lr:ae)(rr(c,0)),c.length=0):c.push(o)},at={varargs:void 0,get(){at.varargs+=4;var i=Pe[at.varargs-4>>2];return i},getStr(i){var o=Lt(i);return o}},Qn=(i,o,c,m)=>{for(var v=0,w=0;w<c;w++){var T=U[o>>2],b=U[o+4>>2];o+=8;for(var k=0;k<b;k++)Zn(i,J[T+k]);v+=b}return U[m>>2]=v,0};_n(),le=s.BindingError=class extends Error{constructor(o){super(o),this.name="BindingError"}},Ye=s.InternalError=class extends Error{constructor(o){super(o),this.name="InternalError"}},hr(),Kr(),gr(),$t=s.UnboundTypeError=kn(Error,"UnboundTypeError"),$n(),On();var ei={o:zr,r:bn,m:wn,q:Dn,p:rt,d:Ut,u:Un,k:Fn,b:Nn,a:Mn,j:Wt,g:Bn,n:Vn,e:zt,l:Ft,h:ot,f:qn,c:qt,t:Xn,s:Jn,i:Qn},li=gt(),ri=()=>(ri=ee.w)(),Fe=i=>(Fe=ee.x)(i),st=i=>(st=ee.y)(i),Xt=i=>(Xt=ee.A)(i),ti=s.__embind_initialize_bindings=()=>(ti=s.__embind_initialize_bindings=ee.B)(),ni=()=>(ni=ee.__errno_location)(),Kt=i=>(Kt=ee.C)(i),ut=s.dynCall_jiji=(i,o,c,m,v)=>(ut=s.dynCall_jiji=ee.D)(i,o,c,m,v),Ur;Ke=function i(){Ur||Jt(),Ur||(Ke=i)};function Jt(){if(Xe>0||(dn(),Xe>0))return;function i(){Ur||(Ur=!0,s.calledRun=!0,!Nr&&(fn(),y(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),pn()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),i()},1)):i()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return Jt(),p.ready}})(),Si=Xi;var un=class extends ze{constructor(p){super(Si,p!=null&&p.wasmPath?fetch(p.wasmPath).then(s=>s.arrayBuffer()):void 0,p==null?void 0:p.workerMode,p==null?void 0:p.canvas,p==null?void 0:p.yuvMode)}};var cn=class cn{constructor(p){this.core=p;_e(this,"contextMap",new Map);_e(this,"decodeProcessorMap",new WeakMap);this.createDecoder=this.createDecoder.bind(this)}getAlias(){return"videoDecoder"}getGroup(p){return p!=null&&p.track?`${p.track.userId}${p.track.streamType}`:"*"}getName(){return cn.Name}getValidateRule(p){return{type:this.core.enums.BASIC_TYPE.Object}}createDecoder(p,s){switch(p){case"wasm":return this.core.rtcDectection.isSIMDSupported()?new un(Er(wr({},s),{wasmPath:`${this.core.assetsPath}videodec_simd.wasm`})):new sn(Er(wr({},s),{wasmPath:`${this.core.assetsPath}videodec.wasm`}));case"webCodecs":return new ir;case"mse":throw new Error("mse decoder not supported yet");default:throw new Error("Unsupported decoder type")}}start(p){this.decodeProcessorMap.set(p.track,this.decode(p)),this.core.room.videoManager.addDecodeProcessor({processor:({frame:s,track:y})=>{var P;return((P=this.decodeProcessorMap.get(y))==null?void 0:P({frame:s,track:y}))||s},type:3})}decode(p){let{pipe:s,take:y,subscribe:P}=this.core.rx;return({frame:D,track:$})=>{if($!==p.track||D.type==="empty")return D;if(this.contextMap.has($))return this.contextMap.get($).decode(D);let j=this.core.room.videoManager.createDecodeContext(Er(wr({},p),{createDecoder:this.createDecoder}));return s(j.trackDoneOB,y(1),P(()=>{this.core.clearStarted(this,this.getGroup(p)),this.stop({track:$})})),this.contextMap.set($,j),j.decode(D)}}stop(p){if(!(p!=null&&p.track))this.contextMap.forEach((s,y)=>{s.close("stop"),this.contextMap.delete(y)});else{let s=this.contextMap.get(p.track);s&&(s.close("stop"),this.contextMap.delete(p.track))}this.contextMap.size===0&&this.core.room.videoManager.removeDecodeProcessor({type:3})}update(p){let s=this.contextMap.get(p.track);if(s){if(p.type==="mock"){s.mock(this.core.enums.DECODE_FAILED_ERROR_CODE.TEST);return}s.close("update"),this.contextMap.set(p.track,this.core.room.videoManager.createDecodeContext(Er(wr({},p),{createDecoder:this.createDecoder})))}}};_e(cn,"Name","TRTCVideoDecoder");var ui=cn;var Fo=ui;export{ui as VideoDecoderPlugin,Fo as default};
|
|
43
|
+
`,T.push(B);var Y=Ot(Function,T).apply(null,b);return w=zn(Y),Gt[v]=w,w}var qn=()=>{or("")},qt;qt=()=>performance.now();var Xn=(i,o,c)=>J.copyWithin(i,o,o+c),Kn=i=>{or("OOM")},Jn=i=>{var o=J.length;i>>>=0,Kn(i)},Yn=[null,[],[]],Zn=(i,o)=>{var c=Yn[i];o===0||o===10?((i===1?lr:ae)(rr(c,0)),c.length=0):c.push(o)},at={varargs:void 0,get(){at.varargs+=4;var i=Pe[at.varargs-4>>2];return i},getStr(i){var o=Lt(i);return o}},Qn=(i,o,c,m)=>{for(var v=0,w=0;w<c;w++){var T=U[o>>2],b=U[o+4>>2];o+=8;for(var k=0;k<b;k++)Zn(i,J[T+k]);v+=b}return U[m>>2]=v,0};_n(),le=s.BindingError=class extends Error{constructor(o){super(o),this.name="BindingError"}},Ye=s.InternalError=class extends Error{constructor(o){super(o),this.name="InternalError"}},hr(),Kr(),gr(),$t=s.UnboundTypeError=kn(Error,"UnboundTypeError"),$n(),On();var ei={o:zr,r:bn,m:wn,q:Dn,p:rt,d:Ut,u:Un,k:Fn,b:Nn,a:Mn,j:Wt,g:Bn,n:Vn,e:zt,l:Ft,h:ot,f:qn,c:qt,t:Xn,s:Jn,i:Qn},li=gt(),ri=()=>(ri=ee.w)(),Fe=i=>(Fe=ee.x)(i),st=i=>(st=ee.y)(i),Xt=i=>(Xt=ee.A)(i),ti=s.__embind_initialize_bindings=()=>(ti=s.__embind_initialize_bindings=ee.B)(),ni=()=>(ni=ee.__errno_location)(),Kt=i=>(Kt=ee.C)(i),ut=s.dynCall_jiji=(i,o,c,m,v)=>(ut=s.dynCall_jiji=ee.D)(i,o,c,m,v),Ur;Ke=function i(){Ur||Jt(),Ur||(Ke=i)};function Jt(){if(Xe>0||(dn(),Xe>0))return;function i(){Ur||(Ur=!0,s.calledRun=!0,!Nr&&(fn(),y(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),pn()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),i()},1)):i()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return Jt(),p.ready}})(),Si=Xi;var un=class extends ze{constructor(p){super(Si,p!=null&&p.wasmPath?fetch(p.wasmPath).then(s=>s.arrayBuffer()):void 0,p==null?void 0:p.workerMode,p==null?void 0:p.canvas,p==null?void 0:p.yuvMode)}};var cn=class cn{constructor(p){this.core=p;_e(this,"contextMap",new Map);_e(this,"decodeProcessorMap",new WeakMap);this.createDecoder=this.createDecoder.bind(this)}getAlias(){return"videoDecoder"}getGroup(p){return p!=null&&p.track?`${p.track.userId}${p.track.streamType}`:"*"}getName(){return cn.Name}getValidateRule(p){return{type:this.core.enums.BASIC_TYPE.Object}}createDecoder(p,s){switch(p){case"wasm":return this.core.rtcDectection.isSIMDSupported()?new un(Er(wr({},s),{wasmPath:`${this.core.assetsPath||"."}/videodec_simd.wasm`})):new sn(Er(wr({},s),{wasmPath:`${this.core.assetsPath||"."}/videodec.wasm`}));case"webCodecs":return new ir;case"mse":throw new Error("mse decoder not supported yet");default:throw new Error("Unsupported decoder type")}}start(p){this.decodeProcessorMap.set(p.track,this.decode(p)),this.core.room.videoManager.addDecodeProcessor({processor:({frame:s,track:y})=>{var P;return((P=this.decodeProcessorMap.get(y))==null?void 0:P({frame:s,track:y}))||s},type:3})}decode(p){let{pipe:s,take:y,subscribe:P}=this.core.rx;return({frame:D,track:$})=>{if($!==p.track||D.type==="empty")return D;if(this.contextMap.has($))return this.contextMap.get($).decode(D);let j=this.core.room.videoManager.createDecodeContext(Er(wr({},p),{createDecoder:this.createDecoder}));return s(j.trackDoneOB,y(1),P(()=>{this.core.clearStarted(this,this.getGroup(p)),this.stop({track:$})})),this.contextMap.set($,j),j.decode(D)}}stop(p){if(!(p!=null&&p.track))this.contextMap.forEach((s,y)=>{s.close("stop"),this.contextMap.delete(y)});else{let s=this.contextMap.get(p.track);s&&(s.close("stop"),this.contextMap.delete(p.track))}this.contextMap.size===0&&this.core.room.videoManager.removeDecodeProcessor({type:3})}update(p){let s=this.contextMap.get(p.track);if(s){if(p.type==="mock"){s.mock(this.core.enums.DECODE_FAILED_ERROR_CODE.TEST);return}s.close("update"),this.contextMap.set(p.track,this.core.room.videoManager.createDecodeContext(Er(wr({},p),{createDecoder:this.createDecoder})))}}};_e(cn,"Name","TRTCVideoDecoder");var ui=cn;var Fo=ui;export{ui as VideoDecoderPlugin,Fo as default};
|
|
@@ -40,4 +40,4 @@ return ret;
|
|
|
40
40
|
`;for(var E=0;E<i-1;++E)c[E+1].deleteObject&&(B+=" argType"+E+".deleteObject(arg"+E+`);
|
|
41
41
|
`);m.isVoid||(B+=` return retType.toWireType(destructors, rv);
|
|
42
42
|
`),B+=`};
|
|
43
|
-
`,T.push(B);var Y=Ut(Function,T).apply(null,_);return w=Gn(Y),qt[v]=w,w}var Xn=()=>{or("")},Xt;Xt=()=>performance.now();var Kn=(i,o,c)=>J.copyWithin(i,o,o+c),Jn=i=>{or("OOM")},Yn=i=>{var o=J.length;i>>>=0,Jn(i)},Zn=[null,[],[]],Qn=(i,o)=>{var c=Zn[i];o===0||o===10?((i===1?lr:ae)(rr(c,0)),c.length=0):c.push(o)},st={varargs:void 0,get(){st.varargs+=4;var i=Pe[st.varargs-4>>2];return i},getStr(i){var o=Wt(i);return o}},ei=(i,o,c,m)=>{for(var v=0,w=0;w<c;w++){var T=U[o>>2],_=U[o+4>>2];o+=8;for(var k=0;k<_;k++)Qn(i,J[T+k]);v+=_}return U[m>>2]=v,0};wn(),le=s.BindingError=class extends Error{constructor(o){super(o),this.name="BindingError"}},Ye=s.InternalError=class extends Error{constructor(o){super(o),this.name="InternalError"}},hr(),Jr(),gr(),It=s.UnboundTypeError=Dn(Error,"UnboundTypeError"),In(),Un();var ri={o:Gr,r:_n,m:En,q:Rn,p:tt,d:xt,u:xn,k:Nn,b:Mn,a:Ln,j:Ht,g:Vn,n:jn,e:Gt,l:Nt,h:at,f:Xn,c:Xt,t:Kn,s:Yn,i:ei},li=yt(),ti=()=>(ti=ee.w)(),Fe=i=>(Fe=ee.x)(i),ut=i=>(ut=ee.y)(i),Kt=i=>(Kt=ee.A)(i),ni=s.__embind_initialize_bindings=()=>(ni=s.__embind_initialize_bindings=ee.B)(),ii=()=>(ii=ee.__errno_location)(),Jt=i=>(Jt=ee.C)(i),ct=s.dynCall_jiji=(i,o,c,m,v)=>(ct=s.dynCall_jiji=ee.D)(i,o,c,m,v),Ur;Ke=function i(){Ur||Yt(),Ur||(Ke=i)};function Yt(){if(Xe>0||(fn(),Xe>0))return;function i(){Ur||(Ur=!0,s.calledRun=!0,!Mr&&(pn(),b(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),mn()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),i()},1)):i()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return Yt(),p.ready}})(),Ci=Ji;var un=class extends ze{constructor(p){super(Ci,p!=null&&p.wasmPath?fetch(p.wasmPath).then(s=>s.arrayBuffer()):void 0,p==null?void 0:p.workerMode,p==null?void 0:p.canvas,p==null?void 0:p.yuvMode)}};var ln=class ln{constructor(p){this.core=p;_e(this,"contextMap",new Map);_e(this,"decodeProcessorMap",new WeakMap);this.createDecoder=this.createDecoder.bind(this)}getAlias(){return"videoDecoder"}getGroup(p){return p!=null&&p.track?`${p.track.userId}${p.track.streamType}`:"*"}getName(){return ln.Name}getValidateRule(p){return{type:this.core.enums.BASIC_TYPE.Object}}createDecoder(p,s){switch(p){case"wasm":return this.core.rtcDectection.isSIMDSupported()?new un(Er(wr({},s),{wasmPath:`${this.core.assetsPath}videodec_simd.wasm`})):new sn(Er(wr({},s),{wasmPath:`${this.core.assetsPath}videodec.wasm`}));case"webCodecs":return new ir;case"mse":throw new Error("mse decoder not supported yet");default:throw new Error("Unsupported decoder type")}}start(p){this.decodeProcessorMap.set(p.track,this.decode(p)),this.core.room.videoManager.addDecodeProcessor({processor:({frame:s,track:b})=>{var P;return((P=this.decodeProcessorMap.get(b))==null?void 0:P({frame:s,track:b}))||s},type:3})}decode(p){let{pipe:s,take:b,subscribe:P}=this.core.rx;return({frame:D,track:$})=>{if($!==p.track||D.type==="empty")return D;if(this.contextMap.has($))return this.contextMap.get($).decode(D);let j=this.core.room.videoManager.createDecodeContext(Er(wr({},p),{createDecoder:this.createDecoder}));return s(j.trackDoneOB,b(1),P(()=>{this.core.clearStarted(this,this.getGroup(p)),this.stop({track:$})})),this.contextMap.set($,j),j.decode(D)}}stop(p){if(!(p!=null&&p.track))this.contextMap.forEach((s,b)=>{s.close("stop"),this.contextMap.delete(b)});else{let s=this.contextMap.get(p.track);s&&(s.close("stop"),this.contextMap.delete(p.track))}this.contextMap.size===0&&this.core.room.videoManager.removeDecodeProcessor({type:3})}update(p){let s=this.contextMap.get(p.track);if(s){if(p.type==="mock"){s.mock(this.core.enums.DECODE_FAILED_ERROR_CODE.TEST);return}s.close("update"),this.contextMap.set(p.track,this.core.room.videoManager.createDecodeContext(Er(wr({},p),{createDecoder:this.createDecoder})))}}};_e(ln,"Name","TRTCVideoDecoder");var cn=ln;var Yi=cn;return Bi(Zi);})().default;
|
|
43
|
+
`,T.push(B);var Y=Ut(Function,T).apply(null,_);return w=Gn(Y),qt[v]=w,w}var Xn=()=>{or("")},Xt;Xt=()=>performance.now();var Kn=(i,o,c)=>J.copyWithin(i,o,o+c),Jn=i=>{or("OOM")},Yn=i=>{var o=J.length;i>>>=0,Jn(i)},Zn=[null,[],[]],Qn=(i,o)=>{var c=Zn[i];o===0||o===10?((i===1?lr:ae)(rr(c,0)),c.length=0):c.push(o)},st={varargs:void 0,get(){st.varargs+=4;var i=Pe[st.varargs-4>>2];return i},getStr(i){var o=Wt(i);return o}},ei=(i,o,c,m)=>{for(var v=0,w=0;w<c;w++){var T=U[o>>2],_=U[o+4>>2];o+=8;for(var k=0;k<_;k++)Qn(i,J[T+k]);v+=_}return U[m>>2]=v,0};wn(),le=s.BindingError=class extends Error{constructor(o){super(o),this.name="BindingError"}},Ye=s.InternalError=class extends Error{constructor(o){super(o),this.name="InternalError"}},hr(),Jr(),gr(),It=s.UnboundTypeError=Dn(Error,"UnboundTypeError"),In(),Un();var ri={o:Gr,r:_n,m:En,q:Rn,p:tt,d:xt,u:xn,k:Nn,b:Mn,a:Ln,j:Ht,g:Vn,n:jn,e:Gt,l:Nt,h:at,f:Xn,c:Xt,t:Kn,s:Yn,i:ei},li=yt(),ti=()=>(ti=ee.w)(),Fe=i=>(Fe=ee.x)(i),ut=i=>(ut=ee.y)(i),Kt=i=>(Kt=ee.A)(i),ni=s.__embind_initialize_bindings=()=>(ni=s.__embind_initialize_bindings=ee.B)(),ii=()=>(ii=ee.__errno_location)(),Jt=i=>(Jt=ee.C)(i),ct=s.dynCall_jiji=(i,o,c,m,v)=>(ct=s.dynCall_jiji=ee.D)(i,o,c,m,v),Ur;Ke=function i(){Ur||Yt(),Ur||(Ke=i)};function Yt(){if(Xe>0||(fn(),Xe>0))return;function i(){Ur||(Ur=!0,s.calledRun=!0,!Mr&&(pn(),b(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),mn()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),i()},1)):i()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return Yt(),p.ready}})(),Ci=Ji;var un=class extends ze{constructor(p){super(Ci,p!=null&&p.wasmPath?fetch(p.wasmPath).then(s=>s.arrayBuffer()):void 0,p==null?void 0:p.workerMode,p==null?void 0:p.canvas,p==null?void 0:p.yuvMode)}};var ln=class ln{constructor(p){this.core=p;_e(this,"contextMap",new Map);_e(this,"decodeProcessorMap",new WeakMap);this.createDecoder=this.createDecoder.bind(this)}getAlias(){return"videoDecoder"}getGroup(p){return p!=null&&p.track?`${p.track.userId}${p.track.streamType}`:"*"}getName(){return ln.Name}getValidateRule(p){return{type:this.core.enums.BASIC_TYPE.Object}}createDecoder(p,s){switch(p){case"wasm":return this.core.rtcDectection.isSIMDSupported()?new un(Er(wr({},s),{wasmPath:`${this.core.assetsPath||"."}/videodec_simd.wasm`})):new sn(Er(wr({},s),{wasmPath:`${this.core.assetsPath||"."}/videodec.wasm`}));case"webCodecs":return new ir;case"mse":throw new Error("mse decoder not supported yet");default:throw new Error("Unsupported decoder type")}}start(p){this.decodeProcessorMap.set(p.track,this.decode(p)),this.core.room.videoManager.addDecodeProcessor({processor:({frame:s,track:b})=>{var P;return((P=this.decodeProcessorMap.get(b))==null?void 0:P({frame:s,track:b}))||s},type:3})}decode(p){let{pipe:s,take:b,subscribe:P}=this.core.rx;return({frame:D,track:$})=>{if($!==p.track||D.type==="empty")return D;if(this.contextMap.has($))return this.contextMap.get($).decode(D);let j=this.core.room.videoManager.createDecodeContext(Er(wr({},p),{createDecoder:this.createDecoder}));return s(j.trackDoneOB,b(1),P(()=>{this.core.clearStarted(this,this.getGroup(p)),this.stop({track:$})})),this.contextMap.set($,j),j.decode(D)}}stop(p){if(!(p!=null&&p.track))this.contextMap.forEach((s,b)=>{s.close("stop"),this.contextMap.delete(b)});else{let s=this.contextMap.get(p.track);s&&(s.close("stop"),this.contextMap.delete(p.track))}this.contextMap.size===0&&this.core.room.videoManager.removeDecodeProcessor({type:3})}update(p){let s=this.contextMap.get(p.track);if(s){if(p.type==="mock"){s.mock(this.core.enums.DECODE_FAILED_ERROR_CODE.TEST);return}s.close("update"),this.contextMap.set(p.track,this.core.room.videoManager.createDecodeContext(Er(wr({},p),{createDecoder:this.createDecoder})))}}};_e(ln,"Name","TRTCVideoDecoder");var cn=ln;var Yi=cn;return Bi(Zi);})().default;
|