@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.umd.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
  (function (global, factory) {
@@ -964,6 +964,18 @@
964
964
  * 取消订阅本地清除的订阅关系列表
965
965
  */
966
966
  RCLoggerTag["L_CLEAR_UNSUBSCRIBE_LIST_O"] = "L-clear_unsubscribe_list-O";
967
+ /**
968
+ * 队列任务插入
969
+ */
970
+ RCLoggerTag["L_INVOKER_PUSH_O"] = "L-invoker_push-O";
971
+ /**
972
+ * 队列任务开始执行
973
+ */
974
+ RCLoggerTag["L_INVOKER_EXECUTE_T"] = "L-invoker_execute-T";
975
+ /**
976
+ * 队列任务执行结束
977
+ */
978
+ RCLoggerTag["L_INVOKER_EXECUTE_R"] = "L-invoker_execute-R";
967
979
  })(RCLoggerTag || (RCLoggerTag = {}));
968
980
  var RCLoggerStatus;
969
981
  (function (RCLoggerStatus) {
@@ -14759,7 +14771,7 @@
14759
14771
  'Content-Type': 'application/json;charset=UTF-8',
14760
14772
  'Cache-Control': 'no-cache',
14761
14773
  ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
14762
- ClientVersion: "5.6.3-alpha.2",
14774
+ ClientVersion: "5.6.3-alpha.3",
14763
14775
  'Client-Session-Id': getUUID(),
14764
14776
  'Request-Id': Date.now().toString(),
14765
14777
  });
@@ -15337,7 +15349,7 @@
15337
15349
  'Content-Type': 'application/json;charset=UTF-8',
15338
15350
  'Cache-Control': 'no-cache',
15339
15351
  ClientType: `web|${browserInfo.browser}|${browserInfo.version}`,
15340
- ClientVersion: "5.6.3-alpha.2",
15352
+ ClientVersion: "5.6.3-alpha.3",
15341
15353
  'Client-Session-Id': getUUID(),
15342
15354
  'Request-Id': Date.now().toString(),
15343
15355
  });
@@ -18693,7 +18705,7 @@
18693
18705
  * 加入房间
18694
18706
  */
