trtc-sdk-v5
Advanced tools
Comparing version 5.5.1-beta.3 to 5.5.1
{ | ||
"name": "trtc-sdk-v5", | ||
"version": "5.5.1-beta.3", | ||
"version": "5.5.1", | ||
"description": "Tencent Cloud RTC SDK for Web", | ||
@@ -5,0 +5,0 @@ "main": "trtc.js", |
{ | ||
"name": "@rtc-plugin/cdn-streaming", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"description": "TRTC Web SDK 5.x CDN streaming plugin", | ||
@@ -5,0 +5,0 @@ "main": "./cdn-streaming.esm.js", |
{ | ||
"name": "@rtc-plugin/beauty", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"description": "TRTC Web SDK 5.x beauty plugin", | ||
@@ -5,0 +5,0 @@ "main": "./beauty.esm.js", |
{ | ||
"name": "@rtc-plugin/virtual-background", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"description": "TRTC Web SDK 5.x virtual background plugin", | ||
@@ -5,0 +5,0 @@ "main": "./virtual-background.esm.js", |
{ | ||
"name": "@rtc-plugin/watermark", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"description": "TRTC Web SDK 5.x watermark plugin", | ||
@@ -5,0 +5,0 @@ "main": "./watermark.esm.js", |
@@ -1,1 +0,1 @@ | ||
var U=Object.defineProperty;var C=(o,e,t)=>e in o?U(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var p=(o,e,t)=>(C(o,typeof e!="symbol"?e+"":e,t),t);function O(o){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,i,b){var m;let{RtcError:r,ErrorCode:c,ErrorCodeDictionary:a}=o.errorModule;if(!e)return;let{imageUrl:s}=e,u=s.split("?")[0].split(".").pop();if((u==="jpg"||u==="jpeg")&&o.log.warn("The image format is not recommended to be jpg/jpeg, because the format does not support transparency."),!((m=o.room.videoManager.cameraTrack)!=null&&m.mediaTrack))throw new r({code:c.INVALID_OPERATION,extraCode:a.INVALID_OPERATION_NEED_VIDEO,fnName:i});if(o.utils.isString(e.size)&&e.size!=="contain"&&e.size!=="cover")throw new r({code:c.INVALID_PARAMETER,extraCode:a.INVALID_PARAMETER_TYPE,message:"The size parameter must be 'contain' or 'cover'",fnName:i});if(o.utils.isNumber(e.size)&&(e.size<=0||e.size>1))throw new r({code:c.INVALID_PARAMETER,extraCode:a.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:i});if(o.utils.isObject(e.size)){if(!e.size.width||!e.size.height)throw new r({code:c.INVALID_PARAMETER,extraCode:a.INVALID_PARAMETER_TYPE,message:"The size parameter must be an object with width and height properties",fnName:i});if(e.size.width<=0||e.size.height<=0)throw new r({code:c.INVALID_PARAMETER,extraCode:a.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:i})}}}}function A(o){return{name:"StopWatermarkOptions",required:!1}}var g=0,_=class{constructor(e){this.core=e;p(this,"seq");p(this,"_core");p(this,"log");p(this,"startResolve");p(this,"startReject");g=g+1,this.seq=g,this._core=e,this.log=e.log.createChild({id:`${this.getAlias()}${g}`}),this.log.info("created")}getName(){return"Watermark"}getAlias(){return"w"}getValidateRule(e){switch(e){case"start":return O(this._core);case"update":return A(this._core);case"stop":return A(this._core)}}getGroup(){return"w"}async start(e){return this.doStart(e)}async update(e){return await this.stop(),this.doStart(e)}async stop(){return this._core.room.videoManager.deleteWatermark()}async doStart(e){let{imageUrl:t,x:i=0,y:b=0,size:r="cover"}=e,{settings:c}=this._core.room.videoManager.cameraTrack,a;try{a=await this._core.utils.loadImage(t)}catch(P){let{RtcError:h,ErrorCode:N}=this.core.errorModule;throw new h({code:N.INVALID_PARAMETER,message:`load image failed, url: ${t}`})}let{width:s,height:n}=c,{width:u,height:m}=a,d=u,l=m;this._core.utils.isObject(r)&&(d=(r==null?void 0:r.width)||d,l=(r==null?void 0:r.height)||l),this._core.utils.isNumber(r)&&(d=u*r,l=m*r);let T=u/m,D=s/n,R=T>D;r==="contain"&&(R?(d=s,l=s/T):(d=n*T,l=n)),r==="cover"&&(R?(l=n,d=n*T):(d=s,l=s/T));let S=document.createElement("canvas"),E=S.getContext("2d");S.width=Math.min(s-i,u),S.height=Math.min(n-b,m),E==null||E.drawImage(a,0,0,d,l);let I=new Image;return I.src=S.toDataURL("image/png"),this._core.room.videoManager.setWatermark({x:i,y:b,width:Math.min(s-i,u),height:Math.min(n-b,m),imageUrl:t,imageElement:I})}};var B=_;export{_ as Watermark,B as default}; | ||
var h=Object.defineProperty;var U=(o,e,t)=>e in o?h(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var l=(o,e,t)=>(U(o,typeof e!="symbol"?e+"":e,t),t);function I(o){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,n,g){var p;let{RtcError:r,ErrorCode:m,ErrorCodeDictionary:i}=o.errorModule;if(!e)return;let{imageUrl:u}=e,c=u.split("?")[0].split(".").pop();if((c==="jpg"||c==="jpeg")&&o.log.warn("The image format is not recommended to be jpg/jpeg, because the format does not support transparency."),!((p=o.room.videoManager.cameraTrack)!=null&&p.mediaTrack))throw new r({code:m.INVALID_OPERATION,extraCode:i.INVALID_OPERATION_NEED_VIDEO,fnName:n});if(o.utils.isString(e.size)&&e.size!=="contain"&&e.size!=="cover")throw new r({code:m.INVALID_PARAMETER,extraCode:i.INVALID_PARAMETER_TYPE,message:"The size parameter must be 'contain' or 'cover'",fnName:n});if(o.utils.isNumber(e.size)&&(e.size<=0||e.size>1))throw new r({code:m.INVALID_PARAMETER,extraCode:i.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:n});if(o.utils.isObject(e.size)){if(!e.size.width||!e.size.height)throw new r({code:m.INVALID_PARAMETER,extraCode:i.INVALID_PARAMETER_TYPE,message:"The size parameter must be an object with width and height properties",fnName:n});if(e.size.width<=0||e.size.height<=0)throw new r({code:m.INVALID_PARAMETER,extraCode:i.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:n})}}}}function A(o){return{name:"StopWatermarkOptions",required:!1}}var S=0,_=class{constructor(e){this.core=e;l(this,"seq");l(this,"_core");l(this,"log");l(this,"startResolve");l(this,"startReject");S=S+1,this.seq=S,this._core=e,this.log=e.log.createChild({id:`${this.getAlias()}${S}`}),this.log.info("created")}getName(){return"Watermark"}getAlias(){return"w"}getValidateRule(e){switch(e){case"start":return I(this._core);case"update":return A(this._core);case"stop":return A(this._core)}}getGroup(){return"w"}async start(e){return this.doStart(e)}async update(e){return await this.stop(),this.doStart(e)}async stop(){return this._core.room.videoManager.deleteWatermark()}async doStart(e){let{imageUrl:t,x:n=0,y:g=0,size:r="cover"}=e,{settings:m}=this._core.room.videoManager.cameraTrack,i;try{i=await this._core.utils.loadImage(t)}catch(C){let{RtcError:D,ErrorCode:N}=this.core.errorModule;throw new D({code:N.INVALID_PARAMETER,message:`load image failed, url: ${t}`})}let{width:u,height:d}=m,{width:c,height:p}=i,a=c,s=p;this._core.utils.isObject(r)&&(a=(r==null?void 0:r.width)||a,s=(r==null?void 0:r.height)||s),this._core.utils.isNumber(r)&&(a=c*r,s=p*r);let T=c/p,O=u/d,R=T>O;r==="contain"&&(R?(a=u,s=u/T):(a=d*T,s=d)),r==="cover"&&(R?(s=d,a=d*T):(a=u,s=u/T));let b=document.createElement("canvas"),E=b.getContext("2d");return b.width=Math.min(u-n,a),b.height=Math.min(d-g,s),E==null||E.drawImage(i,0,0,a,s),this._core.room.videoManager.setWatermark({x:n,y:g,imageUrl:b.toDataURL("image/png")})}};var V=_;export{_ as Watermark,V as default}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var Watermark=(()=>{var g=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var x=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var M=(r,e)=>{for(var t in e)g(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of P(e))!y.call(r,a)&&a!==t&&g(r,a,{get:()=>e[a],enumerable:!(i=C(e,a))||i.enumerable});return r};var L=r=>f(g({},"__esModule",{value:!0}),r);var T=(r,e,t)=>(x(r,typeof e!="symbol"?e+"":e,t),t);var V={};M(V,{Watermark:()=>A,default:()=>k});function D(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,i,a){var d;let{RtcError:o,ErrorCode:p,ErrorCodeDictionary:s}=r.errorModule;if(!e)return;let{imageUrl:n}=e,m=n.split("?")[0].split(".").pop();if((m==="jpg"||m==="jpeg")&&r.log.warn("The image format is not recommended to be jpg/jpeg, because the format does not support transparency."),!((d=r.room.videoManager.cameraTrack)!=null&&d.mediaTrack))throw new o({code:p.INVALID_OPERATION,extraCode:s.INVALID_OPERATION_NEED_VIDEO,fnName:i});if(r.utils.isString(e.size)&&e.size!=="contain"&&e.size!=="cover")throw new o({code:p.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be 'contain' or 'cover'",fnName:i});if(r.utils.isNumber(e.size)&&(e.size<=0||e.size>1))throw new o({code:p.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:i});if(r.utils.isObject(e.size)){if(!e.size.width||!e.size.height)throw new o({code:p.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be an object with width and height properties",fnName:i});if(e.size.width<=0||e.size.height<=0)throw new o({code:p.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:i})}}}}function R(r){return{name:"StopWatermarkOptions",required:!1}}var E=0,A=class{constructor(e){this.core=e;T(this,"seq");T(this,"_core");T(this,"log");T(this,"startResolve");T(this,"startReject");E=E+1,this.seq=E,this._core=e,this.log=e.log.createChild({id:`${this.getAlias()}${E}`}),this.log.info("created")}getName(){return"Watermark"}getAlias(){return"w"}getValidateRule(e){switch(e){case"start":return D(this._core);case"update":return R(this._core);case"stop":return R(this._core)}}getGroup(){return"w"}async start(e){return this.doStart(e)}async update(e){return await this.stop(),this.doStart(e)}async stop(){return this._core.room.videoManager.deleteWatermark()}async doStart(e){let{imageUrl:t,x:i=0,y:a=0,size:o="cover"}=e,{settings:p}=this._core.room.videoManager.cameraTrack,s;try{s=await this._core.utils.loadImage(t)}catch(B){let{RtcError:N,ErrorCode:U}=this.core.errorModule;throw new N({code:U.INVALID_PARAMETER,message:`load image failed, url: ${t}`})}let{width:n,height:u}=p,{width:m,height:d}=s,l=m,c=d;this._core.utils.isObject(o)&&(l=(o==null?void 0:o.width)||l,c=(o==null?void 0:o.height)||c),this._core.utils.isNumber(o)&&(l=m*o,c=d*o);let b=m/d,h=n/u,I=b>h;o==="contain"&&(I?(l=n,c=n/b):(l=u*b,c=u)),o==="cover"&&(I?(c=u,l=u*b):(l=n,c=n/b));let S=document.createElement("canvas"),_=S.getContext("2d");S.width=Math.min(n-i,m),S.height=Math.min(u-a,d),_==null||_.drawImage(s,0,0,l,c);let O=new Image;return O.src=S.toDataURL("image/png"),this._core.room.videoManager.setWatermark({x:i,y:a,width:Math.min(n-i,m),height:Math.min(u-a,d),imageUrl:t,imageElement:O})}};var k=A;return L(V);})().default; | ||
"use strict";var Watermark=(()=>{var g=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var y=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var x=(r,e)=>{for(var t in e)g(r,t,{get:e[t],enumerable:!0})},M=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of C(e))!P.call(r,a)&&a!==t&&g(r,a,{get:()=>e[a],enumerable:!(i=U(e,a))||i.enumerable});return r};var f=r=>M(g({},"__esModule",{value:!0}),r);var c=(r,e,t)=>(y(r,typeof e!="symbol"?e+"":e,t),t);var k={};x(k,{Watermark:()=>A,default:()=>L});function O(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,i,a){var T;let{RtcError:o,ErrorCode:d,ErrorCodeDictionary:s}=r.errorModule;if(!e)return;let{imageUrl:m}=e,p=m.split("?")[0].split(".").pop();if((p==="jpg"||p==="jpeg")&&r.log.warn("The image format is not recommended to be jpg/jpeg, because the format does not support transparency."),!((T=r.room.videoManager.cameraTrack)!=null&&T.mediaTrack))throw new o({code:d.INVALID_OPERATION,extraCode:s.INVALID_OPERATION_NEED_VIDEO,fnName:i});if(r.utils.isString(e.size)&&e.size!=="contain"&&e.size!=="cover")throw new o({code:d.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be 'contain' or 'cover'",fnName:i});if(r.utils.isNumber(e.size)&&(e.size<=0||e.size>1))throw new o({code:d.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:i});if(r.utils.isObject(e.size)){if(!e.size.width||!e.size.height)throw new o({code:d.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be an object with width and height properties",fnName:i});if(e.size.width<=0||e.size.height<=0)throw new o({code:d.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:i})}}}}function R(r){return{name:"StopWatermarkOptions",required:!1}}var E=0,A=class{constructor(e){this.core=e;c(this,"seq");c(this,"_core");c(this,"log");c(this,"startResolve");c(this,"startReject");E=E+1,this.seq=E,this._core=e,this.log=e.log.createChild({id:`${this.getAlias()}${E}`}),this.log.info("created")}getName(){return"Watermark"}getAlias(){return"w"}getValidateRule(e){switch(e){case"start":return O(this._core);case"update":return R(this._core);case"stop":return R(this._core)}}getGroup(){return"w"}async start(e){return this.doStart(e)}async update(e){return await this.stop(),this.doStart(e)}async stop(){return this._core.room.videoManager.deleteWatermark()}async doStart(e){let{imageUrl:t,x:i=0,y:a=0,size:o="cover"}=e,{settings:d}=this._core.room.videoManager.cameraTrack,s;try{s=await this._core.utils.loadImage(t)}catch(V){let{RtcError:N,ErrorCode:h}=this.core.errorModule;throw new N({code:h.INVALID_PARAMETER,message:`load image failed, url: ${t}`})}let{width:m,height:l}=d,{width:p,height:T}=s,n=p,u=T;this._core.utils.isObject(o)&&(n=(o==null?void 0:o.width)||n,u=(o==null?void 0:o.height)||u),this._core.utils.isNumber(o)&&(n=p*o,u=T*o);let b=p/T,D=m/l,I=b>D;o==="contain"&&(I?(n=m,u=m/b):(n=l*b,u=l)),o==="cover"&&(I?(u=l,n=l*b):(n=m,u=m/b));let S=document.createElement("canvas"),_=S.getContext("2d");return S.width=Math.min(m-i,n),S.height=Math.min(l-a,u),_==null||_.drawImage(s,0,0,n,u),this._core.room.videoManager.setWatermark({x:i,y:a,imageUrl:S.toDataURL("image/png")})}};var L=A;return f(k);})().default; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
10412185
45976