quickvo-sdk-js 1.6.72 → 1.6.73

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.
Files changed (43) hide show
  1. package/dist/chunk-BXUcB7os.js +58 -0
  2. package/dist/index.js +16592 -17151
  3. package/dist/index.umd.cjs +4 -4
  4. package/dist/lib-9TnBQie8.js +11083 -0
  5. package/dist/src/action/ActionSFU.d.ts +7 -31
  6. package/dist/src/action/Task.d.ts +3 -27
  7. package/dist/src/base/Base.d.ts +1 -1
  8. package/dist/src/base/modules/Notifys.d.ts +15 -5
  9. package/dist/src/base/modules/Peer.d.ts +12 -8
  10. package/dist/src/base/modules/cws/CallsWebSocket.d.ts +34 -22
  11. package/dist/src/base/modules/cws/CallsWebSocketEvent.d.ts +7 -8
  12. package/dist/src/base/modules/cws/PrWebSocket.d.ts +2 -0
  13. package/dist/src/base/modules/users/Users.d.ts +3 -3
  14. package/dist/src/base/modules/users/modules/RemoteUser.d.ts +1 -1
  15. package/dist/src/base/modules/users/modules/RemoteUserP2P.d.ts +3 -5
  16. package/dist/src/base/modules/users/modules/UserBase.d.ts +14 -2
  17. package/dist/src/base/modules/webmDurationFixWorkerMain.d.ts +2 -0
  18. package/dist/src/enums/eventName.d.ts +4 -4
  19. package/dist/src/enums/mediaType.d.ts +1 -1
  20. package/dist/src/enums/notifyName.d.ts +2 -1
  21. package/dist/src/index.d.ts +0 -4
  22. package/dist/src/protos/gen/{modules/BaseData_pb.d.ts → BaseData_pb.d.ts} +2 -2
  23. package/dist/src/protos/gen/{modules/Room_pb.d.ts → Room_pb.d.ts} +16 -22
  24. package/dist/src/protos/gen/{modules/Rtc_pb.d.ts → Rtc_pb.d.ts} +20 -4
  25. package/dist/src/protos/index.d.ts +3 -4
  26. package/dist/src/protos/protoEvent.d.ts +72 -150
  27. package/dist/src/tools.d.ts +1 -1
  28. package/dist/src/types.d.ts +0 -12
  29. package/dist/src/workers/protos/WorkerCore.d.ts +8 -0
  30. package/dist/src/workers/protos/index.d.ts +10 -0
  31. package/dist/src/workers/protos/types.d.ts +8 -0
  32. package/package.json +6 -5
  33. package/dist/chunk-763Ozoio.js +0 -57
  34. package/dist/index.d.ts +0 -2
  35. package/dist/lib-BMLdj_6t.js +0 -11058
  36. package/dist/src/QuickVO.d.ts +0 -85
  37. package/dist/src/base/modules/cws/quickvoCodecWorkerMain.d.ts +0 -6
  38. package/dist/src/base/modules/notifyPayloadMap.d.ts +0 -119
  39. package/dist/src/protos/protoCodec.d.ts +0 -19
  40. package/dist/src/workers/cwsCodec/CwsCodecCore.d.ts +0 -7
  41. package/dist/src/workers/cwsCodec/CwsCodecWorker.d.ts +0 -15
  42. package/dist/src/workers/cwsCodec/type.d.ts +0 -33
  43. /package/dist/src/workers/{cwsCodec/cwsCodec.worker.d.ts → protos/protos.worker.d.ts} +0 -0