18695
18707
  sendR1() {
18696
- const rtcVersion = "5.6.3-alpha.2";
18708
+ const rtcVersion = "5.6.3-alpha.3";
18697
18709
  const imVersion = this._context.getCoreVersion();
18698
18710
  const platform = 'web';
18699
18711
  const pcName = navigator.platform;
@@ -18843,7 +18855,7 @@
18843
18855
  _formatR1Data() {
18844
18856
  return {
18845
18857
  joinTime: this._context.userJoinTime || 0,
18846
- rtcVersion: "5.6.3-alpha.2",
18858
+ rtcVersion: "5.6.3-alpha.3",
18847
18859
  imVersion: this._context.getCoreVersion(),
18848
18860
  platform: 'web',
18849
18861
  device: navigator.platform,
@@ -19292,24 +19304,84 @@
19292
19304
  /* 定义命令类型 */
19293
19305
  var RCCommandKind;
19294
19306
  (function (RCCommandKind) {
19307
+ /**
19308
+ * 发信令取消加入房间之前的资源
19309
+ */
19310
+ RCCommandKind["UNPUBLISH_PREV"] = "UnpublishPrevCommand";
19311
+ /**
19312
+ * 拉取房间内数据
19313
+ */
19314
+ RCCommandKind["PULL_RTCROOM_STATUS"] = "PullRTCRoomStatusCommand";
19315
+ /**
19316
+ * 加入房间
19317
+ */
19318
+ RCCommandKind["JOINROOM"] = "JoinRoomCommand";
19319
+ /**
19320
+ * 解析远端资源数据
19321
+ */
19322
+ RCCommandKind["PARSE_REMOTERES"] = "ParseRemoteResCommand";
19323
+ /**
19324
+ * 解析远端人员数据
19325
+ */
19326
+ RCCommandKind["PARSE_USERSTATE"] = "ParseUserStateCommand";
19327
+ /**
19328
+ * 本端 track 禁用/启用
19329
+ */
19330
+ RCCommandKind["LOCAL_TRACK_MUTE"] = "LocalTrackMuteCommand";
19331
+ /**
19332
+ * 发布资源
19333
+ */
19334
+ RCCommandKind["PUBLISH"] = "PublishCommand";
19335
+ /**
19336
+ * 恢复 ice 连接
19337
+ */
19338
+ RCCommandKind["RETRY_EXCHANGE"] = "RetryExchangeCommand";
19339
+ /**
19340
+ * 取消发布
19341
+ */
19342
+ RCCommandKind["UNPUBLISH"] = "UnpublishCommand";
19343
+ /**
19344
+ * 订阅
19345
+ */
19346
+ RCCommandKind["SUBSCRIBE"] = "SubscribeCommand";
19347
+ /**
19348
+ * 异步订阅、取消订阅、全量订阅
19349
+ */
19350
+ RCCommandKind["ASYNC_COMMAND"] = "AsyncCommand";
19351
+ /**
19352
+ * 取消订阅
19353
+ */
19354
+ RCCommandKind["UNSUBSCRIBE"] = "UnsubscribeCommand";
19355
+ /**
19356
+ * 全量订阅
19357
+ */
19358
+ RCCommandKind["UPDATE_SUBSCRIBE_LIST"] = "UpdateSubscribeListCommand";
19359
+ /**
19360
+ * im 重连房间内人员、资源处理
19361
+ */
19362
+ RCCommandKind["ON_SIGNAL_RECONNECTED"] = "OnSignalReconnectedCommand";
19363
+ /**
19364
+ * 退出副房间
19365
+ */
19366
+ RCCommandKind["LEAVE_OTHER_ROOM"] = "LeaveOtherRoomCommand";
19367
+ /**
19368
+ * 主播、观众切换身份
19369
+ */
19370
+ RCCommandKind["RTC_IDENTITY_CHANGE"] = "RTCIdentityChangeCommand";
19371
+ /**
19372
+ * 开/关 CDN
19373
+ */
19374
+ RCCommandKind["ENABLE_INNER_CDN"] = "EnableInnerCDNCommand";
19375
+ /**
19376
+ * 携带副房间信息重新发 /exchange 请求
19377
+ */
19378
+ RCCommandKind["EXCHANGE_WITH_PUSH_OTHER_ROOM"] = "ExchangeWithPushOtherRoomCommand";
19379
+ /**
19380
+ * 发送 MCU 请求
19381
+ */
19382
+ RCCommandKind["MCUCONFIG_FLUSH"] = "MCUConfigFlushCommand";
19295
19383
  // 未定议的
19296
- RCCommandKind[RCCommandKind["Unknow"] = 0] = "Unknow";
19297
- // 发布资源
19298
- RCCommandKind[RCCommandKind["Publish"] = 1] = "Publish";
19299
- // 取消发布资源
19300
- RCCommandKind[RCCommandKind["UnPublish"] = 2] = "UnPublish";
19301
- // 加入房间
19302
- RCCommandKind[RCCommandKind["JoinRoom"] = 3] = "JoinRoom";
19303
- // 离开房间
19304
- RCCommandKind[RCCommandKind["LeaveRoom"] = 4] = "LeaveRoom";
19305
- // 更新订阅列表
19306
- RCCommandKind[RCCommandKind["UpdateSubscribeTask"] = 5] = "UpdateSubscribeTask";
19307
- // 资源订阅
19308
- RCCommandKind[RCCommandKind["SubscribedTask"] = 6] = "SubscribedTask";
19309
- // 取消资源订阅
19310
- RCCommandKind[RCCommandKind["UnSubscribedTask"] = 7] = "UnSubscribedTask";
19311
- // 异步事件命令
19312
- RCCommandKind["AsyncCommand"] = "AsyncCommand";
19384
+ RCCommandKind["UNKNOWN"] = "Unknown";
19313
19385
  })(RCCommandKind || (RCCommandKind = {}));
19314
19386
 
19315
19387
  // 描述 链表 中的位置
@@ -19345,7 +19417,7 @@
19345
19417
  * @returns 命令的种类。
19346
19418
  */
19347
19419
  get kind() {
19348
- return RCCommandKind.Unknow;
19420
+ return RCCommandKind.UNKNOWN;
19349
19421
  }
19350
19422
  }
19351
19423
 
@@ -19355,7 +19427,7 @@
19355
19427
  this.state = state;
19356
19428
  }
19357
19429
  get kind() {
19358
- return RCCommandKind.AsyncCommand;
19430
+ return RCCommandKind.ASYNC_COMMAND;
19359
19431
  }
19360
19432
  /**
19361
19433
  * `public setState(状态:RCLinkedListPoint):void`
@@ -19642,7 +19714,7 @@
19642
19714
  }
19643
19715
 
19644
19716
  class BaseInvoker {
19645
- constructor(
19717
+ constructor(context,
19646
19718
  /**
19647
19719
  * 内存数据管理实例
19648
19720
  */
@@ -19651,6 +19723,7 @@
19651
19723
  * 命令终止时返回的错误码定义
19652
19724
  */
19653
19725
  abortCode) {
19726
+ this.context = context;
19654
19727
  this._store = _store;
19655
19728
  this.abortCode = abortCode;
19656
19729
  // command 队列
@@ -19664,6 +19737,7 @@
19664
19737
  this._execute();
19665
19738
  }
