Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trtc-cloud-js-sdk

Package Overview
Dependencies
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trtc-cloud-js-sdk - npm Package Compare versions

Comparing version 2.1.1-beta.1 to 2.1.2

4

package.json
{
"name": "trtc-cloud-js-sdk",
"version": "2.1.1-beta.1",
"version": "2.1.2",
"description": "Tencent Cloud RTC SDK for Web And Electron",

@@ -22,4 +22,4 @@ "main": "trtc-cloud-js-sdk.js",

"rtc-beauty-plugin": "^0.0.5",
"trtc-sdk-v5": "5.0.2-beta.1"
"trtc-sdk-v5": "^5.0.0"
}
}

@@ -1,1 +0,1 @@

var global,factory;global=this,factory=function(e,t,i){function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r,n,s,a,c,u,T,d,l=o(i),h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},h(e,t)},p=function(){return p=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},p.apply(this,arguments)};function R(e,t,i,o){return new(i||(i=Promise))((function(r,n){function s(e){try{c(o.next(e))}catch(t){n(t)}}function a(e){try{c(o.throw(e))}catch(t){n(t)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))}function C(e,t){var i,o,r,n,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,a[0]&&(s=0)),s;)try{if(i=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(c){a=[6,c],o=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function _(e,t,i){if(i||2===arguments.length)for(var o,r=0,n=t.length;r<n;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}e.TRTCVideoResolution=void 0,(r=e.TRTCVideoResolution||(e.TRTCVideoResolution={}))[r.TRTCVideoResolution_120_120=1]="TRTCVideoResolution_120_120",r[r.TRTCVideoResolution_160_160=3]="TRTCVideoResolution_160_160",r[r.TRTCVideoResolution_270_270=5]="TRTCVideoResolution_270_270",r[r.TRTCVideoResolution_480_480=7]="TRTCVideoResolution_480_480",r[r.TRTCVideoResolution_160_120=50]="TRTCVideoResolution_160_120",r[r.TRTCVideoResolution_240_180=52]="TRTCVideoResolution_240_180",r[r.TRTCVideoResolution_280_210=54]="TRTCVideoResolution_280_210",r[r.TRTCVideoResolution_320_240=56]="TRTCVideoResolution_320_240",r[r.TRTCVideoResolution_400_300=58]="TRTCVideoResolution_400_300",r[r.TRTCVideoResolution_480_360=60]="TRTCVideoResolution_480_360",r[r.TRTCVideoResolution_640_480=62]="TRTCVideoResolution_640_480",r[r.TRTCVideoResolution_960_720=64]="TRTCVideoResolution_960_720",r[r.TRTCVideoResolution_160_90=100]="TRTCVideoResolution_160_90",r[r.TRTCVideoResolution_256_144=102]="TRTCVideoResolution_256_144",r[r.TRTCVideoResolution_320_180=104]="TRTCVideoResolution_320_180",r[r.TRTCVideoResolution_480_270=106]="TRTCVideoResolution_480_270",r[r.TRTCVideoResolution_640_360=108]="TRTCVideoResolution_640_360",r[r.TRTCVideoResolution_960_540=110]="TRTCVideoResolution_960_540",r[r.TRTCVideoResolution_1280_720=112]="TRTCVideoResolution_1280_720",r[r.TRTCVideoResolution_1920_1080=114]="TRTCVideoResolution_1920_1080",e.TRTCVideoStreamType=void 0,(n=e.TRTCVideoStreamType||(e.TRTCVideoStreamType={}))[n.TRTCVideoStreamTypeBig=0]="TRTCVideoStreamTypeBig",n[n.TRTCVideoStreamTypeSmall=1]="TRTCVideoStreamTypeSmall",n[n.TRTCVideoStreamTypeSub=2]="TRTCVideoStreamTypeSub",e.TRTCVideoFillMode=void 0,(s=e.TRTCVideoFillMode||(e.TRTCVideoFillMode={}))[s.TRTCVideoFillMode_Fill=0]="TRTCVideoFillMode_Fill",s[s.TRTCVideoFillMode_Fit=1]="TRTCVideoFillMode_Fit",e.TRTCVideoMirrorType=void 0,(a=e.TRTCVideoMirrorType||(e.TRTCVideoMirrorType={}))[a.TRTCVideoMirrorType_Auto=0]="TRTCVideoMirrorType_Auto",a[a.TRTCVideoMirrorType_Enable=1]="TRTCVideoMirrorType_Enable",a[a.TRTCVideoMirrorType_Disable=2]="TRTCVideoMirrorType_Disable",e.TRTCBeautyStyle=void 0,(c=e.TRTCBeautyStyle||(e.TRTCBeautyStyle={}))[c.TRTCBeautyStyleSmooth=0]="TRTCBeautyStyleSmooth",c[c.TRTCBeautyStyleNature=1]="TRTCBeautyStyleNature",e.TRTCAppScene=void 0,(u=e.TRTCAppScene||(e.TRTCAppScene={}))[u.TRTCAppSceneVideoCall=0]="TRTCAppSceneVideoCall",u[u.TRTCAppSceneLIVE=1]="TRTCAppSceneLIVE",u[u.TRTCAppSceneAudioCall=2]="TRTCAppSceneAudioCall",u[u.TRTCAppSceneVoiceChatRoom=3]="TRTCAppSceneVoiceChatRoom",e.TRTCRoleType=void 0,(T=e.TRTCRoleType||(e.TRTCRoleType={}))[T.TRTCRoleAnchor=20]="TRTCRoleAnchor",T[T.TRTCRoleAudience=21]="TRTCRoleAudience",e.TRTCAudioQuality=void 0,(d=e.TRTCAudioQuality||(e.TRTCAudioQuality={}))[d.TRTCAudioQualityDefault=0]="TRTCAudioQualityDefault",d[d.TRTCAudioQualitySpeech=1]="TRTCAudioQualitySpeech",d[d.TRTCAudioQualityMusic=3]="TRTCAudioQualityMusic";var v,f,y=function(e,t,i,o,r){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),void 0===o&&(o=""),void 0===r&&(r=""),this.deviceId=e,this.deviceName=t,this.kind=i,this.label=o,this.groupId=r};e.TRTCDeviceState=void 0,(v=e.TRTCDeviceState||(e.TRTCDeviceState={}))[v.TRTCDeviceStateAdd=0]="TRTCDeviceStateAdd",v[v.TRTCDeviceStateRemove=1]="TRTCDeviceStateRemove",v[v.TRTCDeviceStateActive=2]="TRTCDeviceStateActive",e.TRTCDeviceType=void 0,(f=e.TRTCDeviceType||(e.TRTCDeviceType={}))[f.TRTCDeviceTypeUnknow=-1]="TRTCDeviceTypeUnknow",f[f.TRTCDeviceTypeMic=0]="TRTCDeviceTypeMic",f[f.TRTCDeviceTypeSpeaker=1]="TRTCDeviceTypeSpeaker",f[f.TRTCDeviceTypeCamera=2]="TRTCDeviceTypeCamera";var m,g=function(t,i,o,r,n,s,a,c,u,T,d){void 0===t&&(t=0),void 0===i&&(i=""),void 0===o&&(o=""),void 0===r&&(r=0),void 0===n&&(n=""),void 0===s&&(s=e.TRTCRoleType.TRTCRoleAnchor),void 0===a&&(a=null),void 0===u&&(u=null),void 0===T&&(T=null),void 0===d&&(d=30),this.sdkAppId=t,this.userId=i,this.userSig=o,this.roomId=r,this.strRoomId=n,this.role=s,this.privateMapKey=a,this.streamId=u,this.userDefineRecordId=T,this.frameWorkType=d},V=function(t,i,o){void 0===t&&(t=e.TRTCVideoResolution.TRTCVideoResolution_640_360),void 0===i&&(i=15),void 0===o&&(o=550),this.videoResolution=t,this.videoFps=i,this.videoBitrate=o};e.TRTCVideoRotation=void 0,(m=e.TRTCVideoRotation||(e.TRTCVideoRotation={}))[m.TRTCVideoRotation0=0]="TRTCVideoRotation0",m[m.TRTCVideoRotation90=1]="TRTCVideoRotation90",m[m.TRTCVideoRotation180=2]="TRTCVideoRotation180",m[m.TRTCVideoRotation270=3]="TRTCVideoRotation270";var S,M=function(t,i,o){void 0===t&&(t=e.TRTCVideoRotation.TRTCVideoRotation0),void 0===i&&(i=e.TRTCVideoFillMode.TRTCVideoFillMode_Fit),void 0===o&&(o=e.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable),this.rotation=t,this.fillMode=i,this.mirrorType=o};e.TRTCQuality=void 0,(S=e.TRTCQuality||(e.TRTCQuality={}))[S.TRTCQuality_Unknown=0]="TRTCQuality_Unknown",S[S.TRTCQuality_Excellent=1]="TRTCQuality_Excellent",S[S.TRTCQuality_Good=2]="TRTCQuality_Good",S[S.TRTCQuality_Poor=3]="TRTCQuality_Poor",S[S.TRTCQuality_Bad=4]="TRTCQuality_Bad",S[S.TRTCQuality_Vbad=5]="TRTCQuality_Vbad",S[S.TRTCQuality_Down=6]="TRTCQuality_Down";var A,I,E,b=function(t,i){void 0===t&&(t=""),void 0===i&&(i=e.TRTCQuality.TRTCQuality_Unknown),this.userId=t,this.quality=i},D=function(e,t){void 0===e&&(e=""),void 0===t&&(t=0),this.userId=e,this.volume=t},w=function(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=null),this.appId=e,this.bizId=t,this.url=i},P=function(t,i,o,r,n,s,a){void 0===t&&(t=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===a&&(a=e.TRTCVideoStreamType.TRTCVideoStreamTypeBig),this.width=t,this.height=i,this.frameRate=o,this.videoBitrate=r,this.audioSampleRate=n,this.audioBitrate=s,this.streamType=a},L=function(e,t,i,o,r,n,s,a,c,u){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===a&&(a=[]),void 0===c&&(c=0),void 0===u&&(u=0),this.upLoss=e,this.downLoss=t,this.appCpu=i,this.systemCpu=o,this.rtt=r,this.receivedBytes=n,this.sentBytes=s,this.localStatisticsArray=a,this.localStatisticsArraySize=c,this.remoteStatisticsArraySize=u};e.TRTCVideoResolutionMode=void 0,(A=e.TRTCVideoResolutionMode||(e.TRTCVideoResolutionMode={}))[A.TRTCVideoResolutionModeLandscape=0]="TRTCVideoResolutionModeLandscape",A[A.TRTCVideoResolutionModePortrait=1]="TRTCVideoResolutionModePortrait",e.TRTCVideoQosPreference=void 0,(I=e.TRTCVideoQosPreference||(e.TRTCVideoQosPreference={}))[I.TRTCVideoQosPreferenceSmooth=1]="TRTCVideoQosPreferenceSmooth",I[I.TRTCVideoQosPreferenceClear=2]="TRTCVideoQosPreferenceClear",e.TRTCQosControlMode=void 0,(E=e.TRTCQosControlMode||(e.TRTCQosControlMode={}))[E.TRTCQosControlModeClient=0]="TRTCQosControlModeClient",E[E.TRTCQosControlModeServer=1]="TRTCQosControlModeServer";var O,F=function(t,i){void 0===t&&(t=e.TRTCVideoQosPreference.TRTCVideoQosPreferenceClear),void 0===i&&(i=e.TRTCQosControlMode.TRTCQosControlModeServer),this.preference=t,this.controlMode=i},k=function(e,t,i,o){void 0===e&&(e=new ArrayBuffer(0)),void 0===t&&(t=0),void 0===i&&(i=0),void 0===o&&(o=0),this.buffer=e,this.length=t,this.width=i,this.height=o};e.TRTCScreenCaptureSourceType=void 0,(O=e.TRTCScreenCaptureSourceType||(e.TRTCScreenCaptureSourceType={}))[O.TRTCScreenCaptureSourceTypeUnknown=-1]="TRTCScreenCaptureSourceTypeUnknown",O[O.TRTCScreenCaptureSourceTypeWindow=0]="TRTCScreenCaptureSourceTypeWindow",O[O.TRTCScreenCaptureSourceTypeScreen=1]="TRTCScreenCaptureSourceTypeScreen",O[O.TRTCScreenCaptureSourceTypeCustom=2]="TRTCScreenCaptureSourceTypeCustom";var Q,N=function(t,i,o,r,n,s){void 0===t&&(t=e.TRTCScreenCaptureSourceType.TRTCScreenCaptureSourceTypeUnknown),void 0===i&&(i=""),void 0===o&&(o=""),void 0===r&&(r=new k),void 0===n&&(n=new k),void 0===s&&(s=!1),this.type=t,this.sourceId=i,this.sourceName=o,this.thumbBGRA=r,this.iconBGRA=n,this.isMinimizeWindow=s},B=function(e,t,i,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===o&&(o=0),this.left=e,this.top=t,this.right=i,this.bottom=o},U=function(t,i,o,r,n,s,a,c,u,T,d,l,h,p,R){void 0===t&&(t=e.TRTCTranscodingConfigMode.TRTCTranscodingConfigMode_Unknown),void 0===i&&(i=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===a&&(a=15),void 0===c&&(c=2),void 0===u&&(u=0),void 0===T&&(T=""),void 0===d&&(d=64),void 0===l&&(l=48e3),void 0===h&&(h=1),void 0===p&&(p=[]),void 0===R&&(R=""),this.mode=t,this.appId=i,this.bizId=o,this.videoWidth=r,this.videoHeight=n,this.videoBitrate=s,this.videoFramerate=a,this.videoGOP=c,this.backgroundColor=u,this.backgroundImage=T,this.audioSampleRate=d,this.audioBitrate=l,this.audioChannels=h,this.mixUsersArray=p,this.mixUsersArraySize=p.length,this.streamId=R};e.TRTCTranscodingConfigMode=void 0,(Q=e.TRTCTranscodingConfigMode||(e.TRTCTranscodingConfigMode={}))[Q.TRTCTranscodingConfigMode_Unknown=0]="TRTCTranscodingConfigMode_Unknown",Q[Q.TRTCTranscodingConfigMode_Manual=1]="TRTCTranscodingConfigMode_Manual",Q[Q.TRTCTranscodingConfigMode_Template_PureAudio=2]="TRTCTranscodingConfigMode_Template_PureAudio",Q[Q.TRTCTranscodingConfigMode_Template_PresetLayout=3]="TRTCTranscodingConfigMode_Template_PresetLayout",Q[Q.TRTCTranscodingConfigMode_Template_ScreenSharing=4]="TRTCTranscodingConfigMode_Template_ScreenSharing",Q[Q.TRTC_TranscodingConfigMode_Unknown=5]="TRTC_TranscodingConfigMode_Unknown",Q[Q.TRTC_TranscodingConfigMode_Manual=6]="TRTC_TranscodingConfigMode_Manual",Q[Q.TRTC_TranscodingConfigMode_Template_PureAudio=7]="TRTC_TranscodingConfigMode_Template_PureAudio",Q[Q.TRTC_TranscodingConfigMode_Template_PresetLayout=8]="TRTC_TranscodingConfigMode_Template_PresetLayout",Q[Q.TRTC_TranscodingConfigMode_Template_ScreenSharing=9]="TRTC_TranscodingConfigMode_Template_ScreenSharing";var x,j=function(t,i,o,r,n,s,a,c){void 0===t&&(t=""),void 0===i&&(i=""),void 0===o&&(o=null),void 0===r&&(r=0),void 0===n&&(n=!1),void 0===s&&(s=e.TRTCVideoStreamType.TRTCVideoStreamTypeBig),void 0===a&&(a=e.TRTCMixInputType.TRTCMixInputTypeUndefined),void 0===c&&(c=0),this.userId=t,this.roomId=i,this.rect=o,this.zOrder=r,this.pureAudio=n,this.streamType=s,this.inputType=a,this.renderMode=c};e.TRTCMixInputType=void 0,(x=e.TRTCMixInputType||(e.TRTCMixInputType={}))[x.TRTCMixInputTypeUndefined=0]="TRTCMixInputTypeUndefined",x[x.TRTCMixInputTypeAudioVideo=1]="TRTCMixInputTypeAudioVideo",x[x.TRTCMixInputTypePureVideo=2]="TRTCMixInputTypePureVideo",x[x.TRTCMixInputTypePureAudio=3]="TRTCMixInputTypePureAudio";var W,Y="onError",G="rtc",K="live",z={20:"anchor",21:"audience"},H={0:G,1:K,2:G,3:K},J={0:"standard",1:"high",2:"standard_stereo",3:"high_stereo"};function q(){return Math.floor(performance.now())}!function(e){e[e.ActiveExitRoom=0]="ActiveExitRoom",e[e.KickedExitRoom=1]="KickedExitRoom"}(W||(W={}));var X,Z,$=function(e){return void 0===e};function ee(e,t){for(var i=0,o=Reflect.ownKeys(t);i<o.length;i++){var r=o[i];if("constructor"!==r&&"prototype"!==r&&"name"!==r){var n=Object.getOwnPropertyDescriptor(t,r)||"";Object.defineProperty(e,r,n)}}}!function(e){e.LIVE="live",e.RTC="rtc"}(X||(X={})),function(e){e.CONTAIN="contain",e.COVER="cover",e.FILL="fill"}(Z||(Z={}));var te=-1e3,ie={code:-1001,message:"参数错误, 请检查参数格式、是否非空等"},oe={code:-1005,message:"not supported"},re="2.1.1-beta.1",ne=null,se="【TRTCCloud】";l.default._loggerManager.info("TRTCCloud Version: ".concat(re));var ae=function(t){function i(i){void 0===i&&(i={});var o=t.call(this)||this;o._version="",o._frameWorkType=30,o._component=0,o._localView=null,o._localTestView=null,o._isVideoPublish=!0,o._localRenderParams={rotation:e.TRTCVideoRotation.TRTCVideoRotation0,fillMode:e.TRTCVideoFillMode.TRTCVideoFillMode_Fill,mirrorType:e.TRTCVideoMirrorType.TRTCVideoMirrorType_Auto},o._videoProfile={},o._videoPlayOption={},o._isAudioPublish=!0,o._audioProfile=Object.keys(J)[0],o._isSharingScreen=!1,o._remoteStreamConfig=new Map,o._remoteStreamMap=new Map,o._cameraList=[],o._microphoneList=[],o._speakerList=[],o._currentCamera={},o._currentMicrophone={},o._currentSpeaker={},o._currentCameraId="",o._currentMicrophoneId="",o._currentSpeakerId="",o._screenShareParams={option:{}},o._isMobile=!1,o._isFrontCamera=!1,o._defaultVideoProfile={width:640,height:480,frameRate:15,bitrate:900},o._defaultScreenProfile={width:1920,height:1080,frameRate:15,bitrate:1500},o._version=re;var r,n,s,a=i.frameWorkType,c=void 0===a?30:a,u=i.component,T=void 0===u?0:u;return o._trtc=l.default.create({frameWorkType:c,component:T}),o._testTrtc=l.default.create(),o._log=l.default._loggerManager,o._addTRTCEvents(),o.handleDeviceChange=o.handleDeviceChange.bind(o),navigator&&navigator.mediaDevices&&navigator.mediaDevices.addEventListener("devicechange",(r=o.handleDeviceChange,n=30,function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];s>0&&clearTimeout(s),s=window.setTimeout((function(){r.apply(e,t),s=-1}),n)})),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(i,t),i.getTRTCShareInstance=function(e){return ne||(ne=new i(e)),ne},i.prototype.destroyTRTCShareInstance=function(){ne&&(this._removeTRTCEvents(),ne._destroy(),ne=null)},i.prototype.getSDKVersion=function(){return this._version||""},i.prototype.off=function(e,t){void 0===t&&(t=function(){});try{"*"===e?this.removeAllListeners():this.removeListener(e,t)}catch(i){console.log("off error ",i)}},i.prototype.enterRoom=function(e,t){return R(this,void 0,Promise,(function(){var i,o,r,n,s,a,c,u,T,d,l,h,R,_,v,f;return C(this,(function(C){switch(C.label){case 0:if(i=e.sdkAppId,o=e.userId,r=e.userSig,n=e.roomId,s=e.strRoomId,a=e.role,c=e.privateMapKey,u=e.businessInfo,T=e.enableAutoPlayDialog,d=e.proxy,l=e.streamId,h=e.userDefineRecordId,!(i&&o&&r))return[3,5];C.label=1;case 1:return C.trys.push([1,3,,4]),R={sdkAppId:i,userId:o,userSig:r,roomId:n||s,role:z[a],scene:H[t],frameWorkType:this._frameWorkType,component:this._component},R=c?p(p({},R),{privateMapKey:c}):R,R=u?p(p({},R),{businessInfo:u}):R,R=T?p(p({},R),{enableAutoPlayDialog:T}):R,R=d?p(p({},R),{proxy:d}):R,R=l?p(p({},R),{streamId:l}):R,R=h?p(p({},R),{userDefineRecordId:h}):R,_=q(),[4,this._trtc.enterRoom(R)];case 2:return C.sent(),v=q()-_,this.emit("onEnterRoom",v),[3,4];case 3:return f=C.sent(),this.emit("onEnterRoom",-1),this._callFunctionErrorManage(f,"enterRoom"),[3,4];case 4:return[3,6];case 5:this._emitError(ie),C.label=6;case 6:return[2]}}))}))},i.prototype.exitRoom=function(){return R(this,void 0,Promise,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),console.warn("".concat(se," exitRoom")),this._isSharingScreen?[4,this.stopScreenShare()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,this._trtc.exitRoom()];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),this._callFunctionErrorManage(e,"exitRoom"),[3,5];case 5:return[2]}}))}))},i.prototype.switchRole=function(e){return R(this,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this._trtc.switchRole(z[e])];case 1:return i.sent(),this.emit("onSwitchRole",0,"switch role success, role = ".concat(e,", ").concat(z[e])),[3,3];case 2:return t=i.sent(),this.emit("onSwitchRole",null==t?void 0:t.getCode(),t.message),[3,3];case 3:return[2]}}))}))},i.prototype._updateLocalVideo=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.updateLocalVideo(this._generateLocalVideoData())];case 1:return t.sent(),[3,3];case 2:if((e=t.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw e;case 3:return[2]}}))}))},i.prototype._updateLocalTestVideo=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._testTrtc.updateLocalVideo(this._generateLocalTestVideoData())];case 1:return t.sent(),[3,3];case 2:if((e=t.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw e;case 3:return[2]}}))}))},i.prototype._updateRemoteVideo=function(e,t){return R(this,void 0,void 0,(function(){var i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._trtc.updateRemoteVideo(this._generateRemoteVideoData(e,t))];case 1:return o.sent(),[3,3];case 2:if((i=o.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw i;case 3:return[2]}}))}))},i.prototype.startLocalPreview=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return R(this,void 0,Promise,(function(){var i,o,r,n,s;return C(this,(function(a){switch(a.label){case 0:this._log.info("(startLocalPreview) start - start local preview with params: [".concat(t,"]")),1===_([],t,!0).length?o=_([],t,!0)[0]:2===_([],t,!0).length&&(s=_([],t,!0),i=s[0],o=s[1]),$(i)||(this._setIsMobile(!0),this._setIsFrontCamera(i)),this._setLocalView(o),a.label=1;case 1:a.trys.push([1,8,,9]),a.label=2;case 2:return a.trys.push([2,4,,7]),[4,this._trtc.startLocalVideo(this._generateLocalVideoData())];case 3:return a.sent(),[3,7];case 4:return(r=a.sent()).code!==l.default.ERROR_CODE.OPERATION_ABORT?[3,6]:[4,this._updateLocalVideo()];case 5:return a.sent(),[2];case 6:throw r;case 7:return this.emit("onCameraDidReady"),this.emit("onFirstVideoFrame",{userId:"",streamType:e.TRTCVideoStreamType.TRTCVideoStreamTypeBig,width:this._getVideoProfile().width,height:this._getVideoProfile().height}),[3,9];case 8:return n=a.sent(),this._callFunctionErrorManage(n,"startLocalPreview"),[3,9];case 9:return[2]}}))}))},i.prototype.updateLocalView=function(e){return R(this,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return this._setLocalView(e),[4,this._updateLocalVideo()];case 1:return t.sent(),[2]}}))}))},i.prototype.stopLocalPreview=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this._setLocalView(null),[4,this._trtc.stopLocalVideo()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("".concat(se," stopLocalPreview error: ").concat(e)),this._callFunctionErrorManage(e,"stopLocalPreview"),[3,3];case 3:return[2]}}))}))},i.prototype.muteLocalVideo=function(e){return void 0===e&&(e=!1),R(this,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this._setIsVideoPublish(!e),[4,this._updateLocalVideo()];case 1:return i.sent(),[3,3];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"muteLocalVideo"),[3,3];case 3:return[2]}}))}))},i.prototype.startRemoteView=function(e,t,i){return R(this,void 0,void 0,(function(){var o,r;return C(this,(function(n){switch(n.label){case 0:if(n.trys.push([0,7,,8]),this._setRemoteStreamConfig(e,i,{view:t}),!this._remoteStreamMap.get("".concat(e,"_").concat(this._getTRTCStreamType(i))))return[2];n.label=1;case 1:return n.trys.push([1,3,,6]),[4,this._trtc.startRemoteVideo(this._generateRemoteVideoData(e,i))];case 2:return n.sent(),[3,6];case 3:return(o=n.sent()).code!==l.default.ERROR_CODE.OPERATION_ABORT?[3,5]:[4,this._updateRemoteVideo(e,i)];case 4:return n.sent(),[2];case 5:throw o;case 6:return[3,8];case 7:return r=n.sent(),this._callFunctionErrorManage(r,"startRemoteView"),[3,8];case 8:return[2]}}))}))},i.prototype.updateRemoteView=function(e,t,i){return R(this,void 0,void 0,(function(){return C(this,(function(o){switch(o.label){case 0:return this._setRemoteStreamConfig(e,i,{view:t}),[4,this._updateRemoteVideo(e,i)];case 1:return o.sent(),[2]}}))}))},i.prototype.stopRemoteView=function(e,t){return R(this,void 0,void 0,(function(){var i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._trtc.stopRemoteVideo({userId:e,streamType:this._getTRTCStreamType(t)})];case 1:return o.sent(),[3,3];case 2:return i=o.sent(),this._callFunctionErrorManage(i,"stopRemoteView"),[3,3];case 3:return[2]}}))}))},i.prototype.stopAllRemoteView=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.stopRemoteVideo({userId:"*"})];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this._callFunctionErrorManage(e,"stopAllRemoteView"),[3,3];case 3:return[2]}}))}))},i.prototype.setVideoEncoderParam=function(e){return R(this,void 0,void 0,(function(){var t,i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),t=this._getTRTCVideoProfile("video",e),this._setVideoProfile(t),[4,this._updateLocalVideo()];case 1:return o.sent(),[4,this._updateLocalTestVideo()];case 2:return o.sent(),[3,4];case 3:return i=o.sent(),this._callFunctionErrorManage(i,"setVideoEncoderParam"),[3,4];case 4:return[2]}}))}))},i.prototype.setLocalRenderParams=function(e){return R(this,void 0,void 0,(function(){var t,i;return C(this,(function(o){switch(o.label){case 0:Object.assign(this._localRenderParams,e),o.label=1;case 1:return o.trys.push([1,4,,5]),t={},e.mirrorType&&(t.mirror=this._getTRTCMirror(e.mirrorType)),e.fillMode&&(t.fillMode=this._getTRTCFillMode(e.fillMode)),this._setVideoPlayOption(t),[4,this._updateLocalVideo()];case 2:return o.sent(),[4,this._updateLocalTestVideo()];case 3:return o.sent(),[3,5];case 4:return i=o.sent(),this._callFunctionErrorManage(i,"setLocalRenderParams"),[3,5];case 5:return[2]}}))}))},i.prototype.setRemoteRenderParams=function(e,t,i){return R(this,void 0,void 0,(function(){var o;return C(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this._setRemoteStreamConfig(e,t,i),[4,this._updateRemoteVideo(e,t)];case 1:return r.sent(),[3,3];case 2:return o=r.sent(),this._callFunctionErrorManage(o,"setRemoteRenderParams"),[3,3];case 3:return[2]}}))}))},i.prototype._updateLocalAudio=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.updateLocalAudio(this._generateLocalAudioData())];case 1:return t.sent(),[3,3];case 2:if((e=t.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw e;case 3:return[2]}}))}))},i.prototype.startLocalAudio=function(t){return void 0===t&&(t=e.TRTCAudioQuality.TRTCAudioQualityDefault),R(this,void 0,void 0,(function(){var e,i;return C(this,(function(o){switch(o.label){case 0:o.trys.push([0,7,,8]),this._setAudioProfile(J[t]),o.label=1;case 1:return o.trys.push([1,3,,6]),[4,this._trtc.startLocalAudio(this._generateLocalAudioData())];case 2:return o.sent(),[3,6];case 3:return(e=o.sent()).code!==l.default.ERROR_CODE.OPERATION_ABORT?[3,5]:[4,this._updateLocalAudio()];case 4:return o.sent(),[2];case 5:throw e;case 6:return this.emit("onMicDidReady"),[3,8];case 7:return i=o.sent(),console.warn("".concat(se," startLocalAudio error: ").concat(i)),this._callFunctionErrorManage(i,"startLocalAudio"),[3,8];case 8:return[2]}}))}))},i.prototype.stopLocalAudio=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.stopLocalAudio()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this._callFunctionErrorManage(e,"stopLocalAudio"),[3,3];case 3:return[2]}}))}))},i.prototype.muteLocalAudio=function(e){return void 0===e&&(e=!1),R(this,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this._setIsAudioPublish(!e),[4,this._updateLocalAudio()];case 1:return i.sent(),[3,3];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"muteLocalAudio"),[3,3];case 3:return[2]}}))}))},i.prototype.muteRemoteAudio=function(e,t){return void 0===t&&(t=!1),R(this,void 0,void 0,(function(){var i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e?[4,this._trtc.muteRemoteAudio(e,t)]:(this._emitError(ie),[2]);case 1:return o.sent(),[3,3];case 2:return i=o.sent(),this._callFunctionErrorManage(i,"muteRemoteAudio"),[3,3];case 3:return[2]}}))}))},i.prototype.muteAllRemoteAudio=function(e){try{this._trtc.muteRemoteAudio("*",e)}catch(t){this._callFunctionErrorManage(t,"muteAllRemoteAudio")}},i.prototype.setRemoteAudioVolume=function(e,t){try{this._trtc.setRemoteAudioVolume(e,t)}catch(i){this._callFunctionErrorManage(i,"setRemoteAudioVolume")}},i.prototype.enableAudioVolumeEvaluation=function(e){try{this._trtc.enableAudioVolumeEvaluation(e)}catch(t){this._callFunctionErrorManage(t,"enableAudioVolumeEvaluation")}},i.prototype.startScreenShare=function(t,i,o){return R(this,void 0,void 0,(function(){var i,r,n,s;return C(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),i=(o||{}).screenAudio,r=void 0!==i&&i,n=this._getTRTCVideoProfile("screen",o),this._setScreenShareParams({view:t,profile:n,systemAudio:r}),[4,this._trtc.startScreenShare(this._getScreenShareParams())];case 1:return a.sent(),this._isSharingScreen=!0,this.emit("onFirstVideoFrame",{userId:"",streamType:e.TRTCVideoStreamType.TRTCVideoStreamTypeSub,width:n.width,height:n.height}),[3,3];case 2:if((s=a.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw console.error("Start share screen error:",s,s.code,s.name,s.message),s;case 3:return[2]}}))}))},i.prototype.setSubStreamEncoderParam=function(e){return R(this,void 0,void 0,(function(){var t,i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=this._getTRTCVideoProfile("screen",e),this._setScreenShareParams({profile:t}),[4,this._trtc.updateScreenShare(this._getScreenShareParams())];case 1:return o.sent(),[3,3];case 2:return i=o.sent(),this._callFunctionErrorManage(i,"setSubStreamEncoderParam"),[3,3];case 3:return[2]}}))}))},i.prototype.stopScreenShare=function(){return R(this,void 0,Promise,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.stopScreenShare()];case 1:return t.sent(),this._isSharingScreen=!1,this.emit("onScreenCaptureStopped",{reason:0}),[3,3];case 2:return e=t.sent(),this._callFunctionErrorManage(e,"stopScreenShare"),[3,3];case 3:return[2]}}))}))},i.prototype.startScreenCapture=function(){this.emitError(oe)},i.prototype.pauseScreenCapture=function(){this.emitError(oe)},i.prototype.resumeScreenCapture=function(){this.emitError(oe)},i.prototype.getScreenCaptureSources=function(){this.emitError(oe)},i.prototype.selectScreenCaptureTarget=function(){this.emitError(oe)},i.prototype.getCameraDevicesList=function(){return R(this,void 0,Promise,(function(){var e,t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,l.default.getCameraList()];case 1:return e=(e=i.sent()).map((function(e){return p(p({},e),{deviceName:e.label})})),this._cameraList=e,this._currentCamera=this.getDefaultDeviceInfo(e),this._currentCameraId=this._currentCamera.deviceId,[2,Promise.resolve(e)];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"getCameraDevicesList"),[2,Promise.resolve([])];case 3:return[2]}}))}))},i.prototype.setCurrentCameraDevice=function(e){return R(this,void 0,Promise,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e?(this._currentCameraId=e,this._currentCamera=this._cameraList.filter((function(t){return t.deviceId===e})),[4,this._updateLocalVideo()]):[2,!1];case 1:return i.sent(),[4,this._updateLocalTestVideo()];case 2:return i.sent(),[2,!0];case 3:return t=i.sent(),this._callFunctionErrorManage(t,"setCurrentCameraDevice"),[2,!1];case 4:return[2]}}))}))},i.prototype.getCurrentCameraDevice=function(){return new y},i.prototype.isFrontCamera=function(){return this._getIsFrontCamera()},i.prototype.switchCamera=function(e){return R(this,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return this._setIsFrontCamera(e),(t=this._getVideoPlayOption()).mirror=this._getTRTCMirror(this._localRenderParams.mirrorType),this._setVideoPlayOption(t),[4,this._updateLocalVideo()];case 1:return i.sent(),[2]}}))}))},i.prototype.getMicDevicesList=function(){return R(this,void 0,Promise,(function(){var e,t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,l.default.getMicrophoneList()];case 1:return e=(e=i.sent()).map((function(e){return p(p({},e),{deviceName:e.label})})),this._microphoneList=e,this._currentMicrophone=this.getDefaultDeviceInfo(e),this._currentMicrophoneId=this._currentMicrophone.deviceId,[2,Promise.resolve(e)];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"getMicDevicesList"),[2,Promise.resolve([])];case 3:return[2]}}))}))},i.prototype.setCurrentMicDevice=function(e){return R(this,void 0,Promise,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e?(this._setCurrentMicrophoneId(e),this._currentMicrophone=this._microphoneList.filter((function(t){return t.deviceId===e})),[4,this._trtc.updateLocalAudio(this._generateLocalAudioData())]):[2,!1];case 1:return i.sent(),[2,!0];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"setCurrentMicDevice"),[2,!1];case 3:return[2]}}))}))},i.prototype.getCurrentMicDevice=function(){return new y},i.prototype.getSpeakerDevicesList=function(){return R(this,void 0,Promise,(function(){var e,t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,l.default.getSpeakerList()];case 1:return e=(e=i.sent()).map((function(e){return p(p({},e),{deviceName:e.label})})),this._speakerList=e,this._currentSpeaker=this.getDefaultDeviceInfo(e),this._currentSpeakerId=this._currentSpeaker.deviceId,[2,Promise.resolve(e)];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"getSpeakerDevicesList"),[2,Promise.resolve([])];case 3:return[2]}}))}))},i.prototype.setCurrentSpeakerDevice=function(e){return R(this,void 0,Promise,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e?(this._setCurrentSpeakerId(e),this._currentSpeaker=this._speakerList.filter((function(t){return t.deviceId===e})),[4,l.default.setCurrentSpeaker(e)]):[2,!1];case 1:return i.sent(),[2,!0];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"setCurrentSpeakerDevice"),[2,!1];case 3:return[2]}}))}))},i.prototype.getCurrentSpeakerDevice=function(){return new y},i.prototype.startCameraDeviceTest=function(e){return R(this,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return this._log.info("(startCameraDeviceTest) start - start test camera Device",e),e?(this._setLocalTestView(e),[4,this._testTrtc.startLocalVideo(this._generateLocalTestVideoData())]):[2];case 1:return t.sent(),[2]}}))}))},i.prototype.stopCameraDeviceTest=function(){return R(this,void 0,void 0,(function(){return C(this,(function(e){switch(e.label){case 0:return this._setLocalTestView(null),[4,this._testTrtc.stopLocalVideo()];case 1:return e.sent(),[2]}}))}))},i.prototype.startMicDeviceTest=function(t){return R(this,void 0,void 0,(function(){var i=this;return C(this,(function(o){switch(o.label){case 0:return this._log.info("(startMicDeviceTest) start - start test mic Device",t),[4,this._testTrtc.startLocalAudio({publish:!1,option:{microphoneId:this._currentMicrophoneId,profile:J[e.TRTCAudioQuality.TRTCAudioQualityDefault]}})];case 1:return o.sent(),this._testTrtc.on(l.default.EVENT.AUDIO_VOLUME,(function(e){null==e||e.result.forEach((function(e){var t=e.userId,o=e.volume;""===t&&i.emit("onTestMicVolume",o)}))})),[4,this._testTrtc.enableAudioVolumeEvaluation(t)];case 2:return o.sent(),[2]}}))}))},i.prototype.stopMicDeviceTest=function(){this._log.info("(stopMicDeviceTest) stop - stop test mic Device"),this._testTrtc.stopLocalAudio()},i.prototype._unbindEvents=function(){},i.prototype._destroy=function(){this._unbindEvents()},i.prototype._emitError=function(e){e&&this.emit&&this.emit(Y,e.code,e.message)},i.prototype._callFunctionErrorManage=function(e,t){e&&e.code===l.default.ERROR_CODE.OPERATION_ABORT||(e&&e.getCode&&e.getCode()?(this.emit(Y,e.getCode(),e.message),this._log.error("(".concat(t,") failed - ").concat(e.message))):(this.emit(Y,te,e.message),this._log.error("(".concat(t,") failed - ").concat(e.message))))},i.prototype._getTRTCResolution=function(t){var i=(e.TRTCVideoResolution[t]||"").split("_");return{width:+(i.length>1&&i[1]),height:+(i.length>2&&i[2])}},i.prototype._getTRTCVideoProfile=function(e,t){var i=t.videoResolution,o=t.videoFps,r=t.videoBitrate,n="screen"===e?this._defaultScreenProfile:this._defaultVideoProfile;if(i){var s=this._getTRTCResolution(i);n.width=s.width,n.height=s.height}return o&&(n.frameRate=o),r&&(n.bitrate=r),n},i.prototype._getTRTCStreamType=function(t){var i;return((i={})[e.TRTCVideoStreamType.TRTCVideoStreamTypeBig]=l.default.TYPE.STREAM_TYPE_MAIN,i[e.TRTCVideoStreamType.TRTCVideoStreamTypeSmall]=l.default.TYPE.STREAM_TYPE_MAIN,i[e.TRTCVideoStreamType.TRTCVideoStreamTypeSub]=l.default.TYPE.STREAM_TYPE_SUB,i)[t]},i.prototype._getTRTCFillMode=function(t){var i;return((i={})[e.TRTCVideoFillMode.TRTCVideoFillMode_Fill]=Z.COVER,i[e.TRTCVideoFillMode.TRTCVideoFillMode_Fit]=Z.CONTAIN,i)[t]},i.prototype._getTRTCMirror=function(t){var i;return t===e.TRTCVideoMirrorType.TRTCVideoMirrorType_Auto?!this._getIsMobile()||this._getIsFrontCamera():((i={})[e.TRTCVideoMirrorType.TRTCVideoMirrorType_Enable]=!0,i[e.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable]=!1,i)[t]},i.prototype._getTRTCCloudDeviceType=function(t){return{camera:e.TRTCDeviceType.TRTCDeviceTypeCamera,microphone:e.TRTCDeviceType.TRTCDeviceTypeMic,speaker:e.TRTCDeviceType.TRTCDeviceTypeSpeaker}[t]},i.prototype._getTRTCCloudDeviceState=function(t){return{add:e.TRTCDeviceState.TRTCDeviceStateAdd,remove:e.TRTCDeviceState.TRTCDeviceStateRemove,active:e.TRTCDeviceState.TRTCDeviceStateActive}[t]},i.prototype._generateLocalVideoData=function(){var e={view:this._getLocalView(),publish:this._getIsVideoPublish(),option:p({profile:this._getVideoProfile()},this._getVideoPlayOption())};return this._getIsMobile()?e&&Object.assign(e.option,{useFrontCamera:this._getIsFrontCamera()}):e&&Object.assign(e.option,{cameraId:this._getCurrentCameraId()}),e},i.prototype._generateLocalTestVideoData=function(){return{view:this._getLocalTestView(),publish:!1,option:p({cameraId:this._getCurrentCameraId(),profile:this._getVideoProfile()},this._getVideoPlayOption())}},i.prototype._generateLocalAudioData=function(){return{publish:this._getIsAudioPublish(),option:{microphoneId:this._getCurrentMicrophoneId(),profile:this._getAudioProfile()}}},i.prototype._generateRemoteVideoData=function(e,t){return this._remoteStreamConfig.get("".concat(e,"_").concat(this._getTRTCStreamType(t)))},i.prototype._addTRTCEvents=function(){var t=this;this._trtc.on(l.default.EVENT.ERROR,(function(e){var i;e&&t.emit("onError",null===(i=null==e?void 0:e.getCode)||void 0===i?void 0:i.getCode(),e.message)})),this._trtc.on(l.default.EVENT.REMOTE_USER_ENTER,(function(e){(null==e?void 0:e.userId)&&t.emit("onRemoteUserEnterRoom",e.userId)})),this._trtc.on(l.default.EVENT.REMOTE_USER_EXIT,(function(e){(null==e?void 0:e.userId)&&t.emit("onRemoteUserLeaveRoom",e.userId)})),this._trtc.on(l.default.EVENT.REMOTE_AUDIO_AVAILABLE,(function(e){(null==e?void 0:e.userId)&&t.emit("onUserAudioAvailable",e.userId,!0)})),this._trtc.on(l.default.EVENT.REMOTE_AUDIO_UNAVAILABLE,(function(e){(null==e?void 0:e.userId)&&t.emit("onUserAudioAvailable",e.userId,!1)})),this._trtc.on(l.default.EVENT.REMOTE_VIDEO_AVAILABLE,(function(e){t._emitVideoAvailable(e,!0)})),this._trtc.on(l.default.EVENT.REMOTE_VIDEO_UNAVAILABLE,(function(e){t._emitVideoAvailable(e,!1)})),this._trtc.on(l.default.EVENT.AUDIO_VOLUME,(function(e){(null==e?void 0:e.result)&&t.emit("onUserVoiceVolume",null==e?void 0:e.result,((null==e?void 0:e.result)||[]).length)})),this._trtc.on(l.default.EVENT.NETWORK_QUALITY,(function(i){var o=i.uplinkNetworkQuality,r=i.downlinkNetworkQuality,n=t.client?t.client.getUserId():"",s=[e.TRTCQuality.TRTCQuality_Unknown,e.TRTCQuality.TRTCQuality_Excellent,e.TRTCQuality.TRTCQuality_Good,e.TRTCQuality.TRTCQuality_Poor,e.TRTCQuality.TRTCQuality_Bad,e.TRTCQuality.TRTCQuality_Vbad,e.TRTCQuality.TRTCQuality_Down],a=new b(n,s[o]),c=new b("remote",s[r]);t.emit("onNetworkQuality",a,[c])})),this._trtc.on(l.default.EVENT.SCREEN_SHARE_STOPPED,(function(){t.emit("onScreenCaptureStopped",{reason:0}),t._isSharingScreen=!1})),this._trtc.on(l.default.EVENT.PUBLISH_STATE_CHANGED,(function(i){var o=i.mediaType;"started"===i.state&&("audio"===o?t.emit("onSendFirstLocalAudioFrame"):"video"===o?t.emit("onSendFirstLocalVideoFrame",{streamType:e.TRTCVideoStreamType.TRTCVideoStreamTypeBig}):"screen"===o&&t.emit("onSendFirstLocalVideoFrame",{streamType:e.TRTCVideoStreamType.TRTCVideoStreamTypeSub}))}))},i.prototype._removeTRTCEvents=function(){this._trtc.off("*")},i.prototype._emitVideoAvailable=function(e,t){var i=e.userId,o=e.streamType;t?this._remoteStreamMap.set("".concat(i,"_").concat(o),!0):this._remoteStreamMap.delete("".concat(i,"_").concat(o)),o===l.default.TYPE.STREAM_TYPE_SUB?i&&this.emit("onUserSubStreamAvailable",i,t):i&&this.emit("onUserVideoAvailable",i,t)},i.prototype._setLocalView=function(e){this._localView=e},i.prototype._getLocalView=function(){return this._localView},i.prototype._setIsMobile=function(e){this._isMobile=e},i.prototype._getIsMobile=function(){return this._isMobile},i.prototype._setIsFrontCamera=function(e){this._isFrontCamera=e},i.prototype._getIsFrontCamera=function(){return this._isFrontCamera},i.prototype._setIsVideoPublish=function(e){this._isVideoPublish=e},i.prototype._getIsVideoPublish=function(){return this._isVideoPublish},i.prototype._setVideoProfile=function(e){this._videoProfile=e},i.prototype._getVideoProfile=function(){return this._videoProfile},i.prototype._setVideoPlayOption=function(e){this._videoPlayOption=e},i.prototype._getVideoPlayOption=function(){return this._videoPlayOption},i.prototype._setLocalTestView=function(e){this._localTestView=e},i.prototype._getLocalTestView=function(){return this._localTestView},i.prototype._setScreenShareParams=function(e){var t=e.view,i=e.systemAudio,o=e.fillMode,r=e.profile;$(t)||(this._screenShareParams.view=t),$(i)||(this._screenShareParams.option.systemAudio=i),$(o)||(this._screenShareParams.option.fillMode=o),$(r)||(this._screenShareParams.option.profile=r)},i.prototype._getScreenShareParams=function(){return this._screenShareParams},i.prototype._setIsAudioPublish=function(e){this._isAudioPublish=e},i.prototype._getIsAudioPublish=function(){return this._isAudioPublish},i.prototype._setAudioProfile=function(e){this._audioProfile=e},i.prototype._getAudioProfile=function(){return this._audioProfile},i.prototype._setCurrentCameraId=function(e){this._currentCameraId=e},i.prototype._getCurrentCameraId=function(){return this._currentCameraId},i.prototype._setCurrentMicrophoneId=function(e){this._currentMicrophoneId=e},i.prototype._getCurrentMicrophoneId=function(){return this._currentMicrophoneId},i.prototype._setCurrentSpeakerId=function(e){this._currentSpeakerId=e},i.prototype._getCurrentSpeakerId=function(){return this._currentSpeakerId},i.prototype._setRemoteStreamConfig=function(e,t,i){var o={userId:e,streamType:this._getTRTCStreamType(t),option:{}},r=i.view,n=i.mirrorType,s=i.fillMode;$(r)||(o.view=r),$(n)||(o.option.mirror=this._getTRTCMirror(n)),$(s)||(o.option.fillMode=this._getTRTCFillMode(s)),this._remoteStreamConfig.set("".concat(e,"_").concat(this._getTRTCStreamType(t)),o)},i.prototype.handleDeviceChange=function(){return R(this,void 0,void 0,(function(){var t=this;return C(this,(function(i){return l.default.getCameraList().then((function(i){return R(t,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return this._cameraList.length===i.length?[2]:[4,this.deviceChangeManage(this._cameraList,i,e.TRTCDeviceType.TRTCDeviceTypeCamera)];case 1:return t.sent(),this._cameraList=i,[2]}}))}))})),l.default.getMicrophoneList().then((function(i){return R(t,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.deviceChangeManage(this._microphoneList,i,e.TRTCDeviceType.TRTCDeviceTypeMic)];case 1:return t.sent(),this._microphoneList=i,[2]}}))}))})),l.default.getSpeakerList().then((function(i){return R(t,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.deviceChangeManage(this._speakerList,i,e.TRTCDeviceType.TRTCDeviceTypeSpeaker)];case 1:return t.sent(),this._speakerList=i,[2]}}))}))})),[2]}))}))},i.prototype.isSameDevice=function(e,t){var i=e&&e.deviceId&&e.groupId&&e.label,o=t&&t.deviceId&&t.groupId&&t.label;return!(!i||!o)&&e.deviceId===t.deviceId&&e.groupId===t.groupId&&e.label===t.label},i.prototype.deviceChangeManage=function(t,i,o){return R(this,void 0,void 0,(function(){var r,n,s,a,c;return C(this,(function(u){switch(u.label){case 0:return r=void 0,t.length!==i.length&&(n=(i||[]).map((function(e){return e.deviceId})),s=new y,t.length>i.length?(s=t.filter((function(e){return!n.includes(e.deviceId)}))[0]||{},r=e.TRTCDeviceState.TRTCDeviceStateRemove):(n=(t||[]).map((function(e){return e.deviceId})),s=i.filter((function(e){return!n.includes(e.deviceId)}))[0]||{},r=e.TRTCDeviceState.TRTCDeviceStateAdd),a=s.deviceId,this.emitOnDeviceChange(a,o,r)),c=this.getDefaultDeviceInfo(i),o!==e.TRTCDeviceType.TRTCDeviceTypeCamera||r!==e.TRTCDeviceState.TRTCDeviceStateRemove?[3,3]:this.isSameDevice(this._currentCamera,c)?[2]:c.deviceId?[4,this.autoChangeDevice(o,c)]:[3,2];case 1:u.sent(),u.label=2;case 2:u.label=3;case 3:return o!==e.TRTCDeviceType.TRTCDeviceTypeMic?[3,6]:this.isSameDevice(this._currentMicrophone,c)?[2]:c.deviceId?[4,this.autoChangeDevice(o,c)]:[3,5];case 4:u.sent(),u.label=5;case 5:u.label=6;case 6:return o!==e.TRTCDeviceType.TRTCDeviceTypeSpeaker?[3,9]:this.isSameDevice(this._currentSpeaker,c)?[2]:c.deviceId?[4,this.autoChangeDevice(o,c)]:[3,8];case 7:u.sent(),u.label=8;case 8:u.label=9;case 9:return[2]}}))}))},i.prototype.getDefaultDeviceInfo=function(e){var t=new y;if(0===e.length)return t;var i=e.filter((function(e){return"default"===e.deviceId}));return t=i.length>0?i[0]:e[0]},i.prototype.autoChangeDevice=function(t,i){return R(this,void 0,void 0,(function(){var o,r,n,s,a;return C(this,(function(c){switch(c.label){case 0:if(o=i.deviceId,t!==e.TRTCDeviceType.TRTCDeviceTypeCamera)return[3,8];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this._trtc.updateLocalVideo({option:{cameraId:o}})];case 2:return c.sent(),[3,4];case 3:return r=c.sent(),console.log("error",JSON.stringify(r)),r.code,l.default.ERROR_CODE.OPERATION_ABORT,[3,4];case 4:return c.trys.push([4,6,,7]),[4,this._testTrtc.updateLocalVideo({option:{cameraId:o}})];case 5:return c.sent(),[3,7];case 6:return n=c.sent(),console.log("testTRTC error",JSON.stringify(n)),n.code,l.default.ERROR_CODE.OPERATION_ABORT,[3,7];case 7:this._currentCameraId=o,this._currentCamera=i,this.emitOnDeviceChange(o,t,e.TRTCDeviceState.TRTCDeviceStateActive),c.label=8;case 8:if(t!==e.TRTCDeviceType.TRTCDeviceTypeMic)return[3,16];c.label=9;case 9:return c.trys.push([9,11,,12]),[4,this._trtc.updateLocalAudio({option:{microphoneId:o}})];case 10:return c.sent(),[3,12];case 11:return s=c.sent(),console.log("error",JSON.stringify(s)),s.code,l.default.ERROR_CODE.OPERATION_ABORT,[3,12];case 12:return c.trys.push([12,14,,15]),[4,this._testTrtc.updateLocalAudio({option:{microphoneId:o}})];case 13:return c.sent(),[3,15];case 14:return a=c.sent(),console.log("testTRTC error",JSON.stringify(a)),a.code,l.default.ERROR_CODE.OPERATION_ABORT,[3,15];case 15:this._currentMicId=o,this._currentMicrophone=i,this.emitOnDeviceChange(o,t,e.TRTCDeviceState.TRTCDeviceStateActive),c.label=16;case 16:return t!==e.TRTCDeviceType.TRTCDeviceTypeSpeaker?[3,18]:[4,l.default.setCurrentSpeaker(o)];case 17:c.sent(),this._currentSpeakerId=o,this._currentSpeaker=i,this.emitOnDeviceChange(o,t,e.TRTCDeviceState.TRTCDeviceStateActive),c.label=18;case 18:return[2]}}))}))},i.prototype.emitOnDeviceChange=function(e,t,i){this.emit("onDeviceChange",e,t,i)},i}(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i=function(){for(var t=0,i=e;t<i.length;t++)ee(this,new(0,i[t])(this))},o=i.prototype,r=0,n=e;r<n.length;r++){var s=n[r];ee(i,s),ee(o,s.prototype)}return i}(t.EventEmitter));e.Rect=B,e.TRTCDeviceInfo=y,e.TRTCImageBuffer=k,e.TRTCLocalStatistics=P,e.TRTCMixUser=j,e.TRTCNetworkQosParam=F,e.TRTCParams=g,e.TRTCPublishCDNParam=w,e.TRTCQualityInfo=b,e.TRTCRenderParams=M,e.TRTCScreenCaptureSourceInfo=N,e.TRTCStatistics=L,e.TRTCTranscodingConfig=U,e.TRTCVideoEncParam=V,e.TRTCVolumeInfo=D,e.default=ae,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("events"),require("trtc-sdk-v5")):"function"==typeof define&&define.amd?define(["exports","events","trtc-sdk-v5"],factory):factory((global="undefined"!=typeof globalThis?globalThis:global||self).TRTC={},global.events,global.TRTC);
var global,factory;global=this,factory=function(e,t,i){function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r,n,s,a,c,u,T,d,l=o(i),h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},h(e,t)},p=function(){return p=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},p.apply(this,arguments)};function R(e,t,i,o){return new(i||(i=Promise))((function(r,n){function s(e){try{c(o.next(e))}catch(t){n(t)}}function a(e){try{c(o.throw(e))}catch(t){n(t)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))}function C(e,t){var i,o,r,n,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(a){return function(c){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,a[0]&&(s=0)),s;)try{if(i=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(c){a=[6,c],o=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function _(e,t,i){if(i||2===arguments.length)for(var o,r=0,n=t.length;r<n;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}e.TRTCVideoResolution=void 0,(r=e.TRTCVideoResolution||(e.TRTCVideoResolution={}))[r.TRTCVideoResolution_120_120=1]="TRTCVideoResolution_120_120",r[r.TRTCVideoResolution_160_160=3]="TRTCVideoResolution_160_160",r[r.TRTCVideoResolution_270_270=5]="TRTCVideoResolution_270_270",r[r.TRTCVideoResolution_480_480=7]="TRTCVideoResolution_480_480",r[r.TRTCVideoResolution_160_120=50]="TRTCVideoResolution_160_120",r[r.TRTCVideoResolution_240_180=52]="TRTCVideoResolution_240_180",r[r.TRTCVideoResolution_280_210=54]="TRTCVideoResolution_280_210",r[r.TRTCVideoResolution_320_240=56]="TRTCVideoResolution_320_240",r[r.TRTCVideoResolution_400_300=58]="TRTCVideoResolution_400_300",r[r.TRTCVideoResolution_480_360=60]="TRTCVideoResolution_480_360",r[r.TRTCVideoResolution_640_480=62]="TRTCVideoResolution_640_480",r[r.TRTCVideoResolution_960_720=64]="TRTCVideoResolution_960_720",r[r.TRTCVideoResolution_160_90=100]="TRTCVideoResolution_160_90",r[r.TRTCVideoResolution_256_144=102]="TRTCVideoResolution_256_144",r[r.TRTCVideoResolution_320_180=104]="TRTCVideoResolution_320_180",r[r.TRTCVideoResolution_480_270=106]="TRTCVideoResolution_480_270",r[r.TRTCVideoResolution_640_360=108]="TRTCVideoResolution_640_360",r[r.TRTCVideoResolution_960_540=110]="TRTCVideoResolution_960_540",r[r.TRTCVideoResolution_1280_720=112]="TRTCVideoResolution_1280_720",r[r.TRTCVideoResolution_1920_1080=114]="TRTCVideoResolution_1920_1080",e.TRTCVideoStreamType=void 0,(n=e.TRTCVideoStreamType||(e.TRTCVideoStreamType={}))[n.TRTCVideoStreamTypeBig=0]="TRTCVideoStreamTypeBig",n[n.TRTCVideoStreamTypeSmall=1]="TRTCVideoStreamTypeSmall",n[n.TRTCVideoStreamTypeSub=2]="TRTCVideoStreamTypeSub",e.TRTCVideoFillMode=void 0,(s=e.TRTCVideoFillMode||(e.TRTCVideoFillMode={}))[s.TRTCVideoFillMode_Fill=0]="TRTCVideoFillMode_Fill",s[s.TRTCVideoFillMode_Fit=1]="TRTCVideoFillMode_Fit",e.TRTCVideoMirrorType=void 0,(a=e.TRTCVideoMirrorType||(e.TRTCVideoMirrorType={}))[a.TRTCVideoMirrorType_Auto=0]="TRTCVideoMirrorType_Auto",a[a.TRTCVideoMirrorType_Enable=1]="TRTCVideoMirrorType_Enable",a[a.TRTCVideoMirrorType_Disable=2]="TRTCVideoMirrorType_Disable",e.TRTCBeautyStyle=void 0,(c=e.TRTCBeautyStyle||(e.TRTCBeautyStyle={}))[c.TRTCBeautyStyleSmooth=0]="TRTCBeautyStyleSmooth",c[c.TRTCBeautyStyleNature=1]="TRTCBeautyStyleNature",e.TRTCAppScene=void 0,(u=e.TRTCAppScene||(e.TRTCAppScene={}))[u.TRTCAppSceneVideoCall=0]="TRTCAppSceneVideoCall",u[u.TRTCAppSceneLIVE=1]="TRTCAppSceneLIVE",u[u.TRTCAppSceneAudioCall=2]="TRTCAppSceneAudioCall",u[u.TRTCAppSceneVoiceChatRoom=3]="TRTCAppSceneVoiceChatRoom",e.TRTCRoleType=void 0,(T=e.TRTCRoleType||(e.TRTCRoleType={}))[T.TRTCRoleAnchor=20]="TRTCRoleAnchor",T[T.TRTCRoleAudience=21]="TRTCRoleAudience",e.TRTCAudioQuality=void 0,(d=e.TRTCAudioQuality||(e.TRTCAudioQuality={}))[d.TRTCAudioQualityDefault=0]="TRTCAudioQualityDefault",d[d.TRTCAudioQualitySpeech=1]="TRTCAudioQualitySpeech",d[d.TRTCAudioQualityMusic=3]="TRTCAudioQualityMusic";var v,f,y=function(e,t,i,o,r){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),void 0===o&&(o=""),void 0===r&&(r=""),this.deviceId=e,this.deviceName=t,this.kind=i,this.label=o,this.groupId=r};e.TRTCDeviceState=void 0,(v=e.TRTCDeviceState||(e.TRTCDeviceState={}))[v.TRTCDeviceStateAdd=0]="TRTCDeviceStateAdd",v[v.TRTCDeviceStateRemove=1]="TRTCDeviceStateRemove",v[v.TRTCDeviceStateActive=2]="TRTCDeviceStateActive",e.TRTCDeviceType=void 0,(f=e.TRTCDeviceType||(e.TRTCDeviceType={}))[f.TRTCDeviceTypeUnknow=-1]="TRTCDeviceTypeUnknow",f[f.TRTCDeviceTypeMic=0]="TRTCDeviceTypeMic",f[f.TRTCDeviceTypeSpeaker=1]="TRTCDeviceTypeSpeaker",f[f.TRTCDeviceTypeCamera=2]="TRTCDeviceTypeCamera";var m,g=function(t,i,o,r,n,s,a,c,u,T,d){void 0===t&&(t=0),void 0===i&&(i=""),void 0===o&&(o=""),void 0===r&&(r=0),void 0===n&&(n=""),void 0===s&&(s=e.TRTCRoleType.TRTCRoleAnchor),void 0===a&&(a=null),void 0===u&&(u=null),void 0===T&&(T=null),void 0===d&&(d=30),this.sdkAppId=t,this.userId=i,this.userSig=o,this.roomId=r,this.strRoomId=n,this.role=s,this.privateMapKey=a,this.streamId=u,this.userDefineRecordId=T,this.frameWorkType=d},V=function(t,i,o){void 0===t&&(t=e.TRTCVideoResolution.TRTCVideoResolution_640_360),void 0===i&&(i=15),void 0===o&&(o=550),this.videoResolution=t,this.videoFps=i,this.videoBitrate=o};e.TRTCVideoRotation=void 0,(m=e.TRTCVideoRotation||(e.TRTCVideoRotation={}))[m.TRTCVideoRotation0=0]="TRTCVideoRotation0",m[m.TRTCVideoRotation90=1]="TRTCVideoRotation90",m[m.TRTCVideoRotation180=2]="TRTCVideoRotation180",m[m.TRTCVideoRotation270=3]="TRTCVideoRotation270";var S,M=function(t,i,o){void 0===t&&(t=e.TRTCVideoRotation.TRTCVideoRotation0),void 0===i&&(i=e.TRTCVideoFillMode.TRTCVideoFillMode_Fit),void 0===o&&(o=e.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable),this.rotation=t,this.fillMode=i,this.mirrorType=o};e.TRTCQuality=void 0,(S=e.TRTCQuality||(e.TRTCQuality={}))[S.TRTCQuality_Unknown=0]="TRTCQuality_Unknown",S[S.TRTCQuality_Excellent=1]="TRTCQuality_Excellent",S[S.TRTCQuality_Good=2]="TRTCQuality_Good",S[S.TRTCQuality_Poor=3]="TRTCQuality_Poor",S[S.TRTCQuality_Bad=4]="TRTCQuality_Bad",S[S.TRTCQuality_Vbad=5]="TRTCQuality_Vbad",S[S.TRTCQuality_Down=6]="TRTCQuality_Down";var A,I,E,b=function(t,i){void 0===t&&(t=""),void 0===i&&(i=e.TRTCQuality.TRTCQuality_Unknown),this.userId=t,this.quality=i},D=function(e,t){void 0===e&&(e=""),void 0===t&&(t=0),this.userId=e,this.volume=t},w=function(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=null),this.appId=e,this.bizId=t,this.url=i},P=function(t,i,o,r,n,s,a){void 0===t&&(t=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===a&&(a=e.TRTCVideoStreamType.TRTCVideoStreamTypeBig),this.width=t,this.height=i,this.frameRate=o,this.videoBitrate=r,this.audioSampleRate=n,this.audioBitrate=s,this.streamType=a},L=function(e,t,i,o,r,n,s,a,c,u){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===a&&(a=[]),void 0===c&&(c=0),void 0===u&&(u=0),this.upLoss=e,this.downLoss=t,this.appCpu=i,this.systemCpu=o,this.rtt=r,this.receivedBytes=n,this.sentBytes=s,this.localStatisticsArray=a,this.localStatisticsArraySize=c,this.remoteStatisticsArraySize=u};e.TRTCVideoResolutionMode=void 0,(A=e.TRTCVideoResolutionMode||(e.TRTCVideoResolutionMode={}))[A.TRTCVideoResolutionModeLandscape=0]="TRTCVideoResolutionModeLandscape",A[A.TRTCVideoResolutionModePortrait=1]="TRTCVideoResolutionModePortrait",e.TRTCVideoQosPreference=void 0,(I=e.TRTCVideoQosPreference||(e.TRTCVideoQosPreference={}))[I.TRTCVideoQosPreferenceSmooth=1]="TRTCVideoQosPreferenceSmooth",I[I.TRTCVideoQosPreferenceClear=2]="TRTCVideoQosPreferenceClear",e.TRTCQosControlMode=void 0,(E=e.TRTCQosControlMode||(e.TRTCQosControlMode={}))[E.TRTCQosControlModeClient=0]="TRTCQosControlModeClient",E[E.TRTCQosControlModeServer=1]="TRTCQosControlModeServer";var O,F=function(t,i){void 0===t&&(t=e.TRTCVideoQosPreference.TRTCVideoQosPreferenceClear),void 0===i&&(i=e.TRTCQosControlMode.TRTCQosControlModeServer),this.preference=t,this.controlMode=i},k=function(e,t,i,o){void 0===e&&(e=new ArrayBuffer(0)),void 0===t&&(t=0),void 0===i&&(i=0),void 0===o&&(o=0),this.buffer=e,this.length=t,this.width=i,this.height=o};e.TRTCScreenCaptureSourceType=void 0,(O=e.TRTCScreenCaptureSourceType||(e.TRTCScreenCaptureSourceType={}))[O.TRTCScreenCaptureSourceTypeUnknown=-1]="TRTCScreenCaptureSourceTypeUnknown",O[O.TRTCScreenCaptureSourceTypeWindow=0]="TRTCScreenCaptureSourceTypeWindow",O[O.TRTCScreenCaptureSourceTypeScreen=1]="TRTCScreenCaptureSourceTypeScreen",O[O.TRTCScreenCaptureSourceTypeCustom=2]="TRTCScreenCaptureSourceTypeCustom";var Q,N=function(t,i,o,r,n,s){void 0===t&&(t=e.TRTCScreenCaptureSourceType.TRTCScreenCaptureSourceTypeUnknown),void 0===i&&(i=""),void 0===o&&(o=""),void 0===r&&(r=new k),void 0===n&&(n=new k),void 0===s&&(s=!1),this.type=t,this.sourceId=i,this.sourceName=o,this.thumbBGRA=r,this.iconBGRA=n,this.isMinimizeWindow=s},B=function(e,t,i,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===o&&(o=0),this.left=e,this.top=t,this.right=i,this.bottom=o},U=function(t,i,o,r,n,s,a,c,u,T,d,l,h,p,R){void 0===t&&(t=e.TRTCTranscodingConfigMode.TRTCTranscodingConfigMode_Unknown),void 0===i&&(i=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===a&&(a=15),void 0===c&&(c=2),void 0===u&&(u=0),void 0===T&&(T=""),void 0===d&&(d=64),void 0===l&&(l=48e3),void 0===h&&(h=1),void 0===p&&(p=[]),void 0===R&&(R=""),this.mode=t,this.appId=i,this.bizId=o,this.videoWidth=r,this.videoHeight=n,this.videoBitrate=s,this.videoFramerate=a,this.videoGOP=c,this.backgroundColor=u,this.backgroundImage=T,this.audioSampleRate=d,this.audioBitrate=l,this.audioChannels=h,this.mixUsersArray=p,this.mixUsersArraySize=p.length,this.streamId=R};e.TRTCTranscodingConfigMode=void 0,(Q=e.TRTCTranscodingConfigMode||(e.TRTCTranscodingConfigMode={}))[Q.TRTCTranscodingConfigMode_Unknown=0]="TRTCTranscodingConfigMode_Unknown",Q[Q.TRTCTranscodingConfigMode_Manual=1]="TRTCTranscodingConfigMode_Manual",Q[Q.TRTCTranscodingConfigMode_Template_PureAudio=2]="TRTCTranscodingConfigMode_Template_PureAudio",Q[Q.TRTCTranscodingConfigMode_Template_PresetLayout=3]="TRTCTranscodingConfigMode_Template_PresetLayout",Q[Q.TRTCTranscodingConfigMode_Template_ScreenSharing=4]="TRTCTranscodingConfigMode_Template_ScreenSharing",Q[Q.TRTC_TranscodingConfigMode_Unknown=5]="TRTC_TranscodingConfigMode_Unknown",Q[Q.TRTC_TranscodingConfigMode_Manual=6]="TRTC_TranscodingConfigMode_Manual",Q[Q.TRTC_TranscodingConfigMode_Template_PureAudio=7]="TRTC_TranscodingConfigMode_Template_PureAudio",Q[Q.TRTC_TranscodingConfigMode_Template_PresetLayout=8]="TRTC_TranscodingConfigMode_Template_PresetLayout",Q[Q.TRTC_TranscodingConfigMode_Template_ScreenSharing=9]="TRTC_TranscodingConfigMode_Template_ScreenSharing";var x,j=function(t,i,o,r,n,s,a,c){void 0===t&&(t=""),void 0===i&&(i=""),void 0===o&&(o=null),void 0===r&&(r=0),void 0===n&&(n=!1),void 0===s&&(s=e.TRTCVideoStreamType.TRTCVideoStreamTypeBig),void 0===a&&(a=e.TRTCMixInputType.TRTCMixInputTypeUndefined),void 0===c&&(c=0),this.userId=t,this.roomId=i,this.rect=o,this.zOrder=r,this.pureAudio=n,this.streamType=s,this.inputType=a,this.renderMode=c};e.TRTCMixInputType=void 0,(x=e.TRTCMixInputType||(e.TRTCMixInputType={}))[x.TRTCMixInputTypeUndefined=0]="TRTCMixInputTypeUndefined",x[x.TRTCMixInputTypeAudioVideo=1]="TRTCMixInputTypeAudioVideo",x[x.TRTCMixInputTypePureVideo=2]="TRTCMixInputTypePureVideo",x[x.TRTCMixInputTypePureAudio=3]="TRTCMixInputTypePureAudio";var W,Y="onError",G="rtc",K="live",z={20:"anchor",21:"audience"},H={0:G,1:K,2:G,3:K},J={0:"standard",1:"high",2:"standard_stereo",3:"high_stereo"};function q(){return Math.floor(performance.now())}!function(e){e[e.ActiveExitRoom=0]="ActiveExitRoom",e[e.KickedExitRoom=1]="KickedExitRoom"}(W||(W={}));var X,Z,$=function(e){return void 0===e};function ee(e,t){for(var i=0,o=Reflect.ownKeys(t);i<o.length;i++){var r=o[i];if("constructor"!==r&&"prototype"!==r&&"name"!==r){var n=Object.getOwnPropertyDescriptor(t,r)||"";Object.defineProperty(e,r,n)}}}!function(e){e.LIVE="live",e.RTC="rtc"}(X||(X={})),function(e){e.CONTAIN="contain",e.COVER="cover",e.FILL="fill"}(Z||(Z={}));var te=-1e3,ie={code:-1001,message:"参数错误, 请检查参数格式、是否非空等"},oe={code:-1005,message:"not supported"},re="2.1.2",ne=null,se="【TRTCCloud】";l.default._loggerManager.info("TRTCCloud Version: ".concat(re));var ae=function(t){function i(i){void 0===i&&(i={});var o=t.call(this)||this;o._version="",o._frameWorkType=30,o._component=0,o._localView=null,o._localTestView=null,o._isVideoPublish=!0,o._localRenderParams={rotation:e.TRTCVideoRotation.TRTCVideoRotation0,fillMode:e.TRTCVideoFillMode.TRTCVideoFillMode_Fill,mirrorType:e.TRTCVideoMirrorType.TRTCVideoMirrorType_Auto},o._videoProfile={},o._videoPlayOption={},o._isAudioPublish=!0,o._audioProfile=Object.keys(J)[0],o._isSharingScreen=!1,o._remoteStreamConfig=new Map,o._remoteStreamMap=new Map,o._cameraList=[],o._microphoneList=[],o._speakerList=[],o._currentCamera={},o._currentMicrophone={},o._currentSpeaker={},o._currentCameraId="",o._currentMicrophoneId="",o._currentSpeakerId="",o._screenShareParams={option:{}},o._isMobile=!1,o._isFrontCamera=!1,o._defaultVideoProfile={width:640,height:480,frameRate:15,bitrate:900},o._defaultScreenProfile={width:1920,height:1080,frameRate:15,bitrate:1500},o._version=re;var r,n,s,a=i.frameWorkType,c=void 0===a?30:a,u=i.component,T=void 0===u?0:u;return o._trtc=l.default.create({frameWorkType:c,component:T}),o._testTrtc=l.default.create(),o._log=l.default._loggerManager,o._addTRTCEvents(),o.handleDeviceChange=o.handleDeviceChange.bind(o),navigator&&navigator.mediaDevices&&navigator.mediaDevices.addEventListener("devicechange",(r=o.handleDeviceChange,n=30,function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];s>0&&clearTimeout(s),s=window.setTimeout((function(){r.apply(e,t),s=-1}),n)})),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(i,t),i.getTRTCShareInstance=function(e){return ne||(ne=new i(e)),ne},i.prototype.destroyTRTCShareInstance=function(){ne&&(this._removeTRTCEvents(),ne._destroy(),ne=null)},i.prototype.getSDKVersion=function(){return this._version||""},i.prototype.off=function(e,t){void 0===t&&(t=function(){});try{"*"===e?this.removeAllListeners():this.removeListener(e,t)}catch(i){console.log("off error ",i)}},i.prototype.enterRoom=function(e,t){return R(this,void 0,Promise,(function(){var i,o,r,n,s,a,c,u,T,d,l,h,R,_,v,f;return C(this,(function(C){switch(C.label){case 0:if(i=e.sdkAppId,o=e.userId,r=e.userSig,n=e.roomId,s=e.strRoomId,a=e.role,c=e.privateMapKey,u=e.businessInfo,T=e.enableAutoPlayDialog,d=e.proxy,l=e.streamId,h=e.userDefineRecordId,!(i&&o&&r))return[3,5];C.label=1;case 1:return C.trys.push([1,3,,4]),R={sdkAppId:i,userId:o,userSig:r,roomId:n||s,role:z[a],scene:H[t],frameWorkType:this._frameWorkType,component:this._component},R=c?p(p({},R),{privateMapKey:c}):R,R=u?p(p({},R),{businessInfo:u}):R,R=T?p(p({},R),{enableAutoPlayDialog:T}):R,R=d?p(p({},R),{proxy:d}):R,R=l?p(p({},R),{streamId:l}):R,R=h?p(p({},R),{userDefineRecordId:h}):R,_=q(),[4,this._trtc.enterRoom(R)];case 2:return C.sent(),v=q()-_,this.emit("onEnterRoom",v),[3,4];case 3:return f=C.sent(),this.emit("onEnterRoom",-1),this._callFunctionErrorManage(f,"enterRoom"),[3,4];case 4:return[3,6];case 5:this._emitError(ie),C.label=6;case 6:return[2]}}))}))},i.prototype.exitRoom=function(){return R(this,void 0,Promise,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),console.warn("".concat(se," exitRoom")),this._isSharingScreen?[4,this.stopScreenShare()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,this._trtc.exitRoom()];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),this._callFunctionErrorManage(e,"exitRoom"),[3,5];case 5:return[2]}}))}))},i.prototype.switchRole=function(e){return R(this,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this._trtc.switchRole(z[e])];case 1:return i.sent(),this.emit("onSwitchRole",0,"switch role success, role = ".concat(e,", ").concat(z[e])),[3,3];case 2:return t=i.sent(),this.emit("onSwitchRole",null==t?void 0:t.getCode(),t.message),[3,3];case 3:return[2]}}))}))},i.prototype._updateLocalVideo=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.updateLocalVideo(this._generateLocalVideoData())];case 1:return t.sent(),[3,3];case 2:if((e=t.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw e;case 3:return[2]}}))}))},i.prototype._updateLocalTestVideo=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._testTrtc.updateLocalVideo(this._generateLocalTestVideoData())];case 1:return t.sent(),[3,3];case 2:if((e=t.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw e;case 3:return[2]}}))}))},i.prototype._updateRemoteVideo=function(e,t){return R(this,void 0,void 0,(function(){var i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._trtc.updateRemoteVideo(this._generateRemoteVideoData(e,t))];case 1:return o.sent(),[3,3];case 2:if((i=o.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw i;case 3:return[2]}}))}))},i.prototype.startLocalPreview=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return R(this,void 0,Promise,(function(){var i,o,r,n,s;return C(this,(function(a){switch(a.label){case 0:this._log.info("(startLocalPreview) start - start local preview with params: [".concat(t,"]")),1===_([],t,!0).length?o=_([],t,!0)[0]:2===_([],t,!0).length&&(s=_([],t,!0),i=s[0],o=s[1]),$(i)||(this._setIsMobile(!0),this._setIsFrontCamera(i)),this._setLocalView(o),a.label=1;case 1:a.trys.push([1,8,,9]),a.label=2;case 2:return a.trys.push([2,4,,7]),[4,this._trtc.startLocalVideo(this._generateLocalVideoData())];case 3:return a.sent(),[3,7];case 4:return(r=a.sent()).code!==l.default.ERROR_CODE.OPERATION_ABORT?[3,6]:[4,this._updateLocalVideo()];case 5:return a.sent(),[2];case 6:throw r;case 7:return this.emit("onCameraDidReady"),this.emit("onFirstVideoFrame",{userId:"",streamType:e.TRTCVideoStreamType.TRTCVideoStreamTypeBig,width:this._getVideoProfile().width,height:this._getVideoProfile().height}),[3,9];case 8:return n=a.sent(),this._callFunctionErrorManage(n,"startLocalPreview"),[3,9];case 9:return[2]}}))}))},i.prototype.updateLocalView=function(e){return R(this,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return this._setLocalView(e),[4,this._updateLocalVideo()];case 1:return t.sent(),[2]}}))}))},i.prototype.stopLocalPreview=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this._setLocalView(null),[4,this._trtc.stopLocalVideo()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("".concat(se," stopLocalPreview error: ").concat(e)),this._callFunctionErrorManage(e,"stopLocalPreview"),[3,3];case 3:return[2]}}))}))},i.prototype.muteLocalVideo=function(e){return void 0===e&&(e=!1),R(this,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this._setIsVideoPublish(!e),[4,this._updateLocalVideo()];case 1:return i.sent(),[3,3];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"muteLocalVideo"),[3,3];case 3:return[2]}}))}))},i.prototype.startRemoteView=function(e,t,i){return R(this,void 0,void 0,(function(){var o,r;return C(this,(function(n){switch(n.label){case 0:if(n.trys.push([0,7,,8]),this._setRemoteStreamConfig(e,i,{view:t}),!this._remoteStreamMap.get("".concat(e,"_").concat(this._getTRTCStreamType(i))))return[2];n.label=1;case 1:return n.trys.push([1,3,,6]),[4,this._trtc.startRemoteVideo(this._generateRemoteVideoData(e,i))];case 2:return n.sent(),[3,6];case 3:return(o=n.sent()).code!==l.default.ERROR_CODE.OPERATION_ABORT?[3,5]:[4,this._updateRemoteVideo(e,i)];case 4:return n.sent(),[2];case 5:throw o;case 6:return[3,8];case 7:return r=n.sent(),this._callFunctionErrorManage(r,"startRemoteView"),[3,8];case 8:return[2]}}))}))},i.prototype.updateRemoteView=function(e,t,i){return R(this,void 0,void 0,(function(){return C(this,(function(o){switch(o.label){case 0:return this._setRemoteStreamConfig(e,i,{view:t}),[4,this._updateRemoteVideo(e,i)];case 1:return o.sent(),[2]}}))}))},i.prototype.stopRemoteView=function(e,t){return R(this,void 0,void 0,(function(){var i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._trtc.stopRemoteVideo({userId:e,streamType:this._getTRTCStreamType(t)})];case 1:return o.sent(),[3,3];case 2:return i=o.sent(),this._callFunctionErrorManage(i,"stopRemoteView"),[3,3];case 3:return[2]}}))}))},i.prototype.stopAllRemoteView=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.stopRemoteVideo({userId:"*"})];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this._callFunctionErrorManage(e,"stopAllRemoteView"),[3,3];case 3:return[2]}}))}))},i.prototype.setVideoEncoderParam=function(e){return R(this,void 0,void 0,(function(){var t,i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),t=this._getTRTCVideoProfile("video",e),this._setVideoProfile(t),[4,this._updateLocalVideo()];case 1:return o.sent(),[4,this._updateLocalTestVideo()];case 2:return o.sent(),[3,4];case 3:return i=o.sent(),this._callFunctionErrorManage(i,"setVideoEncoderParam"),[3,4];case 4:return[2]}}))}))},i.prototype.setLocalRenderParams=function(e){return R(this,void 0,void 0,(function(){var t,i;return C(this,(function(o){switch(o.label){case 0:Object.assign(this._localRenderParams,e),o.label=1;case 1:return o.trys.push([1,4,,5]),t={},e.mirrorType&&(t.mirror=this._getTRTCMirror(e.mirrorType)),e.fillMode&&(t.fillMode=this._getTRTCFillMode(e.fillMode)),this._setVideoPlayOption(t),[4,this._updateLocalVideo()];case 2:return o.sent(),[4,this._updateLocalTestVideo()];case 3:return o.sent(),[3,5];case 4:return i=o.sent(),this._callFunctionErrorManage(i,"setLocalRenderParams"),[3,5];case 5:return[2]}}))}))},i.prototype.setRemoteRenderParams=function(e,t,i){return R(this,void 0,void 0,(function(){var o;return C(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this._setRemoteStreamConfig(e,t,i),[4,this._updateRemoteVideo(e,t)];case 1:return r.sent(),[3,3];case 2:return o=r.sent(),this._callFunctionErrorManage(o,"setRemoteRenderParams"),[3,3];case 3:return[2]}}))}))},i.prototype._updateLocalAudio=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.updateLocalAudio(this._generateLocalAudioData())];case 1:return t.sent(),[3,3];case 2:if((e=t.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw e;case 3:return[2]}}))}))},i.prototype.startLocalAudio=function(t){return void 0===t&&(t=e.TRTCAudioQuality.TRTCAudioQualityDefault),R(this,void 0,void 0,(function(){var e,i;return C(this,(function(o){switch(o.label){case 0:o.trys.push([0,7,,8]),this._setAudioProfile(J[t]),o.label=1;case 1:return o.trys.push([1,3,,6]),[4,this._trtc.startLocalAudio(this._generateLocalAudioData())];case 2:return o.sent(),[3,6];case 3:return(e=o.sent()).code!==l.default.ERROR_CODE.OPERATION_ABORT?[3,5]:[4,this._updateLocalAudio()];case 4:return o.sent(),[2];case 5:throw e;case 6:return this.emit("onMicDidReady"),[3,8];case 7:return i=o.sent(),console.warn("".concat(se," startLocalAudio error: ").concat(i)),this._callFunctionErrorManage(i,"startLocalAudio"),[3,8];case 8:return[2]}}))}))},i.prototype.stopLocalAudio=function(){return R(this,void 0,void 0,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.stopLocalAudio()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this._callFunctionErrorManage(e,"stopLocalAudio"),[3,3];case 3:return[2]}}))}))},i.prototype.muteLocalAudio=function(e){return void 0===e&&(e=!1),R(this,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this._setIsAudioPublish(!e),[4,this._updateLocalAudio()];case 1:return i.sent(),[3,3];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"muteLocalAudio"),[3,3];case 3:return[2]}}))}))},i.prototype.muteRemoteAudio=function(e,t){return void 0===t&&(t=!1),R(this,void 0,void 0,(function(){var i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e?[4,this._trtc.muteRemoteAudio(e,t)]:(this._emitError(ie),[2]);case 1:return o.sent(),[3,3];case 2:return i=o.sent(),this._callFunctionErrorManage(i,"muteRemoteAudio"),[3,3];case 3:return[2]}}))}))},i.prototype.muteAllRemoteAudio=function(e){try{this._trtc.muteRemoteAudio("*",e)}catch(t){this._callFunctionErrorManage(t,"muteAllRemoteAudio")}},i.prototype.setRemoteAudioVolume=function(e,t){try{this._trtc.setRemoteAudioVolume(e,t)}catch(i){this._callFunctionErrorManage(i,"setRemoteAudioVolume")}},i.prototype.enableAudioVolumeEvaluation=function(e){try{this._trtc.enableAudioVolumeEvaluation(e)}catch(t){this._callFunctionErrorManage(t,"enableAudioVolumeEvaluation")}},i.prototype.startScreenShare=function(t,i,o){return R(this,void 0,void 0,(function(){var i,r,n,s;return C(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),i=(o||{}).screenAudio,r=void 0!==i&&i,n=this._getTRTCVideoProfile("screen",o),this._setScreenShareParams({view:t,profile:n,systemAudio:r}),[4,this._trtc.startScreenShare(this._getScreenShareParams())];case 1:return a.sent(),this._isSharingScreen=!0,this.emit("onFirstVideoFrame",{userId:"",streamType:e.TRTCVideoStreamType.TRTCVideoStreamTypeSub,width:n.width,height:n.height}),[3,3];case 2:if((s=a.sent()).code===l.default.ERROR_CODE.OPERATION_ABORT)return[2];throw console.error("Start share screen error:",s,s.code,s.name,s.message),s;case 3:return[2]}}))}))},i.prototype.setSubStreamEncoderParam=function(e){return R(this,void 0,void 0,(function(){var t,i;return C(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=this._getTRTCVideoProfile("screen",e),this._setScreenShareParams({profile:t}),[4,this._trtc.updateScreenShare(this._getScreenShareParams())];case 1:return o.sent(),[3,3];case 2:return i=o.sent(),this._callFunctionErrorManage(i,"setSubStreamEncoderParam"),[3,3];case 3:return[2]}}))}))},i.prototype.stopScreenShare=function(){return R(this,void 0,Promise,(function(){var e;return C(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._trtc.stopScreenShare()];case 1:return t.sent(),this._isSharingScreen=!1,this.emit("onScreenCaptureStopped",{reason:0}),[3,3];case 2:return e=t.sent(),this._callFunctionErrorManage(e,"stopScreenShare"),[3,3];case 3:return[2]}}))}))},i.prototype.startScreenCapture=function(){this.emitError(oe)},i.prototype.pauseScreenCapture=function(){this.emitError(oe)},i.prototype.resumeScreenCapture=function(){this.emitError(oe)},i.prototype.getScreenCaptureSources=function(){this.emitError(oe)},i.prototype.selectScreenCaptureTarget=function(){this.emitError(oe)},i.prototype.getCameraDevicesList=function(){return R(this,void 0,Promise,(function(){var e,t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,l.default.getCameraList()];case 1:return e=(e=i.sent()).map((function(e){return p(p({},e),{deviceName:e.label})})),this._cameraList=e,this._currentCamera=this.getDefaultDeviceInfo(e),this._currentCameraId=this._currentCamera.deviceId,[2,Promise.resolve(e)];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"getCameraDevicesList"),[2,Promise.resolve([])];case 3:return[2]}}))}))},i.prototype.setCurrentCameraDevice=function(e){return R(this,void 0,Promise,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e?(this._currentCameraId=e,this._currentCamera=this._cameraList.filter((function(t){return t.deviceId===e})),[4,this._updateLocalVideo()]):[2,!1];case 1:return i.sent(),[4,this._updateLocalTestVideo()];case 2:return i.sent(),[2,!0];case 3:return t=i.sent(),this._callFunctionErrorManage(t,"setCurrentCameraDevice"),[2,!1];case 4:return[2]}}))}))},i.prototype.getCurrentCameraDevice=function(){return new y},i.prototype.isFrontCamera=function(){return this._getIsFrontCamera()},i.prototype.switchCamera=function(e){return R(this,void 0,void 0,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return this._setIsFrontCamera(e),(t=this._getVideoPlayOption()).mirror=this._getTRTCMirror(this._localRenderParams.mirrorType),this._setVideoPlayOption(t),[4,this._updateLocalVideo()];case 1:return i.sent(),[2]}}))}))},i.prototype.getMicDevicesList=function(){return R(this,void 0,Promise,(function(){var e,t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,l.default.getMicrophoneList()];case 1:return e=(e=i.sent()).map((function(e){return p(p({},e),{deviceName:e.label})})),this._microphoneList=e,this._currentMicrophone=this.getDefaultDeviceInfo(e),this._currentMicrophoneId=this._currentMicrophone.deviceId,[2,Promise.resolve(e)];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"getMicDevicesList"),[2,Promise.resolve([])];case 3:return[2]}}))}))},i.prototype.setCurrentMicDevice=function(e){return R(this,void 0,Promise,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e?(this._setCurrentMicrophoneId(e),this._currentMicrophone=this._microphoneList.filter((function(t){return t.deviceId===e})),[4,this._trtc.updateLocalAudio(this._generateLocalAudioData())]):[2,!1];case 1:return i.sent(),[2,!0];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"setCurrentMicDevice"),[2,!1];case 3:return[2]}}))}))},i.prototype.getCurrentMicDevice=function(){return new y},i.prototype.getSpeakerDevicesList=function(){return R(this,void 0,Promise,(function(){var e,t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,l.default.getSpeakerList()];case 1:return e=(e=i.sent()).map((function(e){return p(p({},e),{deviceName:e.label})})),this._speakerList=e,this._currentSpeaker=this.getDefaultDeviceInfo(e),this._currentSpeakerId=this._currentSpeaker.deviceId,[2,Promise.resolve(e)];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"getSpeakerDevicesList"),[2,Promise.resolve([])];case 3:return[2]}}))}))},i.prototype.setCurrentSpeakerDevice=function(e){return R(this,void 0,Promise,(function(){var t;return C(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e?(this._setCurrentSpeakerId(e),this._currentSpeaker=this._speakerList.filter((function(t){return t.deviceId===e})),[4,l.default.setCurrentSpeaker(e)]):[2,!1];case 1:return i.sent(),[2,!0];case 2:return t=i.sent(),this._callFunctionErrorManage(t,"setCurrentSpeakerDevice"),[2,!1];case 3:return[2]}}))}))},i.prototype.getCurrentSpeakerDevice=function(){return new y},i.prototype.startCameraDeviceTest=function(e){return R(this,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return this._log.info("(startCameraDeviceTest) start - start test camera Device",e),e?(this._setLocalTestView(e),[4,this._testTrtc.startLocalVideo(this._generateLocalTestVideoData())]):[2];case 1:return t.sent(),[2]}}))}))},i.prototype.stopCameraDeviceTest=function(){return R(this,void 0,void 0,(function(){return C(this,(function(e){switch(e.label){case 0:return this._setLocalTestView(null),[4,this._testTrtc.stopLocalVideo()];case 1:return e.sent(),[2]}}))}))},i.prototype.startMicDeviceTest=function(t){return R(this,void 0,void 0,(function(){var i=this;return C(this,(function(o){switch(o.label){case 0:return this._log.info("(startMicDeviceTest) start - start test mic Device",t),[4,this._testTrtc.startLocalAudio({publish:!1,option:{microphoneId:this._currentMicrophoneId,profile:J[e.TRTCAudioQuality.TRTCAudioQualityDefault]}})];case 1:return o.sent(),this._testTrtc.on(l.default.EVENT.AUDIO_VOLUME,(function(e){null==e||e.result.forEach((function(e){var t=e.userId,o=e.volume;""===t&&i.emit("onTestMicVolume",o)}))})),[4,this._testTrtc.enableAudioVolumeEvaluation(t)];case 2:return o.sent(),[2]}}))}))},i.prototype.stopMicDeviceTest=function(){this._log.info("(stopMicDeviceTest) stop - stop test mic Device"),this._testTrtc.stopLocalAudio()},i.prototype._unbindEvents=function(){},i.prototype._destroy=function(){this._unbindEvents()},i.prototype._emitError=function(e){e&&this.emit&&this.emit(Y,e.code,e.message)},i.prototype._callFunctionErrorManage=function(e,t){e&&e.code===l.default.ERROR_CODE.OPERATION_ABORT||(e&&e.getCode&&e.getCode()?(this.emit(Y,e.getCode(),e.message),this._log.error("(".concat(t,") failed - ").concat(e.message))):(this.emit(Y,te,e.message),this._log.error("(".concat(t,") failed - ").concat(e.message))))},i.prototype._getTRTCResolution=function(t){var i=(e.TRTCVideoResolution[t]||"").split("_");return{width:+(i.length>1&&i[1]),height:+(i.length>2&&i[2])}},i.prototype._getTRTCVideoProfile=function(e,t){var i=t.videoResolution,o=t.videoFps,r=t.videoBitrate,n="screen"===e?this._defaultScreenProfile:this._defaultVideoProfile;if(i){var s=this._getTRTCResolution(i);n.width=s.width,n.height=s.height}return o&&(n.frameRate=o),r&&(n.bitrate=r),n},i.prototype._getTRTCStreamType=function(t){var i;return((i={})[e.TRTCVideoStreamType.TRTCVideoStreamTypeBig]=l.default.TYPE.STREAM_TYPE_MAIN,i[e.TRTCVideoStreamType.TRTCVideoStreamTypeSmall]=l.default.TYPE.STREAM_TYPE_MAIN,i[e.TRTCVideoStreamType.TRTCVideoStreamTypeSub]=l.default.TYPE.STREAM_TYPE_SUB,i)[t]},i.prototype._getTRTCFillMode=function(t){var i;return((i={})[e.TRTCVideoFillMode.TRTCVideoFillMode_Fill]=Z.COVER,i[e.TRTCVideoFillMode.TRTCVideoFillMode_Fit]=Z.CONTAIN,i)[t]},i.prototype._getTRTCMirror=function(t){var i;return t===e.TRTCVideoMirrorType.TRTCVideoMirrorType_Auto?!this._getIsMobile()||this._getIsFrontCamera():((i={})[e.TRTCVideoMirrorType.TRTCVideoMirrorType_Enable]=!0,i[e.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable]=!1,i)[t]},i.prototype._getTRTCCloudDeviceType=function(t){return{camera:e.TRTCDeviceType.TRTCDeviceTypeCamera,microphone:e.TRTCDeviceType.TRTCDeviceTypeMic,speaker:e.TRTCDeviceType.TRTCDeviceTypeSpeaker}[t]},i.prototype._getTRTCCloudDeviceState=function(t){return{add:e.TRTCDeviceState.TRTCDeviceStateAdd,remove:e.TRTCDeviceState.TRTCDeviceStateRemove,active:e.TRTCDeviceState.TRTCDeviceStateActive}[t]},i.prototype._generateLocalVideoData=function(){var e={view:this._getLocalView(),publish:this._getIsVideoPublish(),option:p({profile:this._getVideoProfile()},this._getVideoPlayOption())};return this._getIsMobile()?e&&Object.assign(e.option,{useFrontCamera:this._getIsFrontCamera()}):e&&Object.assign(e.option,{cameraId:this._getCurrentCameraId()}),e},i.prototype._generateLocalTestVideoData=function(){return{view:this._getLocalTestView(),publish:!1,option:p({cameraId:this._getCurrentCameraId(),profile:this._getVideoProfile()},this._getVideoPlayOption())}},i.prototype._generateLocalAudioData=function(){return{publish:this._getIsAudioPublish(),option:{microphoneId:this._getCurrentMicrophoneId(),profile:this._getAudioProfile()}}},i.prototype._generateRemoteVideoData=function(e,t){return this._remoteStreamConfig.get("".concat(e,"_").concat(this._getTRTCStreamType(t)))},i.prototype._addTRTCEvents=function(){var t=this;this._trtc.on(l.default.EVENT.ERROR,(function(e){var i;e&&t.emit("onError",null===(i=null==e?void 0:e.getCode)||void 0===i?void 0:i.getCode(),e.message)})),this._trtc.on(l.default.EVENT.REMOTE_USER_ENTER,(function(e){(null==e?void 0:e.userId)&&t.emit("onRemoteUserEnterRoom",e.userId)})),this._trtc.on(l.default.EVENT.REMOTE_USER_EXIT,(function(e){(null==e?void 0:e.userId)&&t.emit("onRemoteUserLeaveRoom",e.userId)})),this._trtc.on(l.default.EVENT.REMOTE_AUDIO_AVAILABLE,(function(e){(null==e?void 0:e.userId)&&t.emit("onUserAudioAvailable",e.userId,!0)})),this._trtc.on(l.default.EVENT.REMOTE_AUDIO_UNAVAILABLE,(function(e){(null==e?void 0:e.userId)&&t.emit("onUserAudioAvailable",e.userId,!1)})),this._trtc.on(l.default.EVENT.REMOTE_VIDEO_AVAILABLE,(function(e){t._emitVideoAvailable(e,!0)})),this._trtc.on(l.default.EVENT.REMOTE_VIDEO_UNAVAILABLE,(function(e){t._emitVideoAvailable(e,!1)})),this._trtc.on(l.default.EVENT.AUDIO_VOLUME,(function(e){(null==e?void 0:e.result)&&t.emit("onUserVoiceVolume",null==e?void 0:e.result,((null==e?void 0:e.result)||[]).length)})),this._trtc.on(l.default.EVENT.NETWORK_QUALITY,(function(i){var o=i.uplinkNetworkQuality,r=i.downlinkNetworkQuality,n=t.client?t.client.getUserId():"",s=[e.TRTCQuality.TRTCQuality_Unknown,e.TRTCQuality.TRTCQuality_Excellent,e.TRTCQuality.TRTCQuality_Good,e.TRTCQuality.TRTCQuality_Poor,e.TRTCQuality.TRTCQuality_Bad,e.TRTCQuality.TRTCQuality_Vbad,e.TRTCQuality.TRTCQuality_Down],a=new b(n,s[o]),c=new b("remote",s[r]);t.emit("onNetworkQuality",a,[c])})),this._trtc.on(l.default.EVENT.SCREEN_SHARE_STOPPED,(function(){t.emit("onScreenCaptureStopped",{reason:0}),t._isSharingScreen=!1})),this._trtc.on(l.default.EVENT.PUBLISH_STATE_CHANGED,(function(i){var o=i.mediaType;"started"===i.state&&("audio"===o?t.emit("onSendFirstLocalAudioFrame"):"video"===o?t.emit("onSendFirstLocalVideoFrame",{streamType:e.TRTCVideoStreamType.TRTCVideoStreamTypeBig}):"screen"===o&&t.emit("onSendFirstLocalVideoFrame",{streamType:e.TRTCVideoStreamType.TRTCVideoStreamTypeSub}))}))},i.prototype._removeTRTCEvents=function(){this._trtc.off("*")},i.prototype._emitVideoAvailable=function(e,t){var i=e.userId,o=e.streamType;t?this._remoteStreamMap.set("".concat(i,"_").concat(o),!0):this._remoteStreamMap.delete("".concat(i,"_").concat(o)),o===l.default.TYPE.STREAM_TYPE_SUB?i&&this.emit("onUserSubStreamAvailable",i,t):i&&this.emit("onUserVideoAvailable",i,t)},i.prototype._setLocalView=function(e){this._localView=e},i.prototype._getLocalView=function(){return this._localView},i.prototype._setIsMobile=function(e){this._isMobile=e},i.prototype._getIsMobile=function(){return this._isMobile},i.prototype._setIsFrontCamera=function(e){this._isFrontCamera=e},i.prototype._getIsFrontCamera=function(){return this._isFrontCamera},i.prototype._setIsVideoPublish=function(e){this._isVideoPublish=e},i.prototype._getIsVideoPublish=function(){return this._isVideoPublish},i.prototype._setVideoProfile=function(e){this._videoProfile=e},i.prototype._getVideoProfile=function(){return this._videoProfile},i.prototype._setVideoPlayOption=function(e){this._videoPlayOption=e},i.prototype._getVideoPlayOption=function(){return this._videoPlayOption},i.prototype._setLocalTestView=function(e){this._localTestView=e},i.prototype._getLocalTestView=function(){return this._localTestView},i.prototype._setScreenShareParams=function(e){var t=e.view,i=e.systemAudio,o=e.fillMode,r=e.profile;$(t)||(this._screenShareParams.view=t),$(i)||(this._screenShareParams.option.systemAudio=i),$(o)||(this._screenShareParams.option.fillMode=o),$(r)||(this._screenShareParams.option.profile=r)},i.prototype._getScreenShareParams=function(){return this._screenShareParams},i.prototype._setIsAudioPublish=function(e){this._isAudioPublish=e},i.prototype._getIsAudioPublish=function(){return this._isAudioPublish},i.prototype._setAudioProfile=function(e){this._audioProfile=e},i.prototype._getAudioProfile=function(){return this._audioProfile},i.prototype._setCurrentCameraId=function(e){this._currentCameraId=e},i.prototype._getCurrentCameraId=function(){return this._currentCameraId},i.prototype._setCurrentMicrophoneId=function(e){this._currentMicrophoneId=e},i.prototype._getCurrentMicrophoneId=function(){return this._currentMicrophoneId},i.prototype._setCurrentSpeakerId=function(e){this._currentSpeakerId=e},i.prototype._getCurrentSpeakerId=function(){return this._currentSpeakerId},i.prototype._setRemoteStreamConfig=function(e,t,i){var o={userId:e,streamType:this._getTRTCStreamType(t),option:{}},r=i.view,n=i.mirrorType,s=i.fillMode;$(r)||(o.view=r),$(n)||(o.option.mirror=this._getTRTCMirror(n)),$(s)||(o.option.fillMode=this._getTRTCFillMode(s)),this._remoteStreamConfig.set("".concat(e,"_").concat(this._getTRTCStreamType(t)),o)},i.prototype.handleDeviceChange=function(){return R(this,void 0,void 0,(function(){var t=this;return C(this,(function(i){return l.default.getCameraList().then((function(i){return R(t,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return this._cameraList.length===i.length?[2]:[4,this.deviceChangeManage(this._cameraList,i,e.TRTCDeviceType.TRTCDeviceTypeCamera)];case 1:return t.sent(),this._cameraList=i,[2]}}))}))})),l.default.getMicrophoneList().then((function(i){return R(t,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.deviceChangeManage(this._microphoneList,i,e.TRTCDeviceType.TRTCDeviceTypeMic)];case 1:return t.sent(),this._microphoneList=i,[2]}}))}))})),l.default.getSpeakerList().then((function(i){return R(t,void 0,void 0,(function(){return C(this,(function(t){switch(t.label){case 0:return[4,this.deviceChangeManage(this._speakerList,i,e.TRTCDeviceType.TRTCDeviceTypeSpeaker)];case 1:return t.sent(),this._speakerList=i,[2]}}))}))})),[2]}))}))},i.prototype.isSameDevice=function(e,t){var i=e&&e.deviceId&&e.groupId&&e.label,o=t&&t.deviceId&&t.groupId&&t.label;return!(!i||!o)&&e.deviceId===t.deviceId&&e.groupId===t.groupId&&e.label===t.label},i.prototype.deviceChangeManage=function(t,i,o){return R(this,void 0,void 0,(function(){var r,n,s,a,c;return C(this,(function(u){switch(u.label){case 0:return r=void 0,t.length!==i.length&&(n=(i||[]).map((function(e){return e.deviceId})),s=new y,t.length>i.length?(s=t.filter((function(e){return!n.includes(e.deviceId)}))[0]||{},r=e.TRTCDeviceState.TRTCDeviceStateRemove):(n=(t||[]).map((function(e){return e.deviceId})),s=i.filter((function(e){return!n.includes(e.deviceId)}))[0]||{},r=e.TRTCDeviceState.TRTCDeviceStateAdd),a=s.deviceId,this.emitOnDeviceChange(a,o,r)),c=this.getDefaultDeviceInfo(i),o!==e.TRTCDeviceType.TRTCDeviceTypeCamera||r!==e.TRTCDeviceState.TRTCDeviceStateRemove?[3,3]:this.isSameDevice(this._currentCamera,c)?[2]:c.deviceId?[4,this.autoChangeDevice(o,c)]:[3,2];case 1:u.sent(),u.label=2;case 2:u.label=3;case 3:return o!==e.TRTCDeviceType.TRTCDeviceTypeMic?[3,6]:this.isSameDevice(this._currentMicrophone,c)?[2]:c.deviceId?[4,this.autoChangeDevice(o,c)]:[3,5];case 4:u.sent(),u.label=5;case 5:u.label=6;case 6:return o!==e.TRTCDeviceType.TRTCDeviceTypeSpeaker?[3,9]:this.isSameDevice(this._currentSpeaker,c)?[2]:c.deviceId?[4,this.autoChangeDevice(o,c)]:[3,8];case 7:u.sent(),u.label=8;case 8:u.label=9;case 9:return[2]}}))}))},i.prototype.getDefaultDeviceInfo=function(e){var t=new y;if(0===e.length)return t;var i=e.filter((function(e){return"default"===e.deviceId}));return t=i.length>0?i[0]:e[0]},i.prototype.autoChangeDevice=function(t,i){return R(this,void 0,void 0,(function(){var o,r,n,s,a;return C(this,(function(c){switch(c.label){case 0:if(o=i.deviceId,t!==e.TRTCDeviceType.TRTCDeviceTypeCamera)return[3,8];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this._trtc.updateLocalVideo({option:{cameraId:o}})];case 2:return c.sent(),[3,4];case 3:return r=c.sent(),console.log("error",JSON.stringify(r)),r.code,l.default.ERROR_CODE.OPERATION_ABORT,[3,4];case 4:return c.trys.push([4,6,,7]),[4,this._testTrtc.updateLocalVideo({option:{cameraId:o}})];case 5:return c.sent(),[3,7];case 6:return n=c.sent(),console.log("testTRTC error",JSON.stringify(n)),n.code,l.default.ERROR_CODE.OPERATION_ABORT,[3,7];case 7:this._currentCameraId=o,this._currentCamera=i,this.emitOnDeviceChange(o,t,e.TRTCDeviceState.TRTCDeviceStateActive),c.label=8;case 8:if(t!==e.TRTCDeviceType.TRTCDeviceTypeMic)return[3,16];c.label=9;case 9:return c.trys.push([9,11,,12]),[4,this._trtc.updateLocalAudio({option:{microphoneId:o}})];case 10:return c.sent(),[3,12];case 11:return s=c.sent(),console.log("error",JSON.stringify(s)),s.code,l.default.ERROR_CODE.OPERATION_ABORT,[3,12];case 12:return c.trys.push([12,14,,15]),[4,this._testTrtc.updateLocalAudio({option:{microphoneId:o}})];case 13:return c.sent(),[3,15];case 14:return a=c.sent(),console.log("testTRTC error",JSON.stringify(a)),a.code,l.default.ERROR_CODE.OPERATION_ABORT,[3,15];case 15:this._currentMicId=o,this._currentMicrophone=i,this.emitOnDeviceChange(o,t,e.TRTCDeviceState.TRTCDeviceStateActive),c.label=16;case 16:return t!==e.TRTCDeviceType.TRTCDeviceTypeSpeaker?[3,18]:[4,l.default.setCurrentSpeaker(o)];case 17:c.sent(),this._currentSpeakerId=o,this._currentSpeaker=i,this.emitOnDeviceChange(o,t,e.TRTCDeviceState.TRTCDeviceStateActive),c.label=18;case 18:return[2]}}))}))},i.prototype.emitOnDeviceChange=function(e,t,i){this.emit("onDeviceChange",e,t,i)},i}(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i=function(){for(var t=0,i=e;t<i.length;t++)ee(this,new(0,i[t])(this))},o=i.prototype,r=0,n=e;r<n.length;r++){var s=n[r];ee(i,s),ee(o,s.prototype)}return i}(t.EventEmitter));e.Rect=B,e.TRTCDeviceInfo=y,e.TRTCImageBuffer=k,e.TRTCLocalStatistics=P,e.TRTCMixUser=j,e.TRTCNetworkQosParam=F,e.TRTCParams=g,e.TRTCPublishCDNParam=w,e.TRTCQualityInfo=b,e.TRTCRenderParams=M,e.TRTCScreenCaptureSourceInfo=N,e.TRTCStatistics=L,e.TRTCTranscodingConfig=U,e.TRTCVideoEncParam=V,e.TRTCVolumeInfo=D,e.default=ae,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("events"),require("trtc-sdk-v5")):"function"==typeof define&&define.amd?define(["exports","events","trtc-sdk-v5"],factory):factory((global="undefined"!=typeof globalThis?globalThis:global||self).TRTC={},global.events,global.TRTC);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc