aliyun-rtc-sdk 6.14.1-beta.0 → 6.14.2-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.
@@ -2395,6 +2395,28 @@ declare enum CodecType {
2395
2395
  UNKNOWN = ""
2396
2396
  }
2397
2397
 
2398
+ declare enum ConnectionLatencyStage {
2399
+ CREATE_ENGINE = "create_engine",
2400
+ JOIN = "join",
2401
+ WANT_INSERT_PUB_TASK = "wantInsertPubTask",
2402
+ INSERT_PUB_TASK = "InsertPubTask",
2403
+ HANDLE_PUB_TASK = "HandlePubTask",
2404
+ RECV_NOTIFY_PUBLISH = "RecvNotifyPublish",
2405
+ INSERT_SUB_TASK = "InsertSubTask",
2406
+ HANDLE_SUB_TASK = "HandleSubTask",
2407
+ FIRST_REMOTE = "first_remote"
2408
+ }
2409
+
2410
+ declare enum ConnectionLatencyStatus {
2411
+ START = "start",
2412
+ SEND_SIG = "send_sig",
2413
+ RECV_RST = "recv_rst",
2414
+ END = "end",
2415
+ RECEIVED = "received",
2416
+ DECODED = "decoded",
2417
+ PLAYED = "played"
2418
+ }
2419
+
2398
2420
  /**
2399
2421
  * websocket链接状态
2400
2422
  */