19666
19739
  _execute() {
19740
+ var _a, _b, _c, _d;
19667
19741
  return __awaiter(this, void 0, void 0, function* () {
19668
19742
  if (this._isDestroyed || this._busy || this._queue.length === 0) {
19669
19743
  return;
@@ -19671,23 +19745,37 @@
19671
19745
  this._busy = true;
19672
19746
  const { command, resolve, reject } = this._queue.shift();
19673
19747
  let res;
19748
+ const traceId = (_a = this.context.logger) === null || _a === void 0 ? void 0 : _a.createTraceId();
19674
19749
  try {
19675
19750
  /**
19676
19751
  * 说明:由于是先弹出 再执行 Command,所以不存在 在队列中正在执行的任务
19677
19752
  */
19753
+ (_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);
19678
19754
  res = yield command.execute(this._store, this);
19679
19755
  }
19680
19756
  catch (error) {
19757
+ (_c = this.context.logger) === null || _c === void 0 ? void 0 : _c.error(RCLoggerTag.L_INVOKER_EXECUTE_R, JSON.stringify({
19758
+ error,
19759
+ status: RCLoggerStatus.FAILED,
19760
+ commandKind: command.kind,
19761
+ }), traceId);
19681
19762
  reject(error);
19682
19763
  this._next();
19683
19764
  return;
19684
19765
  }
19766
+ (_d = this.context.logger) === null || _d === void 0 ? void 0 : _d.info(RCLoggerTag.L_INVOKER_EXECUTE_R, `status: ${RCLoggerStatus.SUCCESSED}, commandKind: ${command.kind}`, traceId);
19685
19767
  resolve(res);
19686
19768
  this._next();
19687
19769
  });
19688
19770
  }
19689
19771
  push(command) {
19690
19772
  return new Promise((resolve, reject) => {
19773
+ var _a;
19774
+ (_a = this.context.logger) === null || _a === void 0 ? void 0 : _a.info(RCLoggerTag.L_INVOKER_PUSH_O, JSON.stringify({
19775
+ isDestroyed: this._isDestroyed,
19776
+ commandKind: command.kind,
19777
+ commandLength: this._queue.length,
19778
+ }));
19691
19779
  // 房间已销毁
19692
19780
  if (this._isDestroyed) {
19693
19781
  reject({
@@ -19700,7 +19788,7 @@
19700
19788
  // 所以只要队列中存在中 Subscribed 或 UnSubscribed 则可以只执行最后一个
19701
19789
  const { kind } = command;
19702
19790
  if (this._queue.length > 0) {
19703
- if (kind === RCCommandKind.AsyncCommand) {
19791
+ if (kind === RCCommandKind.ASYNC_COMMAND) {
19704
19792
  // 重写 resolve, reject 并将使用新回调的进行包裹它
19705
19793
  ({ command, resolve, reject } = this.commandOffset(command, resolve, reject));
19706
19794
  }
@@ -19729,7 +19817,7 @@
19729
19817
  });
19730
19818
  }
19731
19819
  /**
19732
- * 查找出 RCCommandKind.AsyncCommand 类型的 Command,并将其从队列中删除
19820
+ * 查找出 RCCommandKind.ASYNC_COMMAND 类型的 Command,并将其从队列中删除
19733
19821
  * 并使用最新的一次 Command 接管它的 resolve & reject
19734
19822
  * @param resolve
19735
19823
  * @param reject
@@ -19739,7 +19827,7 @@
19739
19827
  // 因为一次只可以插入一个 Command 所以查找 只需要在队列最后查找一个即可
19740
19828
  const index = this._queue.length - 1;
19741
19829
  const item = this._queue[index];
19742
- const hashSubscribTask = item.command.kind === RCCommandKind.AsyncCommand;
19830
+ const hashSubscribTask = item.command.kind === RCCommandKind.ASYNC_COMMAND;
19743
19831
  // 如果队列中不存在则直接返回
19744
19832
  if (!hashSubscribTask) {
19745
19833
  return { command, resolve, reject };
@@ -19792,7 +19880,7 @@
19792
19880
  */
19793
19881
  class Invoker extends BaseInvoker {
19794
19882
  constructor(context, service, peerMrg, roomId, crtUserId, mode, reporter, isUpgrade, isMainRoom) {
19795
- super(new Store(context, service, peerMrg, roomId, crtUserId, mode, reporter, isUpgrade, isMainRoom), exports.RCRTCCode.ROOM_HAS_BEEN_DESTROYED);
19883
+ super(context, new Store(context, service, peerMrg, roomId, crtUserId, mode, reporter, isUpgrade, isMainRoom), exports.RCRTCCode.ROOM_HAS_BEEN_DESTROYED);
19796
19884
  }
19797
19885
  /**
19798
19886
  * 获取 store 存储实例,返回值类型 `ReadableStore`,避免非 command 定义中修改内存
@@ -19812,6 +19900,9 @@
19812
19900
  * 该步骤没有必要与 MediaServer 的交互,因后续资源变更交互为全量交互
19813
19901
  */
19814
19902
  class UnpublishPrevCommand extends BaseCommand {
19903
+ get kind() {
19904
+ return RCCommandKind.UNPUBLISH_PREV;
19905
+ }
19815
19906
  execute(store) {
19816
19907
  var _a, _b, _c, _d, _e, _f, _g, _h;
19817
19908
  return __awaiter(this, void 0, void 0, function* () {
@@ -19891,7 +19982,7 @@
19891
19982
  this.traceId = traceId;
19892
19983
  }
19893
19984
  get kind() {
19894
- return RCCommandKind.JoinRoom;
19985
+ return RCCommandKind.JOINROOM;
19895
19986
  }
19896
19987
  execute(store, invoker) {
19897
19988
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
@@ -20086,6 +20177,9 @@
20086
20177
  this.forceReq = forceReq;
20087
20178
  this.traceId = traceId;
20088
20179
  }
20180
+ get kind() {
20181
+ return RCCommandKind.UPDATE_SUBSCRIBE_LIST;
20182
+ }
20089
20183
  execute(store, invoker) {
20090
20184
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
20091
20185
  return __awaiter(this, void 0, void 0, function* () {
@@ -20230,6 +20324,9 @@
20230
20324
  this.subhook = subhook;
20231
20325
  this.traceId = traceId;
20232
20326
  }
20327
+ get kind() {
20328
+ return RCCommandKind.UNSUBSCRIBE;
20329
+ }
20233
20330
  execute(store, invoker) {
20234
20331
  var _a, _b, _c, _d;
20235
20332
  return __awaiter(this, void 0, void 0, function* () {
@@ -20617,6 +20714,9 @@
20617
20714
  this.subhook = subhook;
20618
20715
  this.traceId = traceId;
20619
20716
  }
20717
+ get kind() {
20718
+ return RCCommandKind.PARSE_USERSTATE;
20719
+ }
20620
20720
  get priority() {
20621
20721
  return CommandPriority.NORMAL;
20622
20722
  }
@@ -20711,6 +20811,9 @@
20711
20811
  this.callback = callback;
20712
20812
  this.traceId = traceId;
20713
20813
  }
20814
+ get kind() {
20815
+ return RCCommandKind.PARSE_REMOTERES;
20816
+ }
20714
20817
  get priority() {
20715
20818
  return CommandPriority.NORMAL;
20716
20819
  }
@@ -20842,6 +20945,9 @@
20842
20945
  this.subhook = subhook;
20843
20946
  this.forceReq = forceReq;
20844
20947
  }
20948
+ get kind() {
20949
+ return RCCommandKind.SUBSCRIBE;
20950
+ }
20845
20951
  execute(store, invoker) {
20846
20952
  var _a, _b, _c, _d, _e, _f, _g, _h;
20847
20953
  return __awaiter(this, void 0, void 0, function* () {
@@ -20961,7 +21067,7 @@
20961
21067
  this._traceId = (_a = this._logger) === null || _a === void 0 ? void 0 : _a.createTraceId();
20962
21068
  }
20963
21069
  get kind() {
20964
- return RCCommandKind.Publish;
21070
+ return RCCommandKind.PUBLISH;
20965
21071
  }
20966
21072
  /**
20967
21073
  * 从 pc 移除当次发布失败的资源
@@ -21296,7 +21402,7 @@
21296
21402
  this.unpubhook = unpubhook;
21297
21403
  }
21298
21404
  get kind() {
21299
- return RCCommandKind.UnPublish;
21405
+ return RCCommandKind.UNPUBLISH;
21300
21406
  }
21301
21407
  __unpublish(store, invoker, peerCItem, tracks) {
21302
21408
  var _a, _b, _c, _d;
@@ -21483,6 +21589,9 @@
21483
21589
  this.localTrack = localTrack;
21484
21590
  this._recvSignalResultFn = _recvSignalResultFn;
21485
21591
  }
21592
+ get kind() {
21593
+ return RCCommandKind.LOCAL_TRACK_MUTE;
21594
+ }
21486
21595
  execute(store, invoker) {
21487
21596
  var _a, _b, _c, _d;
21488
21597
  return __awaiter(this, void 0, void 0, function* () {
@@ -21536,6 +21645,9 @@
21536
21645
  this.isPub = isPub;
21537
21646
  this.retryHook = retryHook;
21538
21647
  }
21648
+ get kind() {
21649
+ return RCCommandKind.RETRY_EXCHANGE;
21650
+ }
21539
21651
  get priority() {
21540
21652
  return CommandPriority.HIGH;
21541
21653
  }
@@ -21573,12 +21685,19 @@
21573
21685
  }
21574
21686
 
21575
21687
  class OnSignalReconnectedCommand extends BaseCommand {
21576
- constructor(subhook, callbacks, livingType) {
21688
+ constructor(subhook, callbacks, _retryHook, _pubhook, _signalRetryTime = PUBLISHSIGNALRETRYTIME, _pullRTCRoomStatus, livingType) {
21577
21689
  super();
21578
21690
  this.subhook = subhook;
21579
21691
  this.callbacks = callbacks;
21692
+ this._retryHook = _retryHook;
21693
+ this._pubhook = _pubhook;
21694
+ this._signalRetryTime = _signalRetryTime;
21695
+ this._pullRTCRoomStatus = _pullRTCRoomStatus;
21580
21696
  this.livingType = livingType;
21581
21697
  }
21698
+ get kind() {
21699
+ return RCCommandKind.ON_SIGNAL_RECONNECTED;
21700
+ }
21582
21701
  /**
21583
21702
  * @override
21584
21703
  */
@@ -21586,10 +21705,11 @@
21586
21705
  return CommandPriority.HIGH;
21587
21706
  }
21588
21707
  execute(store, invoker) {
21589
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
21708
+ var _a, _b, _c, _d, _e, _f;
21590
21709
  return __awaiter(this, void 0, void 0, function* () {
21591
- const { livingType } = this;
21592
21710
  const { roomId, roomMode } = store;
21711
+ this._roomId = roomId;
21712
+ this._roomMode = roomMode;
21593
21713
  const traceId = (_b = (_a = store.context) === null || _a === void 0 ? void 0 : _a.logger) === null || _b === void 0 ? void 0 : _b.createTraceId();
21594
21714
  (_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);
21595
21715
  /**
@@ -21607,9 +21727,32 @@
21607
21727
  this.callbacks.onPeerClosed && this.callbacks.onPeerClosed();
21608
21728
  return;
21609
21729
  }
21610
- const { code, data } = yield store.context.joinRTCRoom(roomId, roomMode, livingType);
21730
+ const { code: pingCode } = yield store.context.rtcPing(roomId, roomMode);
21731
+ /**
21732
+ * 不在房间内时,需重新加房间,恢复资源状态
21733
+ * ErrorCode 增加 40001 需更新 im 包,暂时转为数字对比
21734
+ * 在房间内获取房间内最新数据
21735
+ */
21736
+ if (pingCode === 40001) {
21737
+ const code = yield this._joinRoom(store, traceId, invoker);
21738
+ /**
21739
+ * 加入房间成功后,恢复和 mediaServer 服务之间的连接
21740
+ */
21741
+ if (code === engine.ErrorCode.SUCCESS) {
21742
+ yield this._restoreMediaServer(store, invoker);
21743
+ }
21744
+ }
21745
+ else {
21746
+ yield this._pullRTCRoomStatus(this._roomId, traceId).execute(store, invoker);
21747
+ }
21748
+ });
21749
+ }
21750
+ _joinRoom(store, traceId, invoker) {
21751
+ var _a, _b, _c, _d, _e, _f, _g;
21752
+ return __awaiter(this, void 0, void 0, function* () {
21753
+ const { code, data } = yield store.context.joinRTCRoom(this._roomId, this._roomMode, this.livingType);
21611
21754
  if (code !== engine.ErrorCode.SUCCESS) {
21612
- (_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({
21755
+ (_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({
21613
21756
  status: RCLoggerStatus.FAILED,
21614
21757
  code,
21615
21758
  msg: 'im reconnect joinRTCRoom failed',
@@ -21617,7 +21760,7 @@
21617
21760
  return;
21618
21761
  }
21619
21762
  if (!data) {
21620
- (_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({
21763
+ (_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({
21621
21764
  status: RCLoggerStatus.FAILED,
21622
21765
  msg: 'im reconnect joinRTCRoom, roomData is empty',
21623
21766
  }), traceId);
@@ -21626,13 +21769,38 @@
21626
21769
  /**
21627
21770
  * 处理全量的房间数据
21628
21771
  */
21629
- const CDNUris = (_l = data.roomInfo.filter((item) => item.key === 'cdn_uris')[0]) === null || _l === void 0 ? void 0 : _l.value;
21772
+ const CDNUris = (_e = data.roomInfo.filter((item) => item.key === 'cdn_uris')[0]) === null || _e === void 0 ? void 0 : _e.value;
21630
21773
  handleFullRoomData(data, store, this.callbacks, invoker, this.subhook, CDNUris, traceId);
21631
- (_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({
21774
+ (_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({
21632
21775
  status: RCLoggerStatus.SUCCESSED,
21633
21776
  roomData: data,
21634
21777
  }), traceId);
21635
- return { data };
21778
+ return code;
21779
+ });
21780
+ }
21781
+ _restoreMediaServer(store, invoker) {
21782
+ return __awaiter(this, void 0, void 0, function* () {
21783
+ const { useMutilPeerC } = store.peerMgr;
21784
+ const localTracks = store.getLocalTracks();
21785
+ const subedTracks = Object.values(store.getRemoteTracks()).filter((track) => !!track.isSubscribed());
21786
+ /**
21787
+ * 多 peerConnection 恢复订阅资源
21788
+ */
21789
+ if (useMutilPeerC) {
21790
+ /**
21791
+ * 多 peerConnection 恢复发布资源
21792
+ */
21793
+ subedTracks.length && (yield new SubscribeCommand(subedTracks, this.subhook, true).execute(store, invoker));
21794
+ localTracks.length && (yield new PublishCommand(localTracks, this._pubhook, this._signalRetryTime).execute(store, invoker));
21795
+ return;
21796
+ }
21797
+ /**
21798
+ * 单 peerConnection 恢复发布、订阅资源
21799
+ */
21800
+ localTracks.length && (yield new PublishCommand(localTracks, this._pubhook, this._signalRetryTime).execute(store, invoker));
21801
+ if (!localTracks.length && subedTracks.length) {
21802
+ yield new SubscribeCommand(subedTracks, this.subhook, true).execute(store, invoker);
21803
+ }
21636
21804
  });
21637
21805
  }
21638
21806
  }
@@ -21650,6 +21818,9 @@
21650
21818
  this._logger = null;
21651
21819
  this._logger = RTCLogger.getLogger();
21652
21820
  }
21821
+ get kind() {
21822
+ return RCCommandKind.ASYNC_COMMAND;
21823
+ }
21653
21824
  execute(store, invoker) {
21654
21825
  var _a, _b, _c, _d;
21655
21826
  return __awaiter(this, void 0, void 0, function* () {
@@ -21713,6 +21884,9 @@
21713
21884
  this.subhook = subhook;
21714
21885
  this.callbacks = callbacks;
21715
21886
  }
21887
+ get kind() {
21888
+ return RCCommandKind.ASYNC_COMMAND;
21889
+ }
21716
21890
  execute(store, invoker) {
21717
21891
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
21718
21892
  return __awaiter(this, void 0, void 0, function* () {
@@ -21807,6 +21981,9 @@
21807
21981
  this.subhook = subhook;
21808
21982
  this.callbacks = callbacks;
21809
21983
  }
21984
+ get kind() {
21985
+ return RCCommandKind.ASYNC_COMMAND;
21986
+ }
21810
21987
  execute(store, invoker) {
21811
21988
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
21812
21989
  return __awaiter(this, void 0, void 0, function* () {
@@ -21913,8 +22090,11 @@
21913
22090
  this._subhook = _subhook;
21914
22091
  this._dealUserAppListener = _dealUserAppListener;
21915
22092
  }
22093
+ get kind() {
22094
+ return RCCommandKind.PULL_RTCROOM_STATUS;
22095
+ }
21916
22096
  execute(store, invoker) {
21917
- var _a, _b;
22097
+ var _a, _b, _c;
21918
22098
  return __awaiter(this, void 0, void 0, function* () {
21919
22099
  const version = store.getRoomStatusVersion();
21920
22100
  (_a = this._context.logger) === null || _a === void 0 ? void 0 : _a.info(RCLoggerTag.L_PULL_ROOM_STATUS_T, JSON.stringify({
@@ -21923,10 +22103,14 @@
21923
22103
  }), this._traceId);
21924
22104
  const { code, data } = yield this._context.pullRTCRoomStatus(this._roomId, version);
21925
22105
  if (code !== engine.ErrorCode.SUCCESS) {
22106
+ (_b = this._context.logger) === null || _b === void 0 ? void 0 : _b.info(RCLoggerTag.L_PULL_ROOM_STATUS_R, JSON.stringify({
22107
+ status: RCLoggerStatus.FAILED,
22108
+ code,
22109
+ }), this._traceId);
21926
22110
  return { code };
21927
22111
  }
21928
22112
  const { bFullStatus, version: newVersion, usersData, roomStatus, } = data;
21929
- (_b = this._context.logger) === null || _b === void 0 ? void 0 : _b.info(RCLoggerTag.L_PULL_ROOM_STATUS_R, JSON.stringify({
22113
+ (_c = this._context.logger) === null || _c === void 0 ? void 0 : _c.info(RCLoggerTag.L_PULL_ROOM_STATUS_R, JSON.stringify({
21930
22114
  bFullStatus,
21931
22115
  version: int64ToTimestamp(newVersion),
21932
22116
  usersData,
@@ -22039,21 +22223,24 @@
22039
22223
  }
22040
22224
  }));
22041
22225
  }
22226
+ _pullRTCRoomStatus(roomId, tracId) {
22227
+ return new PullRTCRoomStatusCommand(roomId, tracId, this._context, {
22228
+ onUserJoin: this._callAppListener.bind(this, 'onUserJoin'),
22229
+ onUserLeave: this._callAppListener.bind(this, 'onUserLeave'),
22230
+ onAudioMuteChange: this._onAudioMuteChange.bind(this),
22231
+ onVideoMuteChange: this._onVideoMuteChange.bind(this),
22232
+ onTrackPublish: this._onTrackPublish.bind(this),
22233
+ onTrackUnpublish: this._onTrackUnpublish.bind(this),
22234
+ onCDNEnableChange: this._callAppListener.bind(this, 'onCDNEnableChange'),
22235
+ }, this._subhook.bind(this), this._dealUserAppListener.bind(this));
22236
+ }
22042
22237
  /**
22043
22238
  * 拉取房间数据
22044
22239
  * @param roomId 房间 id
22045
22240
  */
22046
22241
  _startPullRTCRoomStatus(roomId, tracId) {
22047
22242
  return __awaiter(this, void 0, void 0, function* () {
22048
- yield this._invoker.push(new PullRTCRoomStatusCommand(roomId, tracId, this._context, {
22049
- onUserJoin: this._callAppListener.bind(this, 'onUserJoin'),
22050
- onUserLeave: this._callAppListener.bind(this, 'onUserLeave'),
22051
- onAudioMuteChange: this._onAudioMuteChange.bind(this),
22052
- onVideoMuteChange: this._onVideoMuteChange.bind(this),
22053
- onTrackPublish: this._onTrackPublish.bind(this),
22054
- onTrackUnpublish: this._onTrackUnpublish.bind(this),
22055
- onCDNEnableChange: this._callAppListener.bind(this, 'onCDNEnableChange'),
22056
- }, this._subhook.bind(this), this._dealUserAppListener.bind(this)));
22243
+ yield this._invoker.push(this._pullRTCRoomStatus(roomId, tracId));
22057
22244
  });
22058
22245
  }
22059
22246
  __innerInit(mode, joinType, livingType, innerUserDatas, outerUserDatas, traceId) {
@@ -22919,7 +23106,7 @@
22919
23106
  onTrackPublish: this._onTrackPublish.bind(this),
22920
23107
  onTrackUnpublish: this._onTrackUnpublish.bind(this),
22921
23108
  onCDNEnableChange: this._callAppListener.bind(this, 'onCDNEnableChange'),
22922
- }, livingType));
23109
+ }, (pcName) => ({ pushOtherRooms: this._getPushOtherRoomsParams(), headers: this._getRTCReqestHeaders(pcName) }), this._pubhook.bind(this), this.signalRetryTime, this._pullRTCRoomStatus.bind(this), livingType));
22923
23110
  });
22924
23111
  }
22925
23112
  _onAudioMuteChange(audioTrack) {
@@ -22961,6 +23148,9 @@
22961
23148
  this.data = data;
22962
23149
  this.cdnValues = cdnValues;
22963
23150
  }
23151
+ get kind() {
23152
+ return RCCommandKind.MCUCONFIG_FLUSH;
23153
+ }
22964
23154
  execute(store, invoker) {
22965
23155
  var _a, _b, _c, _d;
22966
23156
  return __awaiter(this, void 0, void 0, function* () {
@@ -24019,6 +24209,9 @@
24019
24209
  }
24020
24210
  });
24021
24211
  }
24212
+ get kind() {
24213
+ return RCCommandKind.EXCHANGE_WITH_PUSH_OTHER_ROOM;
24214
+ }
24022
24215
  execute(store, invoker) {
24023
24216
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
24024
24217
  return __awaiter(this, void 0, void 0, function* () {
@@ -24068,7 +24261,7 @@
24068
24261
  this.isQuitPK = isQuitPK;
24069
24262
  }
24070
24263
  get kind() {
24071
- return RCCommandKind.LeaveRoom;
24264
+ return RCCommandKind.LEAVE_OTHER_ROOM;
24072
24265
  }
24073
24266
  /**
24074
24267
  * 结束跨房间连麦
@@ -24663,6 +24856,9 @@
24663
24856
  this.cdnValues = cdnValues;
24664
24857
  this.enable = enable;
24665
24858
  }
24859
+ get kind() {
24860
+ return RCCommandKind.ENABLE_INNER_CDN;
24861
+ }
24666
24862
  execute(store, invoker) {
24667
24863
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
24668
24864
  return __awaiter(this, void 0, void 0, function* () {
@@ -24748,6 +24944,9 @@
24748
24944
  this.livingType = livingType;
24749
24945
  this.traceId = traceId;
24750
24946
  }
24947
+ get kind() {
24948
+ return RCCommandKind.RTC_IDENTITY_CHANGE;
24949
+ }
24751
24950
  execute(store, invoker) {
24752
24951
  var _a;
24753
24952
  return __awaiter(this, void 0, void 0, function* () {
@@ -27901,7 +28100,7 @@
27901
28100
  }
27902
28101
  reportSDKInfo() {
27903
28102
  this._context.reportSDKInfo({
27904
- 'plugin-rtc': "5.6.3-alpha.2",
28103
+ 'plugin-rtc': "5.6.3-alpha.3",
27905
28104
  });
27906
28105
  }
27907
28106
  }
@@ -28890,7 +29089,7 @@ message probuf {
28890
29089
  console.error('Please use the https protocol or use `http://localhost` to open the page!');
28891
29090
  return false;
28892
29091
  }
28893
- engine.VersionManage.add('plugin-rtc', "5.6.3-alpha.2");
29092
+ engine.VersionManage.add('plugin-rtc', "5.6.3-alpha.3");
28894
29093
  if (!engine.VersionManage.validEngine("^5.6.0")) {
28895
29094
  console.error(`The current engine version '${engine.VersionManage.getInfo().engine}' error, plugin-rtc required engine version at least '${"^5.6.0"}'.`);
28896
29095
  return false;
@@ -28904,8 +29103,8 @@ message probuf {
28904
29103
  RTCLogger.setLogger(originLogger);
28905
29104
  logger.setLogger(originLogger);
28906
29105
  originLogger.warn(RCLoggerTag.L_INDEX_INSTALL_RTC_PLUGIN_O, JSON.stringify({
28907
- 'RCRTC Version': "5.6.3-alpha.2",
28908
- Commit: "2fda2b34be0736183519f005f2d4157acd8a3161",
29106
+ 'RCRTC Version': "5.6.3-alpha.3",
29107
+ Commit: "db726c933e72872baf32689bc9690c7a34f2bab2",
28909
29108
  'browserInfo.browser': browserInfo.browser,
28910
29109
  'browserInfo.supportsUnifiedPlan': browserInfo.supportsUnifiedPlan,
28911
29110
  'browserInfo.version': browserInfo.version,