@rongcloud/plugin-rtc 5.6.3-alpha.2 → 5.6.3-alpha.3

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/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCRTC - v5.6.3-alpha.2
3
- * CommitId - 2fda2b34be0736183519f005f2d4157acd8a3161
4
- * Sun Nov 13 2022 12:38:30 GMT+0800 (China Standard Time)
2
+ * RCRTC - v5.6.3-alpha.3
3
+ * CommitId - db726c933e72872baf32689bc9690c7a34f2bab2
4
+ * Sun Nov 13 2022 23:10:47 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  import { EventEmitter, isNumber, validate, isObject as isObject$1, ErrorCode, HttpMethod, isArray, ConnectionStatus, notEmptyObject, notEmptyArray, notEmptyString, isString, RTCMode as RTCMode$1, assert, ConversationType, isHttpUrl, isBoolean, isUndefined, forEach, VersionManage, LogL } from '@rongcloud/engine';
@@ -960,6 +960,18 @@ var RCLoggerTag;
960
960
  * 取消订阅本地清除的订阅关系列表
961
961
  */
962
962
  RCLoggerTag["L_CLEAR_UNSUBSCRIBE_LIST_O"] = "L-clear_unsubscribe_list-O";
963
+ /**
964
+ * 队列任务插入
965
+ */
966
+ RCLoggerTag["L_INVOKER_PUSH_O"] = "L-invoker_push-O";
967
+ /**
968
+ * 队列任务开始执行
969
+ */
970
+ RCLoggerTag["L_INVOKER_EXECUTE_T"] = "L-invoker_execute-T";
971
+ /**
972
+ * 队列任务执行结束
973
+ */
974
+ RCLoggerTag["L_INVOKER_EXECUTE_R"] = "L-invoker_execute-R";
963
975
  })(RCLoggerTag || (RCLoggerTag = {}));
964
976
  var RCLoggerStatus;
965
977
  (function (RCLoggerStatus) {
@@ -14755,7 +14767,7 @@ const getCommonHeader$1 = () => ({
14755
14767
  'Content-Type': 'application/json;charset=UTF-8',
14756
14768
  'Cache-Control': 'no-cache',
14757
14769
  ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
14758
- ClientVersion: "5.6.3-alpha.2",
14770
+ ClientVersion: "5.6.3-alpha.3",
14759
14771
  'Client-Session-Id': getUUID(),
14760
14772
  'Request-Id': Date.now().toString(),
14761
14773
  });
@@ -15333,7 +15345,7 @@ const getCommonHeader = () => ({
15333
15345
  'Content-Type': 'application/json;charset=UTF-8',
15334
15346
  'Cache-Control': 'no-cache',
15335
15347
  ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
15336
- ClientVersion: "5.6.3-alpha.2",
15348
+ ClientVersion: "5.6.3-alpha.3",
15337
15349
  'Client-Session-Id': getUUID(),
15338
15350
  'Request-Id': Date.now().toString(),
15339
15351
  });
@@ -18689,7 +18701,7 @@ class PolarisReporter {
18689
18701
  * 加入房间
18690
18702
  */
18691
18703
  sendR1() {
18692
- const rtcVersion = "5.6.3-alpha.2";
18704
+ const rtcVersion = "5.6.3-alpha.3";
18693
18705
  const imVersion = this._context.getCoreVersion();
18694
18706
  const platform = 'web';
18695
18707
  const pcName = navigator.platform;
@@ -18839,7 +18851,7 @@ class PolarisHttpReporter {
18839
18851
  _formatR1Data() {
18840
18852
  return {
18841
18853
  joinTime: this._context.userJoinTime || 0,
18842
- rtcVersion: "5.6.3-alpha.2",
18854
+ rtcVersion: "5.6.3-alpha.3",
18843
18855
  imVersion: this._context.getCoreVersion(),
18844
18856
  platform: 'web',
18845
18857
  device: navigator.platform,
@@ -19288,24 +19300,84 @@ class RCRTCPeerCManager {
19288
19300
  /* 定义命令类型 */
19289
19301
  var RCCommandKind;
19290
19302
  (function (RCCommandKind) {
19303
+ /**
19304
+ * 发信令取消加入房间之前的资源
19305
+ */
19306
+ RCCommandKind["UNPUBLISH_PREV"] = "UnpublishPrevCommand";
19307
+ /**
19308
+ * 拉取房间内数据
19309
+ */
19310
+ RCCommandKind["PULL_RTCROOM_STATUS"] = "PullRTCRoomStatusCommand";
19311
+ /**
19312
+ * 加入房间
19313
+ */
19314
+ RCCommandKind["JOINROOM"] = "JoinRoomCommand";
19315
+ /**
19316
+ * 解析远端资源数据
19317
+ */
19318
+ RCCommandKind["PARSE_REMOTERES"] = "ParseRemoteResCommand";
19319
+ /**
19320
+ * 解析远端人员数据
19321
+ */
19322
+ RCCommandKind["PARSE_USERSTATE"] = "ParseUserStateCommand";
19323
+ /**
19324
+ * 本端 track 禁用/启用
19325
+ */
19326
+ RCCommandKind["LOCAL_TRACK_MUTE"] = "LocalTrackMuteCommand";
19327
+ /**
19328
+ * 发布资源
19329
+ */
19330
+ RCCommandKind["PUBLISH"] = "PublishCommand";
19331
+ /**
19332
+ * 恢复 ice 连接
19333
+ */
19334
+ RCCommandKind["RETRY_EXCHANGE"] = "RetryExchangeCommand";
19335
+ /**
19336
+ * 取消发布
19337
+ */
19338
+ RCCommandKind["UNPUBLISH"] = "UnpublishCommand";
19339
+ /**
19340
+ * 订阅
19341
+ */
19342
+ RCCommandKind["SUBSCRIBE"] = "SubscribeCommand";
19343
+ /**
19344
+ * 异步订阅、取消订阅、全量订阅
19345
+ */
19346
+ RCCommandKind["ASYNC_COMMAND"] = "AsyncCommand";
19347
+ /**
19348
+ * 取消订阅
19349
+ */
19350
+ RCCommandKind["UNSUBSCRIBE"] = "UnsubscribeCommand";
19351
+ /**
19352
+ * 全量订阅
19353
+ */
19354
+ RCCommandKind["UPDATE_SUBSCRIBE_LIST"] = "UpdateSubscribeListCommand";
19355
+ /**
19356
+ * im 重连房间内人员、资源处理
19357
+ */
19358
+ RCCommandKind["ON_SIGNAL_RECONNECTED"] = "OnSignalReconnectedCommand";
19359
+ /**
19360
+ * 退出副房间
19361
+ */
19362
+ RCCommandKind["LEAVE_OTHER_ROOM"] = "LeaveOtherRoomCommand";
19363
+ /**
19364
+ * 主播、观众切换身份
19365
+ */
19366
+ RCCommandKind["RTC_IDENTITY_CHANGE"] = "RTCIdentityChangeCommand";
19367
+ /**
19368
+ * 开/关 CDN
19369
+ */
19370
+ RCCommandKind["ENABLE_INNER_CDN"] = "EnableInnerCDNCommand";
19371
+ /**
19372
+ * 携带副房间信息重新发 /exchange 请求
19373
+ */
19374
+ RCCommandKind["EXCHANGE_WITH_PUSH_OTHER_ROOM"] = "ExchangeWithPushOtherRoomCommand";
19375
+ /**
19376
+ * 发送 MCU 请求
19377
+ */
19378
+ RCCommandKind["MCUCONFIG_FLUSH"] = "MCUConfigFlushCommand";
19291
19379
  // 未定议的
19292
- RCCommandKind[RCCommandKind["Unknow"] = 0] = "Unknow";
19293
- // 发布资源
19294
- RCCommandKind[RCCommandKind["Publish"] = 1] = "Publish";
19295
- // 取消发布资源
19296
- RCCommandKind[RCCommandKind["UnPublish"] = 2] = "UnPublish";
19297
- // 加入房间
19298
- RCCommandKind[RCCommandKind["JoinRoom"] = 3] = "JoinRoom";
19299
- // 离开房间
19300
- RCCommandKind[RCCommandKind["LeaveRoom"] = 4] = "LeaveRoom";
19301
- // 更新订阅列表
19302
- RCCommandKind[RCCommandKind["UpdateSubscribeTask"] = 5] = "UpdateSubscribeTask";
19303
- // 资源订阅
19304
- RCCommandKind[RCCommandKind["SubscribedTask"] = 6] = "SubscribedTask";
19305
- // 取消资源订阅
19306
- RCCommandKind[RCCommandKind["UnSubscribedTask"] = 7] = "UnSubscribedTask";
19307
- // 异步事件命令
19308
- RCCommandKind["AsyncCommand"] = "AsyncCommand";
19380
+ RCCommandKind["UNKNOWN"] = "Unknown";
19309
19381
  })(RCCommandKind || (RCCommandKind = {}));
19310
19382
 
19311
19383
  // 描述 链表 中的位置
@@ -19341,7 +19413,7 @@ class BaseCommand {
19341
19413
  * @returns 命令的种类。
19342
19414
  */
19343
19415
  get kind() {
19344
- return RCCommandKind.Unknow;
19416
+ return RCCommandKind.UNKNOWN;
19345
19417
  }
19346
19418
  }
19347
19419
 
@@ -19351,7 +19423,7 @@ class AsyncCommand extends BaseCommand {
19351
19423
  this.state = state;
19352
19424
  }
19353
19425
  get kind() {
19354
- return RCCommandKind.AsyncCommand;
19426
+ return RCCommandKind.ASYNC_COMMAND;
19355
19427
  }
19356
19428
  /**
19357
19429
  * `public setState(状态:RCLinkedListPoint):void`
@@ -19638,7 +19710,7 @@ class Store extends ReadableStore {
19638
19710
  }
19639
19711
 
19640
19712
  class BaseInvoker {
19641
- constructor(
19713
+ constructor(context,
19642
19714
  /**
19643
19715
  * 内存数据管理实例
19644
19716
  */
@@ -19647,6 +19719,7 @@ class BaseInvoker {
19647
19719
  * 命令终止时返回的错误码定义
19648
19720
  */
19649
19721
  abortCode) {
19722
+ this.context = context;
19650
19723
  this._store = _store;
19651
19724
  this.abortCode = abortCode;
19652
19725
  // command 队列
@@ -19660,6 +19733,7 @@ class BaseInvoker {
19660
19733
  this._execute();
19661
19734
  }
19662
19735
  _execute() {
19736
+ var _a, _b, _c, _d;
19663
19737
  return __awaiter(this, void 0, void 0, function* () {
19664
19738
  if (this._isDestroyed || this._busy || this._queue.length === 0) {
19665
19739
  return;
@@ -19667,23 +19741,37 @@ class BaseInvoker {
19667
19741
  this._busy = true;
19668
19742
  const { command, resolve, reject } = this._queue.shift();
19669
19743
  let res;
19744
+ const traceId = (_a = this.context.logger) === null || _a === void 0 ? void 0 : _a.createTraceId();
19670
19745
  try {
19671
19746
  /**
19672
19747
  * 说明:由于是先弹出 再执行 Command,所以不存在 在队列中正在执行的任务
19673
19748
  */
19749
+ (_b = this.context.logger) === null || _b === void 0 ? void 0 : _b.info(RCLoggerTag.L_INVOKER_EXECUTE_T, `commandKind: ${command.kind}, commandLength: ${this._queue.length}`, traceId);
19674
19750
  res = yield command.execute(this._store, this);
19675
19751
  }
19676
19752
  catch (error) {
19753
+ (_c = this.context.logger) === null || _c === void 0 ? void 0 : _c.error(RCLoggerTag.L_INVOKER_EXECUTE_R, JSON.stringify({
19754
+ error,
19755
+ status: RCLoggerStatus.FAILED,
19756
+ commandKind: command.kind,
19757
+ }), traceId);
19677
19758
  reject(error);
19678
19759
  this._next();
19679
19760
  return;
19680
19761
  }
19762
+ (_d = this.context.logger) === null || _d === void 0 ? void 0 : _d.info(RCLoggerTag.L_INVOKER_EXECUTE_R, `status: ${RCLoggerStatus.SUCCESSED}, commandKind: ${command.kind}`, traceId);
19681
19763
  resolve(res);
19682
19764
  this._next();
19683
19765
  });
19684
19766
  }
19685
19767
  push(command) {
19686
19768
  return new Promise((resolve, reject) => {
19769
+ var _a;
19770
+ (_a = this.context.logger) === null || _a === void 0 ? void 0 : _a.info(RCLoggerTag.L_INVOKER_PUSH_O, JSON.stringify({
19771
+ isDestroyed: this._isDestroyed,
19772
+ commandKind: command.kind,
19773
+ commandLength: this._queue.length,
19774
+ }));
19687
19775
  // 房间已销毁
19688
19776
  if (this._isDestroyed) {
19689
19777
  reject({
@@ -19696,7 +19784,7 @@ class BaseInvoker {
19696
19784
  // 所以只要队列中存在中 Subscribed 或 UnSubscribed 则可以只执行最后一个
19697
19785
  const { kind } = command;
19698
19786
  if (this._queue.length > 0) {
19699
- if (kind === RCCommandKind.AsyncCommand) {
19787
+ if (kind === RCCommandKind.ASYNC_COMMAND) {
19700
19788
  // 重写 resolve, reject 并将使用新回调的进行包裹它
19701
19789
  ({ command, resolve, reject } = this.commandOffset(command, resolve, reject));
19702
19790
  }
@@ -19725,7 +19813,7 @@ class BaseInvoker {
19725
19813
  });
19726
19814
  }
19727
19815
  /**
19728
- * 查找出 RCCommandKind.AsyncCommand 类型的 Command,并将其从队列中删除
19816
+ * 查找出 RCCommandKind.ASYNC_COMMAND 类型的 Command,并将其从队列中删除
19729
19817
  * 并使用最新的一次 Command 接管它的 resolve & reject
19730
19818
  * @param resolve
19731
19819
  * @param reject
@@ -19735,7 +19823,7 @@ class BaseInvoker {
19735
19823
  // 因为一次只可以插入一个 Command 所以查找 只需要在队列最后查找一个即可
19736
19824
  const index = this._queue.length - 1;
19737
19825
  const item = this._queue[index];
19738
- const hashSubscribTask = item.command.kind === RCCommandKind.AsyncCommand;
19826
+ const hashSubscribTask = item.command.kind === RCCommandKind.ASYNC_COMMAND;
19739
19827
  // 如果队列中不存在则直接返回
19740
19828
  if (!hashSubscribTask) {
19741
19829
  return { command, resolve, reject };
@@ -19788,7 +19876,7 @@ class BaseInvoker {
19788
19876
  */
19789
19877
  class Invoker extends BaseInvoker {
19790
19878
  constructor(context, service, peerMrg, roomId, crtUserId, mode, reporter, isUpgrade, isMainRoom) {
19791
- super(new Store(context, service, peerMrg, roomId, crtUserId, mode, reporter, isUpgrade, isMainRoom), RCRTCCode.ROOM_HAS_BEEN_DESTROYED);
19879
+ super(context, new Store(context, service, peerMrg, roomId, crtUserId, mode, reporter, isUpgrade, isMainRoom), RCRTCCode.ROOM_HAS_BEEN_DESTROYED);
19792
19880
  }
19793
19881
  /**
19794
19882
  * 获取 store 存储实例,返回值类型 `ReadableStore`,避免非 command 定义中修改内存
@@ -19808,6 +19896,9 @@ class Invoker extends BaseInvoker {
19808
19896
  * 该步骤没有必要与 MediaServer 的交互,因后续资源变更交互为全量交互
19809
19897
  */
19810
19898
  class UnpublishPrevCommand extends BaseCommand {
19899
+ get kind() {
19900
+ return RCCommandKind.UNPUBLISH_PREV;
19901
+ }
19811
19902
  execute(store) {
19812
19903
  var _a, _b, _c, _d, _e, _f, _g, _h;
19813
19904
  return __awaiter(this, void 0, void 0, function* () {
@@ -19887,7 +19978,7 @@ class JoinRoomCommand extends BaseCommand {
19887
19978
  this.traceId = traceId;
19888
19979
  }
19889
19980
  get kind() {
19890
- return RCCommandKind.JoinRoom;
19981
+ return RCCommandKind.JOINROOM;
19891
19982
  }
19892
19983
  execute(store, invoker) {
19893
19984
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
@@ -20082,6 +20173,9 @@ class UpdateSubscribeListCommand extends BaseCommand {
20082
20173
  this.forceReq = forceReq;
20083
20174
  this.traceId = traceId;
20084
20175
  }
20176
+ get kind() {
20177
+ return RCCommandKind.UPDATE_SUBSCRIBE_LIST;
20178
+ }
20085
20179
  execute(store, invoker) {
20086
20180
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
20087
20181
  return __awaiter(this, void 0, void 0, function* () {
@@ -20226,6 +20320,9 @@ class UnsubscribeCommand extends BaseCommand {
20226
20320
  this.subhook = subhook;
20227
20321
  this.traceId = traceId;
20228
20322
  }
20323
+ get kind() {
20324
+ return RCCommandKind.UNSUBSCRIBE;
20325
+ }
20229
20326
  execute(store, invoker) {
20230
20327
  var _a, _b, _c, _d;
20231
20328
  return __awaiter(this, void 0, void 0, function* () {
@@ -20613,6 +20710,9 @@ class ParseUserStateCommand extends BaseCommand {
20613
20710
  this.subhook = subhook;
20614
20711
  this.traceId = traceId;
20615
20712
  }
20713
+ get kind() {
20714
+ return RCCommandKind.PARSE_USERSTATE;
20715
+ }
20616
20716
  get priority() {
20617
20717
  return CommandPriority.NORMAL;
20618
20718
  }
@@ -20707,6 +20807,9 @@ class ParseRemoteResCommand extends BaseCommand {
20707
20807
  this.callback = callback;
20708
20808
  this.traceId = traceId;
20709
20809
  }
20810
+ get kind() {
20811
+ return RCCommandKind.PARSE_REMOTERES;
20812
+ }
20710
20813
  get priority() {
20711
20814
  return CommandPriority.NORMAL;
20712
20815
  }
@@ -20838,6 +20941,9 @@ class SubscribeCommand extends BaseCommand {
20838
20941
  this.subhook = subhook;
20839
20942
  this.forceReq = forceReq;
20840
20943
  }
20944
+ get kind() {
20945
+ return RCCommandKind.SUBSCRIBE;
20946
+ }
20841
20947
  execute(store, invoker) {
20842
20948
  var _a, _b, _c, _d, _e, _f, _g, _h;
20843
20949
  return __awaiter(this, void 0, void 0, function* () {
@@ -20957,7 +21063,7 @@ class PublishCommand extends BaseCommand {
20957
21063
  this._traceId = (_a = this._logger) === null || _a === void 0 ? void 0 : _a.createTraceId();
20958
21064
  }
20959
21065
  get kind() {
20960
- return RCCommandKind.Publish;
21066
+ return RCCommandKind.PUBLISH;
20961
21067
  }
20962
21068
  /**
20963
21069
  * 从 pc 移除当次发布失败的资源
@@ -21292,7 +21398,7 @@ class UnpublishCommand extends BaseCommand {
21292
21398
  this.unpubhook = unpubhook;
21293
21399
  }
21294
21400
  get kind() {
21295
- return RCCommandKind.UnPublish;
21401
+ return RCCommandKind.UNPUBLISH;
21296
21402
  }
21297
21403
  __unpublish(store, invoker, peerCItem, tracks) {
21298
21404
  var _a, _b, _c, _d;
@@ -21479,6 +21585,9 @@ class LocalTrackMuteCommand extends BaseCommand {
21479
21585
  this.localTrack = localTrack;
21480
21586
  this._recvSignalResultFn = _recvSignalResultFn;
21481
21587
  }
21588
+ get kind() {
21589
+ return RCCommandKind.LOCAL_TRACK_MUTE;
21590
+ }
21482
21591
  execute(store, invoker) {
21483
21592
  var _a, _b, _c, _d;
21484
21593
  return __awaiter(this, void 0, void 0, function* () {
@@ -21532,6 +21641,9 @@ class RetryExchangeCommand extends BaseCommand {
21532
21641
  this.isPub = isPub;
21533
21642
  this.retryHook = retryHook;
21534
21643
  }
21644
+ get kind() {
21645
+ return RCCommandKind.RETRY_EXCHANGE;
21646
+ }
21535
21647
  get priority() {
21536
21648
  return CommandPriority.HIGH;
21537
21649
  }
@@ -21569,12 +21681,19 @@ class RetryExchangeCommand extends BaseCommand {
21569
21681
  }
21570
21682
 
21571
21683
  class OnSignalReconnectedCommand extends BaseCommand {
21572
- constructor(subhook, callbacks, livingType) {
21684
+ constructor(subhook, callbacks, _retryHook, _pubhook, _signalRetryTime = PUBLISHSIGNALRETRYTIME, _pullRTCRoomStatus, livingType) {
21573
21685
  super();
21574
21686
  this.subhook = subhook;
21575
21687
  this.callbacks = callbacks;
21688
+ this._retryHook = _retryHook;
21689
+ this._pubhook = _pubhook;
21690
+ this._signalRetryTime = _signalRetryTime;
21691
+ this._pullRTCRoomStatus = _pullRTCRoomStatus;
21576
21692
  this.livingType = livingType;
21577
21693
  }
21694
+ get kind() {
21695
+ return RCCommandKind.ON_SIGNAL_RECONNECTED;
21696
+ }
21578
21697
  /**
21579
21698
  * @override
21580
21699
  */
@@ -21582,10 +21701,11 @@ class OnSignalReconnectedCommand extends BaseCommand {
21582
21701
  return CommandPriority.HIGH;
21583
21702
  }
21584
21703
  execute(store, invoker) {
21585
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
21704
+ var _a, _b, _c, _d, _e, _f;
21586
21705
  return __awaiter(this, void 0, void 0, function* () {
21587
- const { livingType } = this;
21588
21706
  const { roomId, roomMode } = store;
21707
+ this._roomId = roomId;
21708
+ this._roomMode = roomMode;
21589
21709
  const traceId = (_b = (_a = store.context) === null || _a === void 0 ? void 0 : _a.logger) === null || _b === void 0 ? void 0 : _b.createTraceId();
21590
21710
  (_d = (_c = store.context) === null || _c === void 0 ? void 0 : _c.logger) === null || _d === void 0 ? void 0 : _d.info(RCLoggerTag.L_ABSTRACT_ROOM_IM_RECONNECTED_T, undefined, traceId);
21591
21711
  /**
@@ -21603,9 +21723,32 @@ class OnSignalReconnectedCommand extends BaseCommand {
21603
21723
  this.callbacks.onPeerClosed && this.callbacks.onPeerClosed();
21604
21724
  return;
21605
21725
  }
21606
- const { code, data } = yield store.context.joinRTCRoom(roomId, roomMode, livingType);
21726
+ const { code: pingCode } = yield store.context.rtcPing(roomId, roomMode);
21727
+ /**
21728
+ * 不在房间内时,需重新加房间,恢复资源状态
21729
+ * ErrorCode 增加 40001 需更新 im 包,暂时转为数字对比
21730
+ * 在房间内获取房间内最新数据
21731
+ */
21732
+ if (pingCode === 40001) {
21733
+ const code = yield this._joinRoom(store, traceId, invoker);
21734
+ /**
21735
+ * 加入房间成功后,恢复和 mediaServer 服务之间的连接
21736
+ */
21737
+ if (code === ErrorCode.SUCCESS) {
21738
+ yield this._restoreMediaServer(store, invoker);
21739
+ }
21740
+ }
21741
+ else {
21742
+ yield this._pullRTCRoomStatus(this._roomId, traceId).execute(store, invoker);
21743
+ }
21744
+ });
21745
+ }
21746
+ _joinRoom(store, traceId, invoker) {
21747
+ var _a, _b, _c, _d, _e, _f, _g;
21748
+ return __awaiter(this, void 0, void 0, function* () {
21749
+ const { code, data } = yield store.context.joinRTCRoom(this._roomId, this._roomMode, this.livingType);
21607
21750
  if (code !== ErrorCode.SUCCESS) {
21608
- (_h = (_g = store.context) === null || _g === void 0 ? void 0 : _g.logger) === null || _h === void 0 ? void 0 : _h.error(RCLoggerTag.L_ABSTRACT_ROOM_IM_RECONNECTED_R, JSON.stringify({
21751
+ (_b = (_a = store.context) === null || _a === void 0 ? void 0 : _a.logger) === null || _b === void 0 ? void 0 : _b.error(RCLoggerTag.L_ABSTRACT_ROOM_IM_RECONNECTED_R, JSON.stringify({
21609
21752
  status: RCLoggerStatus.FAILED,
21610
21753
  code,
21611
21754
  msg: 'im reconnect joinRTCRoom failed',
@@ -21613,7 +21756,7 @@ class OnSignalReconnectedCommand extends BaseCommand {
21613
21756
  return;
21614
21757
  }
21615
21758
  if (!data) {
21616
- (_k = (_j = store.context) === null || _j === void 0 ? void 0 : _j.logger) === null || _k === void 0 ? void 0 : _k.info(RCLoggerTag.L_LIVING_ROOM_RECONNECTED_R, JSON.stringify({
21759
+ (_d = (_c = store.context) === null || _c === void 0 ? void 0 : _c.logger) === null || _d === void 0 ? void 0 : _d.info(RCLoggerTag.L_LIVING_ROOM_RECONNECTED_R, JSON.stringify({
21617
21760
  status: RCLoggerStatus.FAILED,
21618
21761
  msg: 'im reconnect joinRTCRoom, roomData is empty',
21619
21762
  }), traceId);
@@ -21622,13 +21765,38 @@ class OnSignalReconnectedCommand extends BaseCommand {
21622
21765
  /**
21623
21766
  * 处理全量的房间数据
21624
21767
  */
21625
- const CDNUris = (_l = data.roomInfo.filter((item) => item.key === 'cdn_uris')[0]) === null || _l === void 0 ? void 0 : _l.value;
21768
+ const CDNUris = (_e = data.roomInfo.filter((item) => item.key === 'cdn_uris')[0]) === null || _e === void 0 ? void 0 : _e.value;
21626
21769
  handleFullRoomData(data, store, this.callbacks, invoker, this.subhook, CDNUris, traceId);
21627
- (_o = (_m = store.context) === null || _m === void 0 ? void 0 : _m.logger) === null || _o === void 0 ? void 0 : _o.info(RCLoggerTag.L_ABSTRACT_ROOM_IM_RECONNECTED_R, JSON.stringify({
21770
+ (_g = (_f = store.context) === null || _f === void 0 ? void 0 : _f.logger) === null || _g === void 0 ? void 0 : _g.info(RCLoggerTag.L_ABSTRACT_ROOM_IM_RECONNECTED_R, JSON.stringify({
21628
21771
  status: RCLoggerStatus.SUCCESSED,
21629
21772
  roomData: data,
21630
21773
  }), traceId);
21631
- return { data };
21774
+ return code;
21775
+ });
21776
+ }
21777
+ _restoreMediaServer(store, invoker) {
21778
+ return __awaiter(this, void 0, void 0, function* () {
21779
+ const { useMutilPeerC } = store.peerMgr;
21780
+ const localTracks = store.getLocalTracks();
21781
+ const subedTracks = Object.values(store.getRemoteTracks()).filter((track) => !!track.isSubscribed());
21782
+ /**
21783
+ * 多 peerConnection 恢复订阅资源
21784
+ */
21785
+ if (useMutilPeerC) {
21786
+ /**
21787
+ * 多 peerConnection 恢复发布资源
21788
+ */
21789
+ subedTracks.length && (yield new SubscribeCommand(subedTracks, this.subhook, true).execute(store, invoker));
21790
+ localTracks.length && (yield new PublishCommand(localTracks, this._pubhook, this._signalRetryTime).execute(store, invoker));
21791
+ return;
21792
+ }
21793
+ /**
21794
+ * 单 peerConnection 恢复发布、订阅资源
21795
+ */
21796
+ localTracks.length && (yield new PublishCommand(localTracks, this._pubhook, this._signalRetryTime).execute(store, invoker));
21797
+ if (!localTracks.length && subedTracks.length) {
21798
+ yield new SubscribeCommand(subedTracks, this.subhook, true).execute(store, invoker);
21799
+ }
21632
21800
  });
21633
21801
  }
21634
21802
  }
@@ -21646,6 +21814,9 @@ class AsyncUpdateSubscribeListCommand extends AsyncCommand {
21646
21814
  this._logger = null;
21647
21815
  this._logger = RTCLogger.getLogger();
21648
21816
  }
21817
+ get kind() {
21818
+ return RCCommandKind.ASYNC_COMMAND;
21819
+ }
21649
21820
  execute(store, invoker) {
21650
21821
  var _a, _b, _c, _d;
21651
21822
  return __awaiter(this, void 0, void 0, function* () {
@@ -21709,6 +21880,9 @@ class AsyncSubscribeCommand extends AsyncCommand {
21709
21880
  this.subhook = subhook;
21710
21881
  this.callbacks = callbacks;
21711
21882
  }
21883
+ get kind() {
21884
+ return RCCommandKind.ASYNC_COMMAND;
21885
+ }
21712
21886
  execute(store, invoker) {
21713
21887
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
21714
21888
  return __awaiter(this, void 0, void 0, function* () {
@@ -21803,6 +21977,9 @@ class AsyncUnsubscribeCommand extends AsyncCommand {
21803
21977
  this.subhook = subhook;
21804
21978
  this.callbacks = callbacks;
21805
21979
  }
21980
+ get kind() {
21981
+ return RCCommandKind.ASYNC_COMMAND;
21982
+ }
21806
21983
  execute(store, invoker) {
21807
21984
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
21808
21985
  return __awaiter(this, void 0, void 0, function* () {
@@ -21909,8 +22086,11 @@ class PullRTCRoomStatusCommand extends BaseCommand {
21909
22086
  this._subhook = _subhook;
21910
22087
  this._dealUserAppListener = _dealUserAppListener;
21911
22088
  }
22089
+ get kind() {
22090
+ return RCCommandKind.PULL_RTCROOM_STATUS;
22091
+ }
21912
22092
  execute(store, invoker) {
21913
- var _a, _b;
22093
+ var _a, _b, _c;
21914
22094
  return __awaiter(this, void 0, void 0, function* () {
21915
22095
  const version = store.getRoomStatusVersion();
21916
22096
  (_a = this._context.logger) === null || _a === void 0 ? void 0 : _a.info(RCLoggerTag.L_PULL_ROOM_STATUS_T, JSON.stringify({
@@ -21919,10 +22099,14 @@ class PullRTCRoomStatusCommand extends BaseCommand {
21919
22099
  }), this._traceId);
21920
22100
  const { code, data } = yield this._context.pullRTCRoomStatus(this._roomId, version);
21921
22101
  if (code !== ErrorCode.SUCCESS) {
22102
+ (_b = this._context.logger) === null || _b === void 0 ? void 0 : _b.info(RCLoggerTag.L_PULL_ROOM_STATUS_R, JSON.stringify({
22103
+ status: RCLoggerStatus.FAILED,
22104
+ code,
22105
+ }), this._traceId);
21922
22106
  return { code };
21923
22107
  }
21924
22108
  const { bFullStatus, version: newVersion, usersData, roomStatus, } = data;
21925
- (_b = this._context.logger) === null || _b === void 0 ? void 0 : _b.info(RCLoggerTag.L_PULL_ROOM_STATUS_R, JSON.stringify({
22109
+ (_c = this._context.logger) === null || _c === void 0 ? void 0 : _c.info(RCLoggerTag.L_PULL_ROOM_STATUS_R, JSON.stringify({
21926
22110
  bFullStatus,
21927
22111
  version: int64ToTimestamp(newVersion),
21928
22112
  usersData,
@@ -22035,21 +22219,24 @@ class RCAbstractRoom extends EventEmitter {
22035
22219
  }
22036
22220
  }));
22037
22221
  }
22222
+ _pullRTCRoomStatus(roomId, tracId) {
22223
+ return new PullRTCRoomStatusCommand(roomId, tracId, this._context, {
22224
+ onUserJoin: this._callAppListener.bind(this, 'onUserJoin'),
22225
+ onUserLeave: this._callAppListener.bind(this, 'onUserLeave'),
22226
+ onAudioMuteChange: this._onAudioMuteChange.bind(this),
22227
+ onVideoMuteChange: this._onVideoMuteChange.bind(this),
22228
+ onTrackPublish: this._onTrackPublish.bind(this),
22229
+ onTrackUnpublish: this._onTrackUnpublish.bind(this),
22230
+ onCDNEnableChange: this._callAppListener.bind(this, 'onCDNEnableChange'),
22231
+ }, this._subhook.bind(this), this._dealUserAppListener.bind(this));
22232
+ }
22038
22233
  /**
22039
22234
  * 拉取房间数据
22040
22235
  * @param roomId 房间 id
22041
22236
  */
22042
22237
  _startPullRTCRoomStatus(roomId, tracId) {
22043
22238
  return __awaiter(this, void 0, void 0, function* () {
22044
- yield this._invoker.push(new PullRTCRoomStatusCommand(roomId, tracId, this._context, {
22045
- onUserJoin: this._callAppListener.bind(this, 'onUserJoin'),
22046
- onUserLeave: this._callAppListener.bind(this, 'onUserLeave'),
22047
- onAudioMuteChange: this._onAudioMuteChange.bind(this),
22048
- onVideoMuteChange: this._onVideoMuteChange.bind(this),
22049
- onTrackPublish: this._onTrackPublish.bind(this),
22050
- onTrackUnpublish: this._onTrackUnpublish.bind(this),
22051
- onCDNEnableChange: this._callAppListener.bind(this, 'onCDNEnableChange'),
22052
- }, this._subhook.bind(this), this._dealUserAppListener.bind(this)));
22239
+ yield this._invoker.push(this._pullRTCRoomStatus(roomId, tracId));
22053
22240
  });
22054
22241
  }
22055
22242
  __innerInit(mode, joinType, livingType, innerUserDatas, outerUserDatas, traceId) {
@@ -22915,7 +23102,7 @@ class RCAbstractRoom extends EventEmitter {
22915
23102
  onTrackPublish: this._onTrackPublish.bind(this),
22916
23103
  onTrackUnpublish: this._onTrackUnpublish.bind(this),
22917
23104
  onCDNEnableChange: this._callAppListener.bind(this, 'onCDNEnableChange'),
22918
- }, livingType));
23105
+ }, (pcName) => ({ pushOtherRooms: this._getPushOtherRoomsParams(), headers: this._getRTCReqestHeaders(pcName) }), this._pubhook.bind(this), this.signalRetryTime, this._pullRTCRoomStatus.bind(this), livingType));
22919
23106
  });
22920
23107
  }
22921
23108
  _onAudioMuteChange(audioTrack) {
@@ -22957,6 +23144,9 @@ class MCUConfigFlushCommand extends BaseCommand {
22957
23144
  this.data = data;
22958
23145
  this.cdnValues = cdnValues;
22959
23146
  }
23147
+ get kind() {
23148
+ return RCCommandKind.MCUCONFIG_FLUSH;
23149
+ }
22960
23150
  execute(store, invoker) {
22961
23151
  var _a, _b, _c, _d;
22962
23152
  return __awaiter(this, void 0, void 0, function* () {
@@ -24015,6 +24205,9 @@ class ExchangeWithPushOtherRoomCommand extends BaseCommand {
24015
24205
  }
24016
24206
  });
24017
24207
  }
24208
+ get kind() {
24209
+ return RCCommandKind.EXCHANGE_WITH_PUSH_OTHER_ROOM;
24210
+ }
24018
24211
  execute(store, invoker) {
24019
24212
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
24020
24213
  return __awaiter(this, void 0, void 0, function* () {
@@ -24064,7 +24257,7 @@ class LeaveOtherRoomCommand extends BaseCommand {
24064
24257
  this.isQuitPK = isQuitPK;
24065
24258
  }
24066
24259
  get kind() {
24067
- return RCCommandKind.LeaveRoom;
24260
+ return RCCommandKind.LEAVE_OTHER_ROOM;
24068
24261
  }
24069
24262
  /**
24070
24263
  * 结束跨房间连麦
@@ -24659,6 +24852,9 @@ class EnableInnerCDNCommand extends BaseCommand {
24659
24852
  this.cdnValues = cdnValues;
24660
24853
  this.enable = enable;
24661
24854
  }
24855
+ get kind() {
24856
+ return RCCommandKind.ENABLE_INNER_CDN;
24857
+ }
24662
24858
  execute(store, invoker) {
24663
24859
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
24664
24860
  return __awaiter(this, void 0, void 0, function* () {
@@ -24744,6 +24940,9 @@ class RTCIdentityChangeCommand extends BaseCommand {
24744
24940
  this.livingType = livingType;
24745
24941
  this.traceId = traceId;
24746
24942
  }
24943
+ get kind() {
24944
+ return RCCommandKind.RTC_IDENTITY_CHANGE;
24945
+ }
24747
24946
  execute(store, invoker) {
24748
24947
  var _a;
24749
24948
  return __awaiter(this, void 0, void 0, function* () {
@@ -27897,7 +28096,7 @@ class RCRTCClient extends RCMediaStreamCapture {
27897
28096
  }
27898
28097
  reportSDKInfo() {
27899
28098
  this._context.reportSDKInfo({
27900
- 'plugin-rtc': "5.6.3-alpha.2",
28099
+ 'plugin-rtc': "5.6.3-alpha.3",
27901
28100
  });
27902
28101
  }
27903
28102
  }
@@ -28886,7 +29085,7 @@ const installer = {
28886
29085
  console.error('Please use the https protocol or use `http://localhost` to open the page!');
28887
29086
  return false;
28888
29087
  }
28889
- VersionManage.add('plugin-rtc', "5.6.3-alpha.2");
29088
+ VersionManage.add('plugin-rtc', "5.6.3-alpha.3");
28890
29089
  if (!VersionManage.validEngine("^5.6.0")) {
28891
29090
  console.error(`The current engine version '${VersionManage.getInfo().engine}' error, plugin-rtc required engine version at least '${"^5.6.0"}'.`);
28892
29091
  return false;
@@ -28900,8 +29099,8 @@ const installer = {
28900
29099
  RTCLogger.setLogger(originLogger);
28901
29100
  logger.setLogger(originLogger);
28902
29101
  originLogger.warn(RCLoggerTag.L_INDEX_INSTALL_RTC_PLUGIN_O, JSON.stringify({
28903
- 'RCRTC Version': "5.6.3-alpha.2",
28904
- Commit: "2fda2b34be0736183519f005f2d4157acd8a3161",
29102
+ 'RCRTC Version': "5.6.3-alpha.3",
29103
+ Commit: "db726c933e72872baf32689bc9690c7a34f2bab2",
28905
29104
  'browserInfo.browser': browserInfo.browser,
28906
29105
  'browserInfo.supportsUnifiedPlan': browserInfo.supportsUnifiedPlan,
28907
29106
  'browserInfo.version': browserInfo.version,