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