@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.
@@ -1705,7 +1705,7 @@ class Live extends Subscribe {
1705
1705
  this._handleMessage = (liveMsg) => __awaiter(this, void 0, void 0, function* () {
1706
1706
  var _b, _c, _d, _e, _f, _g;
1707
1707
  if (typeof liveMsg === 'object') {
1708
- const { command, data, frontRequestId, code, message } = liveMsg;
1708
+ const { command, data = {}, frontRequestId, code, message } = liveMsg;
1709
1709
  if (code === 'SUCCESS') {
1710
1710
  switch (command) {
1711
1711
  /**
@@ -1875,8 +1875,8 @@ class Live extends Subscribe {
1875
1875
  }
1876
1876
  const { force = false } = options;
1877
1877
  // 检测一下麦克风权限,hack
1878
- if (this._options.rtc && this._options.jsBridge) {
1879
- const res = yield this._options.jsBridge.detectMicro();
1878
+ if (this._options.rtc) {
1879
+ const res = yield this._options.rtc.detectMicro();
1880
1880
  if (!res) {
1881
1881
  return new Error('Failed to obtain microphone authorization');
1882
1882
  }
@@ -2255,11 +2255,11 @@ function createLiveReact(options) {
2255
2255
  * @deprecated
2256
2256
  * @returns
2257
2257
  */
2258
- const unsafe__useLiveInstance = () => useLiveInstance();
2258
+ const unsafe__useLiveInstance = () => live;
2259
2259
  /**
2260
2260
  * 使用rtc实例
2261
2261
  */
2262
- const useRTCInstance = () => useLiveInstance().$RTC;
2262
+ const useRTCInstance = () => live.$RTC;
2263
2263
  /**
2264
2264
  * 不建议这样使用
2265
2265
  * @deprecated
@@ -2269,7 +2269,7 @@ function createLiveReact(options) {
2269
2269
  /**
2270
2270
  * 带看连接操作
2271
2271
  */
2272
- const useConnect = () => (options) => __awaiter(this, void 0, void 0, function* () { return yield useLiveInstance().connect(options); });
2272
+ const useConnect = () => (options) => __awaiter(this, void 0, void 0, function* () { return yield live.connect(options); });
2273
2273
  /**
2274
2274
  *
2275
2275
  * @param name