@@ -2755,6 +2777,8 @@ declare class LocalUser extends User {
2755
2777
  private reportAudioProfile;
2756
2778
  private reportVideoProfile;
2757
2779
  private reportScreenProfile;
2780
+ private updateDataChannel;
2781
+ private publishDataChannel;
2758
2782
  /**
2759
2783
  * 开始推流
2760
2784
  * @param isResume 是否是恢复推流
@@ -2869,6 +2893,8 @@ declare class LogClient {
2869
2893
  protected stsOpt?: any;
2870
2894
  protected slsToken?: SLSSTSToken;
2871
2895
  protected ossToken?: OSSSTSToken;
2896
+ protected ntpClock: NTPClient;
2897
+ constructor();
2872
2898
  private createTracker;
2873
2899
  start(info: AliRtcAuthInfo): void;
2874
2900
  updateToken(slsToken: SLSSTSToken, ossToken?: OSSSTSToken): void;
@@ -2936,6 +2962,14 @@ declare enum MsidType {
2936
2962
  Data = "sophon_data"
2937
2963
  }
2938
2964
 
2965
+ declare class NTPClient {
2966
+ private static instance;
2967
+ private ntpClock;
2968
+ private constructor();
2969
+ static getInstance(): NTPClient;
2970
+ now(): number;
2971
+ }
2972
+
2939
2973
  declare interface OSSSTSToken {
2940
2974
  access_key_id: string;
2941
2975
  access_key_secret: string;
@@ -3392,6 +3426,7 @@ declare class RemoteUser extends User {
3392
3426
  private clearScreenStream;
3393
3427
  private onDataChannelMessage;
3394
3428
  private onDataChannelError;
3429
+ private dataChannelConnected;
3395
3430
  private subscribeDataChannel;
3396
3431
  private subscribeStopDataChannel;
3397
3432
  getRetryOptions(): RemoteSubscribeOptions | undefined;
@@ -3770,6 +3805,7 @@ declare class RtsManager extends default_2<RtsManagerEventListener> {
3770
3805
  private connectionResolve?;
3771
3806
  private connectingPromise?;
3772
3807
  private dcResolve?;
3808
+ private dcReject?;
3773
3809
  private dcConnectingPromise?;
3774
3810
  private _publishingTracks;
3775
3811
  private parameter;
@@ -3826,6 +3862,10 @@ declare class RtsManager extends default_2<RtsManagerEventListener> {
3826
3862
  getSubscribeVideoStats(streamUrl: string, msid?: string): Promise<unknown>;
3827
3863
  getSubscribeAudioStats(streamUrl: string, msid?: string): Promise<unknown>;
3828
3864
  getStreamByMsid(config: any): LocalStream | RemoteStream;
3865
+ getDatachannelByMsid(config: {
3866
+ url: string;
3867
+ msid?: string;
3868
+ }): any;
3829
3869
  getPCStats(): Promise<any>;
3830
3870
  sendSEI(streamUrl: string, data: ArrayBuffer, repeatCount: number, payloadType: number): Promise<void>;
3831
3871
  }
@@ -3987,6 +4027,7 @@ declare class SLSReporter {
3987
4027
  private engine;
3988
4028
  protected logClient: LogClient;
3989
4029
  protected authInfo?: AliRtcAuthInfo;
4030
+ private ntpClock;
3990
4031
  private static staticClient;
3991
4032
  private static getLogClient;
3992
4033
  static reportOSSUpload(sessionId: string, date: string, responseCode?: number): void;
@@ -4123,6 +4164,15 @@ declare class SLSReporter {
4123
4164
  reportSTSResult(code: number, startTs: number): void;
4124
4165
  reportLeaveInvoked(): void;
4125
4166
  reportSEIMessage(payloadType: number, length: number, repeatCount: number, delay: number, isKey: boolean): void;
4167
+ /**
4168
+ * 接通耗时事件(12001)
4169
+ * 用stage和status来区分接通过程中各个时间节点。
4170
+ * @param state
4171
+ * @param status
4172
+ * @param calid
4173
+ * @param tckid
4174
+ */
4175
+ reportConnectionLatencyEvent<Stage extends keyof ValidStatusMap>(stage: Stage, status: ValidStatusMap[Stage], calid: string, tckid: string, tm?: number, ntptm?: number): void;
4126
4176
  /**
4127
4177
  * 日志埋点
4128
4178
  * 在埋点中增加tm字段,表示发生埋点的客户端本地时间
@@ -4389,6 +4439,15 @@ declare interface UserListener {
4389
4439
  remoteDataChannelMessage: (uid: string, message: AliRtcDataChannelMsg) => void;
4390
4440
  }
4391
4441
 
4442
+ declare type ValidStatusMap = {
4443
+ [ConnectionLatencyStage.CREATE_ENGINE]: ConnectionLatencyStatus.START | ConnectionLatencyStatus.END;
4444
+ [ConnectionLatencyStage.JOIN]: ConnectionLatencyStatus.START | ConnectionLatencyStatus.SEND_SIG | ConnectionLatencyStatus.RECV_RST | ConnectionLatencyStatus.END;
4445
+ [ConnectionLatencyStage.FIRST_REMOTE]: ConnectionLatencyStatus.RECEIVED | ConnectionLatencyStatus.DECODED | ConnectionLatencyStatus.PLAYED;
4446
+ [ConnectionLatencyStage.RECV_NOTIFY_PUBLISH]: any;
4447
+ [ConnectionLatencyStage.HANDLE_PUB_TASK]: ConnectionLatencyStatus.START | ConnectionLatencyStatus.END;
4448
+ [ConnectionLatencyStage.HANDLE_SUB_TASK]: ConnectionLatencyStatus.START | ConnectionLatencyStatus.END;
4449
+ };
4450
+
4392
4451
  declare interface VideoScaler {
4393
4452
  getVideoTrack: () => MediaStreamTrack;
4394
4453
  updateOptions: (options: VideoScalerOptions) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aliyun-rtc-sdk",
3
- "version": "6.14.1-beta.0",
3
+ "version": "6.14.2-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.3",
13
- "aliyun-rts-sdk": "^2.11.0-beta.0",
13
+ "aliyun-rts-sdk": "2.12.0-beta.0",
14
14
  "crypto-js": "^4.1.1",
15
15
  "dateformat": "^5.0.3",
16
16
  "eventemitter3": "^5.0.1",