@realsee/live 0.4.0-beta.3 → 0.4.0-beta.6

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.
@@ -490,6 +490,8 @@ class BrowserRTC4Chime extends CoreRTC {
490
490
  });
491
491
  }
492
492
  quit() {
493
+ if (!this.joined)
494
+ return Promise.resolve(true);
493
495
  return new Promise((success, fail) => {
494
496
  var _a, _b;
495
497
  this.joined = false;
@@ -1056,6 +1058,7 @@ class LiveController {
1056
1058
  clearInterval(this.healthCheckId);
1057
1059
  this.healthCheckId = undefined;
1058
1060
  }
1061
+ return true;
1059
1062
  };
1060
1063
  /**
1061
1064
  * 销毁WebSocket相关依赖。
@@ -1081,6 +1084,7 @@ class LiveController {
1081
1084
  }
1082
1085
  this.webSocket.close();
1083
1086
  this.webSocket = undefined;
1087
+ return true;
1084
1088
  };
1085
1089
  this.options = Object.assign({ autoConnect: true, healthCheck: 3000 }, options);
1086
1090
  }
@@ -1259,7 +1263,7 @@ function createLive(options) {
1259
1263
  super();
1260
1264
  this.keyframes = new Subscribe();
1261
1265
  const jsBridge = (() => {
1262
- if (!options.jsBridge)
1266
+ if (options.jsBridge)
1263
1267
  return options.jsBridge;
1264
1268
  if (options.useBuiltInJsBridge)
1265
1269
  return new JSBridge();
@@ -1490,8 +1494,14 @@ function createLive(options) {
1490
1494
  }
1491
1495
  async exit() {
1492
1496
  /** 退出强制关闭语音(?) */
1493
- await this.$RTC.quit();
1494
- return await this.updateStatus(BuiltinEventType.RoomChange, BuiltinActionType.RoomClose, {});
1497
+ try {
1498
+ this.$RTC.quit();
1499
+ await this.updateStatus(BuiltinEventType.RoomChange, BuiltinActionType.RoomClose, {});
1500
+ }
1501
+ catch (e) {
1502
+ console.log(e);
1503
+ }
1504
+ return liveController.dispose();
1495
1505
  }
1496
1506
  async connect(options = {}) {
1497
1507
  // 连接 WebSocket 前验证麦克风权限