trtc-sdk-v5
Advanced tools
Comparing version 5.8.3-beta.1 to 5.8.3-beta.2
{ | ||
"name": "trtc-sdk-v5", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "Tencent Cloud RTC SDK for Web", | ||
@@ -5,0 +5,0 @@ "main": "trtc.js", |
{ | ||
"name": "@rtc-plugin/cdn-streaming", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "TRTC Web SDK 5.x CDN streaming plugin", | ||
@@ -5,0 +5,0 @@ "main": "./cdn-streaming.esm.js", |
@@ -1,1 +0,1 @@ | ||
var N=Object.defineProperty,G=Object.defineProperties,M=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var O=(i,e,r)=>e in i?N(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,y=(i,e)=>{for(var r in e||(e={}))F.call(e,r)&&O(i,r,e[r]);if(x)for(var r of x(e))K.call(e,r)&&O(i,r,e[r]);return i},A=(i,e)=>G(i,H(e));var I=(i,e,r,o)=>{for(var t=o>1?void 0:o?M(e,r):e,a=i.length-1,n;a>=0;a--)(n=i[a])&&(t=(o?n(e,r,t):n(t))||t);return o&&t&&N(e,r,t),t};var b=(i,e,r)=>(O(i,typeof e!="symbol"?e+"":e,r),r);var P={properties:{roomId:{type:"number"},strRoomId:{type:"string"}}},_={name:"option",required:!0,properties:A(y({},P.properties),{userId:{type:"string"}})},L={name:"option",required:!0,properties:{updateList:{type:"array",required:!0,arrayItem:{required:!0,type:"object",properties:A(y({},_.properties),{userId:{required:!1,type:"string"},muteAudio:{type:"boolean"},muteVideo:{type:"boolean"},muteSubStream:{type:"boolean"}})}}}},k={name:"option",properties:y({},P.properties)};var p=i=>typeof i=="function";var j=0,W=1,V=2;function q({retryFunction:i,settings:e,onError:r,onRetrying:o,onRetryFailed:t,onRetrySuccess:a,context:n}){return function(...d){let{retries:m=5,timeout:u=1e3}=e,s=0,l=-1,c=j,R=async(f,E)=>{let w=n||this;try{let g=await i.apply(w,d);s>0&&a&&a.call(this,s),s=0,f(g)}catch(g){let U=()=>{clearTimeout(l),s=0,c=V,E(g)},h=()=>{c!==V&&s<(p(m)?m():m)?(s++,c=W,p(o)&&o.call(this,s,U),l=window.setTimeout(()=>{l=-1,R(f,E)},p(u)?u(s):u)):(U(),p(t)&&t.call(this,g))};p(r)?r.call(this,{error:g,retry:h,reject:E,retryFuncArgs:d,retriedCount:s}):h()}};return new Promise(R)}}var B=q;var T=new WeakMap;function D({settings:i={retries:5,timeout:2e3},onError:e,onRetrying:r,onRetryFailed:o}){return function(t,a,n){let d=B({retryFunction:n.value,settings:i,onError({error:m,retry:u,reject:s,retryFuncArgs:l}){var c;e?e.call(this,m,()=>{var R;(R=T.get(t))!=null&&R.has(a)?u():s(m)},s,l):(c=T.get(t))!=null&&c.has(a)?u():s(m)},onRetrying(m,u){var s;p(r)&&r.call(this,m,u),(s=T.get(t))!=null&&s.has(a)&&(T.get(t).get(a).stopRetry=u)},onRetryFailed:o});return n.value=function(...m){let u=T.get(t);return u?u.set(a,{args:m}):T.set(t,new Map([[a,{args:m}]])),d.apply(this,m).finally(()=>{var s;return(s=T.get(t))==null?void 0:s.delete(a)})},n}}var S=class S{constructor(e){this.core=e;b(this,"disableRandomCall",!0);b(this,"connectedRoomIdSet",new Set);b(this,"updateSeq",0);b(this,"_log");this._log=this.core.log.createChild({id:`${this.getAlias()}`})}getName(){return S.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 _;case"update":return L;case"stop":return k}}async start({roomId:e,strRoomId:r,userId:o}){let{RtcError:t,ErrorCode:a}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new t({code:a.ENV_NOT_SUPPORTED});let n=e||r,d=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(d.data.code!==0)throw new t({code:a.SERVER_ERROR,extraCode:d.data.code,message:d.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(d=>d.userId)?0:1,a=await this.core.room.sendSignalMessage({command:"update_other_room_forward_mode",responseCommand:String(8213),data:{seq:++this.updateSeq,operationType:t,updateList:e.map(({roomId:d,strRoomId:m,userId:u,muteAudio:s,muteVideo:l,muteSubStream:c})=>({roomId:d||m,userId:u,muteAudio:s,muteVideo:l,muteSubStream:c}))},retries:3});if(a.data.data.expectSeq)return this.updateSeq=a.data.data.expectSeq,this.update({updateList:e});if(a.data.code!==0)throw new r({code:o.SERVER_ERROR,extraCode:a.data.code,message:a.data.message});if(((n=a.data.data.errorList)==null?void 0:n.length)>0)throw new r({code:o.UNKNOWN_ERROR,message:a.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(){}};b(S,"Name","CrossRoom"),I([D({settings:{retries:3,timeout:1e3},onRetrying(i){this._log.warn(`retry start: ${i}`)}})],S.prototype,"start",1),I([D({settings:{retries:3,timeout:1e3},onRetrying(i){this._log.warn(`retry update: ${i}`)}})],S.prototype,"update",1);var C=S;var ne=C;export{C as CrossRoom,ne as default}; | ||
var N=Object.defineProperty,G=Object.defineProperties,M=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var O=(i,e,r)=>e in i?N(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,y=(i,e)=>{for(var r in e||(e={}))K.call(e,r)&&O(i,r,e[r]);if(x)for(var r of x(e))F.call(e,r)&&O(i,r,e[r]);return i},A=(i,e)=>G(i,H(e));var I=(i,e,r,o)=>{for(var t=o>1?void 0:o?M(e,r):e,a=i.length-1,n;a>=0;a--)(n=i[a])&&(t=(o?n(e,r,t):n(t))||t);return o&&t&&N(e,r,t),t};var b=(i,e,r)=>(O(i,typeof e!="symbol"?e+"":e,r),r);var P={properties:{roomId:{type:"number"},strRoomId:{type:"string"}}},_={name:"option",required:!0,properties:A(y({},P.properties),{userId:{type:"string"}})},L={name:"option",required:!0,properties:{updateList:{type:"array",required:!0,arrayItem:{required:!0,type:"object",properties:A(y({},_.properties),{userId:{required:!1,type:"string"},muteAudio:{type:"boolean"},muteVideo:{type:"boolean"},muteSubStream:{type:"boolean"}})}}}},k={name:"option",properties:y({},P.properties)};var p=i=>typeof i=="function";var j=0,W=1,V=2;function q({retryFunction:i,settings:e,onError:r,onRetrying:o,onRetryFailed:t,onRetrySuccess:a,context:n}){return function(...d){let{retries:m=5,timeout:u=1e3}=e,s=0,l=-1,c=j,R=async(f,E)=>{let w=n||this;try{let g=await i.apply(w,d);s>0&&a&&a.call(this,s),s=0,f(g)}catch(g){let U=()=>{clearTimeout(l),s=0,c=V,E(g)},h=()=>{c!==V&&s<(p(m)?m():m)?(s++,c=W,p(o)&&o.call(this,s,U),l=window.setTimeout(()=>{l=-1,R(f,E)},p(u)?u(s):u)):(U(),p(t)&&t.call(this,g))};p(r)?r.call(this,{error:g,retry:h,reject:E,retryFuncArgs:d,retriedCount:s}):h()}};return new Promise(R)}}var B=q;var T=new WeakMap;function D({settings:i={retries:5,timeout:2e3},onError:e,onRetrying:r,onRetryFailed:o}){return function(t,a,n){let d=B({retryFunction:n.value,settings:i,onError({error:m,retry:u,reject:s,retryFuncArgs:l}){var c;e?e.call(this,m,()=>{var R;(R=T.get(t))!=null&&R.has(a)?u():s(m)},s,l):(c=T.get(t))!=null&&c.has(a)?u():s(m)},onRetrying(m,u){var s;p(r)&&r.call(this,m,u),(s=T.get(t))!=null&&s.has(a)&&(T.get(t).get(a).stopRetry=u)},onRetryFailed:o});return n.value=function(...m){let u=T.get(t);return u?u.set(a,{args:m}):T.set(t,new Map([[a,{args:m}]])),d.apply(this,m).finally(()=>{var s;return(s=T.get(t))==null?void 0:s.delete(a)})},n}}var S=class S{constructor(e){this.core=e;b(this,"disableRandomCall",!0);b(this,"connectedRoomIdSet",new Set);b(this,"updateSeq",0);b(this,"_log");this._log=this.core.log.createChild({id:`${this.getAlias()}`})}getName(){return S.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 _;case"update":return L;case"stop":return k}}async start({roomId:e,strRoomId:r,userId:o}){let{RtcError:t,ErrorCode:a}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new t({code:a.ENV_NOT_SUPPORTED});let n=e||r,d=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(d.data.code!==0)throw new t({code:a.SERVER_ERROR,extraCode:d.data.code,message:d.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(d=>d.userId)?0:1,a=await this.core.room.sendSignalMessage({command:"update_other_room_forward_mode",responseCommand:String(8213),data:{seq:++this.updateSeq,operationType:t,updateList:e.map(({roomId:d,strRoomId:m,userId:u,muteAudio:s,muteVideo:l,muteSubStream:c})=>({roomId:d||m,userId:u,muteAudio:s,muteVideo:l,muteSubStream:c}))},retries:3});if(a.data.data.expectSeq)return this.updateSeq=a.data.data.expectSeq,this.update({updateList:e});if(a.data.code!==0)throw new r({code:o.SERVER_ERROR,extraCode:a.data.code,message:a.data.message});if(((n=a.data.data.errorList)==null?void 0:n.length)>0)throw new r({code:o.UNKNOWN_ERROR,message:a.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(){}};b(S,"Name","CrossRoom"),I([D({settings:{retries:3,timeout:1e3},onRetrying(i){this._log.warn(`retry start: ${i}`)}})],S.prototype,"start",1),I([D({settings:{retries:3,timeout:1e3},onRetrying(i){this._log.warn(`retry update: ${i}`)}})],S.prototype,"update",1);var C=S;var ne=C;export{C as CrossRoom,ne as default}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var CrossRoom=(()=>{var y=Object.defineProperty,H=Object.defineProperties,P=Object.getOwnPropertyDescriptor,F=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var I=(o,e,r)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,E=(o,e)=>{for(var r in e||(e={}))L.call(e,r)&&I(o,r,e[r]);if(N)for(var r of N(e))j.call(e,r)&&I(o,r,e[r]);return o},_=(o,e)=>H(o,F(e));var W=(o,e)=>{for(var r in e)y(o,r,{get:e[r],enumerable:!0})},q=(o,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of K(e))!L.call(o,t)&&t!==r&&y(o,t,{get:()=>e[t],enumerable:!(a=P(e,t))||a.enumerable});return o};var X=o=>q(y({},"__esModule",{value:!0}),o),D=(o,e,r,a)=>{for(var t=a>1?void 0:a?P(e,r):e,i=o.length-1,n;i>=0;i--)(n=o[i])&&(t=(a?n(e,r,t):n(t))||t);return a&&t&&y(e,r,t),t};var b=(o,e,r)=>(I(o,typeof e!="symbol"?e+"":e,r),r);var Z={};W(Z,{CrossRoom:()=>O,default:()=>Y});var k={properties:{roomId:{type:"number"},strRoomId:{type:"string"}}},C={name:"option",required:!0,properties:_(E({},k.properties),{userId:{type:"string"}})},V={name:"option",required:!0,properties:{updateList:{type:"array",required:!0,arrayItem:{required:!0,type:"object",properties:_(E({},C.properties),{userId:{required:!1,type:"string"},muteAudio:{type:"boolean"},muteVideo:{type:"boolean"},muteSubStream:{type:"boolean"}})}}}},B={name:"option",properties:E({},k.properties)};var p=o=>typeof o=="function";var J=0,$=1,w=2;function z({retryFunction:o,settings:e,onError:r,onRetrying:a,onRetryFailed:t,onRetrySuccess:i,context:n}){return function(...d){let{retries:m=5,timeout:u=1e3}=e,s=0,l=-1,c=J,R=async(U,A)=>{let M=n||this;try{let g=await o.apply(M,d);s>0&&i&&i.call(this,s),s=0,U(g)}catch(g){let h=()=>{clearTimeout(l),s=0,c=w,A(g)},x=()=>{c!==w&&s<(p(m)?m():m)?(s++,c=$,p(a)&&a.call(this,s,h),l=window.setTimeout(()=>{l=-1,R(U,A)},p(u)?u(s):u)):(h(),p(t)&&t.call(this,g))};p(r)?r.call(this,{error:g,retry:x,reject:A,retryFuncArgs:d,retriedCount:s}):x()}};return new Promise(R)}}var G=z;var T=new WeakMap;function f({settings:o={retries:5,timeout:2e3},onError:e,onRetrying:r,onRetryFailed:a}){return function(t,i,n){let d=G({retryFunction:n.value,settings:o,onError({error:m,retry:u,reject:s,retryFuncArgs:l}){var c;e?e.call(this,m,()=>{var R;(R=T.get(t))!=null&&R.has(i)?u():s(m)},s,l):(c=T.get(t))!=null&&c.has(i)?u():s(m)},onRetrying(m,u){var s;p(r)&&r.call(this,m,u),(s=T.get(t))!=null&&s.has(i)&&(T.get(t).get(i).stopRetry=u)},onRetryFailed:a});return n.value=function(...m){let u=T.get(t);return u?u.set(i,{args:m}):T.set(t,new Map([[i,{args:m}]])),d.apply(this,m).finally(()=>{var s;return(s=T.get(t))==null?void 0:s.delete(i)})},n}}var S=class S{constructor(e){this.core=e;b(this,"disableRandomCall",!0);b(this,"connectedRoomIdSet",new Set);b(this,"updateSeq",0);b(this,"_log");this._log=this.core.log.createChild({id:`${this.getAlias()}`})}getName(){return S.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 C;case"update":return V;case"stop":return B}}async start({roomId:e,strRoomId:r,userId:a}){let{RtcError:t,ErrorCode:i}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new t({code:i.ENV_NOT_SUPPORTED});let n=e||r,d=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(d.data.code!==0)throw new t({code:i.SERVER_ERROR,extraCode:d.data.code,message:d.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(d=>d.userId)?0:1,i=await this.core.room.sendSignalMessage({command:"update_other_room_forward_mode",responseCommand:String(8213),data:{seq:++this.updateSeq,operationType:t,updateList:e.map(({roomId:d,strRoomId:m,userId:u,muteAudio:s,muteVideo:l,muteSubStream:c})=>({roomId:d||m,userId:u,muteAudio:s,muteVideo:l,muteSubStream:c}))},retries:3});if(i.data.data.expectSeq)return this.updateSeq=i.data.data.expectSeq,this.update({updateList:e});if(i.data.code!==0)throw new r({code:a.SERVER_ERROR,extraCode:i.data.code,message:i.data.message});if(((n=i.data.data.errorList)==null?void 0:n.length)>0)throw new r({code:a.UNKNOWN_ERROR,message:i.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(){}};b(S,"Name","CrossRoom"),D([f({settings:{retries:3,timeout:1e3},onRetrying(o){this._log.warn(`retry start: ${o}`)}})],S.prototype,"start",1),D([f({settings:{retries:3,timeout:1e3},onRetrying(o){this._log.warn(`retry update: ${o}`)}})],S.prototype,"update",1);var O=S;var Y=O;return X(Z);})().default; | ||
"use strict";var CrossRoom=(()=>{var y=Object.defineProperty,H=Object.defineProperties,P=Object.getOwnPropertyDescriptor,K=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var I=(o,e,r)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,E=(o,e)=>{for(var r in e||(e={}))L.call(e,r)&&I(o,r,e[r]);if(N)for(var r of N(e))j.call(e,r)&&I(o,r,e[r]);return o},_=(o,e)=>H(o,K(e));var W=(o,e)=>{for(var r in e)y(o,r,{get:e[r],enumerable:!0})},q=(o,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of F(e))!L.call(o,t)&&t!==r&&y(o,t,{get:()=>e[t],enumerable:!(a=P(e,t))||a.enumerable});return o};var X=o=>q(y({},"__esModule",{value:!0}),o),D=(o,e,r,a)=>{for(var t=a>1?void 0:a?P(e,r):e,i=o.length-1,n;i>=0;i--)(n=o[i])&&(t=(a?n(e,r,t):n(t))||t);return a&&t&&y(e,r,t),t};var b=(o,e,r)=>(I(o,typeof e!="symbol"?e+"":e,r),r);var Z={};W(Z,{CrossRoom:()=>O,default:()=>Y});var k={properties:{roomId:{type:"number"},strRoomId:{type:"string"}}},C={name:"option",required:!0,properties:_(E({},k.properties),{userId:{type:"string"}})},V={name:"option",required:!0,properties:{updateList:{type:"array",required:!0,arrayItem:{required:!0,type:"object",properties:_(E({},C.properties),{userId:{required:!1,type:"string"},muteAudio:{type:"boolean"},muteVideo:{type:"boolean"},muteSubStream:{type:"boolean"}})}}}},B={name:"option",properties:E({},k.properties)};var p=o=>typeof o=="function";var J=0,$=1,w=2;function z({retryFunction:o,settings:e,onError:r,onRetrying:a,onRetryFailed:t,onRetrySuccess:i,context:n}){return function(...d){let{retries:m=5,timeout:u=1e3}=e,s=0,l=-1,c=J,R=async(U,A)=>{let M=n||this;try{let g=await o.apply(M,d);s>0&&i&&i.call(this,s),s=0,U(g)}catch(g){let h=()=>{clearTimeout(l),s=0,c=w,A(g)},x=()=>{c!==w&&s<(p(m)?m():m)?(s++,c=$,p(a)&&a.call(this,s,h),l=window.setTimeout(()=>{l=-1,R(U,A)},p(u)?u(s):u)):(h(),p(t)&&t.call(this,g))};p(r)?r.call(this,{error:g,retry:x,reject:A,retryFuncArgs:d,retriedCount:s}):x()}};return new Promise(R)}}var G=z;var T=new WeakMap;function f({settings:o={retries:5,timeout:2e3},onError:e,onRetrying:r,onRetryFailed:a}){return function(t,i,n){let d=G({retryFunction:n.value,settings:o,onError({error:m,retry:u,reject:s,retryFuncArgs:l}){var c;e?e.call(this,m,()=>{var R;(R=T.get(t))!=null&&R.has(i)?u():s(m)},s,l):(c=T.get(t))!=null&&c.has(i)?u():s(m)},onRetrying(m,u){var s;p(r)&&r.call(this,m,u),(s=T.get(t))!=null&&s.has(i)&&(T.get(t).get(i).stopRetry=u)},onRetryFailed:a});return n.value=function(...m){let u=T.get(t);return u?u.set(i,{args:m}):T.set(t,new Map([[i,{args:m}]])),d.apply(this,m).finally(()=>{var s;return(s=T.get(t))==null?void 0:s.delete(i)})},n}}var S=class S{constructor(e){this.core=e;b(this,"disableRandomCall",!0);b(this,"connectedRoomIdSet",new Set);b(this,"updateSeq",0);b(this,"_log");this._log=this.core.log.createChild({id:`${this.getAlias()}`})}getName(){return S.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 C;case"update":return V;case"stop":return B}}async start({roomId:e,strRoomId:r,userId:a}){let{RtcError:t,ErrorCode:i}=this.core.errorModule;if(!this.core.room.sendSignalMessage)throw new t({code:i.ENV_NOT_SUPPORTED});let n=e||r,d=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(d.data.code!==0)throw new t({code:i.SERVER_ERROR,extraCode:d.data.code,message:d.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(d=>d.userId)?0:1,i=await this.core.room.sendSignalMessage({command:"update_other_room_forward_mode",responseCommand:String(8213),data:{seq:++this.updateSeq,operationType:t,updateList:e.map(({roomId:d,strRoomId:m,userId:u,muteAudio:s,muteVideo:l,muteSubStream:c})=>({roomId:d||m,userId:u,muteAudio:s,muteVideo:l,muteSubStream:c}))},retries:3});if(i.data.data.expectSeq)return this.updateSeq=i.data.data.expectSeq,this.update({updateList:e});if(i.data.code!==0)throw new r({code:a.SERVER_ERROR,extraCode:i.data.code,message:i.data.message});if(((n=i.data.data.errorList)==null?void 0:n.length)>0)throw new r({code:a.UNKNOWN_ERROR,message:i.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(){}};b(S,"Name","CrossRoom"),D([f({settings:{retries:3,timeout:1e3},onRetrying(o){this._log.warn(`retry start: ${o}`)}})],S.prototype,"start",1),D([f({settings:{retries:3,timeout:1e3},onRetrying(o){this._log.warn(`retry update: ${o}`)}})],S.prototype,"update",1);var O=S;var Y=O;return X(Z);})().default; |
{ | ||
"name": "@rtc-plugin/cross-room", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "TRTC Web SDK 5.x Cross Room plugin", | ||
@@ -5,0 +5,0 @@ "main": "./cross-room.esm.js", |
{ | ||
"name": "@rtc-plugin/debug", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "TRTC Web SDK Debug Plugin", | ||
@@ -5,0 +5,0 @@ "main": "./debug.esm.js", |
{ | ||
"name": "@rtc-plugin/device-detector", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "TRTC Web SDK 5.x device detector plugin", | ||
@@ -5,0 +5,0 @@ "main": "./device-detector.esm.js", |
{ | ||
"name": "@rtc-plugin/basic-beauty", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "TRTC Web SDK 5.x basic-beauty plugin", | ||
@@ -5,0 +5,0 @@ "main": "./basic-beauty.esm.js", |
{ | ||
"name": "@rtc-plugin/beauty", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "TRTC Web SDK 5.x beauty plugin", | ||
@@ -5,0 +5,0 @@ "main": "./beauty.esm.js", |
{ | ||
"name": "@rtc-plugin/virtual-background", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "TRTC Web SDK 5.x virtual background plugin", | ||
@@ -5,0 +5,0 @@ "main": "./virtual-background.esm.js", |
{ | ||
"name": "@rtc-plugin/watermark", | ||
"version": "5.8.3-beta.1", | ||
"version": "5.8.3-beta.2", | ||
"description": "TRTC Web SDK 5.x watermark plugin", | ||
@@ -5,0 +5,0 @@ "main": "./watermark.esm.js", |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54343
11915252