@realsee/live 0.5.0-alpha.12 → 0.5.0-alpha.15

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.
@@ -1715,7 +1715,7 @@ class Live extends Subscribe {
1715
1715
  this._handleMessage = (liveMsg) => __awaiter(this, void 0, void 0, function* () {
1716
1716
  var _b, _c, _d, _e, _f, _g;
1717
1717
  if (typeof liveMsg === 'object') {
1718
- const { command, data, frontRequestId, code, message } = liveMsg;
1718
+ const { command, data = {}, frontRequestId, code, message } = liveMsg;
1719
1719
  if (code === 'SUCCESS') {
1720
1720
  switch (command) {
1721
1721
  /**
@@ -1885,8 +1885,8 @@ class Live extends Subscribe {
1885
1885
  }
1886
1886
  const { force = false } = options;
1887
1887
  // 检测一下麦克风权限,hack
1888
- if (this._options.rtc && this._options.jsBridge) {
1889
- const res = yield this._options.jsBridge.detectMicro();
1888
+ if (this._options.rtc) {
1889
+ const res = yield this._options.rtc.detectMicro();
1890
1890
  if (!res) {
1891
1891
  return new Error('Failed to obtain microphone authorization');
1892
1892
  }
@@ -2265,11 +2265,11 @@ function createLiveReact(options) {
2265
2265
  * @deprecated
2266
2266
  * @returns
2267
2267
  */
2268
- const unsafe__useLiveInstance = () => useLiveInstance();
2268
+ const unsafe__useLiveInstance = () => live;
2269
2269
  /**
2270
2270
  * 使用rtc实例
2271
2271
  */
2272
- const useRTCInstance = () => useLiveInstance().$RTC;
2272
+ const useRTCInstance = () => live.$RTC;
2273
2273
  /**
2274
2274
  * 不建议这样使用
2275
2275
  * @deprecated
@@ -2279,7 +2279,7 @@ function createLiveReact(options) {
2279
2279
  /**
2280
2280
  * 带看连接操作
2281
2281
  */
2282
- const useConnect = () => (options) => __awaiter(this, void 0, void 0, function* () { return yield useLiveInstance().connect(options); });
2282
+ const useConnect = () => (options) => __awaiter(this, void 0, void 0, function* () { return yield live.connect(options); });
2283
2283
  /**
2284
2284
  *
2285
2285
  * @param name