@@ -24,10 +24,7 @@ export declare class ActionSFU {
24
24
  private _syncRoomInfoTask;
25
25
  private _restorePeerTask;
26
26
  private _quitRoomTask;
27
- /** 串行化 joinRoom,避免并发进房互相覆盖 config / 用户列表 / 连接状态 */
28
- private _joinRoomSerial;
29
- /** 合并同一宏任务内多次 _autoCheckSubscribe 触发 */
30
- private _autoCheckSubscribeCoalesce;
27
+ private _lastUpdateNetworkTime;
31
28
  constructor({ base }: {
32
29
  base: Base;
33
30
  });
@@ -78,14 +75,14 @@ export declare class ActionSFU {
78
75
  * @param usersMediaTypes: UserMediaTypes[] = [] 不传入订阅所有
79
76
  * @example quickvo.subscribe([{ userId: '123', mediaTypes: ['mc_audio', 'mc_video'] }])
80
77
  */
81
- subscribe: (usersMediaTypes?: UserMediaTypes[]) => Promise<true>;
78
+ subscribe: (usersMediaTypes?: UserMediaTypes[]) => Promise<true | undefined>;
82
79
  /**
83
80
  * stopSubscribe
84
81
  * @param usersMediaTypes: UserMediaTypes[] = [] 不传入取消订阅所有
85
82
  * @example quickvo.stopSubscribe([{ userId: '123', mediaTypes: ['mc_audio', 'mc_video'] }])
86
83
  * @returns Promise<boolean>
87
84
  */
88
- stopSubscribe: (usersMediaTypes?: UserMediaTypes[]) => Promise<true>;
85
+ stopSubscribe: (usersMediaTypes?: UserMediaTypes[]) => Promise<true | undefined>;
89
86
  /**
90
87
  * quitRoom
91
88
  * @example quickvo.quitRoom()
@@ -105,7 +102,7 @@ export declare class ActionSFU {
105
102
  setBehaviors: (usersBehaviors: Array<{
106
103
  id: string;
107
104
  behaviors: { [key in K_mediaType]?: boolean; };
108
- }>) => Promise<import('../protos/protoEvent').MessageRspCore<"preventUsersBehavior">>;
105
+ }>) => Promise<import('../protos/protoEvent').MessageRsp<"preventUsersBehavior">>;
109
106
  /**
110
107
  * toggleRoomSpeechLang
111
108
  * @param data { input: string; output: string; translateEnable?: boolean }
@@ -128,42 +125,21 @@ export declare class ActionSFU {
128
125
  * destroy
129
126
  */
130
127
  destroy: () => Promise<void>;
131
- private _scheduleAutoCheckSubscribe;
132
- private _waitPeerThenSubscribeTask;
133
128
  private _clearTask;
134
129
  private _clear;
135
130
  private _connectCws;
136
- /** joinRoom 专用:已 OPEN 则跳过;否则最多 3 次建连,单次超时 10s,均失败则 throw */
137
- private static _JOIN_ROOM_WS_ATTEMPTS;
138
- private static _JOIN_ROOM_WS_TIMEOUT_MS;
139
- private _ensureWebSocketBeforeJoinRoom;
140
- /**
141
- * SFU Peer 建连:最多 3 次 `_connectCF`;单次信令(genTurnAddress / publish)超时 10s;ICE 等待 10s(见 `_connectCF` 内 `peerConnected`)。
142
- * 用于进房与 disconnected→closed 后的 `_restorePeer`。
143
- */
144
- private static _RTC_RECOVERY_ATTEMPTS;
145
- private static _RTC_RECOVERY_CWS_TIMEOUT_MS;
146
- private _connectCFWithRecoveryRetries;
147
- private _ensureWebRtcForJoinRoom;
148
131
  private _initHeartbeat;
149
132
  /** 向服务端拉取 TURN/STUN 配置;失败或未返回有效 iceServers 时返回 undefined,由 Peer 回退默认 STUN */
150
133
  private _fetchGenTurnAddress;
151
- private _cancelTurnRefreshSchedule;
152
- /**
153
- * 按 `peer.turnExpiresAtMs` 在过期前 60s 触发:拉新 TURN 并通过 `RTCPeerConnection.setConfiguration` 更新(不重建 PC)。
154
- * 无有效过期时间(仅 STUN 等)时不调度。
155
- */
156
- private _scheduleTurnRefreshBeforeExpiry;
157
134
  private _refreshTurnViaSetConfiguration;
158
135
  private _connectCF;
159
136
  private _reportNetwork;
160
137
  private _createTracks;
161
138
  private _closeTrack;
162
139
  private _pubNotify;
140
+ private _submitRtcStats;
163
141
  private _renegotiate;
164
142
  private _ackMsg;
165
- private _acquireJoinRoomSerial;
166
- private _joinRoomExecute;
167
143
  private _autoCheckSubscribe;
168
144
  private _onRemoteUsersQuitRoom;
169
145
  private _notifySelfCallAction;
@@ -173,8 +149,8 @@ export declare class ActionSFU {
173
149
  private _syncRoomInfo;
174
150
  private _restorePeer;
175
151
  private _pubChannel;
176
- private _subChannel;
177
- private _initChannel;
152
+ private _closeChannel;
153
+ private _checkAndSubChannel;
178
154
  private _emitSelfNetworkQualityChange;
179
155
  _restoreRoom: () => Promise<void>;
180
156
  }
@@ -1,40 +1,16 @@
1
- export type TaskExeOptions = {
2
- /**
3
- * 默认 true:防抖结束后执行 fn,用其返回值 resolve,异常则 reject。
4
- * false:仅调用 fn,由 fn 内部通过 task.resolve / task.reject 结束(如订阅队列回调)。
5
- */
6
- settle?: boolean;
7
- };
8
- /**
9
- * 异步任务与防抖:constructor(debounceMs) 防抖毫秒数,默认 0。
10
- * 多次 exe 会重置防抖;若需放弃上一轮可先判断 state === 'waiting' 再 clear()。
11
- */
12
1
  export declare class Task<R = true> {
13
2
  private readonly debounceMs;
14
3
  private timer?;
15
- /** 每次调度 / 清理 / 手动 settle 递增,用于丢弃过期的 setTimeout / microtask */
16
- private scheduleGen;
17
4
  state: 'ready' | 'waiting';
18
5
  promise?: Promise<R>;
19
6
  private _resolve?;
20
7
  private _reject?;
21
8
  private pendingFn?;
22
- private pendingSettle;
23
9
  constructor(debounceMs?: number);
24
- /** ready 进入 waiting 并创建 promise(不启动防抖);用于 debounce 前仍需 await 其它逻辑的场景 */
25
- begin(): Promise<R>;
26
- /**
27
- * 注册待执行函数:在防抖时间结束后执行。
28
- * 若当前为 ready,会先 begin;若已在 waiting,会复用同一 promise 并重置防抖(尾触发)。
29
- */
30
- exe(fn: () => unknown | Promise<unknown>, options?: TaskExeOptions): Promise<R>;
31
- /**
32
- * 典型用于 publish:先 begin 占位,再 await prepare(如补本地流),最后对 fn 做防抖调度。
33
- */
34
- beginPrepareThenExe(prepare: () => void | Promise<void>, fn: () => unknown | Promise<unknown>): Promise<R>;
10
+ begin: () => void;
11
+ exe: (fn: () => unknown | Promise<unknown>) => Promise<R>;
35
12
  private _runFlush;
36
- resolve: (value: R) => void;
13
+ resolve: (value: any) => void;
37
14
  reject: (error: unknown) => void;
38
- /** SDK 内部清理:取消待执行的防抖,并以 resolve 结束,避免对外 Promise rejection */
39
15
  clear: () => void;
40
16
  }
@@ -57,7 +57,7 @@ export declare class Base {
57
57
  mediaTypes: K_mediaType[];
58
58
  desc?: string;
59
59
  connectedTime?: string;
60
- }) => Promise<import('../protos/protoEvent').MessageRspCore<"reportP2PConnectEx">> | undefined;
60
+ }) => Promise<import('../protos/protoEvent').MessageRsp<"reportP2PConnectEx">> | undefined;
61
61
  _reportLog: (_type: Report_Log_Type, describe?: string) => void;
