trtc-sdk-v5 5.7.2-beta.0 → 5.7.2-beta.1
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/index.d.ts +2 -7
- package/package.json +1 -1
- package/plugins/cdn-streaming/package.json +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/plugins/video-effect/watermark/watermark.esm.js +1 -1
- package/plugins/video-effect/watermark/watermark.iife.js +1 -1
- package/trtc.esm.js +32 -33
- package/trtc.js +1 -1
- package/plugins/device-detector/device-detector.esm.d.ts +0 -10
- package/plugins/device-detector/device-detector.esm.js +0 -1429
- package/plugins/device-detector/device-detector.iife.js +0 -1429
- package/plugins/device-detector/package.json +0 -29
package/index.d.ts
CHANGED
|
@@ -83,7 +83,6 @@ declare interface RemoteVideoConfig {
|
|
|
83
83
|
small?: boolean;
|
|
84
84
|
receiveWhenViewVisible?: boolean;
|
|
85
85
|
viewRoot?: HTMLElement;
|
|
86
|
-
canvasRender?: boolean;
|
|
87
86
|
};
|
|
88
87
|
}
|
|
89
88
|
declare interface StopRemoteVideoConfig {
|
|
@@ -310,7 +309,6 @@ declare type PluginStartOptionsMap = {
|
|
|
310
309
|
'Watermark': WatermarkOptions;
|
|
311
310
|
'Beauty': BeautyOptions;
|
|
312
311
|
'BasicBeauty': BasicBeautyOptions;
|
|
313
|
-
'DeviceDetector': DeviceDetectorOptions;
|
|
314
312
|
};
|
|
315
313
|
declare type PluginUpdateOptionsMap = {
|
|
316
314
|
'AudioMixer': UpdateAudioMixerOptions;
|
|
@@ -327,7 +325,6 @@ declare type PluginStopOptionsMap = {
|
|
|
327
325
|
'Watermark': undefined;
|
|
328
326
|
'Beauty': undefined;
|
|
329
327
|
'BasicBeauty': undefined;
|
|
330
|
-
'DeviceDetector': undefined;
|
|
331
328
|
};
|
|
332
329
|
declare interface TRTCStatistics {
|
|
333
330
|
rtt: number;
|
|
@@ -632,7 +629,7 @@ declare const TRTCEvent: {
|
|
|
632
629
|
* @default 'connection-state-changed'
|
|
633
630
|
* @memberof module:EVENT
|
|
634
631
|
* @example
|
|
635
|
-
* trtc.on(TRTC.
|
|
632
|
+
* trtc.on(TRTC.CONNECTION_STATE_CHANGED, event => {
|
|
636
633
|
* const prevState = event.prevState;
|
|
637
634
|
* const curState = event.state;
|
|
638
635
|
* });
|
|
@@ -900,7 +897,6 @@ declare interface TRTCEventTypes {
|
|
|
900
897
|
* @returns {TRTC} TRTC object
|
|
901
898
|
*/
|
|
902
899
|
static create(options?: TRTCOptions): TRTC;
|
|
903
|
-
get room(): IRoom;
|
|
904
900
|
/**
|
|
905
901
|
* @private
|
|
906
902
|
* 注册插件 <br>
|
|
@@ -1411,9 +1407,8 @@ declare interface TRTCEventTypes {
|
|
|
1411
1407
|
* - {@link module:ERROR_CODE.OPERATION_ABORT OPERATION_ABORT}
|
|
1412
1408
|
* @example
|
|
1413
1409
|
* const config = {
|
|
1414
|
-
* view: document.getElementById(userId),
|
|
1410
|
+
* view: document.getElementById(userId),
|
|
1415
1411
|
* userId,
|
|
1416
|
-
* streamType: TRTC.TYPE.STREAM_TYPE_MAIN
|
|
1417
1412
|
* }
|
|
1418
1413
|
* await trtc.updateRemoteVideo(config);
|
|
1419
1414
|
* @memberof TRTC
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h=Object.defineProperty;var C=(a,e,o)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[e]=o;var u=(a,e,o)=>(C(a,typeof e!="symbol"?e+"":e,o),o);function D(a){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,o,n,g){var p;let{RtcError:r,ErrorCode:d,ErrorCodeDictionary:t}=a.errorModule;if(!e)return;let{imageUrl:m}=e,c=m.split("?")[0].split(".").pop();if((c==="jpg"||c==="jpeg")&&a.log.warn("The image format is not recommended to be jpg/jpeg, because the format does not support transparency."),!((p=a.room.videoManager.cameraTrack)!=null&&p.mediaTrack))throw new r({code:d.INVALID_OPERATION,extraCode:t.INVALID_OPERATION_NEED_VIDEO,fnName:n});if(a.utils.isString(e.size)&&e.size!=="contain"&&e.size!=="cover")throw new r({code:d.INVALID_PARAMETER,extraCode:t.INVALID_PARAMETER_TYPE,message:"The size parameter must be 'contain' or 'cover'",fnName:n});if(a.utils.isNumber(e.size)&&(e.size<=0||e.size>1))throw new r({code:d.INVALID_PARAMETER,extraCode:t.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:n});if(a.utils.isObject(e.size)){if(!e.size.width||!e.size.height)throw new r({code:d.INVALID_PARAMETER,extraCode:t.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:d.INVALID_PARAMETER,extraCode:t.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:n})}}}}function R(a){return{name:"StopWatermarkOptions",required:!1}}var E=0,S=class S{constructor(e){this.core=e;u(this,"seq");u(this,"_core");u(this,"log");u(this,"startResolve");u(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 S.Name}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:o,x:n=0,y:g=0,size:r="cover"}=e,{settings:d}=this._core.room.videoManager.cameraTrack,t;try{t=await this._core.utils.loadImage(o)}catch(y){let{RtcError:N,ErrorCode:U}=this.core.errorModule;throw new N({code:U.INVALID_PARAMETER,message:`load image failed, url: ${o}`})}let{width:m,height:l}=d,{width:c,height:p}=t,i=c,s=p;this._core.utils.isObject(r)&&(i=(r==null?void 0:r.width)||i,s=(r==null?void 0:r.height)||s),this._core.utils.isNumber(r)&&(i=c*r,s=p*r);let T=c/p,O=m/l,I=T>O;r==="contain"&&(I?(i=m,s=m/T):(i=l*T,s=l)),r==="cover"&&(I?(s=l,i=l*T):(i=m,s=m/T));let b=document.createElement("canvas"),A=b.getContext("2d");return b.width=Math.min(m-n,i),b.height=Math.min(l-g,s),A==null||A.drawImage(t,0,0,i,s),this._core.room.videoManager.setWatermark({x:n,y:g,imageUrl:b.toDataURL("image/png")})}};u(S,"Name","Watermark");var _=S;var G=_;export{_ as Watermark,G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Watermark=(()=>{var S=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var x=(r,e,o)=>e in r?S(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o;var f=(r,e)=>{for(var o in e)S(r,o,{get:e[o],enumerable:!0})},L=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of y(e))!P.call(r,i)&&i!==o&&S(r,i,{get:()=>e[i],enumerable:!(t=C(e,i))||t.enumerable});return r};var k=r=>L(S({},"__esModule",{value:!0}),r);var d=(r,e,o)=>(x(r,typeof e!="symbol"?e+"":e,o),o);var B={};f(B,{Watermark:()=>A,default:()=>V});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,o,t,i){var T;let{RtcError:a,ErrorCode:l,ErrorCodeDictionary:s}=r.errorModule;if(!e)return;let{imageUrl:u}=e,p=u.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 a({code:l.INVALID_OPERATION,extraCode:s.INVALID_OPERATION_NEED_VIDEO,fnName:t});if(r.utils.isString(e.size)&&e.size!=="contain"&&e.size!=="cover")throw new a({code:l.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be 'contain' or 'cover'",fnName:t});if(r.utils.isNumber(e.size)&&(e.size<=0||e.size>1))throw new a({code:l.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:t});if(r.utils.isObject(e.size)){if(!e.size.width||!e.size.height)throw new a({code:l.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be an object with width and height properties",fnName:t});if(e.size.width<=0||e.size.height<=0)throw new a({code:l.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:t})}}}}function I(r){return{name:"StopWatermarkOptions",required:!1}}var g=0,R=class R{constructor(e){this.core=e;d(this,"seq");d(this,"_core");d(this,"log");d(this,"startResolve");d(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 R.Name}getAlias(){return"w"}getValidateRule(e){switch(e){case"start":return O(this._core);case"update":return I(this._core);case"stop":return I(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:o,x:t=0,y:i=0,size:a="cover"}=e,{settings:l}=this._core.room.videoManager.cameraTrack,s;try{s=await this._core.utils.loadImage(o)}catch(G){let{RtcError:
|
|
1
|
+
"use strict";var Watermark=(()=>{var S=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var x=(r,e,o)=>e in r?S(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o;var f=(r,e)=>{for(var o in e)S(r,o,{get:e[o],enumerable:!0})},L=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of y(e))!P.call(r,i)&&i!==o&&S(r,i,{get:()=>e[i],enumerable:!(t=C(e,i))||t.enumerable});return r};var k=r=>L(S({},"__esModule",{value:!0}),r);var d=(r,e,o)=>(x(r,typeof e!="symbol"?e+"":e,o),o);var B={};f(B,{Watermark:()=>A,default:()=>V});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,o,t,i){var T;let{RtcError:a,ErrorCode:l,ErrorCodeDictionary:s}=r.errorModule;if(!e)return;let{imageUrl:u}=e,p=u.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 a({code:l.INVALID_OPERATION,extraCode:s.INVALID_OPERATION_NEED_VIDEO,fnName:t});if(r.utils.isString(e.size)&&e.size!=="contain"&&e.size!=="cover")throw new a({code:l.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be 'contain' or 'cover'",fnName:t});if(r.utils.isNumber(e.size)&&(e.size<=0||e.size>1))throw new a({code:l.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:t});if(r.utils.isObject(e.size)){if(!e.size.width||!e.size.height)throw new a({code:l.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_TYPE,message:"The size parameter must be an object with width and height properties",fnName:t});if(e.size.width<=0||e.size.height<=0)throw new a({code:l.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_RANGE,message:"The size parameter must be greater than 0",fnName:t})}}}}function I(r){return{name:"StopWatermarkOptions",required:!1}}var g=0,R=class R{constructor(e){this.core=e;d(this,"seq");d(this,"_core");d(this,"log");d(this,"startResolve");d(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 R.Name}getAlias(){return"w"}getValidateRule(e){switch(e){case"start":return O(this._core);case"update":return I(this._core);case"stop":return I(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:o,x:t=0,y:i=0,size:a="cover"}=e,{settings:l}=this._core.room.videoManager.cameraTrack,s;try{s=await this._core.utils.loadImage(o)}catch(G){let{RtcError:U,ErrorCode:h}=this.core.errorModule;throw new U({code:h.INVALID_PARAMETER,message:`load image failed, url: ${o}`})}let{width:u,height:c}=l,{width:p,height:T}=s,n=p,m=T;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=p*a,m=T*a);let b=p/T,N=u/c,D=b>N;a==="contain"&&(D?(n=u,m=u/b):(n=c*b,m=c)),a==="cover"&&(D?(m=c,n=c*b):(n=u,m=u/b));let E=document.createElement("canvas"),_=E.getContext("2d");return E.width=Math.min(u-t,n),E.height=Math.min(c-i,m),_==null||_.drawImage(s,0,0,n,m),this._core.room.videoManager.setWatermark({x:t,y:i,imageUrl:E.toDataURL("image/png")})}};d(R,"Name","Watermark");var A=R;var V=A;return k(B);})().default;
|