aliyun-rtc-sdk 6.14.5 → 7.0.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.
@@ -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, userName?: string): Promise<void>;
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,10 @@ declare class BizControl extends default_2<BizControlListener> {
2202
2260
  private audioVolumeIndicationInterval;
2203
2261
  private indicationTimer;
2204
2262
  private parameter;
2263
+ private sendReadyMsg;
2264
+ private readyMsgSuccess;
2265
+ private sendReadyMsgTimer?;
2266
+ private startReadyMsgTime?;
2205
2267
  constructor(config: BizControlConfig);
2206
2268
  private addSignalingManagerListener;
2207
2269
  isAutoSubAudio(): boolean;
@@ -2244,13 +2306,15 @@ declare class BizControl extends default_2<BizControlListener> {
2244
2306
  * @private
2245
2307
  */
2246
2308
  private setTimeoutToUpdateAllStreamUrls;
2309
+ private sendReadyMsgLoop;
2310
+ private onCheckReadyMsg;
2247
2311
  /**
2248
2312
  * 登陆成功后初始化用户管理,创建自己
2249
2313
  * @param {AliRtcAuthInfo} authInfo
2250
2314
  * @param {JoinResult} data
2251
2315
  * @returns {Promise<void>}
2252
2316
  */
2253
- init(authInfo: AliRtcAuthInfo, data: JoinResult): void;
2317
+ init(authInfo: AliRtcAuthInfo, data: JoinResult, channelParam: AliRtcChannelParam): void;
2254
2318
  leave(): Promise<void>;
2255
2319
  /**
2256
2320
  * 离会后清除所有数据
@@ -2366,6 +2430,7 @@ declare interface BizControlListener {
2366
2430
  remoteSubscribeError: (error: AliRtcError, uid?: string) => void;
2367
2431
  occurError: (error: AliRtcError, uid?: string) => void;
2368
2432
  remoteDataChannelMessage: (uid: string, message: AliRtcDataChannelMsg) => void;
2433
+ remoteUserSubscribedDataChannel: (uid: string) => void;
2369
2434
  }
2370
2435
 
2371
2436
  declare enum ClientEventType {
@@ -3008,7 +3073,7 @@ declare class PackageCreater {
3008
3073
  * 创建一个用于发送入会消息的Package
3009
3074
  * @returns
3010
3075
  */
3011
- createJoinPackage(): ISendPackage;
3076
+ createJoinPackage(extraData?: any): ISendPackage;
3012
3077
  /**
3013
3078
  * 创建一个用于发送离会消息的Package
3014
3079
  * @returns
@@ -3547,6 +3612,7 @@ declare interface RoomServerListener {
3547
3612
  onReconnectFail: (err: AliRtcError) => void;
3548
3613
  onReconnectSuccess: (users: JoinInfo[]) => void;
3549
3614
  onError: (err: AliRtcError) => void;
3615
+ onUnknownMessage: (response: any) => void;
3550
3616
  }
3551
3617
 
3552
3618
  /**
@@ -3567,13 +3633,15 @@ declare class RoomServerMessageCenter extends default_2<RoomServerListener> {
3567
3633
  protected isFirstConnect: boolean;
3568
3634
  protected aliveChecker: number;
3569
3635
  protected reconnectData?: ReconnectData;
3636
+ private joinChannelExtraData?;
3570
3637
  constructor(authInfo: AliRtcAuthInfo, userName: string, channelProfile: AliRtcSdkChannelProfile, clientRole: AliRtcSdkClientRole, slsReporter: SLSReporter, maxConnectRetryCount?: number);
3571
3638
  get retryCount(): number;
3572
3639
  /**
3573
3640
  * 开始连接信令
3574
3641
  * @param roomserverurl
3642
+ * @param joinChannelExtraData 发送 joinChannel 信令时额外携带的数据
3575
3643
  */
3576
- start(roomserverurl: string): void;
3644
+ start(roomserverurl: string, joinChannelExtraData?: any): void;
3577
3645
  /**
3578
3646
  * 开始心跳计时器,并自动发送心跳包
3579
3647
  */
@@ -3729,6 +3797,7 @@ declare class RoomServerMessageCenter extends default_2<RoomServerListener> {
3729
3797
  * @param {any} response
3730
3798
  */
3731
3799
  protected onBye(response: any): void;
3800
+ protected onUnknownMessage(response: any): void;
3732
3801
  }
3733
3802
 
3734
3803
  declare class RoomServerSignaling extends default_2<RoomServerListener> {
@@ -3759,7 +3828,7 @@ declare class RoomServerSignaling extends default_2<RoomServerListener> {
3759
3828
  * @param {AliRtcAuthInfo} authInfo
3760
3829
  * @returns
3761
3830
  */
3762
- join(authInfo: AliRtcAuthInfo, userName: string, maxConnectRetryCount?: number): Promise<JoinResult>;
3831
+ join(authInfo: AliRtcAuthInfo, userName: string, maxConnectRetryCount?: number, joinChannelExtraData?: any): Promise<JoinResult>;
3763
3832
  /**
3764
3833
  * 离开频道
3765
3834
  * @returns
@@ -3916,7 +3985,7 @@ declare class SignalingManager extends default_2<RoomServerListener> {
3916
3985
  * @param {AliRtcAuthInfo} authInfo
3917
3986
  * @returns
3918
3987
  */
3919
- join(authInfo: AliRtcAuthInfo, userName?: string, maxConnectRetryCount?: number, timeRecorder?: TimeRecorder): Promise<JoinResult>;
3988
+ join(authInfo: AliRtcAuthInfo, userName?: string, maxConnectRetryCount?: number, timeRecorder?: TimeRecorder, joinChannelExtraData?: any): Promise<JoinResult>;
3920
3989
  retryJoin(): void;
3921
3990
  /**
3922
3991
  * 向业务信令发送离会
@@ -4016,6 +4085,7 @@ declare class SignalingManager extends default_2<RoomServerListener> {
4016
4085
  * @param {AliRtcError} err
4017
4086
  */
4018
4087
  protected onError(err: AliRtcError): void;
4088
+ protected onUnknownMessage(message: any): void;
4019
4089
  }
4020
4090
 
4021
4091
  declare interface SignalingResult {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aliyun-rtc-sdk",
3
- "version": "6.14.5",
3
+ "version": "7.0.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.3",
13
- "aliyun-rts-sdk": "^2.12.2",
13
+ "aliyun-rts-sdk": "2.12.3",
14
14
  "crypto-js": "^4.1.1",
15
15
  "dateformat": "^5.0.3",
16
16
  "eventemitter3": "^5.0.1",