62
62
  }
63
63
  export {};
@@ -1,12 +1,21 @@
1
- import { K_quickvoNotifyName, NotifyPayloadMap, QuickvoNotify } from './notifyPayloadMap';
2
- export type { K_quickvoNotifyName, NotifyPayloadMap, QuickvoNotify, NotifyEmitPayloadFor, NotifyEmitPayloadUnion } from './notifyPayloadMap';
3
- export { defineQuickvoNotify } from './notifyPayloadMap';
1
+ import { K_notifyName as _K_notifyName } from '../../enums';
2
+ type K_notifyName = _K_notifyName | 'onRoomState' | 'onPeerState' | 'onLog' | 'onDevicechange' | 'onRoomUsers' | 'onRoomNetwork';
3
+ export interface MessageNotifys {
4
+ code: number;
5
+ desc: string;
6
+ data: any;
7
+ }
8
+ interface QuickvoNotify {
9
+ event: K_notifyName;
10
+ callback: Function;
11
+ sn?: string;
12
+ }
4
13
  export declare class Notifys {
5
- queue: Map<K_quickvoNotifyName, QuickvoNotify[]>;
14
+ queue: Map<K_notifyName, QuickvoNotify[]>;
6
15
  /**
7
16
  * 派发广播事件(第二参类型随 event 变化)
8
17
  */
9
- emit: <E extends K_quickvoNotifyName>(event: E, result: NotifyPayloadMap[E]) => void;
18
+ emit: <E extends K_notifyName>(event: E, result: MessageNotifys) => void;
10
19
  /**
11
20
  * 添加广播
12
21
  * @param notify
@@ -14,3 +23,4 @@ export declare class Notifys {
14
23
  */
15
24
  add: (notify: QuickvoNotify) => string;
16
25
  }
26
+ export {};
@@ -1,17 +1,15 @@
1
1
  import { K_mediaType } from '../../enums/mediaType';
2
- import { TurnUrlsResponse } from '../../protos/gen/modules/Room_pb';
2
+ import { TurnUrlsResponse } from '../../protos/gen/Room_pb';
3
3
  import { Config } from './Config';
4
4
  import { Users } from './users/Users';
5
5
  import { PrResolves } from './PrResolves';
6
- import { K_eventName } from '../../enums';
7
- import { SendMessageFormat } from '../../protos/protoEvent';
8
6
  interface On {
9
7
  state?: (_state: RTCPeerConnectionState) => void;
10
8
  }
