trtc-sdk-v5 5.8.4-beta.13 → 5.8.4-beta.15
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/debug-dialog.esm.js +126 -0
- package/plugins/debug/debug-dialog.js +1 -0
- package/plugins/debug/debug.esm.js +26 -26
- package/plugins/debug/debug.iife.js +28 -28
- 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.js +26 -26
- package/plugins/video-effect/virtual-background/virtual-background.iife.js +21 -21
- package/plugins/video-effect/watermark/package.json +1 -1
- package/trtc.esm.js +31 -42
- package/trtc.js +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h=Object.defineProperty,G=Object.defineProperties,M=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var O=(s,e,r)=>e in s?h(s,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[e]=r,E=(s,e)=>{for(var r in e||(e={}))F.call(e,r)&&O(s,r,e[r]);if(N)for(var r of N(e))K.call(e,r)&&O(s,r,e[r]);return s},A=(s,e)=>G(s,H(e));var _=(s,e,r,o)=>{for(var t=o>1?void 0:o?M(e,r):e,a=s.length-1,n;a>=0;a--)(n=s[a])&&(t=(o?n(e,r,t):n(t))||t);return o&&t&&h(e,r,t),t};var b=(s,e,r)=>(O(s,typeof e!="symbol"?e+"":e,r),r);var P={properties:{roomId:{type:"number"},strRoomId:{type:"string"}}},I={name:"option",required:!0,properties:A(E({},P.properties),{userId:{type:"string"}})},L={name:"option",required:!0,properties:{updateList:{type:"array",required:!0,arrayItem:{required:!0,type:"object",properties:A(E({},I.properties),{userId:{required:!1,type:"string"},muteAudio:{type:"boolean"},muteVideo:{type:"boolean"},muteSubStream:{type:"boolean"}})}}}},k={name:"option",properties:E({},P.properties)};var p=s=>typeof s=="function";var W=0,j=1,V=2;function q({retryFunction:s,settings:e,onError:r,onRetrying:o,onRetryFailed:t,onRetrySuccess:a,context:n}){return function(...d){let{retries:m=5,timeout:u=1e3}=e,i=0,l=-1,c=W,R=async(C,y)=>{let w=n||this;try{let g=await s.apply(w,d);i>0&&a&&a.call(this,i),i=0,C(g)}catch(g){let U=()=>{clearTimeout(l),i=0,c=V,y(g)},x=()=>{c!==V&&i<(p(m)?m():m)?(i++,c=j,p(o)&&o.call(this,i,U),l=window.setTimeout(()=>{l=-1,R(C,y)},p(u)?u(i):u)):(U(),p(t)&&t.call(this,g))};p(r)?r.call(this,{error:g,retry:x,reject:y,retryFuncArgs:d,retriedCount:i}):x()}};return new Promise(R)}}var B=q;var T=new WeakMap;function D({settings:s={retries:5,timeout:2e3},onError:e,onRetrying:r,onRetryFailed:o}){return function(t,a,n){let d=B({retryFunction:n.value,settings:s,onError({error:m,retry:u,reject:i,retryFuncArgs:l}){var c;e?e.call(this,m,()=>{var R;(R=T.get(t))!=null&&R.has(a)?u():i(m)},i,l):(c=T.get(t))!=null&&c.has(a)?u():i(m)},onRetrying(m,u){var i;p(r)&&r.call(this,m,u),(i=T.get(t))!=null&&i.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 i;return(i=T.get(t))==null?void 0:i.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 I;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:i,muteVideo:l,muteSubStream:c})=>({roomId:d||m,userId:u,muteAudio:i,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"),_([D({settings:{retries:3,timeout:1e3},onRetrying(s){this._log.warn(`retry start: ${s}`)}})],S.prototype,"start",1),_([D({settings:{retries:3,timeout:1e3},onRetrying(s){this._log.warn(`retry update: ${s}`)}})],S.prototype,"update",1);var f=S;var ne=f;export{f as CrossRoom,ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var CrossRoom=(()=>{var E=Object.defineProperty,H=Object.defineProperties,P=Object.getOwnPropertyDescriptor,F=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertyNames,
|
|
1
|
+
"use strict";var CrossRoom=(()=>{var E=Object.defineProperty,H=Object.defineProperties,P=Object.getOwnPropertyDescriptor,F=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var _=(o,e,r)=>e in o?E(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,y=(o,e)=>{for(var r in e||(e={}))L.call(e,r)&&_(o,r,e[r]);if(h)for(var r of h(e))W.call(e,r)&&_(o,r,e[r]);return o},I=(o,e)=>H(o,F(e));var j=(o,e)=>{for(var r in e)E(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&&E(o,t,{get:()=>e[t],enumerable:!(a=P(e,t))||a.enumerable});return o};var X=o=>q(E({},"__esModule",{value:!0}),o),D=(o,e,r,a)=>{for(var t=a>1?void 0:a?P(e,r):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(t=(a?n(e,r,t):n(t))||t);return a&&t&&E(e,r,t),t};var b=(o,e,r)=>(_(o,typeof e!="symbol"?e+"":e,r),r);var Z={};j(Z,{CrossRoom:()=>O,default:()=>z});var k={properties:{roomId:{type:"number"},strRoomId:{type:"string"}}},f={name:"option",required:!0,properties:I(y({},k.properties),{userId:{type:"string"}})},V={name:"option",required:!0,properties:{updateList:{type:"array",required:!0,arrayItem:{required:!0,type:"object",properties:I(y({},f.properties),{userId:{required:!1,type:"string"},muteAudio:{type:"boolean"},muteVideo:{type:"boolean"},muteSubStream:{type:"boolean"}})}}}},B={name:"option",properties:y({},k.properties)};var p=o=>typeof o=="function";var J=0,Y=1,w=2;function $({retryFunction:o,settings:e,onError:r,onRetrying:a,onRetryFailed:t,onRetrySuccess:s,context:n}){return function(...d){let{retries:m=5,timeout:u=1e3}=e,i=0,l=-1,c=J,R=async(U,A)=>{let M=n||this;try{let g=await o.apply(M,d);i>0&&s&&s.call(this,i),i=0,U(g)}catch(g){let x=()=>{clearTimeout(l),i=0,c=w,A(g)},N=()=>{c!==w&&i<(p(m)?m():m)?(i++,c=Y,p(a)&&a.call(this,i,x),l=window.setTimeout(()=>{l=-1,R(U,A)},p(u)?u(i):u)):(x(),p(t)&&t.call(this,g))};p(r)?r.call(this,{error:g,retry:N,reject:A,retryFuncArgs:d,retriedCount:i}):N()}};return new Promise(R)}}var G=$;var T=new WeakMap;function C({settings:o={retries:5,timeout:2e3},onError:e,onRetrying:r,onRetryFailed:a}){return function(t,s,n){let d=G({retryFunction:n.value,settings:o,onError({error:m,retry:u,reject:i,retryFuncArgs:l}){var c;e?e.call(this,m,()=>{var R;(R=T.get(t))!=null&&R.has(s)?u():i(m)},i,l):(c=T.get(t))!=null&&c.has(s)?u():i(m)},onRetrying(m,u){var i;p(r)&&r.call(this,m,u),(i=T.get(t))!=null&&i.has(s)&&(T.get(t).get(s).stopRetry=u)},onRetryFailed:a});return n.value=function(...m){let u=T.get(t);return u?u.set(s,{args:m}):T.set(t,new Map([[s,{args:m}]])),d.apply(this,m).finally(()=>{var i;return(i=T.get(t))==null?void 0:i.delete(s)})},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 f;case"update":return V;case"stop":return B}}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,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:s.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,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:d,strRoomId:m,userId:u,muteAudio:i,muteVideo:l,muteSubStream:c})=>({roomId:d||m,userId:u,muteAudio:i,muteVideo:l,muteSubStream:c}))},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(){}};b(S,"Name","CrossRoom"),D([C({settings:{retries:3,timeout:1e3},onRetrying(o){this._log.warn(`retry start: ${o}`)}})],S.prototype,"start",1),D([C({settings:{retries:3,timeout:1e3},onRetrying(o){this._log.warn(`retry update: ${o}`)}})],S.prototype,"update",1);var O=S;var z=O;return X(Z);})().default;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
var ne=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var ve=(d,t,e)=>t in d?ne(d,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[t]=e;var Q=(d,t,e,i)=>{for(var s=i>1?void 0:i?fe(t,e):t,o=d.length-1,n;o>=0;o--)(n=d[o])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&ne(t,e,s),s};var g=(d,t,e)=>(ve(d,typeof t!="symbol"?t+"":t,e),e);function re(d){return function(t,e,i){return i.value=d(i.value,e),i}}var z=new WeakMap;function Z(d,t){return re((e,i)=>function(...s){var u,p;let o=(u=z.get(this))==null?void 0:u.get(t(...s));o&&o>0&&clearTimeout(o);let n=window.setTimeout(()=>{e.apply(this,s)},d);z.has(this)?(p=z.get(this))==null||p.set(t(...s),n):z.set(this,new Map([[t(...s),n]]))})}var ke=typeof location=="undefined"?!1:location.protocol==="file:"||location.hostname==="localhost"||location.hostname==="127.0.0.1",ee=()=>{let d=window.navigator&&window.navigator.userAgent||"",t=/iPad/i.test(d)||/iPhone/i.test(d),e=/Android/i.test(d);return t||e},ye=()=>{let d=navigator.language;return d=d.substring(0,2),d==="zh"},_=ye(),l={LOG_BUTTON:_?"\u65E5\u5FD7":"Log",NETWORK_BUTTON:_?"\u7F51\u7EDC":"Network",DUMP_BUTTON:_?"\u8F6C\u50A8":"Dump",DUMPING_BUTTON:_?"\u8F6C\u50A8\u4E2D":"Dumping",END_BUTTON:_?"\u7ED3\u675F":"End",UPLOAD_BUTTON:_?"\u4E0A\u4F20":"Upload",EXPORT_BUTTON:_?"\u5BFC\u51FA":"Export",HIDE_BUTTON:_?"\u9690\u85CF":"Hide",GO_BOTTOM:_?"\u5E95\u90E8":"goBottom",BACK_TOP:_?"\u9876\u90E8":"backTop",UPLINK:_?"\u4E0A\u884C":"Uplink",DOWNLINK:_?"\u4E0B\u884C":"Downlink",NO_DATA:_?"\u6682\u65E0\u6570\u636E":"No Data",BASIC:_?"\u57FA\u7840":"Basic",DURATION:_?"\u65F6\u957F":"Duration",VIDEO:_?"\u89C6\u9891":"Video",AUDIO:_?"\u97F3\u9891":"Audio",SCREEN:_?"\u5C4F\u5E55":"Screen"},le=d=>d.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d").replace(">",">").replace(">","<"),S={"play() error: NotAllowedError:":{tips_zh:d=>d.includes("main <video>")||d.includes("main <audio>")?"\u8FDC\u7AEF\u6D41\u81EA\u52A8\u64AD\u653E\u53D7\u9650\u5BFC\u81F4\u64AD\u653E\u5931\u8D25":"\u672C\u5730\u6D41\u51FA\u73B0\u81EA\u52A8\u64AD\u653E\u5931\u8D25\u62A5\u9519\uFF0C\u4E00\u822C\u53EA\u51FA\u73B0\u5728 Android \u5FAE\u4FE1\u8BBE\u5907\uFF0C\u65E0\u9700\u5904\u7406",tips_en:d=>d.includes("main <video>")||d.includes("main <audio>")?"Remote stream auto play is restricted and playback fails":"Local stream playback failure, generally only occurs in Android WeChat devices, no need to handle",color:"red",class:"red"},"updateStream() try to recover local stream":{tips_zh:"\u8BBE\u5907\u91C7\u96C6\u5F02\u5E38\uFF0C\u6B63\u5728\u5C1D\u8BD5\u81EA\u52A8\u6062\u590D\u91C7\u96C6",tips_en:"Device acquisition exception, automatic recovery is in progress"},"updateStream() recover local stream successfully":{tips_zh:"\u8BBE\u5907\u91C7\u96C6\u5F02\u5E38\uFF0C\u81EA\u52A8\u6062\u590D\u91C7\u96C6\u6210\u529F",tips_en:"Device acquisition exception, automatic recovery is successful"},"updateStream() failed to recover local stream":{tips_zh:"\u8BBE\u5907\u91C7\u96C6\u5F02\u5E38\uFF0C\u81EA\u52A8\u6062\u590D\u91C7\u96C6\u5931\u8D25",tips_en:"Device acquisition exception, automatic recovery failed"},"main stream - video track is muted":{tips_zh:"\u8868\u793A\u6536\u5230\u7684\u89C6\u9891\u6570\u636E\u6682\u4E0D\u8DB3\u4EE5\u64AD\u653E\uFF0C\u4E00\u822C\u662F\u7F51\u7EDC\u539F\u56E0\u5F15\u8D77\uFF0C\u5F53\u6536\u5230\u8DB3\u591F\u64AD\u653E\u7684\u6570\u636E\u4F1A\u53D8\u6210 unmuted \u72B6\u6001\u3002",tips_en:"Indicates that the received video data is not enough for playback. This is usually caused by network reasons. When enough data is received for playback, the state will change to unmuted."},"main stream - audio track is muted":{tips_zh:"\u8868\u793A\u6536\u5230\u7684\u97F3\u9891\u6570\u636E\u6682\u4E0D\u8DB3\u4EE5\u64AD\u653E\uFF0C\u4E00\u822C\u662F\u7F51\u7EDC\u539F\u56E0\u5F15\u8D77\uFF0C\u5F53\u6536\u5230\u8DB3\u591F\u64AD\u653E\u7684\u6570\u636E\u4F1A\u53D8\u6210 unmuted \u72B6\u6001\u3002",tips_en:"Indicates that the received audio data is not enough for playback. This is usually caused by network reasons. When enough data is received for playback, the state will change to unmuted."},"auxiliary stream - video track is muted":{tips_zh:"\u8868\u793A\u6536\u5230\u7684\u5C4F\u5E55\u5206\u4EAB\u6570\u636E\u6682\u4E0D\u8DB3\u4EE5\u64AD\u653E\uFF0C\u4E00\u822C\u662F\u7F51\u7EDC\u539F\u56E0\u5F15\u8D77\uFF0C\u5F53\u6536\u5230\u8DB3\u591F\u64AD\u653E\u7684\u6570\u636E\u4F1A\u53D8\u6210 unmuted \u72B6\u6001\u3002",tips_en:"Indicates that the received screen sharing data is not enough for playback. This is usually caused by network reasons. When enough data is received for playback, the state will change to unmuted."},"main stream - video track is unable to provide media output":{tips_zh:"\u8868\u793A\u6536\u5230\u7684\u89C6\u9891\u6570\u636E\u6682\u4E0D\u8DB3\u4EE5\u64AD\u653E\uFF0C\u4E00\u822C\u662F\u7F51\u7EDC\u539F\u56E0\u5F15\u8D77\uFF0C\u5F53\u6536\u5230\u8DB3\u591F\u64AD\u653E\u7684\u6570\u636E\u4F1A\u53D8\u6210 unmuted \u72B6\u6001\u3002",tips_en:"Indicates that the received video data is not enough for playback. This is usually caused by network reasons. When enough data is received for playback, the state will change to unmuted."},"main stream - audio track is unable to provide media output":{tips_zh:"\u8868\u793A\u6536\u5230\u7684\u97F3\u9891\u6570\u636E\u6682\u4E0D\u8DB3\u4EE5\u64AD\u653E\uFF0C\u4E00\u822C\u662F\u7F51\u7EDC\u539F\u56E0\u5F15\u8D77\uFF0C\u5F53\u6536\u5230\u8DB3\u591F\u64AD\u653E\u7684\u6570\u636E\u4F1A\u53D8\u6210 unmuted \u72B6\u6001\u3002",tips_en:"Indicates that the received audio data is not enough for playback. This is usually caused by network reasons. When enough data is received for playback, the state will change to unmuted."},"auxiliary stream - video track is unable to provide media output":{tips_zh:"\u8868\u793A\u6536\u5230\u7684\u5C4F\u5E55\u5206\u4EAB\u6570\u636E\u6682\u4E0D\u8DB3\u4EE5\u64AD\u653E\uFF0C\u4E00\u822C\u662F\u7F51\u7EDC\u539F\u56E0\u5F15\u8D77\uFF0C\u5F53\u6536\u5230\u8DB3\u591F\u64AD\u653E\u7684\u6570\u636E\u4F1A\u53D8\u6210 unmuted \u72B6\u6001\u3002",tips_en:"Indicates that the received screen sharing data is not enough for playback. This is usually caused by network reasons. When enough data is received for playback, the state will change to unmuted."},"main stream - video track is unmuted":{tips_zh:"\u6536\u5230\u4E86\u8DB3\u591F\u64AD\u653E\u7684\u89C6\u9891\u6570\u636E",tips_en:"Received enough playback video data"},"main stream - audio track is unmuted":{tips_zh:"\u6536\u5230\u4E86\u8DB3\u591F\u64AD\u653E\u7684\u97F3\u9891\u6570\u636E",tips_en:"Received enough playback audio data"},"auxiliary stream - video track is unmuted":{tips_zh:"\u6536\u5230\u4E86\u8DB3\u591F\u64AD\u653E\u7684\u5C4F\u5E55\u5206\u4EAB\u6570\u636E",tips_en:"Received enough playback screen sharing data"},"main stream - audio player track is ended":{tips_zh:"\u8FDC\u7AEF\u97F3\u9891\u8F68\u9053\u505C\u6B62",tips_en:"Remote audio track stopped"},"main stream - video player track is ended":{tips_zh:"\u8FDC\u7AEF\u89C6\u9891\u8F68\u9053\u505C\u6B62",tips_en:"Remote video track stopped"},"auxiliary stream - video player track is ended":{tips_zh:"\u8FDC\u7AEF\u5C4F\u5E55\u5206\u4EAB\u8F68\u9053\u505C\u6B62",tips_en:"Received enough playback screen sharing data"},"stream - video track is muted":{tips_zh:"\u6444\u50CF\u5934\u91C7\u96C6\u6682\u505C\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\uFF0C\u9700\u8981\u5BA2\u6237\u91CD\u65B0\u91C7\u96C6\u3002",tips_en:"Camera capture is paused, usually due to the device being occupied by other applications or the browser media permission being revoked. The client needs to re-capture.",color:"orange"},"stream - video track is unable to provide media output":{tips_zh:"\u6444\u50CF\u5934\u91C7\u96C6\u6682\u505C\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\uFF0C\u9700\u8981\u5BA2\u6237\u91CD\u65B0\u91C7\u96C6\u3002v4.11.4+ \u7248\u672C SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\uFF0C\u65E0\u9700\u5BA2\u6237\u5904\u7406",tips_en:"The camera acquisition is paused, usually because the device is occupied by other applications or the browser media permissions are revoked, and the customer needs to re-acquire. SDK v4.11.4+ will automatically resume acquisition without customer intervention",color:"orange"},"video track is unable to provide media output":{tips_zh:d=>d.includes("\u2193")?"\u8FDC\u7AEF track \u6682\u65F6\u65E0\u6CD5\u89E3\u7801\u6570\u636E\uFF0C\u53EF\u80FD\u662F\u7F51\u7EDC\u6CE2\u52A8\u5BFC\u81F4":"\u6444\u50CF\u5934\u91C7\u96C6\u6682\u505C\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\u3002SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\u3002",tips_en:d=>d.includes("\u2193")?"The remote track is temporarily unable to decode data, which may be caused by network fluctuations":"The camera acquisition is paused, usually because the device is occupied by other applications or the browser media permissions are revoked. The SDK will automatically resume the acquisition.",color:"orange"},"stream - video player track is ended":{tips_zh:"\u6444\u50CF\u5934\u91C7\u96C6\u505C\u6B62\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u62D4\u51FA\u5BFC\u81F4\uFF0C\u8FD9\u79CD\u60C5\u51B5 SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\uFF0C\u63A5\u5165\u4FA7\u65E0\u9700\u5904\u7406\u3002\u4E5F\u6709\u53EF\u80FD\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\uFF0Cv4.11.4+ \u7248\u672C SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\uFF0C\u65E0\u9700\u5BA2\u6237\u5904\u7406",tips_en:"The camera acquisition stops, usually because the device is unplugged. In this case, the SDK will automatically resume acquisition, and the access side does not need to handle it. It may also be caused by the device being occupied by other applications or the browser media permissions being reclaimed. It is recommended to remind the user to re-acquire on the page."},"video player track is ended":{tips_zh:"\u6444\u50CF\u5934\u91C7\u96C6\u505C\u6B62\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u62D4\u51FA\u5BFC\u81F4\uFF0C\u8FD9\u79CD\u60C5\u51B5 SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\uFF0C\u63A5\u5165\u4FA7\u65E0\u9700\u5904\u7406\u3002\u4E5F\u6709\u53EF\u80FD\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\uFF0Cv4.11.4+ \u7248\u672C SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\uFF0C\u65E0\u9700\u5BA2\u6237\u5904\u7406",tips_en:"The camera acquisition stops, usually because the device is unplugged. In this case, the SDK will automatically resume acquisition, and the access side does not need to handle it. It may also be caused by the device being occupied by other applications or the browser media permissions being reclaimed. It is recommended to remind the user to re-acquire on the page."},"stream - audio track is muted":{tips_zh:"\u9EA6\u514B\u98CE\u91C7\u96C6\u6682\u505C\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\uFF0C\u9700\u8981\u5BA2\u6237\u91CD\u65B0\u91C7\u96C6\u3002",tips_en:"Microphone capture is paused, usually due to the device being occupied by other applications or the browser media permission being revoked. The client needs to re-capture.",color:"orange"},"audio track is unable to provide media output":{tips_zh:d=>d.includes("\u2193")?"\u8FDC\u7AEF track \u6682\u65F6\u65E0\u6CD5\u89E3\u7801\u6570\u636E\uFF0C\u53EF\u80FD\u662F\u7F51\u7EDC\u6CE2\u52A8\u5BFC\u81F4":"\u9EA6\u514B\u98CE\u91C7\u96C6\u6682\u505C\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\u3002SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\u3002",tips_en:d=>d.includes("\u2193")?"The remote track is temporarily unable to decode data, which may be caused by network fluctuations":"Microphone acquisition is paused, usually because the device is occupied by other applications or the browser media permissions are revoked. The SDK will automatically resume the acquisition.",color:"orange"},"stream - audio track is unable to provide media output":{tips_zh:"\u9EA6\u514B\u98CE\u91C7\u96C6\u6682\u505C\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\uFF0C\u9700\u8981\u5BA2\u6237\u91CD\u65B0\u91C7\u96C6\u3002v4.11.4+ \u7248\u672C SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\uFF0C\u65E0\u9700\u5BA2\u6237\u5904\u7406",tips_en:"The microphone acquisition is paused, usually because the device is occupied by other applications or the browser media permissions are revoked. The SDK will automatically resume the acquisition.",color:"orange"},"stream - audio player track is ended":{tips_zh:"\u9EA6\u514B\u98CE\u91C7\u96C6\u505C\u6B62\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u62D4\u51FA\u5BFC\u81F4\uFF0C\u8FD9\u79CD\u60C5\u51B5 SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\uFF0C\u63A5\u5165\u4FA7\u65E0\u9700\u5904\u7406\u3002\u4E5F\u6709\u53EF\u80FD\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\uFF0C\u5EFA\u8BAE\u6B64\u65F6\u5728\u9875\u9762\u63D0\u9192\u7528\u6237\u91CD\u65B0\u91C7\u96C6\u3002",tips_en:"The microphone acquisition stops, usually because the device is unplugged. In this case, the SDK will automatically resume acquisition, and the access side does not need to handle it. It may also be caused by the device being occupied by other applications or the browser media permissions being reclaimed. It is recommended to remind the user to re-acquire on the page."},"audio player track is ended":{tips_zh:"\u9EA6\u514B\u98CE\u91C7\u96C6\u505C\u6B62\uFF0C\u901A\u5E38\u662F\u8BBE\u5907\u88AB\u62D4\u51FA\u5BFC\u81F4\uFF0C\u8FD9\u79CD\u60C5\u51B5 SDK \u4F1A\u81EA\u52A8\u6062\u590D\u91C7\u96C6\uFF0C\u63A5\u5165\u4FA7\u65E0\u9700\u5904\u7406\u3002\u4E5F\u6709\u53EF\u80FD\u662F\u8BBE\u5907\u88AB\u5176\u4ED6\u5E94\u7528\u5360\u7528\u3001\u6D4F\u89C8\u5668\u5A92\u4F53\u6743\u9650\u88AB\u56DE\u6536\u5BFC\u81F4\uFF0C\u5EFA\u8BAE\u6B64\u65F6\u5728\u9875\u9762\u63D0\u9192\u7528\u6237\u91CD\u65B0\u91C7\u96C6\u3002",tips_en:"The microphone acquisition stops, usually because the device is unplugged. In this case, the SDK will automatically resume acquisition, and the access side does not need to handle it. It may also be caused by the device being occupied by other applications or the browser media permissions being reclaimed. It is recommended to remind the user to re-acquire on the page."},"is adding audio track to current published local stream":{tips_zh:"\u6DFB\u52A0\u97F3\u9891\u8F68",tips_en:"add audio track",color:"orange"},"is removing audio track from current published local stream":{tips_zh:"\u79FB\u9664\u97F3\u9891\u8F68",tips_en:"remove audio track",color:"orange"},"is removing video track from current published local stream":{tips_zh:"\u79FB\u9664\u89C6\u9891\u8F68",tips_en:"remove video track",color:"orange"},"is adding video track to current published local stream":{tips_zh:"\u6DFB\u52A0\u89C6\u9891\u8F68",tips_en:"add video track",color:"orange"},"is replacing audio track to current published local main stream":{tips_zh:"\u66FF\u6362\u97F3\u9891\u8F68",tips_en:"replace audio track",color:"orange"},"is replacing video track to current published local main stream":{tips_zh:"\u66FF\u6362\u89C6\u9891\u8F68",tips_en:"replace video track",color:"orange"},"downlink network quality change":{tips_zh:"\u4E0B\u884C\u7F51\u7EDC\u53D8\u66F4\uFF0C1: \u6781\u4F73\uFF0C2\uFF1A\u8F83\u597D\uFF0C3\uFF1A\u4E00\u822C\uFF0C4\uFF1A\u8F83\u5DEE\uFF0C5\uFF1A\u6781\u5DEE",tips_en:"Downstream network quality change: 1: excellent, 2: good, 3: average, 4: poor, 5: extremely poor"},"uplink network quality change":{tips_zh:"\u4E0A\u884C\u7F51\u7EDC\u53D8\u66F4\uFF0C1: \u6781\u4F73\uFF0C2\uFF1A\u8F83\u597D\uFF0C3\uFF1A\u4E00\u822C\uFF0C4\uFF1A\u8F83\u5DEE\uFF0C5\uFF1A\u6781\u5DEE",tips_en:"Upstream network quality change: 1: excellent, 2: good, 3: average, 4: poor, 5: extremely poor"},"localStream mute video":{tips_zh:"mute \u4E0A\u884C\u89C6\u9891\u6D41",tips_en:"mute upstream video stream",color:"orange"},"localStream unmute video":{tips_zh:"unmute \u4E0A\u884C\u89C6\u9891\u6D41",tips_en:"unmute upstream video stream",color:"orange"},"localStream mute audio":{tips_zh:"mute \u4E0A\u884C\u97F3\u9891\u6D41",tips_en:"mute upstream audio stream",color:"orange"},"localStream unmute audio":{tips_zh:"unmute \u4E0A\u884C\u97F3\u9891\u6D41",tips_en:"unmute upstream audio stream",color:"orange"},"black detected":{tips_zh:"\u68C0\u6D4B\u5230\u9ED1\u5C4F\uFF0C\u8868\u793A\u5F53\u524D fps = 0\u3002\u901A\u5E38\u662F\u7F51\u7EDC\u5F15\u8D77\uFF0C\u7F51\u7EDC\u6062\u590D\u540E\u4F1A\u6062\u590D\u6B63\u5E38\u3002\u82E5\u7F51\u7EDC\u6B63\u5E38\u65F6\uFF0C\u4E00\u76F4\u672A\u6062\u590D\uFF0C\u5219\u4E3A\u5F02\u5E38\u60C5\u51B5\u3002",tips_en:"Detect black screen, which means fps = 0. It is usually caused by network, and the network will be recovered after a while. If the network is normal but has not been restored, it is an abnormal situation."},'main stream start to play with options: {"muted":true}':{tips_zh:"\u5DF2\u9759\u97F3\u7684\u65B9\u5F0F\u64AD\u653E\u8FDC\u7AEF\u6D41\uFF0C\u4E00\u822C\u8FDC\u7AEF\u6D41\u4E0D\u9700\u8981\u9759\u97F3\u64AD\u653E\uFF0C\u9700\u786E\u8BA4\u5BA2\u6237 stream.play \u63A5\u53E3\u8C03\u7528\u7684\u4F20\u53C2\u662F\u5426\u6B63\u786E\u3002",tips_en:"Play the remote stream in silent mode. Generally, the remote stream does not need to be played in silent mode. You need to confirm whether the parameters passed in the client stream.play API call are correct.",color:"orange"},"main stream - audio player is starting playing":{tips_zh:"\u8FDC\u7AEF\u6D41\u97F3\u9891\u64AD\u653E\u6210\u529F",tips_en:"Remote stream audio playback success",color:"#0dd90d",class:"success"},"main stream - video player is starting playing":{tips_zh:"\u8FDC\u7AEF\u6D41\u89C6\u9891\u64AD\u653E\u6210\u529F",tips_en:"Remote stream video playback success",color:"#0dd90d",class:"success"},"video player is playing":{tips_zh:"\u672C\u5730\u89C6\u9891\u64AD\u653E\u6210\u529F",tips_en:"Local video playback success",color:"#0dd90d",class:"success"},"audio player is playing":{tips_zh:"\u672C\u5730\u97F3\u9891\u64AD\u653E\u6210\u529F",tips_en:"Local audio playback success",color:"#0dd90d",class:"success"},"stream - video player is starting playing":{tips_zh:"\u672C\u5730\u89C6\u9891\u64AD\u653E\u6210\u529F",tips_en:"Local video playback success",color:"#0dd90d",class:"success"},"stream - audio player is starting playing":{tips_zh:"\u672C\u5730\u97F3\u9891\u64AD\u653E\u6210\u529F",tips_en:"Local audio playback success",color:"#0dd90d",class:"success"},"switch camera success":{tips_zh:"\u5207\u6362\u6444\u50CF\u5934\u6210\u529F",tips_en:"Switch camera success",color:"#0dd90d",class:"success"},"switch microphone success":{tips_zh:"\u5207\u6362\u9EA6\u514B\u98CE\u6210\u529F",tips_en:"Switch microphone success",color:"#0dd90d",class:"success"},gotStream:{tips_zh:"\u672C\u5730\u6D41\u91C7\u96C6\u6210\u529F",tips_en:"Local stream capture success"},"local stream is published successfully":{tips_zh:"\u63A8\u6D41\u6210\u529F",tips_en:"Publish success",color:"#0dd90d",class:"success"},"encoderImplementation change to OpenH264":{tips_zh:"\u4F7F\u7528\u8F6F\u7F16",tips_en:"Use software encoding"},"encoderImplementation change to ExternalEncoder":{tips_zh:"\u4F7F\u7528\u786C\u7F16",tips_en:"Use hardware encoding"},"getUserMedia with constraints":{tips_zh:"\u5F00\u59CB\u5A92\u4F53\uFF08\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\uFF09\u91C7\u96C6",tips_en:"Start media (camera/microphone) capture"},"getDisplayMedia with constraints":{tips_zh:"\u5F00\u59CB\u5C4F\u5E55\u5206\u4EAB\u91C7\u96C6",tips_en:"Start screen sharing capture"},"client-banned":{tips_zh:"\u88AB\u8E22\u51FA\u623F\u95F4",tips_en:"Kicked out of the room",color:"red",class:"red",textColor:"#fff"},user_timeout:{tips_zh:"\u540E\u53F0\u957F\u65F6\u95F4\u6CA1\u6536\u5230 sdk \u5FC3\u8DF3\u5BFC\u81F4\u88AB\u8E22\uFF0C\u901A\u5E38\u662F\u7528\u6237 JS \u7EBF\u7A0B\u957F\u65F6\u95F4\u963B\u585E\u5BFC\u81F4\uFF0C\u82E5\u590D\u73B0\u6982\u7387\u8F83\u9AD8\uFF0C\u5E94\u7528\u6D4F\u89C8\u5668 Performance \u5DE5\u5177\u5206\u6790\u662F\u54EA\u91CC\u5BFC\u81F4 JS \u7EBF\u7A0B\u963B\u585E\u3002",tips_en:"The backend is too long without receiving SDK heartbeat, which is usually caused by the JS thread being blocked for a long time. If the reproduction probability is high, the application browser Performance tool analyzes where the JS thread is blocked.",color:"red",class:"red",textColor:"#fff"},"schedule failed":{tips_zh:"\u4FE1\u4EE4\u8C03\u5EA6\u8BF7\u6C42\u5931\u8D25\uFF0C\u4E0D\u5F71\u54CD\u6B63\u5E38\u8FDB\u623F\u6D41\u7A0B\uFF0CSDK \u4F1A\u8FDE\u63A5\u9ED8\u8BA4\u7684\u4FE1\u4EE4\u57DF\u540D\u3002",tips_en:"Signaling request failed, does not affect the normal room entry process, SDK will connect to the default signaling domain."},"updateStream() video flag is true, but no camera detected, set video to false":{tips_zh:"\u5C1D\u8BD5\u6062\u590D\u6444\u50CF\u5934\u91C7\u96C6\u65F6\uFF0C\u7531\u4E8E\u68C0\u6D4B\u5230\u6CA1\u6709\u6444\u50CF\u5934\uFF0C\u4E0D\u6062\u590D\u6444\u50CF\u5934\u91C7\u96C6",tips_en:"When trying to resume camera acquisition, the camera acquisition is not resumed because it is detected that there is no camera.",color:"orange",class:"orange",textColor:"#fff"},"qualityLimitationReason change to bandwidth":{tips_zh:"\u5E26\u5BBD\u9884\u4F30\u4E0D\u591F\u5BFC\u81F4\u7F16\u7801\u8D28\u91CF\u53D7\u9650\uFF0C\u53EF\u80FD\u4F1A\u51FA\u73B0\u7F16\u7801\u7801\u7387\u3001\u5E27\u7387\u3001\u5206\u8FA8\u7387\u964D\u4F4E\u95EE\u9898\u3002\u901A\u5E38\u662F\u7F51\u7EDC\u5BFC\u81F4\u3002",tips_en:"bandwidth estimation is not enough to limit the quality of the encoding, which may cause the code rate, frame rate, and resolution to be lowered.",color:"orange",class:"orange",textColor:"#fff"},"qualityLimitationReason change to cpu":{tips_zh:"cpu \u8D1F\u8377\u592A\u9AD8\u5BFC\u81F4\u7F16\u7801\u8D28\u91CF\u53D7\u9650\uFF0C\u53EF\u80FD\u4F1A\u51FA\u73B0\u7F16\u7801\u7801\u7387\u3001\u5E27\u7387\u3001\u5206\u8FA8\u7387\u964D\u4F4E\u95EE\u9898\u3002",tips_en:"cpu load is too high to limit the quality of the encoding, which may cause the code rate, frame rate, and resolution to be lowered.",color:"orange",class:"orange",textColor:"#fff"},"visibility change: hidden":{tips_zh:"\u7528\u6237\u9875\u9762\u5207\u540E\u53F0\uFF0C\u5728\u79FB\u52A8\u7AEF\u8FD9\u4F1A\u5BFC\u81F4\u8BBE\u5907\u91C7\u96C6\u6682\u505C\uFF0C\u5207\u56DE\u524D\u53F0\u65F6\u4F1A\u6062\u590D\u91C7\u96C6",tips_en:"User page switched to backend, in mobile devices, this will cause the device to pause the capture, and it will be restored when the user switches backend to the frontend.",color:"orange",class:"orange",textColor:"#fff"},"visibility change: visible":{tips_zh:"\u7528\u6237\u9875\u9762\u5207\u56DE\u524D\u53F0",tips_en:"User page switched to frontend",color:"orange",class:"orange",textColor:"#fff"},"main stream - audio player is paused":{tips_zh:`\u8FDC\u7AEF\u6D41\u97F3\u9891\u64AD\u653E\u6682\u505C\uFF0C\u4E00\u822C\u6709\u4E24\u79CD\u53EF\u80FD\uFF1A
|
|
2
|
+
1. \u4E1A\u52A1\u4FA7\u4F20\u5165\u7528\u4E8E\u64AD\u653E\u97F3\u89C6\u9891\u7684 div \u6807\u7B7E\u5BB9\u5668\u88AB\u4E1A\u52A1\u4FA7\u4ECE DOM \u79FB\u9664\u3002
|
|
3
|
+
2. \u7528\u6237\u5728 Chrome 70 \u53CA\u4EE5\u4E0B\u7248\u672C\uFF0C\u5F53\u79FB\u52A8 div \u5BB9\u5668\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u64AD\u653E\u6682\u505C\u3002`,tips_en:`The remote stream audio playback is paused, which usually has two possibilities:
|
|
4
|
+
1. The business side passes in the div tag container for playing audio and video to be removed by the business side from the DOM.
|
|
5
|
+
2. If the user is in Chrome 70 and below, when the div container is moved, the playback will be paused.`,color:"orange",class:"orange",textColor:"#fff"},"main stream - video player is paused":{tips_zh:`\u8FDC\u7AEF\u6D41\u89C6\u9891\u64AD\u653E\u6682\u505C\uFF0C\u4E00\u822C\u6709\u4E24\u79CD\u53EF\u80FD\uFF1A
|
|
6
|
+
1. \u4E1A\u52A1\u4FA7\u4F20\u5165\u7528\u4E8E\u64AD\u653E\u97F3\u89C6\u9891\u7684 div \u6807\u7B7E\u5BB9\u5668\u88AB\u4E1A\u52A1\u4FA7\u4ECE DOM \u79FB\u9664\u3002
|
|
7
|
+
2. \u7528\u6237\u5728 Chrome 70 \u53CA\u4EE5\u4E0B\u7248\u672C\uFF0C\u5F53\u79FB\u52A8 div \u5BB9\u5668\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u64AD\u653E\u6682\u505C\u3002`,tips_en:`The remote stream video playback is paused, which usually has two possibilities:
|
|
8
|
+
1. The business side passes in the div tag container for playing audio and video to be removed by the business side from the DOM.
|
|
9
|
+
2. If the user is in Chrome 70 and below, when the div container is moved, the playback will be paused.`,color:"orange",class:"orange",textColor:"#fff"},'"displaySurface":"window"':{tips_zh:"\u5C4F\u5E55\u5206\u4EAB\u91C7\u96C6\u4E86\u5E94\u7528\u7A97\u53E3",tips_en:"Screen sharing captures the application window",color:"blue",class:"blue",textColor:"#fff"},'"displaySurface":"monitor"':{tips_zh:"\u5C4F\u5E55\u5206\u4EAB\u91C7\u96C6\u4E86\u6574\u4E2A\u5C4F\u5E55",tips_en:"Screen sharing captures the entire screen",color:"blue",class:"blue",textColor:"#fff"},'"displaySurface":"browser"':{tips_zh:"\u5C4F\u5E55\u5206\u4EAB\u91C7\u96C6\u4E86\u67D0\u4E2A\u6807\u7B7E\u9875",tips_en:"Screen sharing captures a certain tab page",color:"blue",class:"blue",textColor:"#fff"},updateMediaSettings:{tips_zh:"\u8BE5\u65E5\u5FD7\u4E0B\u7684\u5206\u8FA8\u7387\u3001\u5E27\u7387\u4E3A\u5B9E\u9645\u91C7\u96C6\u51FA\u7684\u5206\u8FA8\u7387\u53CA\u5E27\u7387",tips_en:"The resolution and frame rate below are the actual resolution and frame rate captured",color:"blue",class:"blue",textColor:"#fff"},"main stream start to play with":{tips_zh:"\u8C03\u7528 remoteStream.play \u63A5\u53E3",tips_en:"Call remoteStream.play interface",color:"blue",class:"blue",textColor:"#fff"},"stream start to play with":{tips_zh:"\u8C03\u7528 localStream.play \u63A5\u53E3",tips_en:"Call localStream.play interface",color:"blue",class:"blue",textColor:"#fff"},"main setAudioVolume to 0":{tips_zh:"\u4E1A\u52A1\u4FA7\u8C03\u7528 remoteStream.setAudioVolume(0) \u63A5\u53E3\uFF0C\u5C06\u64AD\u653E\u97F3\u91CF\u8BBE\u7F6E\u4E3A 0\uFF0C\u4F1A\u5BFC\u81F4\u64AD\u653E\u65E0\u58F0",tips_en:"Business side calls remoteStream.setAudioVolume(0) interface to set the playback volume to 0, which will cause the playback to be silent",color:"orange",class:"orange",textColor:"#fff"},"screen sharing was stopped because the video track is ended":{tips_zh:"\u5C4F\u5E55\u5206\u4EAB\u91C7\u96C6\u505C\u6B62\uFF0C\u53EF\u80FD\u539F\u56E0\uFF1A\u7528\u6237\u70B9\u51FB\u505C\u6B62\u91C7\u96C6\u6309\u94AE\u3001\u5206\u4EAB\u7684\u7A97\u53E3/\u9875\u9762\u88AB\u5173\u95ED\u7B49\u3002",tips_en:"Screen sharing capture stopped, possible reasons: user clicks the stop button, the window/page shared by the user is closed, etc.",color:"orange",class:"orange",textColor:"#fff"},"Join() => joining room":{tips_zh:"\u8C03\u7528 client.join \u63A5\u53E3",tips_en:"Call client.join interface",color:"blue",class:"blue",textColor:"#fff"},"publish() => publishing local stream":{tips_zh:"\u8C03\u7528 client.publish \u63A5\u53E3",tips_en:"Call client.publish interface",color:"blue",class:"blue",textColor:"#fff"},"subscribe() => subscribe to":{tips_zh:"\u8C03\u7528 client.subscribe \u63A5\u53E3",tips_en:"Call client.subscribe interface",color:"blue",class:"blue",textColor:"#fff"},"switchRole() => switch role":{tips_zh:"\u8C03\u7528 client.switchRole \u63A5\u53E3",tips_en:"Call client.switchRole interface",color:"blue",class:"blue",textColor:"#fff"}};["enterRoom","exitRoom","switchRole","destroy","startLocalAudio","updateLocalAudio","stopLocalAudio","startLocalVideo","updateLocalVideo","stopLocalVideo","startScreenShare","updateScreenShare","stopScreenShare","startRemoteVideo","updateRemoteVideo","stopRemoteVideo","muteRemoteAudio","setRemoteAudioVolume"].forEach(d=>{S[`${d}()`]={tips_zh:`\u8C03\u7528 trtc.${d}`,tips_en:`Call trtc.${d}`,color:"blue",class:"blue",textColor:"#fff"}});var ce=Object.keys(S);var y="trtc_debug_dialog",A=`${y}_activated`,q=`${y}_switch`,te=`${y}_mask`,K=`${y}_pannel`,oe=`${y}_tabber`,O=`${y}_tab`,ie=`${y}_topbar`,C=`${y}_toptab`,$=`${y}_content`,G=`${y}_has_topbar`,de=`${$}_log`,M=`${$}_network`,D=`${y}_dump`,x=`${M}_title`,W=`${M}_basic`,F=`${M}_local`,X=`${M}_remote`,se=`${D}_title`,B=`${D}_local`,k=`${D}_remote`,J=`${y}_banner`,ue=`${J}_item`,pe=`${y}_toolbar`,U=`${y}_tool`,L=`${y}_item`,he=`${L}_debug`,me=`${L}_info`,_e=`${L}_warn`,be=`${L}_error`,R=`${y}_back_top`,I=`${y}_go_bottom`,Y=`${D}_local_audio`,j=`${D}_local_video_main`,V=`${D}_local_video_aux`,N=`${y}_tooltip`,ae="success",w="failed",Te=0,ge=!1,H=class{constructor(t,e,i,s){g(this,"_dialogNode",null);g(this,"_switchNode",null);g(this,"_maskNode",null);g(this,"_pannelNode",null);g(this,"_logContentNode",null);g(this,"_networkContentNode",null);g(this,"_dumpContentNode",null);g(this,"_tabNodes",[]);g(this,"_toptabNodes",[]);g(this,"_backTopButton",null);g(this,"_goBottomButton",null);g(this,"_hasMove",!1);g(this,"_showDialog",!1);g(this,"_isMobile",!1);g(this,"_showLogType","all");g(this,"prevBytesSent",0);g(this,"prevBytesReceived",0);g(this,"_core");g(this,"_log");g(this,"_logList",[]);g(this,"isUploading",!1);g(this,"publishMap",new Map);g(this,"dumpLocalVideoMap");g(this,"dumpRemoteVideoMap");g(this,"handleLeaveSuccess",()=>{var e;let t=(e=this._dialogNode)==null?void 0:e.querySelector(`.${k}`);for(let i of this.publishMap.values())t==null||t.removeChild(i);this.publishMap.clear()});g(this,"handleRemoteVideoAvailable",t=>{let e=t.streamType==="sub"?"auxiliary":"main";this.renderDumpTab(t.userId,"remote",e,"publish")});g(this,"handleRemoteVideoUnavailable",t=>{let e=t.streamType==="sub"?"auxiliary":"main";this.renderDumpTab(t.userId,"remote",e,"unpublish")});g(this,"handleRemoteAudioAvailable",t=>{this.renderDumpTab(t.userId,"remote","audio","publish")});g(this,"handleRemoteAudioUnavailable",t=>{this.renderDumpTab(t.userId,"remote","audio","unpublish")});g(this,"renderDumpTab",(t,e,i,s)=>{var u,p;let o={main:_?"\u89C6\u9891":"video",auxiliary:_?"\u5C4F\u5E55":"screen",audio:_?"\u97F3\u9891":"audio"},n=(h,f)=>{var m,b;let v=document.createElement("div");v.innerText=`${h} - ${o[f]} - ${l.DURATION}(s):`;let r=document.createElement("input");r.type="number",r.min="0",r.value="0",r.id=`dump_remote_${f}_${h}`;let a=document.createElement("button");a.innerText=l.END_BUTTON,a.style.cssText="border-radius: 5px;",a.disabled=!0;let c=document.createElement("button");return c.innerText=l.DUMP_BUTTON,c.style.cssText="border-radius: 5px;",c.onclick=()=>{let T,E,P=Number(r.value);if(f==="audio"?{download:T,onDumpEnd:E}=this.dumpAudio("remote",P,h):{download:T,onDumpEnd:E}=this.dumpVideo(f,"remote",P,h),!T){this.addInfoToBanner(w,_?`\u8F6C\u50A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8FDC\u7AEF\u7528\u6237${h}\u662F\u5426\u53D1\u5E03\u6D41`:`Failed to dump, please check if the remote user ${h} has published the stream`);return}this.disactiveButton(c,l.DUMPING_BUTTON),P>0?setTimeout(()=>{T==null||T(),this.activeButton(c,l.DUMP_BUTTON)},P*1e3):(this.activeButton(a),a.onclick=()=>{a.onclick=null,T==null||T(),E==null||E(),this.activeButton(c,l.DUMP_BUTTON),this.disactiveButton(a)})},v.appendChild(r),v.appendChild(c),v.appendChild(a),v.style.cssText="padding:10px;border-bottom:1px solid var(--DD-BORDER)",(b=(m=this._dialogNode)==null?void 0:m.querySelector(`.${k}`))==null||b.appendChild(v),v};if(e==="remote")if(s==="publish"){let h=n(t,i);this.publishMap.set(`${t}-${e}-${i}`,h)}else{let h=this.publishMap.get(`${t}-${e}-${i}`);if(!h)return;(p=(u=this._dialogNode)==null?void 0:u.querySelector(`.${k}`))==null||p.removeChild(h),this.publishMap.delete(`${t}-${e}-${i}`)}});g(this,"handleStatistics",t=>{var f,v,r;let e=(t.bytesSent-this.prevBytesSent)/2,i=(t.bytesReceived-this.prevBytesReceived)/2;this.prevBytesSent=t.bytesSent,this.prevBytesReceived=t.bytesReceived;let s=(f=this._dialogNode)==null?void 0:f.querySelector(`.${W}`),o=`rtt: ${t.rtt} ms upLoss: ${t.upLoss} downLoss: ${t.downLoss} <br>
|
|
10
|
+
\u2191 ${e/1e3} KB/s (${8*e/1e3} Kb/s) <br>
|
|
11
|
+
\u2193 ${i/1e3} KB/s (${8*i/1e3} Kb/s) <br>
|
|
12
|
+
`;s.innerHTML=o;let n=(v=this._dialogNode)==null?void 0:v.querySelector(`.${F}`),u="";t.localStatistics.audio.bitrate&&(u=`<li>local audio: ${t.localStatistics.audio.bitrate} Kb/s audioLevel: ${t.localStatistics.audio.audioLevel.toFixed(5)}</li>`),t.localStatistics.video.length>0&&(u+=`${t.localStatistics.video.map(a=>`<li>local ${a.videoType} video: ${a.bitrate} Kb/s ${a.width}*${a.height} ${a.frameRate}fps</li>`).join("")}`),n.innerHTML=u===""?`${l.NO_DATA}`:u;let p=(r=this._dialogNode)==null?void 0:r.querySelector(`.${X}`),h="";t.remoteStatistics.length>0&&t.remoteStatistics.forEach(a=>{let c=`remote ${a.userId}:`;a.audio.bitrate>0&&(c+=`<li>audio: ${a.audio.bitrate} Kb/s audioLevel: ${a.audio.audioLevel.toFixed(5)}</li>`),a.video.length>0&&a.video.forEach(m=>{c+=`<li>${m.videoType} video: ${m.bitrate} Kb/s ${m.width}*${m.height} ${m.frameRate}fps</li>`}),h+=c}),p.innerHTML=h===""?`${l.NO_DATA}`:h});this._core=t,this._log=e,this.dumpLocalVideoMap=i,this.dumpRemoteVideoMap=s,this.addStyle(),this.addDialog(),this.synchronizeLog(),this.installEvents()}synchronizeLog(){this._core.loggerManager.getQueue().forEach(e=>{this.updateLog(e)})}addStyle(){if(ge)return;ge=!0;let t=document.createElement("style");t.innerHTML=`
|
|
13
|
+
#${y}
|
|
14
|
+
{--DD-BG-0:#ededed;--DD-BG-1:#f7f7f7;--DD-BG-2:#fff;--DD-BORDER:rgba(0,0,0,0.1);--DD-ERROR:red;--DD-WARN:#fa9d3b;--DD-INFO:#000;--DD-DEBUG:#10aeff;--DD-WARN-BG:#fff3cc;--DD-ERROR-BG:#ffe6e6;}
|
|
15
|
+
#${y} a,.${q}{cursor:pointer;}
|
|
16
|
+
.${y}{color:black;}
|
|
17
|
+
.${q}{display:block;position:fixed;right:50px;bottom:150px;border-radius:5px;background-color:#07c160;color:#fff;padding:5px 10px;z-index:10000;}
|
|
18
|
+
.${te}{display:none;position:fixed;left:0;top:0;right:0;bottom:0;z-index:10001;background-color:rgb(0,0,0,0.6);}
|
|
19
|
+
.${K}{background-color:#ededed;display:none;position:fixed;min-height:85%;left:60%;right:0;bottom:0;z-index:10002;border:1px solid var(--DD-BG-0);}
|
|
20
|
+
@media (max-width:768px) {.${K}{left:0;}}
|
|
21
|
+
.${oe}{display:flex;height:2rem;border-bottom:1px solid var(--DD-BORDER);}
|
|
22
|
+
.${O}{padding:0 20px;border-right:1px solid rgba(0, 0, 0, 0.1);line-height:2rem;color: black;}
|
|
23
|
+
.${O}.${A}{background-color:var(--DD-BG-2);}
|
|
24
|
+
.${O}.disabled{cursor: not-allowed;background-color: #ededed;color: #999;}
|
|
25
|
+
.${ie}{height:2rem;display:flex;flex-direction:row;}
|
|
26
|
+
.${C}{width:20%;text-align:center;line-height:2rem;border-right:1px solid var(--DD-BORDER);border-bottom:1px solid var(--DD-BORDER);color:black;}
|
|
27
|
+
.${C}.${A}{border-bottom:1px solid #1485ee;background-color:var(--DD-BG-2);}
|
|
28
|
+
.${$}{background-color:#fff;position:absolute;left:0;right:0;top:2rem;bottom:8rem;overflow-y:scroll;overflow-x:hidden;}
|
|
29
|
+
.${$}.${G}{top:4rem;}
|
|
30
|
+
.${M}{display:none;}
|
|
31
|
+
.${D}{display:none;}
|
|
32
|
+
.${x},.${se}{line-height:2rem;text-align:center;background-color:var(--DD-BG-0);border-bottom:1px solid var(--DD-BORDER);}
|
|
33
|
+
.${W},.${F},.${X}{text-align:center;border-bottom:1px solid var(--DD-BORDER);}
|
|
34
|
+
.${B},.${k}{display:flex;flex-direction:column;padding:0.5rem 0;justify-content:center;align-items:center;}
|
|
35
|
+
.${B} div input{margin:0 10px;height:1.8rem;width:4rem;}
|
|
36
|
+
.${B} div {padding:10px 0;border-radius:5px;}
|
|
37
|
+
.${B} div button {border-radius:5px;}
|
|
38
|
+
.${k} div input{margin:0 10px;height:1.8rem;width:4rem;}
|
|
39
|
+
.${k} div select{margin:0 10px;height:1.8rem;width:6rem;appearance:auto;}
|
|
40
|
+
.${x}{text-align:center;background-color:var(--DD-BG-0);border-bottom:1px solid var(--DD-BORDER);}
|
|
41
|
+
.${W},.${F},.${X}{text-align:center;border-bottom:1px solid var(--DD-BORDER);}
|
|
42
|
+
.${L}{border-bottom:1px solid var(--DD-BG-0);padding:5px 10px;overflow-wrap: break-word;}
|
|
43
|
+
.${be}{color:var(--DD-ERROR);background-color:var(--DD-ERROR-BG);}
|
|
44
|
+
.${_e}{color:var(--DD-WARN);background-color:var(--DD-WARN-BG);}
|
|
45
|
+
.${me}{color:var(--DD-INFO);}
|
|
46
|
+
.${he}{color:var(--DD-DEBUG);}
|
|
47
|
+
.${J}{position:absolute;left:0;right:0;bottom:2rem;height:6rem;border-bottom:1px solid var(--DD-BORDER);display:flex;flex-direction:column;overflow-y:scroll;background-color:var(--DD-BG-1);}
|
|
48
|
+
.${ue}{border-bottom:1px solid var(--DD-BORDER);padding:5px 10px;overflow-wrap: break-word;}
|
|
49
|
+
.${pe}{position:absolute;line-height:2rem;display:flex;flex-direction:row;left:0;right:0;bottom:0;}
|
|
50
|
+
.${U}{flex:1;color:black;text-align:center;background-color:#ededed;border-right:1px solid var(--DD-BORDER);}
|
|
51
|
+
#${y} .${R},#${y} .${I}{position:absolute;height:2rem;width:6rem;right:2rem;border-radius:5px;background-color:rgba(30, 136, 229, 0.8);z-index:10003;cursor:pointer;padding:0 5px;line-height:2rem;color:white;text-align:center;}
|
|
52
|
+
.${I}{bottom:9rem;}
|
|
53
|
+
.${R}{bottom:11.5rem;}
|
|
54
|
+
#${y} .${U}.disable {cursor: not-allowed;background-color: #ededed;color: #999;}
|
|
55
|
+
.${N} {position: relative;display: inline-block;}
|
|
56
|
+
.${N} .tooltiptext {visibility: hidden;width: 180px;background-color: black;color: #fff;text-align: center;padding: 5px 0;border-radius: 6px;position: absolute;}
|
|
57
|
+
.${N} .tooltip-top {bottom: 125%;left: 50%;margin-left: -90px;}
|
|
58
|
+
.${N}:hover .tooltiptext { visibility: visible;}
|
|
59
|
+
`,document.body.appendChild(t)}addDialog(){this._dialogNode=this.createDiaLog(),document.body.appendChild(this._dialogNode)}createDiaLog(){var n,u,p,h;this._isMobile=ee();let t=document.createElement("template");t.innerHTML=`<div id="${y}" class="${y}">
|
|
60
|
+
<div class="${q}">Debug#${++Te}</div>
|
|
61
|
+
<div class="${te}"></div>
|
|
62
|
+
<div class="${K}">
|
|
63
|
+
<a class="${R}">${l.BACK_TOP}</a>
|
|
64
|
+
<a class="${I}">${l.GO_BOTTOM}</a>
|
|
65
|
+
<div class="${oe}">
|
|
66
|
+
<a class="${O} ${A}" data-tab="log">${l.LOG_BUTTON}</a>
|
|
67
|
+
<a class="${O}" data-tab="network">${l.NETWORK_BUTTON}</a>
|
|
68
|
+
<a class="${O}" data-tab="dump">${l.DUMP_BUTTON}</a>
|
|
69
|
+
</div>
|
|
70
|
+
<div class="${ie}">
|
|
71
|
+
<a class="${C} ${A}" data-type="all">All</a>
|
|
72
|
+
<a class="${C}" data-type="debug">Debug</a>
|
|
73
|
+
<a class="${C}" data-type="info">Info</a>
|
|
74
|
+
<a class="${C}" data-type="warn">Warn</a>
|
|
75
|
+
<a class="${C}" data-type="error">Error</a>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="${$} ${G}">
|
|
78
|
+
<div class="${de}"></div>
|
|
79
|
+
<div class="${M}">
|
|
80
|
+
<div class="${x}">${l.BASIC}</div>
|
|
81
|
+
<div class="${W}">${l.NO_DATA}</div>
|
|
82
|
+
<div class="${x}">${l.UPLINK}</div>
|
|
83
|
+
<div class="${F}">${l.NO_DATA}</div>
|
|
84
|
+
<div class="${x}">${l.DOWNLINK}</div>
|
|
85
|
+
<div class="${X}">${l.NO_DATA}</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="${D}">
|
|
88
|
+
<div class="${se}">${l.UPLINK}</div>
|
|
89
|
+
<div class="${B}">
|
|
90
|
+
<div id="${Y}">
|
|
91
|
+
<span>${l.AUDIO} - ${l.DURATION}(s):</span>
|
|
92
|
+
<input type="number" min=0 value=0></input>
|
|
93
|
+
<button class="dump">${l.DUMP_BUTTON}</button>
|
|
94
|
+
<button class="end-dump" disabled>${l.END_BUTTON}</button>
|
|
95
|
+
</div>
|
|
96
|
+
<div id="${j}">
|
|
97
|
+
<span>${l.VIDEO} - ${l.DURATION}(s):</span>
|
|
98
|
+
<input type="number" min=0 value=0></input>
|
|
99
|
+
<button class="dump">${l.DUMP_BUTTON}</button>
|
|
100
|
+
<button class="end-dump" disabled>${l.END_BUTTON}</button>
|
|
101
|
+
</div>
|
|
102
|
+
<div id="${V}">
|
|
103
|
+
<span>${l.SCREEN} - ${l.DURATION}(s):</span>
|
|
104
|
+
<input type="number" min=0 value=0></input>
|
|
105
|
+
<button class="dump">${l.DUMP_BUTTON}</button>
|
|
106
|
+
<button class="end-dump" disabled>${l.END_BUTTON}</button>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="${se}">${l.DOWNLINK}</div>
|
|
110
|
+
<div class="${k}"></div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="${J}"></div>
|
|
114
|
+
<div class="${pe}">
|
|
115
|
+
<a id="trtc_upload" class="${U}">${l.UPLOAD_BUTTON}</a>
|
|
116
|
+
<a id="trtc_export" class="${U}">${l.EXPORT_BUTTON}</a>
|
|
117
|
+
<a id="trtc_hide" class="${U}">${l.HIDE_BUTTON}</a>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>`;let e=t.content.firstChild;this._switchNode=e.querySelector(`.${q}`),(n=this._switchNode)==null||n.addEventListener("click",this.onSwitchClick.bind(this)),this.dragable(this._switchNode),this._maskNode=e.querySelector(`.${te}`),(u=this._maskNode)==null||u.addEventListener("click",this.onMaskClick.bind(this)),this._pannelNode=e.querySelector(`.${K}`),(p=e.querySelector(`.${R}`))==null||p.addEventListener("click",this.onBackTopClick.bind(this)),(h=e.querySelector(`.${I}`))==null||h.addEventListener("click",this.onGoBottomClick.bind(this)),this._logContentNode=e.querySelector(`.${de}`),this._networkContentNode=e.querySelector(`.${M}`),this._dumpContentNode=e.querySelector(`.${D}`),this._tabNodes=Array.from(e.querySelector(`.${oe}`).children),this._tabNodes.forEach(f=>{f.dataset.tab==="dump"&&!this._core.rtcDectection.IS_INSERTABLE_STREAM_SUPPORTED?(f.classList.add("disabled"),this._log.error("insertable-stream is supported, cannot use dump in debug plugin"),f.addEventListener("click",()=>{this.addInfoToBanner(w,_?"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301insertable-stream API\uFF0C\u65E0\u6CD5\u4F7F\u7528\u8F6C\u50A8\u529F\u80FD":"insertable-stream is supported, cannot use dump in debug plugin")})):f.addEventListener("click",this.onTabClick.bind(this))}),this._toptabNodes=Array.from(e.querySelector(`.${ie}`).children),this._toptabNodes.forEach(f=>{f.addEventListener("click",this.onToptabClick.bind(this))}),this._backTopButton=e.querySelector(`.${R}`),this._goBottomButton=e.querySelector(`.${I}`);let i=e.querySelector("#trtc_upload");i==null||i.addEventListener("click",this.onUploadClick.bind(this));let s=e.querySelector("#trtc_export");s==null||s.addEventListener("click",this.onExportClick.bind(this));let o=e.querySelector("#trtc_hide");if(o==null||o.addEventListener("click",this.onHideClick.bind(this)),this._core.rtcDectection.IS_INSERTABLE_STREAM_SUPPORTED){let f=e.querySelector(`#${j} .dump`);f==null||f.addEventListener("click",()=>{let a=Number(e.querySelector(`#${j} input`).value),{download:c,onDumpEnd:m}=this.dumpVideo("main","local",a);if(!c){this.addInfoToBanner(w,_?"\u8F6C\u50A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5F53\u524D\u7528\u6237\u662F\u5426\u8FDB\u623F\u6216\u53D1\u5E03\u89C6\u9891\u6D41":"Failed to dump, please check if the current user has entered the room or published the video stream");return}if(this.disactiveButton(f,l.DUMPING_BUTTON),a>0)setTimeout(()=>{c(),this.activeButton(f,l.DUMP_BUTTON)},a*1e3);else{let b=e.querySelector(`#${j} .end-dump`);this.activeButton(b),b.onclick=()=>{b.onclick=null,m==null||m(),c(),this.activeButton(f,l.DUMP_BUTTON),this.disactiveButton(b)}}});let v=e.querySelector(`#${V} .dump`);v==null||v.addEventListener("click",()=>{let a=Number(e.querySelector(`#${V} input`).value),{download:c,onDumpEnd:m}=this.dumpVideo("auxiliary","local",a);if(!c){this.addInfoToBanner(w,_?"\u8F6C\u50A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5F53\u524D\u7528\u6237\u662F\u5426\u8FDB\u623F\u6216\u53D1\u5E03\u5C4F\u5E55\u5206\u4EAB\u6D41":"Failed to dump, please check if the current user has entered the room or published the screen share stream");return}if(this.disactiveButton(v,l.DUMPING_BUTTON),a>0)setTimeout(()=>{c(),this.activeButton(v,l.DUMP_BUTTON)},a*1e3);else{let b=e.querySelector(`#${V} .end-dump`);this.activeButton(b),b.onclick=()=>{b.onclick=null,c(),m==null||m(),this.activeButton(v,l.DUMP_BUTTON),this.disactiveButton(b)}}});let r=e.querySelector(`#${Y} button`);r==null||r.addEventListener("click",()=>{let a=Number(e.querySelector(`#${Y} input`).value),{download:c,onDumpEnd:m}=this.dumpAudio("local",a);if(!c){this.addInfoToBanner(w,_?"\u8F6C\u50A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5F53\u524D\u7528\u6237\u662F\u5426\u8FDB\u623F\u6216\u53D1\u5E03\u97F3\u9891\u6D41":"Failed to dump, please check if the current user has entered the room or published the audio stream");return}if(this.disactiveButton(r,l.DUMPING_BUTTON),a>0)setTimeout(()=>{c(),this.activeButton(r,l.DUMP_BUTTON)},a*1e3);else{let b=e.querySelector(`#${Y} .end-dump`);this.activeButton(b),b.onclick=()=>{b.onclick=null,c(),m==null||m(),this.activeButton(r,l.DUMP_BUTTON),this.disactiveButton(b)}}})}return e}closeDialog(){this.uninstallEvents(),this._dialogNode&&(document.body.removeChild(this._dialogNode),this._dialogNode=null),this._core=null,this._log=null,this.dumpLocalVideoMap=null,this.dumpRemoteVideoMap=null,this._logList=null}updateLog(t){var i;this._logList.push(t);let e=document.createElement("div");switch(e.classList.add(L),t.level){case 4:e.classList.add(be);break;case 2:e.classList.add(me);break;case 3:e.classList.add(_e);break;case 1:e.classList.add(he);break;default:break}e.textContent=t.log,this._showLogType!=="all"&&!e.classList.contains(`${L}_${this._showLogType}`)&&(e.style.display="none"),(i=this._logContentNode)==null||i.appendChild(e),this.addHelper(e)}onSwitchClick(){if(this._hasMove){this._hasMove=!1;return}this._showDialog?this.hideDialog():(this._isMobile&&(this._maskNode.style.display="block"),this._pannelNode.style.display="block",this._switchNode.style.display="none",this._showDialog=!0,this.logContentGoBottom())}onTabClick(t){var s,o,n,u,p;let e=t.target;(s=this._tabNodes)==null||s.forEach(h=>{h.classList.remove(A)}),e.classList.add(A);let i=e.getAttribute("data-tab");i==="log"?((n=(o=this._dialogNode)==null?void 0:o.querySelector(`.${$}`))==null||n.classList.add(G),this._logContentNode.style.display="block",this._goBottomButton.style.display="block",this._backTopButton.style.display="block",this._networkContentNode.style.display="none",this._dumpContentNode.style.display="none",this.logContentGoBottom()):(this._backTopButton.style.display="none",this._goBottomButton.style.display="none",(p=(u=this._dialogNode)==null?void 0:u.querySelector(`.${$}`))==null||p.classList.remove(G),i==="network"?(this._networkContentNode.style.display="block",this._logContentNode.style.display="none",this._dumpContentNode.style.display="none"):i==="dump"&&(this._dumpContentNode.style.display="block",this._networkContentNode.style.display="none",this._logContentNode.style.display="none"))}onToptabClick(t){var o,n;let e=t.target;(o=this._toptabNodes)==null||o.forEach(u=>{u.classList.remove(A)}),e.classList.add(A),this._showLogType=e.getAttribute("data-type");let i=(n=this._logContentNode)==null?void 0:n.querySelectorAll(`.${L}`),s=`${L}_${this._showLogType}`;i.forEach(u=>{u.classList.contains(s)||this._showLogType==="all"?u.style.display="block":u.style.display="none"}),this.logContentGoBottom()}onExportClick(){let t=this._logList.reduce((n,u)=>`${n+u.log}
|
|
121
|
+
`,""),e=new Blob([t],{type:"text/plain"}),i=document.createElement("a"),s=URL.createObjectURL(e);i.href=s;let o=`trtc_${this._core.room.sdkAppId===void 0?"EmptySdkAppId":this._core.room.sdkAppId}_${this._core.room.userId===void 0?"EmptyUserId":this._core.room.userId}_${new Date().getTime()}.log`;i.download=o,i.style.display="none",document.body.appendChild(i),i.click(),URL.revokeObjectURL(s),document.body.removeChild(i),this.addInfoToBanner(ae,_?`\u5BFC\u51FA\u6210\u529F\uFF1A\u65E5\u5FD7\u6587\u4EF6\u540D\u4E3A${o}`:`Export success: The log file name is ${o}`),this._core.kvStatManager.addSuccessEvent({key:592703}),this._log.info("Export success: The log file name is ${fileName}")}addInfoToBanner(t,e){var o;let i=(o=this._dialogNode)==null?void 0:o.querySelector(`.${J}`),s=document.createElement("div");s.classList.add(ue),s.innerText=`${t===ae?"\u{1F7E9}":"\u{1F7E5} "} [${this.getCurrentTime()}] ${e}`,i.appendChild(s),i.scrollTop=i.scrollHeight}async onUploadClick(){var u;if(this.isUploading)return;this.isUploading=!0;let t=(u=this._dialogNode)==null?void 0:u.querySelector("#trtc_upload");t.innerText=_?"\u4E0A\u4F20\u4E2D...":"Uploading...",t==null||t.classList.add(".disable");let e=this._logList.reduce((p,h)=>`${p+h.log}
|
|
122
|
+
`,""),i=new Blob([e],{type:"text/plain"}),s=new FormData,o="trtc.log";s.append("file",i,o),s.append("sdkAppId",`${this._core.room.sdkAppId||"EmptySdkAppId"}`),s.append("userId",`${this._core.room.userId||"EmptyUserId"}`),fetch("https://service.trtc.qcloud.com/api/uploadLogFile",{method:"POST",body:s}).then(p=>p.json()).then(p=>{this.addInfoToBanner(p.type,_?p.message_zh:p.message_en),this.isUploading=!1,this._log.info(p.message_en),this._core.kvStatManager.addSuccessEvent({key:592704})}).catch(()=>{this.addInfoToBanner(w,_?"\u4E0A\u4F20\u5931\u8D25\uFF1A\u8BF7\u4F7F\u7528\u672C\u5730\u5BFC\u51FA":"Upload Failed: Please use local export"),this._log.info("Upload Failed: Please use local export"),this._core.kvStatManager.addFailedEvent({key:592704})}).finally(()=>{t.innerText=_?"\u4E0A\u4F20":"Upload",t==null||t.classList.remove(".disable"),this.isUploading=!1})}onHideClick(){this.hideDialog()}onMaskClick(){this.hideDialog()}hideDialog(){this._isMobile&&(this._maskNode.style.display="none"),this._pannelNode.style.display="none",this._switchNode.style.display="block",this._showDialog=!1}onBackTopClick(){var t,e;(e=(t=this._dialogNode)==null?void 0:t.querySelector(`.${$}`))==null||e.scrollTo(0,0)}onGoBottomClick(){this.logContentGoBottom()}logContentGoBottom(){var e;let t=(e=this._dialogNode)==null?void 0:e.querySelector(`.${$}`);t==null||t.scrollTo(0,t==null?void 0:t.scrollHeight)}dragable(t){var f,v;let e={x:0,y:0,startX:0,startY:0,endX:0,endY:0,isTouchEnd:!1};e.x=((f=this._switchNode)==null?void 0:f.offsetLeft)||50,e.y=((v=this._switchNode)==null?void 0:v.offsetTop)||150;let i=r=>{r.preventDefault(),e.startX=r.pageX,e.startY=r.pageY,document.addEventListener("mousemove",s),document.addEventListener("mouseup",o)},s=r=>{r.cancelable&&r.preventDefault(),this._hasMove=!0;let a=e.x-(r.pageX-e.startX),c=e.y-(r.pageY-e.startY);[a,c]=h(a,c),this._switchNode.style.right=`${a}px`,this._switchNode.style.bottom=`${c}px`,e.endX=a,e.endY=c},o=()=>{e.startX=0,e.startY=0,e.x=e.endX,e.y=e.endY,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",o)},n=r=>{e.startX=r.touches[0].pageX,e.startY=r.touches[0].pageY,e.isTouchEnd=!1},u=()=>{!e.isTouchEnd||(e.startX=0,e.startY=0,e.isTouchEnd=!1,e.x=e.endX,e.y=e.endY)},p=r=>{if(r.touches.length<=0)return;let a=r.touches[0].pageX-e.startX,c=r.touches[0].pageY-e.startY,m=Math.floor(e.x-a),b=Math.floor(e.y-c);[m,b]=h(m,b),this._switchNode.style.right=`${m}px`,this._switchNode.style.bottom=`${b}px`,e.endX=m,e.endY=b,e.isTouchEnd=!0,r.cancelable&&r.preventDefault()},h=(r,a)=>{let c=Math.max(document.documentElement.offsetWidth,window.innerWidth),m=Math.max(document.documentElement.offsetHeight,window.innerHeight);return r+this._switchNode.offsetWidth>c&&(r=c-this._switchNode.offsetWidth),a+this._switchNode.offsetHeight>m&&(a=m-this._switchNode.offsetHeight),r<0&&(r=0),a<20&&(a=20),[r,a]};ee()?(t.addEventListener("touchstart",n,{passive:!1}),t.addEventListener("touchend",u,{passive:!1}),t.addEventListener("touchmove",p,{passive:!1})):t.addEventListener("mousedown",i)}installEvents(){this._core.innerEmitter.on("264",this.handleLog,this),this._core.innerEmitter.on("53",this.handleLeaveSuccess,this),this._core.trtc.on(this._core.TRTC.EVENT.STATISTICS,this.handleStatistics,this),this._core.trtc.on(this._core.TRTC.EVENT.REMOTE_AUDIO_AVAILABLE,this.handleRemoteAudioAvailable),this._core.trtc.on(this._core.TRTC.EVENT.REMOTE_AUDIO_UNAVAILABLE,this.handleRemoteAudioUnavailable),this._core.trtc.on(this._core.TRTC.EVENT.REMOTE_VIDEO_AVAILABLE,this.handleRemoteVideoAvailable),this._core.trtc.on(this._core.TRTC.EVENT.REMOTE_VIDEO_UNAVAILABLE,this.handleRemoteVideoUnavailable)}uninstallEvents(){this._core.innerEmitter.off("264",this.handleLog,this),this._core.innerEmitter.off("53",this.handleLeaveSuccess,this),this._core.trtc.off(this._core.TRTC.EVENT.STATISTICS,this.handleStatistics,this),this._core.trtc.off(this._core.TRTC.EVENT.REMOTE_AUDIO_AVAILABLE,this.handleRemoteAudioAvailable),this._core.trtc.off(this._core.TRTC.EVENT.REMOTE_AUDIO_UNAVAILABLE,this.handleRemoteAudioUnavailable),this._core.trtc.off(this._core.TRTC.EVENT.REMOTE_VIDEO_AVAILABLE,this.handleRemoteVideoAvailable),this._core.trtc.off(this._core.TRTC.EVENT.REMOTE_VIDEO_UNAVAILABLE,this.handleRemoteVideoUnavailable)}disactiveButton(t,e){t.disabled=!0,e&&(t.innerText=e),t.style.cssText="cursor: not-allowed;background-color: #ededed;color: #999;border-radius: 5px;"}activeButton(t,e){t.disabled=!1,e&&(t.innerText=e),t.style.cssText="border-radius: 5px;margin-right: 5px;"}handleLog(t){this.updateLog(t.log)}addHelper(t){let e=/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/g,i=ce,s=t.innerText;s=s.split(`
|
|
123
|
+
`).map(o=>{if(o=o.replace(/</g,"<").replace(/>/g,">"),o.includes("failed"))return o.includes("on autoplay-failed")?o:`<span class='red' style="background:red; color:#fff;">${o}</span>`;if(o.includes("clientIp:")){let n=o.match(e);return n==null||n.forEach(u=>{o=o.replace(u,`<a href="javascript:void(0);" target=""><span class='ip' style="background:#e1dfdf">${u}</span></a>`)}),o}return o.includes("URL of current page")&&(o=o.replace(/URL of current page: (.+)/,'URL of current page: <a href="$1">$1</a>')),o}).join(`
|
|
124
|
+
`),i.forEach(o=>{if(t.innerText.includes(o)){let n="";_?n=typeof S[o].tips_zh=="function"?S[o].tips_zh(t.innerText):S[o].tips_zh:n=typeof S[o].tips_en=="function"?S[o].tips_en(t.innerText):S[o].tips_en,s=s.replace(new RegExp(`${le(o)}`,"gi"),`<span class="${N}" style="background:${S[o].color||"#e1dfdf"}; color: ${S[o].textColor||"#000"}">${o}
|
|
125
|
+
<span class="tooltiptext tooltip-top">${n}</span>
|
|
126
|
+
</span>`)}}),t.innerHTML=s}getCurrentTime(){let t=n=>n<10?`0${n}`:`${n}`,e=new Date,i=t(e.getHours()),s=t(e.getMinutes()),o=t(e.getSeconds());return`${i}:${s}:${o}`}dumpVideo(t,e,i,s){let o=Date.now(),n=[],u=()=>{if(n.length===0){this.addInfoToBanner(w,_?"\u8F6C\u50A8\u5931\u8D25":"Dump failed");return}let h;t==="main"?h="video":t==="auxiliary"&&(h="screen");let f=URL.createObjectURL(new Blob(n)),v=document.createElement("a"),r=e==="local"?`local-${h}-${o}.h264`:`remote-${s}-${h}-${o}.h264`;v.href=f,v.download=r,v.style.display="none",document.body.appendChild(v),v.click(),URL.revokeObjectURL(f),v.remove(),this.addInfoToBanner(ae,_?`\u8F6C\u50A8\u6210\u529F\uFF0C\u6587\u4EF6\u540D\u4E3A\uFF1A${r}`:`Dump success, file name is: ${r}`)},p;if(e==="local"){if(!this.hasLocalTrack(t,"video"))return{};p=()=>{delete this.dumpLocalVideoMap[t==="auxiliary"?"sub":"main"]},this.dumpLocalVideoMap[t==="auxiliary"?"sub":"main"]={startTimestamp:o,data:n,duration:i,onDumpEnd:p}}return e==="remote"&&s&&(p=()=>{delete this.dumpRemoteVideoMap[`${s}-${t}`]},this.dumpRemoteVideoMap[`${s}-${t}`]={startTimestamp:o,data:n,duration:i,onDumpEnd:p}),{download:u,onDumpEnd:p}}hasLocalTrack(t,e){for(let i of this._core.room.localTracks)if(i.streamType===t&&i.kind===e)return!0;return!1}dumpAudio(t,e,i){var v,r,a;let s=null,o=[],n=[],u=[],p=new AbortController,h=Date.now();if(t==="local"){if(!this.hasLocalTrack("main","audio"))return{};(v=this._core.room.audioManager._localAudioPipline)!=null&&v.source.node&&(o.push(this._core.room.audioManager._localAudioPipline.source.node),n.push(`local-mic-${h}`)),(r=this._core.room.audioManager._localAudioPipline)!=null&&r.denoiser.node&&(o.push(this._core.room.audioManager._localAudioPipline.denoiser.node),n.push(`local-mic-processed-${h}`)),this._core.room.audioManager.mixWeight>1&&(o.push(this._core.room.audioManager.audioContext.createMediaStreamSource(this._core.room.audioManager._localAudioPipline.stream)),n.push(`local-mix-${h}`))}else if(t==="remote"&&i!==void 0){let c=(a=this._core.room.remotePublishedUserMap.get(i))==null?void 0:a.remoteAudioTrack,m=this._core.createAudioNode(c==null?void 0:c.mediaTrack);o.push(m),n.push(`remote-${i}-${h}`)}let f=()=>{for(let c=0;c<n.length;c++){let m=URL.createObjectURL(new Blob(u[c])),b=document.createElement("a");b.href=m,b.download=`${n[c]}.pcm`,b.style.display="none",document.body.appendChild(b),b.click(),URL.revokeObjectURL(m),b.remove()}s&&clearTimeout(s),p.abort("download")};return e>0&&(s=Number(setTimeout(()=>{p.abort("timeout")},e*1e3))),this._core.startGetPCM(o).then(c=>c.pipeTo(new WritableStream({write(m){m.forEach((b,T)=>u[T]=u[T]?u[T].concat(b[0]):[b[0]])}}),p).catch(()=>f)),{download:f,onDumpEnd:()=>{p.abort("timeout")}}}removeEventListener(){}};Q([Z(300,()=>"export")],H.prototype,"onExportClick",1),Q([Z(300,()=>"upload")],H.prototype,"onUploadClick",1);var He=H;export{He as default};
|