trtc-sdk-v5 5.10.1-beta.5 → 5.10.1-beta.7

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.
Files changed (60) hide show
  1. package/README-zh_CN.md +2 -1
  2. package/README.md +2 -1
  3. package/assets/debug-dialog.js +1 -0
  4. package/{plugins/ai-denoiser → assets}/denoiser-wasm.js +1 -1
  5. package/assets/selfie_segmentation/package.json +27 -0
  6. package/assets/selfie_segmentation/selfie_segmentation.binarypb +0 -0
  7. package/assets/selfie_segmentation/selfie_segmentation.tflite +0 -0
  8. package/assets/selfie_segmentation/selfie_segmentation_landscape.tflite +0 -0
  9. package/assets/selfie_segmentation/selfie_segmentation_solution_simd_wasm_bin.data +0 -0
  10. package/assets/selfie_segmentation/selfie_segmentation_solution_simd_wasm_bin.wasm +0 -0
  11. package/assets/selfie_segmentation/selfie_segmentation_solution_wasm_bin.wasm +0 -0
  12. package/assets/videodec.wasm +0 -0
  13. package/assets/videodec_simd.wasm +0 -0
  14. package/index.d.ts +1824 -1796
  15. package/package.json +1 -1
  16. package/plugins/cdn-streaming/cdn-streaming.esm.js +1 -1
  17. package/plugins/cdn-streaming/cdn-streaming.umd.js +1 -0
  18. package/plugins/cdn-streaming/package.json +1 -2
  19. package/plugins/cross-room/cross-room.esm.js +1 -1
  20. package/plugins/cross-room/cross-room.umd.js +1 -0
  21. package/plugins/cross-room/package.json +1 -2
  22. package/plugins/custom-encryption/custom-encryption.esm.d.ts +31 -0
  23. package/plugins/custom-encryption/custom-encryption.esm.js +1 -0
  24. package/plugins/custom-encryption/custom-encryption.umd.js +1 -0
  25. package/plugins/custom-encryption/package.json +7 -0
  26. package/plugins/device-detector/device-detector.esm.js +93 -1234
  27. package/plugins/device-detector/device-detector.umd.js +39 -0
  28. package/plugins/device-detector/package.json +1 -2
  29. package/plugins/video-decoder/package.json +1 -1
  30. package/plugins/video-decoder/video-decoder.esm.d.ts +20 -20
  31. package/plugins/video-decoder/video-decoder.esm.js +1 -43
  32. package/plugins/video-decoder/video-decoder.umd.js +1 -0
  33. package/plugins/video-effect/basic-beauty/basic-beauty.esm.js +1 -2
  34. package/plugins/video-effect/basic-beauty/basic-beauty.umd.js +1 -0
  35. package/plugins/video-effect/basic-beauty/package.json +1 -2
  36. package/plugins/video-effect/beauty/beauty.esm.js +1 -2954
  37. package/plugins/video-effect/beauty/beauty.umd.js +1 -0
  38. package/plugins/video-effect/beauty/package.json +1 -2
  39. package/plugins/video-effect/virtual-background/package.json +1 -2
  40. package/plugins/video-effect/virtual-background/virtual-background.esm.js +1 -60
  41. package/plugins/video-effect/virtual-background/virtual-background.umd.js +1 -0
  42. package/plugins/video-effect/watermark/package.json +1 -2
  43. package/plugins/video-effect/watermark/watermark.esm.d.ts +10 -2
  44. package/plugins/video-effect/watermark/watermark.esm.js +1 -1
  45. package/plugins/video-effect/watermark/watermark.umd.js +1 -0
  46. package/plugins/voice-changer/package.json +9 -0
  47. package/plugins/voice-changer/voice-changer.esm.d.ts +20 -0
  48. package/plugins/voice-changer/voice-changer.esm.js +1 -0
  49. package/plugins/voice-changer/voice-changer.umd.js +1 -0
  50. package/trtc.es5.js +1 -0
  51. package/trtc.esm.js +30 -30
  52. package/trtc.js +1 -1
  53. package/plugins/cdn-streaming/cdn-streaming.iife.js +0 -1
  54. package/plugins/cross-room/cross-room.iife.js +0 -1
  55. package/plugins/device-detector/device-detector.iife.js +0 -1472
  56. package/plugins/video-decoder/video-decoder.iife.js +0 -43
  57. package/plugins/video-effect/basic-beauty/basic-beauty.iife.js +0 -2
  58. package/plugins/video-effect/beauty/beauty.iife.js +0 -2954
  59. package/plugins/video-effect/virtual-background/virtual-background.iife.js +0 -60
  60. package/plugins/video-effect/watermark/watermark.iife.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";var Watermark=(()=>{var S=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var f=(r,e,t)=>e in r?S(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var C=(r,e)=>{for(var t in e)S(r,t,{get:e[t],enumerable:!0})},k=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of D(e))!y.call(r,i)&&i!==t&&S(r,i,{get:()=>e[i],enumerable:!(o=O(e,i))||o.enumerable});return r};var L=r=>k(S({},"__esModule",{value:!0}),r);var d=(r,e,t)=>f(r,typeof e!="symbol"?e+"":e,t);var B={};C(B,{Watermark:()=>I,default:()=>V});function N(r){return{name:"WatermarkOptions",type:"object",required:!0,allowEmpty:!1,properties:{imageUrl:{required:!0,type:"string"},x:{required:!1,type:"number"},y:{required:!1,type:"number"},size:{required:!1,type:["string","object","number"]}},validate(e,t,o,i){var p;let{RtcError:a,ErrorCode:c,ErrorCodeDictionary:s}=r.errorModule;if(!e)return;let{imageUrl:u}=e,b=u.split("?")[0].split(".").pop();if((b==="jpg"||b==="jpeg")&&r.log.warn("The image format is not recommended to be jpg/jpeg, because the format does not support transparency."),!((p=r.room.videoManager.cameraTrack)!=null&&p.mediaTrack))throw new a({code:c.INVALID_OPERATION,extraCode:s.INVALID_OPERATION_NEED_VIDEO,fnName:o});if(r.utils.isString(e.size)&&e.size!=="contain"&&e.size!=="cover")throw new a({code:c.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be 'contain' or 'cover'",fnName:o});if(r.utils.isNumber(e.size)&&(e.size<=0||e.size>1))throw new a({code:c.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:o});if(r.utils.isObject(e.size)){if(!e.size.width||!e.size.height)throw new a({code:c.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be an object with width and height properties",fnName:o});if(e.size.width<=0||e.size.height<=0)throw new a({code:c.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:o})}}}}function U(r){return{name:"StopWatermarkOptions",required:!1}}var A=0,R=class R{constructor(e){this.core=e;d(this,"seq");d(this,"_core");d(this,"log");d(this,"startResolve");d(this,"startReject");A=A+1,this.seq=A,this._core=e,this.log=e.log.createChild({id:`${this.getAlias()}${A}`}),this.log.info("created")}getName(){return R.Name}getAlias(){return"w"}getValidateRule(e){switch(e){case"start":return N(this._core);case"update":return N(this._core);case"stop":return U(this._core)}}getGroup(){return"w"}async start(e){return this.doStart(e)}async update(e){this.doStart(e)}async stop(){return this._core.room.videoManager.deleteWatermark()}async doStart(e){let{x:t=0,y:o=0}=e,i=await this.processWatermark(e);return this._core.room.videoManager.setWatermark({x:t,y:o,imageUrl:i})}async processWatermark(e){let{imageUrl:t,x:o=0,y:i=0,size:a="cover"}=e,{settings:c}=this._core.room.videoManager.cameraTrack,s;try{s=await this._core.utils.loadImage(t)}catch(G){let{RtcError:P,ErrorCode:x}=this.core.errorModule;throw new P({code:x.INVALID_PARAMETER,message:`load image failed, url: ${t}`})}let{width:u,height:l}=c,{width:b,height:p}=s,n=b,m=p;this._core.utils.isObject(a)&&(n=(a==null?void 0:a.width)||n,m=(a==null?void 0:a.height)||m),this._core.utils.isNumber(a)&&(n=b*a,m=p*a);let T=b/p,_=u/l,h=T>_;a==="contain"&&(h?(n=u,m=u/T):(n=l*T,m=l)),a==="cover"&&(h?(m=l,n=l*T):(n=u,m=u/T));let g=document.createElement("canvas"),E=g.getContext("2d");return g.width=Math.min(u-o,n),g.height=Math.min(l-i,m),E==null||E.drawImage(s,0,0,n,m),g.toDataURL("image/png")}};d(R,"Name","Watermark");var I=R;var V=I;return L(B);})().default;