11
9
  export declare class Peer {
12
10
  config: Config;
13
11
  users: Users;
14
- prResolves: PrResolves<"peerConnected" | "isOpenlocalChannel">;
12
+ prResolves: PrResolves<"peerConnected">;
15
13
  pc: RTCPeerConnection;
16
14
  initTime: number;
17
15
  transceiverMap: Map<"mc_audio" | "mc_video" | "ss_video" | "ss_audio", RTCRtpTransceiver>;
@@ -25,12 +23,11 @@ export declare class Peer {
25
23
  simulcast: 'f' | 'h' | 'q';
26
24
  /** 当前 SFU 连接使用的 TURN 配置过期时间(毫秒,来自 genTurnAddress.expiresAt) */
27
25
  turnExpiresAtMs?: number;
28
- localChannel?: RTCDataChannel;
29
- remoteChannels: Map<string, RTCDataChannel>;
26
+ channels: Map<string, RTCDataChannel>;
27
+ _channelDebug: boolean;
30
28
  on: On;
31
29
  waitings: {
32
30
  peerConnected: () => Promise<unknown>;
33
- isOpenlocalChannel: () => Promise<unknown>;
34
31
  };
35
32
  constructor({ config, users }: {
36
33
  config: Config;
@@ -51,9 +48,16 @@ export declare class Peer {
51
48
  * TURN 凭证将过期时:不销毁 PC,仅 `setConfiguration` 更新 ICE(与 init 同源),并尽量 `restartIce` 以用新 relay。
52
49
  */
53
50
  setTurnConfiguration: (turnRsp?: TurnUrlsResponse) => void;
54
- localChannelSend: <T extends K_eventName>(message: Pick<SendMessageFormat<T>, "event" | "data"> & Partial<Omit<SendMessageFormat<T>, "event" | "data">>) => Promise<void>;
51
+ localChannelSend: (data: any) => Promise<void>;
55
52
  addLocalUserChannel: (id?: number) => void;
56
53
  addRemoteUserChannel: (userId: string, id?: number) => void;
54
+ clearChannels: (ids?: string[]) => {
55
+ userId: string;
56
+ channels: {
57
+ id?: number;
58
+ dataChannelName: string;
59
+ }[];
60
+ }[];
57
61
  close: () => void;
58
62
  addSenders: (mediaTypes: K_mediaType[]) => Promise<("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[]>;
59
63
  syncSenderStreamTrack: (mediaTypes: K_mediaType[]) => Promise<void>;
@@ -1,35 +1,47 @@
1
1
  import { K_eventName } from '../../../enums/eventName';
2
- import { CallsWebSocketOn } from '../../../protos/protoEvent';
3
2
  import { Options, CallsWebSocketEvent } from './CallsWebSocketEvent';
4
3
  import { Config } from '../Config';
5
4
  import { PrWebSocket } from './PrWebSocket';
6
- export type { CallsWebSocketOn };
7
- /**
8
- * 从 IndexedDB 读取 `#quickvo.logs` 并触发浏览器下载 JSON 文件(控制台可执行 `getQVLogs()`)。
9
- */
10
- export declare function getQVLogs(): Promise<void>;
11
- export interface CallsWebSocketOptions {
12
- /**
13
- * websocket服务地址
14
- */
15
- url?: string;
16
- /**
17
- * 超时时间
18
- */
19
- timeout?: number;
20
- /**
21
- * 开启后会在控制台显示相关操作日志 默认为false
22
- */
23
- debug?: boolean;
24
- }
5
+ import { WorkerProtos } from '../../../workers/protos';
6
+ import { MessageNotifys } from '../../../protos/protoEvent';
25
7
  type EventsItems = Map<number, CallsWebSocketEvent<any>>;
26
8
  type Events = Map<K_eventName, EventsItems>;
9
+ interface On {
10
+ state?: (state: 'connecting' | 'connected' | 'reconnecting' | 'closed') => void;
11
+ log?: (e: unknown) => void;
12
+ onJoinRoom?: (e: MessageNotifys<'onJoinRoom'>) => void;
13
+ onJoinRoomBatch?: (e: MessageNotifys<'onJoinRoomBatch'>) => void;
14
+ onQuitRoom?: (e: MessageNotifys<'onQuitRoom'>) => void;
15
+ onQuitRoomBatch?: (e: MessageNotifys<'onQuitRoomBatch'>) => void;
16
+ onPublish?: (e: MessageNotifys<'onPublish'>) => void;
17
+ onDataChannelPublish?: (e: MessageNotifys<'onDataChannelPublish'>) => void;
18
+ onCloseTrack?: (e: MessageNotifys<'onCloseTrack'>) => void;
19
+ onTrackInactive?: (e: MessageNotifys<'onTrackInactive'>) => void;
20
+ onUpdatePermissions?: (e: MessageNotifys<'onUpdatePermissions'>) => void;
21
+ onUpdatePermissionsBatch?: (e: MessageNotifys<'onUpdatePermissionsBatch'>) => void;
22
+ onUpdateBehavior?: (e: MessageNotifys<'onUpdateBehavior'>) => void;
23
+ onRoomActionChange?: (e: MessageNotifys<'onRoomActionChange'>) => void;
24
+ onMeetSpecialRolesChange?: (e: MessageNotifys<'onMeetSpecialRolesChange'>) => void;
25
+ onUpdateCall?: (e: MessageNotifys<'onUpdateCall'>) => void;
26
+ onRoomUserSpeech?: (e: MessageNotifys<'onRoomUserSpeech'>) => void;
27
+ onBeforeTokenExpire?: (e: MessageNotifys<'onBeforeTokenExpire'>) => void;
28
+ onTokenExpired?: (e: MessageNotifys<'onTokenExpired'>) => void;
29
+ onCDNPlayUrlAdd?: (e: MessageNotifys<'onCDNPlayUrlAdd'>) => void;
30
+ onNetQuality?: (e: MessageNotifys<'onNetQuality'>) => void;
31
+ onOffer?: (e: MessageNotifys<'onOffer'>) => void;
32
+ onAnswer?: (e: MessageNotifys<'onAnswer'>) => void;
33
+ onCandidate?: (e: MessageNotifys<'onCandidate'>) => void;
34
+ onAttemptP2PEx?: (e: MessageNotifys<'onAttemptP2PEx'>) => void;
35
+ onRtcStats?: (e: MessageNotifys<'onRtcStats'>) => void;
36
+ onDisconnectedP2P?: (e: MessageNotifys<'onDisconnectedP2P'>) => void;
37
+ }
27
38
  export declare class CallsWebSocket {
28
39
  config: Config;
29
40
  timeout: number;
30
41
  prws: PrWebSocket;
42
+ workerProtos: WorkerProtos;
31
43
  events: Events;
32
- on: CallsWebSocketOn;
44
+ on: On;
33
45
  /** 日志写入节流:先入内存缓冲,定时批量写 IndexedDB(structured clone 可保留 BigInt) */
34
46
  private _logBuffer;
35
47
  private _logFlushTimer;
@@ -45,8 +57,8 @@ export declare class CallsWebSocket {
45
57
  createRequest: <T extends K_eventName>(eventName: T, options?: Options) => CallsWebSocketEvent<T>;
46
58
  hasEvent: (eventName: K_eventName) => boolean;
47
59
  clearEvents: () => void;
48
- private _dispatchCwsDecodedMessage;
49
60
  retryEvents: () => Promise<void>;
50
61
  private _updateLogs;
51
62
  private _flushLogs;
52
63
  }
64
+ export {};
@@ -1,9 +1,9 @@
1
1
  import { K_eventName } from '../../../enums/eventName';
2
- import { MessageReq, MessageRsp, MessageRspCore } from '../../../protos/protoEvent';
2
+ import { MessageReq, MessageRsp } from '../../../protos/protoEvent';
3
3
  import { PrWebSocket } from './PrWebSocket';
4
4
  export interface Options {
5
5
  /**
6
- * 超时时间 默认10s
6
+ * 超时时间 默认30s
7
7
  */
8
8
  timeout?: number;
9
9
  /**
@@ -14,23 +14,22 @@ export interface Options {
14
14
  export declare class CallsWebSocketEvent<T extends K_eventName> {
15
15
  eventName: K_eventName;
16
16
  prws: PrWebSocket;
17
- message?: MessageReq<T>;
17
+ message?: any;
18
18
  needRetry: boolean;
19
19
  sn: number;
20
- _resolve: (_value: MessageRspCore<T>) => void;
20
+ _resolve: (_value: MessageRsp<T>) => void;
21
21
  _reject: (_reason?: unknown) => void;
22
- sendBefore?: (_message: MessageReq<T>) => void;
23
- sendAfter?: () => void;
22
+ sender?: (_message: any) => void;
24
23
  options: {
25
24
  timeout: number;
26
25
  onBack: boolean;
27
26
  };
28
27
  timer: number;
29
28
  constructor(eventName: T, prws: PrWebSocket, options?: Options);
30
- resolve: (_value: MessageRspCore<T> & Partial<Pick<MessageRsp<T>, "time">>) => void;
29
+ resolve: (_value: MessageRsp<T>) => void;
31
30
  reject: (_reason?: unknown) => void;
32
31
  retry: () => void;
33
- send: (req_message: Pick<MessageReq<T>, "data" | "compress" | "version">) => Promise<MessageRspCore<T>>;
32
+ send: (req_message: Partial<MessageReq<T>> & Pick<MessageReq<T>, "data">) => Promise<MessageRsp<T>>;
34
33
  private sendMsg;
35
34
  private _createTimer;
36
35
  destroy: () => void;
@@ -20,6 +20,8 @@ export declare class PrWebSocket {
20
20
  activeTimeStamp: number;
21
21
  on: On;
22
22
  getUrl: () => string;
23
+ /** 递增后可使尚未触发的 connect 超时回调不再对当前 socket 调用 close(避免误关下一次建连) */
24
+ private _connectGen;
23
25
  constructor();
24
26
  connect: () => Promise<number>;
25
27
  /**
@@ -1,6 +1,6 @@
1
1
  import { K_mediaType } from '../../../enums/mediaType';
2
2
  import { UserMediaTypes, UserTrack } from '../../../types';
3
- import { User as ProtoUser } from '../../../protos/gen/modules/Room_pb';
3
+ import { User as ProtoUser } from '../../../protos/gen/Room_pb';
4
4
  import { Config } from '../Config';
5
5
  import { LocalMedias } from '../LocalMedias';
6
6
  import { Notifys } from '../Notifys';
@@ -159,7 +159,7 @@ export declare class Users {
159
159
  }[];
160
160
  p2p_mediaTypes: ("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[];
161
161
  }[];
162
- emitUsersChange: () => void;
162
+ emitUsersChange: (force?: boolean) => void;
163
163
  /**
164
164
  * getMaxVolumeUser
165
165
  */
@@ -220,7 +220,7 @@ export declare class Users {
220
220
  mids: string[];
221
221
  }[];
222
222
  updateUsersIsAdmin: (adminIds?: string[]) => void;
223
- initUsers: (users: ProtoUser[], clear: boolean) => void;
223
+ initUsers: (users: ProtoUser[]) => void;
224
224
  clearRemoteUsers: () => void;
225
225
  createRemoteUserP2P: (userId: string) => RemoteUserP2P;
226
226
  syncRemoteUserP2PSenderStreamTrack: (mediaTypes: K_mediaType[]) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { UserBase } from './UserBase';
2
2
  import { K_mediaType } from '../../../../enums/mediaType';
3
- import { RtcStatsData } from '../../../../protos/gen/modules/Rtc_pb';
3
+ import { RtcStatsData } from '../../../../protos/gen/Rtc_pb';
4
4
  import { LocalMedias } from '../../LocalMedias';
5
5
  import { RemoteUserP2P } from './RemoteUserP2P';
6
6
  import { Config } from '../../Config';
@@ -1,8 +1,6 @@
1
1
  import { PrResolves } from '../../PrResolves';
2
- import { SendMessageFormat } from '../../../../protos/protoEvent';
3
- import { RtcTrack } from '../../../../protos/gen/modules/Rtc_pb';
4
- import { Track } from '../../../../protos/gen/modules/Room_pb';
5
- import { K_eventName } from '../../../../enums/eventName';
2
+ import { RtcTrack } from '../../../../protos/gen/Rtc_pb';
3
+ import { Track } from '../../../../protos/gen/Room_pb';
6
4
  import { K_mediaType } from '../../../../enums/mediaType';
7
5
  import { Config } from '../../Config';
8
6
  export interface MediaTypeTransceiver {
@@ -45,7 +43,7 @@ export declare class RemoteUserP2P {
45
43
  config: Config;
46
44
  remoteUserId: string;
47
45
  });
48
- remoteChannelSend: <T extends K_eventName>(message: Pick<SendMessageFormat<T>, "event" | "data"> & Partial<Omit<SendMessageFormat<T>, "event" | "data">>) => Promise<void>;
46
+ remoteChannelSend: (tracks: RtcTrack[]) => Promise<void>;
49
47
  init: () => void;
50
48
  getSenderTrack: (mediaType: K_mediaType) => MediaStreamTrack | null | undefined;
51
49
  getRecvierTrack: (mediaType: K_mediaType) => MediaStreamTrack | undefined;
@@ -28,6 +28,13 @@ export declare class UserBase {
28
28
  tracks: {
29
29
  [key in K_mediaType]?: UserTrack;
30
30
  };
31
+ /**
32
+ * 数据通道
33
+ */
34
+ channels: Array<{
35
+ id?: number;
36
+ dataChannelName: string;
37
+ }>;
31
38
  /**
32
39
  * 网络情况
33
40
  */
@@ -70,9 +77,10 @@ export declare class UserBase {
70
77
  streams: {
71
78
  [key in K_mediaType]: MediaStream;
72
79
  };
73
- constructor({ config, localMedias }: {
80
+ constructor({ config, localMedias, notEmpty }: {
74
81
  config: Config;
75
82
  localMedias: LocalMedias;
83
+ notEmpty: boolean;
76
84
  });
77
85
  setMute: (mediaTypes: K_mediaType[], mute: boolean) => void;
78
86
  updateCallAction: (callAction: number) => void;
@@ -86,7 +94,11 @@ export declare class UserBase {
86
94
  type?: number;
87
95
  trackName?: string;
88
96
  mid?: string;
89
- }>, clear?: boolean) => void;
97
+ }>) => void;
98
+ updateChannels: (channels: Array<{
99
+ id?: number;
100
+ dataChannelName: string;
101
+ }>) => void;
90
102
  getTrack: (mediaType: K_mediaType) => UserTrack | undefined;
91
103
  getTracks: (mediaTypes: K_mediaType[]) => UserTrack[];
92
104
  removeTracks: (mediaTypes: K_mediaType[]) => UserTrack[];
@@ -4,3 +4,5 @@
4
4
  export declare function fixWebmDurationInWorker(buffer: ArrayBuffer, mimeType: string): Promise<Blob>;
5
5
  /** 终止 WebM 修复 Worker;`QuickVO.destroy` 时应调用。 */
6
6
  export declare function destroyWebmFixWorker(): void;
7
+ /** 新 SDK 实例允许再次使用 WebM Worker(与模块级单例对齐)。 */
8
+ export declare function resetWebmFixWorkerAfterNewClient(): void;
@@ -11,10 +11,9 @@ export declare const enum_eventName: {
11
11
  readonly joinRoomEx: "加入房间(提前建连)";
12
12
  readonly pubNotify: "广播已发布的轨道";
13
13
  readonly subscribe: "订阅流";
14
- /** Room.proto ChannelPublishReq / ChannelPublishRsq:发布房间 DataChannel */
15
14
  readonly pubChannel: "发布DataChannel";
16
- /** Room.proto ChannelSubscribeReq / ChannelSubscribeRsq:订阅他人 DataChannel */
17
15
  readonly subChannel: "订阅DataChannel";
16
+ readonly closeChannel: "关闭DataChannel";
18
17
  readonly renegotiate: "协商流";
19
18
  readonly closeTrack: "关闭轨道";
20
19
  readonly preventUsersBehavior: "阻止用户行为";
@@ -33,7 +32,8 @@ export declare const enum_eventName: {
33
32
  readonly debugger: "调试";
34
33
  readonly ai: "WorkerAi调试";
35
34
  readonly UpdateTrackActive: "p2p轨道状态";
36
- readonly RtcStatsData: "客户端rtc网络质量";
35
+ readonly rtcStats: "客户端rtc网络质量";
36
+ readonly RtcStats: "客户端rtc网络质量";
37
37
  };
38
38
  export type T_eventName = typeof enum_eventName;
39
39
  export type K_eventName = keyof T_eventName;
@@ -43,4 +43,4 @@ export declare const eventName_options: {
43
43
  label: any;
44
44
  }[];
45
45
  export declare const eventName_keys: (keyof typeof enum_eventName)[];
46
- export declare const eventName_vals: ("关闭轨道" | "心跳" | "慢心跳" | "确认收到消息" | "上报网络类型" | "连接CF" | "获取TURN地址" | "发布流" | "加入房间" | "加入房间(提前建连)" | "广播已发布的轨道" | "订阅流" | "发布DataChannel" | "订阅DataChannel" | "协商流" | "阻止用户行为" | "更新网络状态" | "更新通话状态" | "切换大小流" | "切换房间语音识别" | "同步房间" | "更新房间SDKTOKEN" | "发送P2P-offer" | "回应P2P-answer" | "发送P2P候选信息-candidate" | "上报P2P连接结果" | "退出房间" | "退出房间不断开连接" | "调试" | "WorkerAi调试" | "p2p轨道状态" | "客户端rtc网络质量")[];
46
+ export declare const eventName_vals: ("心跳" | "慢心跳" | "确认收到消息" | "上报网络类型" | "连接CF" | "获取TURN地址" | "发布流" | "加入房间" | "加入房间(提前建连)" | "广播已发布的轨道" | "订阅流" | "发布DataChannel" | "订阅DataChannel" | "关闭DataChannel" | "协商流" | "关闭轨道" | "阻止用户行为" | "更新网络状态" | "更新通话状态" | "切换大小流" | "切换房间语音识别" | "同步房间" | "更新房间SDKTOKEN" | "发送P2P-offer" | "回应P2P-answer" | "发送P2P候选信息-candidate" | "上报P2P连接结果" | "退出房间" | "退出房间不断开连接" | "调试" | "WorkerAi调试" | "p2p轨道状态" | "客户端rtc网络质量")[];
@@ -1,4 +1,4 @@
1
- import { TrackType } from '../protos/gen/modules/Room_pb';
1
+ import { TrackType } from '../protos/gen/Room_pb';
2
2
  export declare const enum_mediaType: {
3
3
  readonly mc_audio: "麦克风-默认轨道";
4
4
  readonly mc_video: "摄像头-默认轨道";
@@ -1,5 +1,6 @@
1
1
  export declare const enum_notifyName: {
2
2
  readonly onNetQuality: "网络质量回调";
3
+ readonly onRtcStats: "远端用户网络信息广播";
3
4
  readonly updateSeverTime: "服务端时间更新";
4
5
  readonly onDataChannelPublish: "用户房间DataChannel发布或变更";
5
6
  readonly onJoinRoom: "加入房间回调";
@@ -34,4 +35,4 @@ export declare const notifyName_options: {
34
35
  label: any;
35
36
  }[];
36
37
  export declare const notifyName_keys: (keyof typeof enum_notifyName)[];
37
- export declare const notifyName_vals: ("网络质量回调" | "服务端时间更新" | "用户房间DataChannel发布或变更" | "加入房间回调" | "加入房间批量回调" | "退出房间回调" | "退出房间批量回调" | "监听到流发布" | "关闭轨道" | "更新通讯状态" | "通知轨道失效" | "房间内的全体禁言状态发生变化" | "房间内的管理员发生变化" | "建立P2P连接" | "收到P2P-offer" | "收到P2P-answer" | "收到P2P候选信息-candidate" | "断开P2P" | "更新推流权限通知" | "批量更新推流权限通知" | "Token即将过期" | "Token已过期" | "销毁房间" | "行为允许权限变更" | "cdn播放地址变化" | "用户讲话")[];
38
+ export declare const notifyName_vals: ("关闭轨道" | "网络质量回调" | "远端用户网络信息广播" | "服务端时间更新" | "用户房间DataChannel发布或变更" | "加入房间回调" | "加入房间批量回调" | "退出房间回调" | "退出房间批量回调" | "监听到流发布" | "更新通讯状态" | "通知轨道失效" | "房间内的全体禁言状态发生变化" | "房间内的管理员发生变化" | "建立P2P连接" | "收到P2P-offer" | "收到P2P-answer" | "收到P2P候选信息-candidate" | "断开P2P" | "更新推流权限通知" | "批量更新推流权限通知" | "Token即将过期" | "Token已过期" | "销毁房间" | "行为允许权限变更" | "cdn播放地址变化" | "用户讲话")[];
@@ -1,8 +1,4 @@
1
1
  export * from './QuickVO';
2
2
  export * from './types';
3
3
  export * from './enums/index';
4
- /** 与 Room.proto IceConnectType 一致,由 buf 自 Room_pb 生成 */
5
- export { IceConnectType } from './protos/gen/modules/Room_pb';
6
4
  export * as tools from './tools';
7
- /** cws 广播 on 回调:按事件名推断 payload */
8
- export { defineCwsOn, type CallsWebSocketOn, type CwsNotifyPayloadFor, type CwsNotifyPayloadUnion, } from './protos/protoEvent';
@@ -1,9 +1,9 @@
1
1
  import { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2';
2
2
  import { Message } from '@bufbuild/protobuf';
3
3
  /**
4
- * Describes the file modules/BaseData.proto.
4
+ * Describes the file BaseData.proto.
5
5
  */
6
- export declare const file_modules_BaseData: GenFile;
6
+ export declare const file_BaseData: GenFile;
7
7
  /**
8
8
  * 请求
9
9
  *
@@ -1,9 +1,9 @@
1
1
  import { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2';
2
2
  import { Message } from '@bufbuild/protobuf';
3
3
  /**
4
- * Describes the file modules/Room.proto.
4
+ * Describes the file Room.proto.
5
5
  */
6
- export declare const file_modules_Room: GenFile;
6
+ export declare const file_Room: GenFile;
7
7
  /**
8
8
  * Room user info
9
9
  *
@@ -428,6 +428,12 @@ export type SubscribeReq = Message<"com.quick.voice.proto.SubscribeReq"> & {
428
428
  * @generated from field: optional string session = 2;
429
429
  */
430
430
  session?: string;
431
+ /**
432
+ * 2026.3.30 add
433
+ *
434
+ * @generated from field: optional bool selfCheck = 3;
435
+ */
436
+ selfCheck?: boolean;
431
437
  };
432
438
  /**
433
439
  * Describes the message com.quick.voice.proto.SubscribeReq.
@@ -1023,6 +1029,10 @@ export type ChannelPublishReq = Message<"com.quick.voice.proto.ChannelPublishReq
1023
1029
  * @generated from field: repeated com.quick.voice.proto.DataChannel channels = 1;
1024
1030
  */
1025
1031
  channels: DataChannel[];
1032
+ /**
1033
+ * @generated from field: optional string session = 2;
1034
+ */
1035
+ session?: string;
1026
1036
  };
1027
1037
  /**
1028
1038
  * Describes the message com.quick.voice.proto.ChannelPublishReq.
@@ -1053,6 +1063,10 @@ export type ChannelSubscribeReq = Message<"com.quick.voice.proto.ChannelSubscrib
1053
1063
  * @generated from field: repeated com.quick.voice.proto.UserChannel users = 1;
1054
1064
  */
1055
1065
  users: UserChannel[];
1066
+ /**
1067
+ * @generated from field: optional string session = 2;
1068
+ */
1069
+ session?: string;
1056
1070
  };
1057
1071
  /**
1058
1072
  * Describes the message com.quick.voice.proto.ChannelSubscribeReq.
@@ -1073,26 +1087,6 @@ export type ChannelSubscribeRsq = Message<"com.quick.voice.proto.ChannelSubscrib
1073
1087
  * Use `create(ChannelSubscribeRsqSchema)` to create a new message.
1074
1088
  */
1075
1089
  export declare const ChannelSubscribeRsqSchema: GenMessage<ChannelSubscribeRsq>;
1076
- /**
1077
- * notify: 用户 DataChannel 发布或变更(WebSocket event: onDataChannelPublish)
1078
- *
1079
- * @generated from message com.quick.voice.proto.DataChannelPublishNotify
1080
- */
1081
- export type DataChannelPublishNotify = Message<"com.quick.voice.proto.DataChannelPublishNotify"> & {
1082
- /**
1083
- * @generated from field: string roomId = 1;
1084
- */
1085
- roomId: string;
1086
- /**
1087
- * @generated from field: com.quick.voice.proto.User user = 2;
1088
- */
1089
- user?: User;
1090
- };
1091
- /**
1092
- * Describes the message com.quick.voice.proto.DataChannelPublishNotify.
1093
- * Use `create(DataChannelPublishNotifySchema)` to create a new message.
1094
- */
1095
- export declare const DataChannelPublishNotifySchema: GenMessage<DataChannelPublishNotify>;
1096
1090
  /**
1097
1091
  * confirm consumer msg
1098
1092
  *