aliyun-rtc-sdk 6.14.6 → 7.0.0-beta.2
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 +3402 -3271
- package/dist/aliyun-rtc-sdk.umd.js +16 -16
- package/dist/types/index.d.ts +73 -8
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -19,6 +19,17 @@ declare interface AliEngineCameraCapturerConfiguration {
|
|
|
19
19
|
deviceId?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
declare interface AliRtcAIAgentParam {
|
|
23
|
+
/*! ai agent id */
|
|
24
|
+
agentId: string;
|
|
25
|
+
/*! ai agent的区域 */
|
|
26
|
+
region: string;
|
|
27
|
+
/*! 启动ai agent的action */
|
|
28
|
+
action: string;
|
|
29
|
+
/*! 启动ai agent的参数 */
|
|
30
|
+
params: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
declare enum AliRtcAudioTrack {
|
|
23
34
|
/** 无麦克风 */
|
|
24
35
|
AliRtcAudioTrackNo = 0,
|
|
@@ -62,6 +73,17 @@ declare enum AliRtcCameraDirection {
|
|
|
62
73
|
CAMERA_FRONT = 1
|
|
63
74
|
}
|
|
64
75
|
|
|
76
|
+
export declare enum AliRtcCapabilityProfile {
|
|
77
|
+
Default = 0,
|
|
78
|
+
Human = 1,
|
|
79
|
+
Robot = 2
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare type AliRtcChannelParam = {
|
|
83
|
+
userName?: string;
|
|
84
|
+
capabilityProfile?: AliRtcCapabilityProfile;
|
|
85
|
+
};
|
|
86
|
+
|
|
65
87
|
export declare interface AliRtcCheckResult {
|
|
66
88
|
support: boolean;
|
|
67
89
|
detail: {
|
|
@@ -233,6 +255,8 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
233
255
|
private _authInfoExpiredTimer;
|
|
234
256
|
private _serverCheckAuthInfoTimestamp;
|
|
235
257
|
private _localCheckAuthInfoTimestamp;
|
|
258
|
+
private _proxyAiTid;
|
|
259
|
+
private _agentParam;
|
|
236
260
|
constructor(config?: AliRtcEngineConfig);
|
|
237
261
|
/**
|
|
238
262
|
* 获取当前频道号,已经入会成功返回频道号,否则返回undefined
|
|
@@ -366,6 +390,7 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
366
390
|
* ```
|
|
367
391
|
* @param {AliRtcAuthInfo | string} authInfoOrToken (多参数/单参数) 认证信息,从App Server获取。
|
|
368
392
|
* @param {string} userName 任意用于显示的用户名称。不是User ID
|
|
393
|
+
* @param {any} extraData 入会自定义数据
|
|
369
394
|
* @note
|
|
370
395
|
* - 异步接口,方法执行成功则为成功入会
|
|
371
396
|
* - 正常情况一个Appid对应一个App,只有同一个AppId的应用可进行互相童话,不同AppId和channelID不同都不能互通
|
|
@@ -373,7 +398,28 @@ declare class AliRtcEngine_2 extends default_2<AliRtcEngineEventListener> {
|
|
|
373
398
|
* - 如果已在会中想重新入会,需要先调用 {@link leaveChannel} 离会,且确保方法执行成功
|
|
374
399
|
* - 用户加入频道后,默认订阅频道内所有其他用户的音视频流,默认推送音视频流到远端,因此将会产生计费,如果想要取消默认订阅可以 {@link joinChannel} 前调用 {@link setDefaultSubscribeAllRemoteAudioStreams} 和 {@link setDefaultSubscribeAllRemoteVideoStreams}
|
|
375
400
|
*/
|
|
376
|
-
joinChannel(authInfoOrToken: AliRtcAuthInfo | string,
|
|
401
|
+
joinChannel(authInfoOrToken: AliRtcAuthInfo | string, userNameOrParam?: string | AliRtcChannelParam, extraData?: any): Promise<void>;
|
|
402
|
+
/**
|
|
403
|
+
* @brief 加入频道
|
|
404
|
+
* @details 该方法让用户加入频道,一个频道内可以加入多个用户进行互相通话。
|
|
405
|
+
* @details 一般在调用该方法前会根据场景先选择频道模式,通过调用 {@link setChannelProfile} 实现,默认频道模式为通信模式 {@link AliRtcSdkChannelProfile.AliRtcSdkCommunication}
|
|
406
|
+
* ``` javascript
|
|
407
|
+
* // 设置频道为互动模式
|
|
408
|
+
* engine.setChannelProfile(AliRtcSdkChannelProfile.AliRtcInteractiveLive);
|
|
409
|
+
* // 设置角色为主播角色
|
|
410
|
+
* engine.setClientRole(AliRtcSdkClientRole.AliRtcSdkInteractive);
|
|
411
|
+
* ```
|
|
412
|
+
* @param token 认证信息,从App Server获取。
|
|
413
|
+
* @param channelParam 入会参数,详见{@link AliRtcChannelParam}
|
|
414
|
+
* @param agentParam 入会参数,详见{@link AliRtcAIAgentParam}
|
|
415
|
+
* @note
|
|
416
|
+
* - 异步接口,方法执行成功则为成功入会
|
|
417
|
+
* - 正常情况一个AppId对应一个App,只有同一个AppId的应用可进行互相通话,不同AppId和channelID不同都不能互通
|
|
418
|
+
* - 当入会成功后,会触发远端用户收到 {@link AliRtcEngineEventListener.remoteUserOnLineNotify} 回调
|
|
419
|
+
* - 如果已在会中想重新入会,需要先调用 {@link leaveChannel} 离会,且确保方法执行成功
|
|
420
|
+
* - 用户加入频道后,默认订阅频道内所有其他用户的音视频流,默认推送音视频流到远端,因此将会产生计费,如果想要取消默认订阅可以 {@link joinChannel} 前调用 {@link setDefaultSubscribeAllRemoteAudioStreams} 和 {@link setDefaultSubscribeAllRemoteVideoStreams}
|
|
421
|
+
*/
|
|
422
|
+
joinAIChannel(token: string, channelParam: AliRtcChannelParam, agentParam: AliRtcAIAgentParam): Promise<void>;
|
|
377
423
|
/**
|
|
378
424
|
* 离开频道
|
|
379
425
|
* @note 如果当前不在频道内,调用 leaveChannel 不会对实例产生任何影响,但会产生消息,通知频道内其他用户
|
|
@@ -1200,6 +1246,11 @@ declare interface AliRtcEngineEventListener {
|
|
|
1200
1246
|
* @param reason 出错原因,可选
|
|
1201
1247
|
*/
|
|
1202
1248
|
remoteVideoPlayError: (uid: string, reason: string | undefined) => void;
|
|
1249
|
+
/**
|
|
1250
|
+
* 远程用户订阅数据通道
|
|
1251
|
+
* @param uid 用户ID
|
|
1252
|
+
*/
|
|
1253
|
+
remoteUserSubscribedDataChannel: (uid: string) => void;
|
|
1203
1254
|
/**
|
|
1204
1255
|
* rtc 传输数据统计
|
|
1205
1256
|
* @param stats 统计信息
|
|
@@ -1246,6 +1297,13 @@ declare interface AliRtcEngineEventListener {
|
|
|
1246
1297
|
* @param message 消息
|
|
1247
1298
|
*/
|
|
1248
1299
|
dataChannelMsg: (uid: string, message: AliRtcDataChannelMsg) => void;
|
|
1300
|
+
/**
|
|
1301
|
+
* @brief AI agent处理结果
|
|
1302
|
+
* @param code 返回code码
|
|
1303
|
+
* @param action 结果对应的action
|
|
1304
|
+
* @param result 结果
|
|
1305
|
+
*/
|
|
1306
|
+
AIAgentResult: (code: number, action: string, result: string) => void;
|
|
1249
1307
|
}
|
|
1250
1308
|
|
|
1251
1309
|
export declare enum AliRtcEngineLocalDeviceExceptionType {
|
|
@@ -2202,6 +2260,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2202
2260
|
private audioVolumeIndicationInterval;
|
|
2203
2261
|
private indicationTimer;
|
|
2204
2262
|
private parameter;
|
|
2263
|
+
private dcReadyHelper?;
|
|
2205
2264
|
constructor(config: BizControlConfig);
|
|
2206
2265
|
private addSignalingManagerListener;
|
|
2207
2266
|
isAutoSubAudio(): boolean;
|
|
@@ -2250,7 +2309,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2250
2309
|
* @param {JoinResult} data
|
|
2251
2310
|
* @returns {Promise<void>}
|
|
2252
2311
|
*/
|
|
2253
|
-
init(authInfo: AliRtcAuthInfo, data: JoinResult): void;
|
|
2312
|
+
init(authInfo: AliRtcAuthInfo, data: JoinResult, channelParam: AliRtcChannelParam): void;
|
|
2254
2313
|
leave(): Promise<void>;
|
|
2255
2314
|
/**
|
|
2256
2315
|
* 离会后清除所有数据
|
|
@@ -2330,7 +2389,7 @@ declare class BizControl extends default_2<BizControlListener> {
|
|
|
2330
2389
|
setAudioRedEnabled(enable: boolean): void;
|
|
2331
2390
|
setParameter(parameter: string): void;
|
|
2332
2391
|
getParameter(): string;
|
|
2333
|
-
sendDataChannelMessage(message: AliRtcDataChannelMsg):
|
|
2392
|
+
sendDataChannelMessage(message: AliRtcDataChannelMsg): void;
|
|
2334
2393
|
}
|
|
2335
2394
|
|
|
2336
2395
|
declare interface BizControlConfig {
|
|
@@ -2366,6 +2425,7 @@ declare interface BizControlListener {
|
|
|
2366
2425
|
remoteSubscribeError: (error: AliRtcError, uid?: string) => void;
|
|
2367
2426
|
occurError: (error: AliRtcError, uid?: string) => void;
|
|
2368
2427
|
remoteDataChannelMessage: (uid: string, message: AliRtcDataChannelMsg) => void;
|
|
2428
|
+
remoteUserSubscribedDataChannel: (uid: string) => void;
|
|
2369
2429
|
}
|
|
2370
2430
|
|
|
2371
2431
|
declare enum ClientEventType {
|
|
@@ -2864,7 +2924,7 @@ declare class LocalUser extends User {
|
|
|
2864
2924
|
getCurrentMicDeviceId(): string | undefined;
|
|
2865
2925
|
enableAudioVolumeIndication(interval: number): void;
|
|
2866
2926
|
sendSEI(message: ArrayBuffer, repeatCount: number, payloadType: number): Promise<void>;
|
|
2867
|
-
sendDataChannelMessage(message: AliRtcDataChannelMsg):
|
|
2927
|
+
sendDataChannelMessage(message: AliRtcDataChannelMsg): void;
|
|
2868
2928
|
getStats(): Promise<{
|
|
2869
2929
|
audio: AliRtcLocalAudioStats[];
|
|
2870
2930
|
video: AliRtcLocalVideoStats[];
|
|
@@ -3008,7 +3068,7 @@ declare class PackageCreater {
|
|
|
3008
3068
|
* 创建一个用于发送入会消息的Package
|
|
3009
3069
|
* @returns
|
|
3010
3070
|
*/
|
|
3011
|
-
createJoinPackage(): ISendPackage;
|
|
3071
|
+
createJoinPackage(extraData?: any): ISendPackage;
|
|
3012
3072
|
/**
|
|
3013
3073
|
* 创建一个用于发送离会消息的Package
|
|
3014
3074
|
* @returns
|
|
@@ -3547,6 +3607,7 @@ declare interface RoomServerListener {
|
|
|
3547
3607
|
onReconnectFail: (err: AliRtcError) => void;
|
|
3548
3608
|
onReconnectSuccess: (users: JoinInfo[]) => void;
|
|
3549
3609
|
onError: (err: AliRtcError) => void;
|
|
3610
|
+
onUnknownMessage: (response: any) => void;
|
|
3550
3611
|
}
|
|
3551
3612
|
|
|
3552
3613
|
/**
|
|
@@ -3567,13 +3628,15 @@ declare class RoomServerMessageCenter extends default_2<RoomServerListener> {
|
|
|
3567
3628
|
protected isFirstConnect: boolean;
|
|
3568
3629
|
protected aliveChecker: number;
|
|
3569
3630
|
protected reconnectData?: ReconnectData;
|
|
3631
|
+
private joinChannelExtraData?;
|
|
3570
3632
|
constructor(authInfo: AliRtcAuthInfo, userName: string, channelProfile: AliRtcSdkChannelProfile, clientRole: AliRtcSdkClientRole, slsReporter: SLSReporter, maxConnectRetryCount?: number);
|
|
3571
3633
|
get retryCount(): number;
|
|
3572
3634
|
/**
|
|
3573
3635
|
* 开始连接信令
|
|
3574
3636
|
* @param roomserverurl
|
|
3637
|
+
* @param joinChannelExtraData 发送 joinChannel 信令时额外携带的数据
|
|
3575
3638
|
*/
|
|
3576
|
-
start(roomserverurl: string): void;
|
|
3639
|
+
start(roomserverurl: string, joinChannelExtraData?: any): void;
|
|
3577
3640
|
/**
|
|
3578
3641
|
* 开始心跳计时器,并自动发送心跳包
|
|
3579
3642
|
*/
|
|
@@ -3729,6 +3792,7 @@ declare class RoomServerMessageCenter extends default_2<RoomServerListener> {
|
|
|
3729
3792
|
* @param {any} response
|
|
3730
3793
|
*/
|
|
3731
3794
|
protected onBye(response: any): void;
|
|
3795
|
+
protected onUnknownMessage(response: any): void;
|
|
3732
3796
|
}
|
|
3733
3797
|
|
|
3734
3798
|
declare class RoomServerSignaling extends default_2<RoomServerListener> {
|
|
@@ -3759,7 +3823,7 @@ declare class RoomServerSignaling extends default_2<RoomServerListener> {
|
|
|
3759
3823
|
* @param {AliRtcAuthInfo} authInfo
|
|
3760
3824
|
* @returns
|
|
3761
3825
|
*/
|
|
3762
|
-
join(authInfo: AliRtcAuthInfo, userName: string, maxConnectRetryCount?: number): Promise<JoinResult>;
|
|
3826
|
+
join(authInfo: AliRtcAuthInfo, userName: string, maxConnectRetryCount?: number, joinChannelExtraData?: any): Promise<JoinResult>;
|
|
3763
3827
|
/**
|
|
3764
3828
|
* 离开频道
|
|
3765
3829
|
* @returns
|
|
@@ -3916,7 +3980,7 @@ declare class SignalingManager extends default_2<RoomServerListener> {
|
|
|
3916
3980
|
* @param {AliRtcAuthInfo} authInfo
|
|
3917
3981
|
* @returns
|
|
3918
3982
|
*/
|
|
3919
|
-
join(authInfo: AliRtcAuthInfo, userName?: string, maxConnectRetryCount?: number, timeRecorder?: TimeRecorder): Promise<JoinResult>;
|
|
3983
|
+
join(authInfo: AliRtcAuthInfo, userName?: string, maxConnectRetryCount?: number, timeRecorder?: TimeRecorder, joinChannelExtraData?: any): Promise<JoinResult>;
|
|
3920
3984
|
retryJoin(): void;
|
|
3921
3985
|
/**
|
|
3922
3986
|
* 向业务信令发送离会
|
|
@@ -4016,6 +4080,7 @@ declare class SignalingManager extends default_2<RoomServerListener> {
|
|
|
4016
4080
|
* @param {AliRtcError} err
|
|
4017
4081
|
*/
|
|
4018
4082
|
protected onError(err: AliRtcError): void;
|
|
4083
|
+
protected onUnknownMessage(message: any): void;
|
|
4019
4084
|
}
|
|
4020
4085
|
|
|
4021
4086
|
declare interface SignalingResult {
|