@realsee/live 0.4.0-alpha.4 → 0.4.0-alpha.5

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.
@@ -1268,6 +1268,10 @@ function createLive(options) {
1268
1268
  var _a, _b, _c;
1269
1269
  super();
1270
1270
  this.keyframes = new Subscribe();
1271
+ const jsBridge = ((_a = options.jsBridge) !== null && _a !== void 0 ? _a : options.useBuiltInJsBridge)
1272
+ ? new JSBridge__default["default"]()
1273
+ : undefined;
1274
+ liveController.options.jsBridge = jsBridge;
1271
1275
  // 没有传rtc实例时
1272
1276
  if (!options.rtc) {
1273
1277
  // 取指定的内部rtc类型
@@ -1275,15 +1279,15 @@ function createLive(options) {
1275
1279
  if (!options.getVoiceSign) {
1276
1280
  throw new Error('GetVoiceSign method must be passed when using built-in RTC instances');
1277
1281
  }
1278
- const getVoiceSign = (_a = options.getVoiceSign) !== null && _a !== void 0 ? _a : unimplementedGetVoiceSign;
1282
+ const getVoiceSign = (_b = options.getVoiceSign) !== null && _b !== void 0 ? _b : unimplementedGetVoiceSign;
1279
1283
  switch (options.rtcType) {
1280
1284
  case exports.RTCType.RealseeVRWebViewRTC: {
1281
1285
  // 内置的 VRWebViewRTC
1282
- if (!options.jsBridge) {
1286
+ if (!jsBridge) {
1283
1287
  throw new Error('JsBridge instance must be passed when using built-in VRWebViewRTC instances');
1284
1288
  }
1285
1289
  liveController.options.rtc = new VRWebViewRTC({
1286
- jsBridge: options.jsBridge,
1290
+ jsBridge,
1287
1291
  getVoiceSign,
1288
1292
  });
1289
1293
  break;
@@ -1313,14 +1317,10 @@ function createLive(options) {
1313
1317
  if (!options.getVoiceSign) {
1314
1318
  throw new Error('GetVoiceSign method must be passed when using built-in RTC instances');
1315
1319
  }
1316
- const getVoiceSign = (_b = options.getVoiceSign) !== null && _b !== void 0 ? _b : unimplementedGetVoiceSign;
1317
- const jsBridge = ((_c = options.jsBridge) !== null && _c !== void 0 ? _c : options.useBuiltInJsBridge)
1318
- ? new JSBridge__default["default"]()
1319
- : null;
1320
+ const getVoiceSign = (_c = options.getVoiceSign) !== null && _c !== void 0 ? _c : unimplementedGetVoiceSign;
1320
1321
  if (!jsBridge) {
1321
1322
  throw new Error('jsBridge instance must be passed when using built-in RTC instances');
1322
1323
  }
1323
- options.jsBridge = jsBridge;
1324
1324
  // vrwebview 默认
1325
1325
  if ((isRealseeVRWebview && (isAndroid || isIOS)) || isWxMiniProgram) {
1326
1326
  liveController.options.rtc = new VRWebViewRTC({
@@ -1632,6 +1632,7 @@ function createLive(options) {
1632
1632
  function createLiveReact(options) {
1633
1633
  const LiveContext = React__default["default"].createContext(null);
1634
1634
  const live = createLive(options);
1635
+ const jsBridge = live.jsBridge;
1635
1636
  function LiveProvider(props) {
1636
1637
  return (React__default["default"].createElement(LiveContext.Provider, { value: props.live || live }, props.children));
1637
1638
  }
@@ -1827,6 +1828,7 @@ function createLiveReact(options) {
1827
1828
  }
1828
1829
  return {
1829
1830
  live,
1831
+ jsBridge,
1830
1832
  LiveProvider,
1831
1833
  unsafe__useLiveInstance,
1832
1834
  unsafe__useRTCInstance,