trtc-sdk-v5 5.8.1-beta.9 → 5.8.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/package.json +1 -1
- package/plugins/cdn-streaming/package.json +1 -1
- package/plugins/cross-room/cross-room.esm.js +1 -1
- package/plugins/cross-room/cross-room.iife.js +1 -1
- package/plugins/cross-room/package.json +1 -1
- package/plugins/debug/package.json +1 -1
- package/plugins/device-detector/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/virtual-background/virtual-background.esm.d.ts +1 -0
- package/plugins/video-effect/virtual-background/virtual-background.esm.js +55 -26
- package/plugins/video-effect/virtual-background/virtual-background.iife.js +55 -26
- package/plugins/video-effect/watermark/package.json +1 -1
- package/trtc.esm.js +30 -32
- package/trtc.js +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty,
|
|
1
|
+
var D=Object.defineProperty,U=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var p=(a,e,r)=>e in a?D(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,m=(a,e)=>{for(var r in e||(e={}))N.call(e,r)&&p(a,r,e[r]);if(T)for(var r of T(e))y.call(e,r)&&p(a,r,e[r]);return a},c=(a,e)=>U(a,C(e));var d=(a,e,r)=>(p(a,typeof e!="symbol"?e+"":e,r),r);var b={properties:{roomId:{type:"number"},strRoomId:{type:"string"}}},l={name:"option",required:!0,properties:c(m({},b.properties),{userId:{type:"string"}})},R={name:"option",required:!0,properties:{updateList:{type:"array",required:!0,arrayItem:{required:!0,type:"object",properties:c(m({},l.properties),{userId:{required:!1,type:"string"},muteAudio:{type:"boolean"},muteVideo:{type:"boolean"},muteSubStream:{type:"boolean"}})}}}},E={name:"option",properties:m({},b.properties)};var u=class u{constructor(e){this.core=e;d(this,"connectedRoomIdSet",new Set);d(this,"updateSeq",0)}getName(){return u.Name}getAlias(){return"crs-r"}getGroup(e){var o;let r=(e==null?void 0:e.userId)||((o=e==null?void 0:e.updateList)==null?void 0:o[0].userId)||"";return r||(e?e.updateList?String(e.updateList[0].roomId)||e.updateList[0].strRoomId||"":String(e.roomId)||e.strRoomId||"":"*")}getValidateRule(e){switch(e){case"start":return l;case"update":return R;case"stop":return E}}async start({roomId:e,strRoomId:r,userId:o}){let{RtcError:t,ErrorCode:s}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new t({code:s.ENV_NOT_SUPPORTED});let n=e||r,i=await this.core.room.sendSignalMessage({command:"connect_other_room",responseCommand:String(8209),data:{roomId:n,userId:o,localRoomId:o?void 0:this.core.room.roomId},retries:3});if(i.data.code!==0)throw new t({code:s.SERVER_ERROR,extraCode:i.data.code,message:i.data.message});o||this.connectedRoomIdSet.add(n)}async update({updateList:e}){var n;let{RtcError:r,ErrorCode:o}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new r({code:o.ENV_NOT_SUPPORTED});let t=e.find(i=>i.userId)?0:1,s=await this.core.room.sendSignalMessage({command:"update_other_room_forward_mode",responseCommand:String(8213),data:{seq:++this.updateSeq,operationType:t,updateList:e.map(({roomId:i,strRoomId:g,userId:O,muteAudio:_,muteVideo:I,muteSubStream:A})=>({roomId:i||g,userId:O,muteAudio:_,muteVideo:I,muteSubStream:A}))},retries:3});if(s.data.data.expectSeq)return this.updateSeq=s.data.data.expectSeq,this.update({updateList:e});if(s.data.code!==0)throw new r({code:o.SERVER_ERROR,extraCode:s.data.code,message:s.data.message});if(((n=s.data.data.errorList)==null?void 0:n.length)>0)throw new r({code:o.UNKNOWN_ERROR,message:s.data.data.errorList[0].message})}async stop({roomId:e,strRoomId:r}={}){let o=e||r;if(o)await this.doStop(o);else if(this.connectedRoomIdSet.size>0)for(let t of[...this.connectedRoomIdSet.values()])await this.doStop(t);else await this.doStop()}async doStop(e){let{RtcError:r,ErrorCode:o}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new r({code:o.ENV_NOT_SUPPORTED});let t=await this.core.room.sendSignalMessage({command:"disconnect_other_room",responseCommand:String(8211),data:{roomId:e,localRoomId:this.core.room.roomId},retries:3});if(t.data.code!==0)throw new r({code:o.SERVER_ERROR,extraCode:t.data.code,message:t.data.message});this.connectedRoomIdSet.delete(e)}destroy(){}};d(u,"Name","CrossRoom");var S=u;var G=S;export{S as CrossRoom,G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var CrossRoom=(()=>{var m=Object.defineProperty,
|
|
1
|
+
"use strict";var CrossRoom=(()=>{var m=Object.defineProperty,C=Object.defineProperties,N=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var l=(o,e,r)=>e in o?m(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,u=(o,e)=>{for(var r in e||(e={}))R.call(e,r)&&l(o,r,e[r]);if(b)for(var r of b(e))P.call(e,r)&&l(o,r,e[r]);return o},S=(o,e)=>C(o,y(e));var h=(o,e)=>{for(var r in e)m(o,r,{get:e[r],enumerable:!0})},f=(o,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of x(e))!R.call(o,t)&&t!==r&&m(o,t,{get:()=>e[t],enumerable:!(a=N(e,t))||a.enumerable});return o};var L=o=>f(m({},"__esModule",{value:!0}),o);var d=(o,e,r)=>(l(o,typeof e!="symbol"?e+"":e,r),r);var V={};h(V,{CrossRoom:()=>p,default:()=>k});var E={properties:{roomId:{type:"number"},strRoomId:{type:"string"}}},T={name:"option",required:!0,properties:S(u({},E.properties),{userId:{type:"string"}})},g={name:"option",required:!0,properties:{updateList:{type:"array",required:!0,arrayItem:{required:!0,type:"object",properties:S(u({},T.properties),{userId:{required:!1,type:"string"},muteAudio:{type:"boolean"},muteVideo:{type:"boolean"},muteSubStream:{type:"boolean"}})}}}},O={name:"option",properties:u({},E.properties)};var c=class c{constructor(e){this.core=e;d(this,"connectedRoomIdSet",new Set);d(this,"updateSeq",0)}getName(){return c.Name}getAlias(){return"crs-r"}getGroup(e){var a;let r=(e==null?void 0:e.userId)||((a=e==null?void 0:e.updateList)==null?void 0:a[0].userId)||"";return r||(e?e.updateList?String(e.updateList[0].roomId)||e.updateList[0].strRoomId||"":String(e.roomId)||e.strRoomId||"":"*")}getValidateRule(e){switch(e){case"start":return T;case"update":return g;case"stop":return O}}async start({roomId:e,strRoomId:r,userId:a}){let{RtcError:t,ErrorCode:s}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new t({code:s.ENV_NOT_SUPPORTED});let n=e||r,i=await this.core.room.sendSignalMessage({command:"connect_other_room",responseCommand:String(8209),data:{roomId:n,userId:a,localRoomId:a?void 0:this.core.room.roomId},retries:3});if(i.data.code!==0)throw new t({code:s.SERVER_ERROR,extraCode:i.data.code,message:i.data.message});a||this.connectedRoomIdSet.add(n)}async update({updateList:e}){var n;let{RtcError:r,ErrorCode:a}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new r({code:a.ENV_NOT_SUPPORTED});let t=e.find(i=>i.userId)?0:1,s=await this.core.room.sendSignalMessage({command:"update_other_room_forward_mode",responseCommand:String(8213),data:{seq:++this.updateSeq,operationType:t,updateList:e.map(({roomId:i,strRoomId:_,userId:I,muteAudio:A,muteVideo:D,muteSubStream:U})=>({roomId:i||_,userId:I,muteAudio:A,muteVideo:D,muteSubStream:U}))},retries:3});if(s.data.data.expectSeq)return this.updateSeq=s.data.data.expectSeq,this.update({updateList:e});if(s.data.code!==0)throw new r({code:a.SERVER_ERROR,extraCode:s.data.code,message:s.data.message});if(((n=s.data.data.errorList)==null?void 0:n.length)>0)throw new r({code:a.UNKNOWN_ERROR,message:s.data.data.errorList[0].message})}async stop({roomId:e,strRoomId:r}={}){let a=e||r;if(a)await this.doStop(a);else if(this.connectedRoomIdSet.size>0)for(let t of[...this.connectedRoomIdSet.values()])await this.doStop(t);else await this.doStop()}async doStop(e){let{RtcError:r,ErrorCode:a}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new r({code:a.ENV_NOT_SUPPORTED});let t=await this.core.room.sendSignalMessage({command:"disconnect_other_room",responseCommand:String(8211),data:{roomId:e,localRoomId:this.core.room.roomId},retries:3});if(t.data.code!==0)throw new r({code:a.SERVER_ERROR,extraCode:t.data.code,message:t.data.message});this.connectedRoomIdSet.delete(e)}destroy(){}};d(c,"Name","CrossRoom");var p=c;var k=p;return L(V);})().default;
|
|
@@ -21,6 +21,7 @@ export interface UpdateVirtualBackgroundOptions {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export declare class VirtualBackground {
|
|
24
|
+
static isSupported(): boolean;
|
|
24
25
|
start(options: VirtualBackgroundOptions): Promise<void>;
|
|
25
26
|
update(options: UpdateVirtualBackgroundOptions): Promise<void>;
|
|
26
27
|
stop(): Promise<void>;
|