aliyun-rtc-sdk 7.1.9 → 7.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aliyun-rtc-sdk.es.js +4959 -4697
- package/dist/aliyun-rtc-sdk.umd.js +20 -18
- package/dist/plugins/audioProcessPlugin.d.ts +23 -4453
- package/dist/plugins/audioProcessPlugin.js +1 -163
- package/dist/plugins/beautyPlugin.js +1 -1
- package/dist/plugins/{index-BvRi8Pnp.js → index-DBpkuGL4.js} +1 -1
- package/dist/types/index.d.ts +76 -40
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as d}from"./index-
|
|
1
|
+
import{o as d}from"./index-DBpkuGL4.js";import{QueenEngineWorker as g,kQueenVersion as h,QueenEnginePro as m}from"aliyun-queen-engine";import"eventemitter3";var l=Object.defineProperty,p=(i,e,n)=>e in i?l(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n,s=(i,e,n)=>p(i,typeof e!="symbol"?e+"":e,n);class y extends d{constructor(){super("AliRtcBeauty"),s(this,"engineReady",!1),s(this,"_queenEngine"),s(this,"canvas"),s(this,"dirty",!1),s(this,"lastFrameTimestamp",0),s(this,"continuousStuckCount",0),this.zIndex=0}get initOptions(){return{licenseKey:""}}setOptions(e){const n=!!e.segmentBackgroundProcess?.enable,r=!!e.setSegmentBackgroundImage?.backgroundImgUrl;this.options={...this.options,...e},r?delete this.options.segmentBackgroundProcess:n&&delete this.options.setSegmentBackgroundImage,this.engineReady&&this.queenEngine?.setEngineParams(this.options)}async init(){await this.initQueen()}shouldUseWorker(){return!(typeof TransformStream>"u"||typeof MediaStreamTrackProcessor>"u"||typeof MediaStreamTrackGenerator>"u")&&!(typeof OffscreenCanvas>"u"||typeof WebGL2RenderingContext>"u")}isSupported(){return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))}async initQueen(){this.canvas=document.createElement("canvas");const{licenseKey:e=""}=this.options;let n;return this.shouldUseWorker()?n=new g(h.Pro):n=new m,this._queenEngine=n,await new Promise(r=>{n.init(e,()=>{this.engineReady=!0,this.emit("ready"),n.setEngineParams(this.options),r(n)},function(){},this.canvas)}),n}shouldUpdate(e){return this.videoUpdated(e)||this.dirty}async process(e){if(!e.originVideoTrack){this.clear(e),e.updateVideoTrack();return}if(!this.queenEngine||!this.engineReady)return;const[n,r]=await new Promise(a=>{const t=document.createElement("video"),c=new MediaStream([e.originVideoTrack]);t.srcObject=c,t.onloadedmetadata=()=>{const u=[t.videoWidth,t.videoHeight];t.srcObject=null,t.remove(),a(u)},setTimeout(()=>{t.srcObject=null,t.remove(),a([1280,720])},3e3)});this.dirty=!1;const o=this.queenEngine.renderMediaStream(new MediaStream([e.originVideoTrack]),n,r);o?.getVideoTracks().length&&e.updateVideoTrack(o.getVideoTracks()[0])}get queenEngine(){return this._queenEngine}clear(e){this.canvas=void 0,this.engineReady=!1,this._queenEngine=void 0,this.queenEngine?.engineDestory(),super.clear(e)}}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import h from"eventemitter3";var u;(function(t){t[t.AliRtcSdkStreamTypeCapture=0]="AliRtcSdkStreamTypeCapture",t[t.AliRtcSdkStreamTypeScreen=1]="AliRtcSdkStreamTypeScreen"})(u||(u={}));var d=u,o=Object.defineProperty,n=(t,i,a)=>i in t?o(t,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[i]=a,e=(t,i,a)=>n(t,typeof i!="symbol"?i+"":i,a),c;(function(t){t[t.PRE_PROCESSOR=0]="PRE_PROCESSOR",t[t.POST_PROCESSOR=1]="POST_PROCESSOR"})(c||(c={}));var s;(function(t){t[t.AUDIO=0]="AUDIO",t[t.VIDEO=1]="VIDEO",t[t.BOTH=2]="BOTH"})(s||(s={}));class p extends h{constructor(i,a=d.AliRtcSdkStreamTypeCapture,r=s.VIDEO){super(),e(this,"name"),e(this,"options"),e(this,"type",c.PRE_PROCESSOR),e(this,"streamType"),e(this,"trackType"),e(this,"zIndex",1),e(this,"_isEnable",!0),e(this,"shouldCache",!0),e(this,"lastInputAudioTrack"),e(this,"lastOutputAudioTrack"),e(this,"lastInputVideoTrack"),e(this,"lastOutputVideoTrack"),e(this,"_hasCleared",!0),this.name=i,this.streamType=a,this.trackType=r,this.options=this.initOptions}get initOptions(){return{}}getOptions(){return this.options}async init(){}enable(){this._isEnable||(this._isEnable=!0,this.init(),this.emit("enabled"))}disable(){this._isEnable&&(this._isEnable=!1,this.clear(),this.emit("disabled"))}get isEnable(){return this._isEnable}audioUpdated(i){return this.lastInputAudioTrack?.id!==i.currentAudioTrack?.id}videoUpdated(i){return this.lastInputVideoTrack?.id!==i.currentVideoTrack?.id}async execute(i,a){const r=this.shouldUpdate(i,a);this.lastInputAudioTrack=i.currentAudioTrack,this.lastInputVideoTrack=i.currentVideoTrack,this._hasCleared||r?(await this.process(i,a),this._hasCleared=!1):this.shouldCache&&(this.lastOutputAudioTrack&&(this.trackType===s.BOTH||this.trackType===s.AUDIO)&&this.lastOutputAudioTrack&&i.updateAudioTrack(this.lastOutputAudioTrack),this.lastOutputVideoTrack&&(this.trackType===s.BOTH||this.trackType===s.VIDEO)&&this.lastOutputVideoTrack&&i.updateVideoTrack(this.lastOutputVideoTrack)),this.lastOutputAudioTrack=i.currentAudioTrack,this.lastOutputVideoTrack=i.currentVideoTrack}clear(i){this._hasCleared=!0,this.lastInputAudioTrack=void 0,this.lastInputVideoTrack=void 0,this.lastOutputAudioTrack=void 0,this.lastOutputVideoTrack=void 0}}export{s as A,d as
|
|
1
|
+
import h from"eventemitter3";var u;(function(t){t[t.AliRtcSdkStreamTypeCapture=0]="AliRtcSdkStreamTypeCapture",t[t.AliRtcSdkStreamTypeScreen=1]="AliRtcSdkStreamTypeScreen"})(u||(u={}));var d=u,o=Object.defineProperty,n=(t,i,a)=>i in t?o(t,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[i]=a,e=(t,i,a)=>n(t,typeof i!="symbol"?i+"":i,a),c;(function(t){t[t.PRE_PROCESSOR=0]="PRE_PROCESSOR",t[t.POST_PROCESSOR=1]="POST_PROCESSOR"})(c||(c={}));var s;(function(t){t[t.AUDIO=0]="AUDIO",t[t.VIDEO=1]="VIDEO",t[t.BOTH=2]="BOTH"})(s||(s={}));class p extends h{constructor(i,a=d.AliRtcSdkStreamTypeCapture,r=s.VIDEO){super(),e(this,"name"),e(this,"options"),e(this,"type",c.PRE_PROCESSOR),e(this,"streamType"),e(this,"trackType"),e(this,"zIndex",1),e(this,"_isEnable",!0),e(this,"shouldCache",!0),e(this,"lastInputAudioTrack"),e(this,"lastOutputAudioTrack"),e(this,"lastInputVideoTrack"),e(this,"lastOutputVideoTrack"),e(this,"_hasCleared",!0),this.name=i,this.streamType=a,this.trackType=r,this.options=this.initOptions}get initOptions(){return{}}getOptions(){return this.options}async init(){}enable(){this._isEnable||(this._isEnable=!0,this.init(),this.emit("enabled"))}disable(){this._isEnable&&(this._isEnable=!1,this.clear(),this.emit("disabled"))}get isEnable(){return this._isEnable}audioUpdated(i){return this.lastInputAudioTrack?.id!==i.currentAudioTrack?.id}videoUpdated(i){return this.lastInputVideoTrack?.id!==i.currentVideoTrack?.id}async execute(i,a){const r=this.shouldUpdate(i,a);this.lastInputAudioTrack=i.currentAudioTrack,this.lastInputVideoTrack=i.currentVideoTrack,this._hasCleared||r?(await this.process(i,a),this._hasCleared=!1):this.shouldCache&&(this.lastOutputAudioTrack&&(this.trackType===s.BOTH||this.trackType===s.AUDIO)&&this.lastOutputAudioTrack&&i.updateAudioTrack(this.lastOutputAudioTrack),this.lastOutputVideoTrack&&(this.trackType===s.BOTH||this.trackType===s.VIDEO)&&this.lastOutputVideoTrack&&i.updateVideoTrack(this.lastOutputVideoTrack)),this.lastOutputAudioTrack=i.currentAudioTrack,this.lastOutputVideoTrack=i.currentVideoTrack}clear(i){this._hasCleared=!0,this.lastInputAudioTrack=void 0,this.lastInputVideoTrack=void 0,this.lastOutputAudioTrack=void 0,this.lastOutputVideoTrack=void 0}}export{s as A,d as m,p as o};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -182,7 +182,15 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
182
182
|
* @returns {Promise<string[]>}
|
|
183
183
|
*/
|
|
184
184
|
static getCameraList: () => Promise<MediaDeviceInfo[]>;
|
|
185
|
+
/**
|
|
186
|
+
* 获取麦克风列表
|
|
187
|
+
* @returns {Promise<string[]>}
|
|
188
|
+
*/
|
|
185
189
|
static getMicrophoneList: () => Promise<MediaDeviceInfo[]>;
|
|
190
|
+
/**
|
|
191
|
+
* 获取扬声器列表
|
|
192
|
+
* @returns {Promise<string[]>}
|
|
193
|
+
*/
|
|
186
194
|
static getSpeakerList: () => Promise<MediaDeviceInfo[]>;
|
|
187
195
|
static getSdkVersion(): string;
|
|
188
196
|
/**
|
|
@@ -246,7 +254,7 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
246
254
|
protected signalingManager: SignalingManager;
|
|
247
255
|
protected bizControl: BizControl;
|
|
248
256
|
protected liveTranscoding: AliRtcLiveTranscoding;
|
|
249
|
-
protected
|
|
257
|
+
protected maxSignalingReconnectDuration?: number;
|
|
250
258
|
protected slsReporter: SLSReporter;
|
|
251
259
|
protected connectState: AliRtcConnectionStatus;
|
|
252
260
|
protected networkError: boolean;
|
|
@@ -386,7 +394,7 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
386
394
|
* @details 一般在调用该方法前会根据场景先选择频道模式,通过调用 {@link setChannelProfile} 实现,默认频道模式为通信模式 {@link AliRtcSdkChannelProfile.AliRtcSdkCommunication}
|
|
387
395
|
* ``` javascript
|
|
388
396
|
* // 设置频道为互动模式
|
|
389
|
-
* engine.setChannelProfile(AliRtcSdkChannelProfile.
|
|
397
|
+
* engine.setChannelProfile(AliRtcSdkChannelProfile.AliRtcInteractiveLive);
|
|
390
398
|
* // 设置角色为主播角色
|
|
391
399
|
* engine.setClientRole(AliRtcSdkClientRole.AliRtcSdkInteractive);
|
|
392
400
|
* ```
|
|
@@ -395,7 +403,7 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
395
403
|
* @param {any} extraData 入会自定义数据
|
|
396
404
|
* @note
|
|
397
405
|
* - 异步接口,方法执行成功则为成功入会
|
|
398
|
-
* - 正常情况一个
|
|
406
|
+
* - 正常情况一个AppId对应一个App,只有同一个AppId的应用可进行互相通话,不同AppId和channelID不同都不能互通
|
|
399
407
|
* - 当入会成功后,会触发远端用户收到 {@link AliRtcEngineEventListener.remoteUserOnLineNotify} 回调
|
|
400
408
|
* - 如果已在会中想重新入会,需要先调用 {@link leaveChannel} 离会,且确保方法执行成功
|
|
401
409
|
* - 用户加入频道后,默认订阅频道内所有其他用户的音视频流,默认推送音视频流到远端,因此将会产生计费,如果想要取消默认订阅可以 {@link joinChannel} 前调用 {@link setDefaultSubscribeAllRemoteAudioStreams} 和 {@link setDefaultSubscribeAllRemoteVideoStreams}
|
|
@@ -413,18 +421,23 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
413
421
|
* ```
|
|
414
422
|
* @param token 认证信息,从App Server获取。
|
|
415
423
|
* @param channelParam 入会参数,详见{@link AliRtcChannelParam}
|
|
416
|
-
* @param agentParam
|
|
424
|
+
* @param agentParam AI代理参数,详见{@link AliRtcAIAgentParam}
|
|
417
425
|
* @note
|
|
418
426
|
* - 异步接口,方法执行成功则为成功入会
|
|
419
|
-
* - 正常情况一个AppId对应一个App,只有同一个AppId
|
|
427
|
+
* - 正常情况一个AppId对应一个App,只有同一个AppId的应用可进行互相通话,不同AppId和channelID不同都不能互通
|
|
420
428
|
* - 当入会成功后,会触发远端用户收到 {@link AliRtcEngineEventListener.remoteUserOnLineNotify} 回调
|
|
421
429
|
* - 如果已在会中想重新入会,需要先调用 {@link leaveChannel} 离会,且确保方法执行成功
|
|
422
430
|
* - 用户加入频道后,默认订阅频道内所有其他用户的音视频流,默认推送音视频流到远端,因此将会产生计费,如果想要取消默认订阅可以 {@link joinChannel} 前调用 {@link setDefaultSubscribeAllRemoteAudioStreams} 和 {@link setDefaultSubscribeAllRemoteVideoStreams}
|
|
423
431
|
*/
|
|
424
432
|
joinAIChannel(token: string, channelParam: AliRtcChannelParam, agentParam: AliRtcAIAgentParam): Promise<void>;
|
|
425
433
|
/**
|
|
426
|
-
* 离开频道
|
|
427
|
-
* @
|
|
434
|
+
* @brief 离开频道
|
|
435
|
+
* @details 离开频道时会停止推流和拉流,并释放相关资源。调用该方法后会触发以下行为:
|
|
436
|
+
* - 停止音视频流的推送和订阅
|
|
437
|
+
* - 释放音视频设备资源
|
|
438
|
+
* - 触发远端用户收到 {@link AliRtcEngineEventListener.remoteUserOffLineNotify} 回调
|
|
439
|
+
* @note 如果当前不在频道内,调用 leaveChannel 不会对实例产生任何影响
|
|
440
|
+
* @note 该方法为异步调用,需要等待内部资源释放后才能再次调用 {@link joinChannel}
|
|
428
441
|
*/
|
|
429
442
|
leaveChannel(): Promise<void>;
|
|
430
443
|
/**
|
|
@@ -618,7 +631,7 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
618
631
|
*/
|
|
619
632
|
setScreenShareConfiguration(config: AliRtcScreenShareConfiguration): Promise<void>;
|
|
620
633
|
/**
|
|
621
|
-
* @
|
|
634
|
+
* @brief 设置屏幕流采集内容提示
|
|
622
635
|
* @param contentHint 设置屏幕流内容提示,用于提升在不同内容场景下的视频编码质量 [参考文档](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/contentHint)
|
|
623
636
|
*/
|
|
624
637
|
setScreenShareContentHint(contentHint: string): Promise<void>;
|
|
@@ -635,8 +648,8 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
635
648
|
/**
|
|
636
649
|
* @brief 查询是否设置推送屏幕分享
|
|
637
650
|
* @return
|
|
638
|
-
- true: 已设置推送
|
|
639
|
-
- false: 未设置推送
|
|
651
|
+
* - true: 已设置推送
|
|
652
|
+
* - false: 未设置推送
|
|
640
653
|
* @note SDK默认设置不推送屏幕分享,如果需要推送屏幕共享,可以通过{@link startScreenShare}方法开启屏幕共享推送
|
|
641
654
|
*/
|
|
642
655
|
isScreenSharePublished(): boolean;
|
|
@@ -730,8 +743,8 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
730
743
|
setAudioProfile(profileKey: AudioProfileKey): Promise<void>;
|
|
731
744
|
/**
|
|
732
745
|
* @brief 获取当前用户或远端用户的音频轨道
|
|
733
|
-
* @param {string} userId 远端用户 userId
|
|
734
|
-
* @return {MediaStreamTrack}
|
|
746
|
+
* @param {string} userId 远端用户 userId,不传或为空时返回本地音频轨道
|
|
747
|
+
* @return {Promise<MediaStreamTrack | undefined>} 音频轨道,如果不存在则返回 undefined
|
|
735
748
|
*
|
|
736
749
|
*/
|
|
737
750
|
getAudioTrack(userId?: string): Promise<MediaStreamTrack | undefined>;
|
|
@@ -753,7 +766,7 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
753
766
|
*/
|
|
754
767
|
setCameraCapturerConfiguration(cameraCapturerConfiguration: AliEngineCameraCapturerConfiguration): Promise<void>;
|
|
755
768
|
/**
|
|
756
|
-
* @
|
|
769
|
+
* @brief 设置摄像头采集内容提示
|
|
757
770
|
* @param contentHint 设置视频内容提示,用于提升在不同内容场景下的视频编码质量 [参考文档](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/contentHint)
|
|
758
771
|
*/
|
|
759
772
|
setCameraCapturerContentHint(contentHint: string): Promise<void>;
|
|
@@ -851,9 +864,9 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
851
864
|
*/
|
|
852
865
|
updatePublishLiveStream(streamUrl: string, transcoding: AliRtcLiveTranscodingParam): Promise<any>;
|
|
853
866
|
/**
|
|
854
|
-
* @brief 更新旁路直播相关参数
|
|
867
|
+
* @brief 使用任务ID更新旁路直播相关参数
|
|
855
868
|
* @details SDK提供了更新旁路直播的功能,用于实时更新旁路直播参数
|
|
856
|
-
* @param taskId 任务
|
|
869
|
+
* @param taskId 任务ID,通过 {@link startPublishLiveStream} 返回
|
|
857
870
|
* @param transcoding 推流所需参数, 详细定义见{@link AliRtcLiveTranscodingParam}
|
|
858
871
|
* @return
|
|
859
872
|
* - 0 : 成功
|
|
@@ -869,9 +882,9 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
869
882
|
*/
|
|
870
883
|
stopPublishLiveStream(streamUrl: string): Promise<any>;
|
|
871
884
|
/**
|
|
872
|
-
* @brief 停止旁路直播
|
|
885
|
+
* @brief 使用任务ID停止旁路直播
|
|
873
886
|
* @details SDK提供了停止旁路直播的功能
|
|
874
|
-
* @param taskId 任务
|
|
887
|
+
* @param taskId 任务ID,通过 {@link startPublishLiveStream} 返回
|
|
875
888
|
*/
|
|
876
889
|
stopPublishLiveStreamWithTaskId(taskId: string): Promise<any>;
|
|
877
890
|
/**
|
|
@@ -952,8 +965,9 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
952
965
|
setPluginOption(name: string, option: any): void;
|
|
953
966
|
getPluginByName(name: string): any;
|
|
954
967
|
/**
|
|
955
|
-
* @brief
|
|
968
|
+
* @brief 根据插件名称获取插件内部信息
|
|
956
969
|
* @param name 插件名称,通过 plugin.name 获取
|
|
970
|
+
* @return 插件配置信息,如果插件不存在则返回 undefined
|
|
957
971
|
*/
|
|
958
972
|
getPluginOption(name: string): any;
|
|
959
973
|
/**
|
|
@@ -1010,7 +1024,8 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
1010
1024
|
declare interface AliRtcEngineConfig {
|
|
1011
1025
|
env?: AliRtcEnv;
|
|
1012
1026
|
webTrack?: boolean | AliRtcWebTrackConfig;
|
|
1013
|
-
|
|
1027
|
+
maxSignalingReconnectDuration?: number;
|
|
1028
|
+
parameter?: Parameter;
|
|
1014
1029
|
}
|
|
1015
1030
|
|
|
1016
1031
|
declare interface AliRtcEngineEventListener {
|
|
@@ -1986,7 +2001,8 @@ export declare enum AliRtcPublishState {
|
|
|
1986
2001
|
/** 2: 推流链接建立过程中 */
|
|
1987
2002
|
AliRtcStatePublishing = 2,
|
|
1988
2003
|
/** 3: 推流成功 */
|
|
1989
|
-
AliRtcStatePublished = 3
|
|
2004
|
+
AliRtcStatePublished = 3,
|
|
2005
|
+
AliRtcStateReconnecting = 4
|
|
1990
2006
|
}
|
|
1991
2007
|
|
|
1992
2008
|
export declare enum AliRtcRawDataStreamType {
|
|
@@ -2070,7 +2086,9 @@ export declare enum AliRtcSubscribeState {
|
|
|
2070
2086
|
/** 订阅中 */
|
|
2071
2087
|
AliRtcStateSubscribing = 2,
|
|
2072
2088
|
/** 已订阅 */
|
|
2073
|
-
AliRtcStateSubscribed = 3
|
|
2089
|
+
AliRtcStateSubscribed = 3,
|
|
2090
|
+
/** 重连中 */
|
|
2091
|
+
AliRtcStateReconnecting = 4
|
|
2074
2092
|
}
|
|
2075
2093
|
|
|
2076
2094
|
export declare class AliRtcTranscodingClockWidget {
|
|
@@ -2292,6 +2310,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2292
2310
|
private dcReadyHelper?;
|
|
2293
2311
|
constructor(config: BizControlConfig);
|
|
2294
2312
|
private addSignalingManagerListener;
|
|
2313
|
+
private addRTSListener;
|
|
2295
2314
|
isAutoSubAudio(): boolean;
|
|
2296
2315
|
setAutoSubAudio(value: boolean): void;
|
|
2297
2316
|
isAutoSubVideo(): boolean;
|
|
@@ -2426,6 +2445,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2426
2445
|
declare interface BizControlConfig {
|
|
2427
2446
|
slsReporter: SLSReporter;
|
|
2428
2447
|
signalingManager: SignalingManager;
|
|
2448
|
+
parameter?: Parameter;
|
|
2429
2449
|
}
|
|
2430
2450
|
|
|
2431
2451
|
declare interface BizControlListener {
|
|
@@ -2754,6 +2774,8 @@ declare class LocalUser extends User {
|
|
|
2754
2774
|
* @ignore
|
|
2755
2775
|
*/
|
|
2756
2776
|
static logName: string;
|
|
2777
|
+
sessionId: string;
|
|
2778
|
+
traceId: string;
|
|
2757
2779
|
private _url;
|
|
2758
2780
|
private joinTime;
|
|
2759
2781
|
private publishPromise;
|
|
@@ -2765,10 +2787,8 @@ declare class LocalUser extends User {
|
|
|
2765
2787
|
protected publishId: string;
|
|
2766
2788
|
protected signalingManager: SignalingManager;
|
|
2767
2789
|
private shouldPublish;
|
|
2768
|
-
traceId: string;
|
|
2769
2790
|
private monitorTimerId?;
|
|
2770
2791
|
private monitorDataCache;
|
|
2771
|
-
private trackTraceIdMap;
|
|
2772
2792
|
private candidateDataCache;
|
|
2773
2793
|
private pcMediaStatsMap;
|
|
2774
2794
|
protected slsReporter: SLSReporter;
|
|
@@ -2972,6 +2992,8 @@ declare class LocalUser extends User {
|
|
|
2972
2992
|
video: AliRtcLocalVideoStats[];
|
|
2973
2993
|
candidate: any;
|
|
2974
2994
|
}>;
|
|
2995
|
+
markReconnect(msids?: string[]): void;
|
|
2996
|
+
markReconnected(msids?: string[]): void;
|
|
2975
2997
|
}
|
|
2976
2998
|
|
|
2977
2999
|
declare interface LocalUserConfig {
|
|
@@ -3404,7 +3426,7 @@ declare class RemoteUser extends User {
|
|
|
3404
3426
|
* @ignore
|
|
3405
3427
|
*/
|
|
3406
3428
|
static logName: string;
|
|
3407
|
-
|
|
3429
|
+
remoteCallId: string;
|
|
3408
3430
|
remoteUserInfo: AliRtcRemoteUserInfo;
|
|
3409
3431
|
protected localUser?: LocalUser;
|
|
3410
3432
|
protected lastPubId: string;
|
|
@@ -3439,7 +3461,7 @@ declare class RemoteUser extends User {
|
|
|
3439
3461
|
private parameter;
|
|
3440
3462
|
private monitorTimerId?;
|
|
3441
3463
|
private monitorDataCache;
|
|
3442
|
-
|
|
3464
|
+
traceId: string;
|
|
3443
3465
|
constructor(config: RemoteUserConfig);
|
|
3444
3466
|
get streamUrl(): string;
|
|
3445
3467
|
set streamUrl(value: string);
|
|
@@ -3536,7 +3558,7 @@ declare class RemoteUser extends User {
|
|
|
3536
3558
|
* @param {url} pullStreamUrl
|
|
3537
3559
|
* @returns {Promise<SubscribeResult>}
|
|
3538
3560
|
*/
|
|
3539
|
-
private
|
|
3561
|
+
private subscribeDeleteAllTracks;
|
|
3540
3562
|
private updateStream;
|
|
3541
3563
|
private updateScreenStream;
|
|
3542
3564
|
private clearStream;
|
|
@@ -3545,7 +3567,7 @@ declare class RemoteUser extends User {
|
|
|
3545
3567
|
private onDataChannelError;
|
|
3546
3568
|
private dataChannelConnected;
|
|
3547
3569
|
private subscribeDataChannel;
|
|
3548
|
-
private
|
|
3570
|
+
private subscribeDeleteDataChannel;
|
|
3549
3571
|
getRetryOptions(): RemoteSubscribeOptions | undefined;
|
|
3550
3572
|
/**
|
|
3551
3573
|
* 尝试更新订阅
|
|
@@ -3599,6 +3621,8 @@ declare class RemoteUser extends User {
|
|
|
3599
3621
|
* 停止本地流数据采集
|
|
3600
3622
|
*/
|
|
3601
3623
|
private stopStreamMonitor;
|
|
3624
|
+
markReconnect(msids?: string[]): void;
|
|
3625
|
+
markReconnected(msids?: string[]): void;
|
|
3602
3626
|
}
|
|
3603
3627
|
|
|
3604
3628
|
declare interface RemoteUserConfig {
|
|
@@ -3677,13 +3701,16 @@ declare class RoomServerMessageCenter extends default_2<RoomServerListener> {
|
|
|
3677
3701
|
protected wsClient: Socket;
|
|
3678
3702
|
protected packageCreater: PackageCreater;
|
|
3679
3703
|
protected keepAliveTimer: number;
|
|
3704
|
+
protected lastKeepAliveResponseTime: number;
|
|
3705
|
+
protected maxConnectRetryDuration: number;
|
|
3680
3706
|
protected packageCache: Map<string, ISendPackage>;
|
|
3681
3707
|
protected isFirstConnect: boolean;
|
|
3682
3708
|
protected aliveChecker: number;
|
|
3683
3709
|
protected reconnectData?: ReconnectData;
|
|
3684
3710
|
private joinChannelExtraData?;
|
|
3685
|
-
constructor(authInfo: AliRtcAuthInfo, userName: string, channelProfile: AliRtcSdkChannelProfile, clientRole: AliRtcSdkClientRole, slsReporter: SLSReporter,
|
|
3711
|
+
constructor(authInfo: AliRtcAuthInfo, userName: string, channelProfile: AliRtcSdkChannelProfile, clientRole: AliRtcSdkClientRole, slsReporter: SLSReporter, maxConnectRetryDuration?: number);
|
|
3686
3712
|
get retryCount(): number;
|
|
3713
|
+
destroy(): void;
|
|
3687
3714
|
/**
|
|
3688
3715
|
* 开始连接信令
|
|
3689
3716
|
* @param roomserverurl
|
|
@@ -3774,6 +3801,7 @@ declare class RoomServerMessageCenter extends default_2<RoomServerListener> {
|
|
|
3774
3801
|
*/
|
|
3775
3802
|
protected onClose(event: CloseEvent): void;
|
|
3776
3803
|
protected onKeepAliveRsp(): void;
|
|
3804
|
+
protected onWillReconnect(): void;
|
|
3777
3805
|
protected onReconnectStart(): void;
|
|
3778
3806
|
protected onReconnectFail(): void;
|
|
3779
3807
|
/**
|
|
@@ -3876,7 +3904,7 @@ declare class RoomServerSignaling extends default_2<RoomServerListener> {
|
|
|
3876
3904
|
* @param {AliRtcAuthInfo} authInfo
|
|
3877
3905
|
* @returns
|
|
3878
3906
|
*/
|
|
3879
|
-
join(authInfo: AliRtcAuthInfo, userName: string,
|
|
3907
|
+
join(authInfo: AliRtcAuthInfo, userName: string, maxSignalingReconnectDuration?: number, joinChannelExtraData?: any): Promise<JoinResult>;
|
|
3880
3908
|
/**
|
|
3881
3909
|
* 离开频道
|
|
3882
3910
|
* @returns
|
|
@@ -3932,6 +3960,7 @@ declare class RtsManager extends default_2<RtsManagerEventListener> {
|
|
|
3932
3960
|
private parameter;
|
|
3933
3961
|
preferredPubL1Ip?: string;
|
|
3934
3962
|
preferredSubL1Ip?: string;
|
|
3963
|
+
private traceIdMap;
|
|
3935
3964
|
constructor(localStreamManager: LocalStreamManager, slsReporter: SLSReporter, parameter: Parameter);
|
|
3936
3965
|
private addRTSListener;
|
|
3937
3966
|
/**
|
|
@@ -3959,7 +3988,7 @@ declare class RtsManager extends default_2<RtsManagerEventListener> {
|
|
|
3959
3988
|
waitPublishSender(streamUrl: string, isAudio?: boolean, msid?: string): Promise<any>;
|
|
3960
3989
|
getPublishVideoStats(streamUrl: string, msid?: string): Promise<unknown>;
|
|
3961
3990
|
getPublishAudioStats(streamUrl: string, msid?: string): Promise<unknown>;
|
|
3962
|
-
publishAdd(
|
|
3991
|
+
publishAdd(publisher: LocalUser, stream: LocalStream, extra?: PublishExtraParams, isResume?: boolean, waitSender?: boolean, reason?: PublishReason): Promise<string>;
|
|
3963
3992
|
publishDelete(streamUrl: string, options: PublishOptions): Promise<string>;
|
|
3964
3993
|
publishReplace(streamUrl: string, stream: LocalStream, extra?: PublishExtraParams): Promise<string>;
|
|
3965
3994
|
publishStop(streamUrl: string): Promise<string>;
|
|
@@ -3976,10 +4005,9 @@ declare class RtsManager extends default_2<RtsManagerEventListener> {
|
|
|
3976
4005
|
private httpSubscribe;
|
|
3977
4006
|
private subscribeAdd;
|
|
3978
4007
|
subscribeDelete(subscribeOptions: RemoteSubscribeOptions): Promise<ISubDeleteResult | undefined>;
|
|
3979
|
-
subscribeStop(streamUrl: string): Promise<void>;
|
|
3980
4008
|
subscribeAddDataChannel(streamUrl: string): Promise<any>;
|
|
3981
|
-
|
|
3982
|
-
publish(
|
|
4009
|
+
subscribeDeleteDatachannel(streamUrl: string, datachannel: any): Promise<any>;
|
|
4010
|
+
publish(publisher: LocalUser, isResume?: boolean, reason?: PublishReason): Promise<{
|
|
3983
4011
|
traceId: string;
|
|
3984
4012
|
l1ip?: string;
|
|
3985
4013
|
}>;
|
|
@@ -4002,6 +4030,9 @@ declare interface RtsManagerEventListener {
|
|
|
4002
4030
|
connected: (isReconnected: boolean, type: RtsPeerConnectionType) => {};
|
|
4003
4031
|
subscribeexceeds: () => {};
|
|
4004
4032
|
seimessage: (url: string, payloadType: number, data: ArrayBuffer) => {};
|
|
4033
|
+
traceIdUpdated: (url: string, traceId: string) => {};
|
|
4034
|
+
reconnect: (type: RtsReconnectType, url?: string, msids?: string[]) => {};
|
|
4035
|
+
reconnectFinish: (type: RtsReconnectType, url?: string, msids?: string[]) => {};
|
|
4005
4036
|
}
|
|
4006
4037
|
|
|
4007
4038
|
declare enum RtsPeerConnectionType {
|
|
@@ -4009,6 +4040,8 @@ declare enum RtsPeerConnectionType {
|
|
|
4009
4040
|
SUBSCRIBE = "subscribe"
|
|
4010
4041
|
}
|
|
4011
4042
|
|
|
4043
|
+
declare type RtsReconnectType = 'sub' | 'pub' | 'sub-data' | 'pub-data' | 'pc' | 'all';
|
|
4044
|
+
|
|
4012
4045
|
declare interface SendPackageAuthInfo {
|
|
4013
4046
|
timestamp: number;
|
|
4014
4047
|
nonce?: string;
|
|
@@ -4027,7 +4060,7 @@ declare class SignalingManager extends default_2<RoomServerListener> {
|
|
|
4027
4060
|
protected channelProfile: AliRtcSdkChannelProfile;
|
|
4028
4061
|
protected clientRole: AliRtcSdkClientRole;
|
|
4029
4062
|
protected env: AliRtcEnv;
|
|
4030
|
-
protected
|
|
4063
|
+
protected maxSignalingReconnectDuration?: number;
|
|
4031
4064
|
stsManager: StsManager;
|
|
4032
4065
|
private slsReporter;
|
|
4033
4066
|
constructor(channelProfile: AliRtcSdkChannelProfile, clientRole: AliRtcSdkClientRole, slsReporter: SLSReporter, env?: AliRtcEnv);
|
|
@@ -4037,7 +4070,7 @@ declare class SignalingManager extends default_2<RoomServerListener> {
|
|
|
4037
4070
|
* @param {AliRtcAuthInfo} authInfo
|
|
4038
4071
|
* @returns
|
|
4039
4072
|
*/
|
|
4040
|
-
join(authInfo: AliRtcAuthInfo, userName?: string,
|
|
4073
|
+
join(authInfo: AliRtcAuthInfo, userName?: string, maxSignalingReconnectDuration?: number, timeRecorder?: TimeRecorder, joinChannelExtraData?: any): Promise<JoinResult>;
|
|
4041
4074
|
retryJoin(): void;
|
|
4042
4075
|
/**
|
|
4043
4076
|
* 向业务信令发送离会
|
|
@@ -4217,7 +4250,7 @@ declare class SLSReporter {
|
|
|
4217
4250
|
* @param {string} tid
|
|
4218
4251
|
* @param {number} pubTime
|
|
4219
4252
|
*/
|
|
4220
|
-
reportPublish(isRepublish: boolean, url: string, callid: string, isLargeVideo: boolean, isSmallVideo: boolean, isScreenShare: boolean, isAudio: boolean, result: number | undefined, pcTraceId: string, traceId: string, startTime: number): void;
|
|
4253
|
+
reportPublish(isRepublish: boolean, url: string, callid: string, isLargeVideo: boolean, isSmallVideo: boolean, isScreenShare: boolean, isAudio: boolean, result: number | undefined, pcTraceId: string, traceId: string, startTime: number, time?: number): void;
|
|
4221
4254
|
/**
|
|
4222
4255
|
* 首包上报
|
|
4223
4256
|
* @param {string} callid
|
|
@@ -4250,7 +4283,7 @@ declare class SLSReporter {
|
|
|
4250
4283
|
* @param {string} tid
|
|
4251
4284
|
* @param {number} subTime
|
|
4252
4285
|
*/
|
|
4253
|
-
reportSubscribe(callid: string, remoteid: string, isLargeVideo: boolean, isSmallVideo: boolean, isScreenShare: boolean, isAudio: boolean, result: number, tid: string, subTime: number, logInfo: LogInfo): void;
|
|
4286
|
+
reportSubscribe(callid: string, remoteid: string, isLargeVideo: boolean, isSmallVideo: boolean, isScreenShare: boolean, isAudio: boolean, result: number, tid: string, subTime: number, logInfo: LogInfo, successTime?: number): void;
|
|
4254
4287
|
reportSubscribeFirstPacket(isResume: boolean, callid: string, remoteid: string, trackId: string, logInfo: LogInfo): void;
|
|
4255
4288
|
reportSubscribeFirstFrame(isResume: boolean, callid: string, remoteid: string, trackId: string, logInfo: LogInfo): void;
|
|
4256
4289
|
/**
|
|
@@ -4364,14 +4397,15 @@ declare class Socket extends default_2<SocketListener> {
|
|
|
4364
4397
|
protected socketStatus: CONNECTSTATUS;
|
|
4365
4398
|
protected wsUrl: string;
|
|
4366
4399
|
protected lastConnectStartTime: number;
|
|
4367
|
-
protected
|
|
4400
|
+
protected connectRetryMinTimeGap: number;
|
|
4401
|
+
protected shouldReconnect: boolean;
|
|
4368
4402
|
connectRetryCount: number;
|
|
4369
4403
|
protected gotErr: boolean;
|
|
4370
4404
|
protected closedByInvoke: boolean;
|
|
4371
4405
|
protected isReconnecting: boolean;
|
|
4372
4406
|
protected networkAvailableChecked: boolean;
|
|
4373
4407
|
private reconnectTimeoutId;
|
|
4374
|
-
constructor(
|
|
4408
|
+
constructor(connectRetryMinTimeGap?: number);
|
|
4375
4409
|
get connectUrl(): string;
|
|
4376
4410
|
/**
|
|
4377
4411
|
* 返回websocket连接的状态
|
|
@@ -4391,6 +4425,7 @@ declare class Socket extends default_2<SocketListener> {
|
|
|
4391
4425
|
* 主动断开连接
|
|
4392
4426
|
*/
|
|
4393
4427
|
close(): void;
|
|
4428
|
+
markShouldReconnect(shouldReconnect: boolean): void;
|
|
4394
4429
|
reconnect(): void;
|
|
4395
4430
|
/**
|
|
4396
4431
|
* 连接成功
|
|
@@ -4433,6 +4468,7 @@ declare interface SocketListener {
|
|
|
4433
4468
|
onConnectFail: () => void;
|
|
4434
4469
|
onAuthInvalid: () => void;
|
|
4435
4470
|
onNetworkError: () => void;
|
|
4471
|
+
onWillReconnect: () => void;
|
|
4436
4472
|
onReconnectStart: () => void;
|
|
4437
4473
|
onReconnectFail: (event: Event) => void;
|
|
4438
4474
|
}
|
|
@@ -4539,7 +4575,7 @@ declare class User extends default_2<UserListener> {
|
|
|
4539
4575
|
constructor(userId: string, displayname: string, rtsManager: RtsManager, interval: number);
|
|
4540
4576
|
get userId(): string;
|
|
4541
4577
|
get displayname(): string;
|
|
4542
|
-
protected createCallId(): void;
|
|
4578
|
+
protected createCallId(forceUpdate?: boolean): void;
|
|
4543
4579
|
setUserInfo(uid: string, displayName: string): void;
|
|
4544
4580
|
refreshUserInfo(uid: string): void;
|
|
4545
4581
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aliyun-rtc-sdk",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "rtc web sdk of aliyun",
|
|
6
6
|
"main": "dist/aliyun-rtc-sdk.umd.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@aliyun-sls/web-sts-plugin": "^0.3.5",
|
|
11
11
|
"@aliyun-sls/web-track-browser": "^0.3.5",
|
|
12
12
|
"aliyun-queen-engine": "^6.3.14",
|
|
13
|
-
"aliyun-rts-sdk": "2.13.
|
|
13
|
+
"aliyun-rts-sdk": "2.13.5-beta.0",
|
|
14
14
|
"crypto-js": "^4.1.1",
|
|
15
15
|
"dateformat": "^5.0.3",
|
|
16
16
|
"eventemitter3": "^5.0.1",
|