@realsee/live 0.4.0-alpha.5 → 0.4.0-beta.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.
Files changed (51) hide show
  1. package/README.md +22 -0
  2. package/dist/realsee-live.cjs.development.js +10 -6
  3. package/dist/realsee-live.cjs.development.js.map +1 -1
  4. package/dist/realsee-live.cjs.production.js +1 -1
  5. package/dist/realsee-live.cjs.production.js.map +1 -1
  6. package/dist/realsee-live.esm.js +10 -6
  7. package/dist/realsee-live.esm.js.map +1 -1
  8. package/dist/realsee-live.umd.development.js +10 -6
  9. package/dist/realsee-live.umd.development.js.map +1 -1
  10. package/dist/realsee-live.umd.production.js +1 -1
  11. package/dist/realsee-live.umd.production.js.map +1 -1
  12. package/docs/.nojekyll +1 -0
  13. package/docs/assets/custom.css +43 -0
  14. package/docs/assets/highlight.css +120 -0
  15. package/docs/assets/icons.css +1043 -0
  16. package/docs/assets/icons.png +0 -0
  17. package/docs/assets/icons@2x.png +0 -0
  18. package/docs/assets/main.js +52 -0
  19. package/docs/assets/search.js +1 -0
  20. package/docs/assets/style.css +1414 -0
  21. package/docs/assets/widgets.png +0 -0
  22. package/docs/assets/widgets@2x.png +0 -0
  23. package/docs/classes/BrowserRTC.html +68 -0
  24. package/docs/classes/BrowserRTC4Chime.html +76 -0
  25. package/docs/classes/CoreRTC.html +70 -0
  26. package/docs/classes/VRWebViewRTC.html +68 -0
  27. package/docs/enums/BuiltInRTCType.html +1 -0
  28. package/docs/enums/BuiltinActionType.html +15 -0
  29. package/docs/enums/BuiltinEventType.html +7 -0
  30. package/docs/enums/Command.html +7 -0
  31. package/docs/enums/MemUserStatus.html +1 -0
  32. package/docs/enums/MicroStatus.html +3 -0
  33. package/docs/enums/RTCJoinedInfoCodeEnum.html +11 -0
  34. package/docs/enums/RTCType.html +3 -0
  35. package/docs/enums/UserStatus.html +9 -0
  36. package/docs/enums/WebSocketCloseError.html +19 -0
  37. package/docs/enums/WebSocketErrorType.html +1 -0
  38. package/docs/enums/WebSocketState.html +13 -0
  39. package/docs/index.html +386 -0
  40. package/docs/interfaces/AttendeeResponse.html +1 -0
  41. package/docs/interfaces/GetVoiceSignReturnType.html +3 -0
  42. package/docs/interfaces/Live.html +116 -0
  43. package/docs/interfaces/LiveOptions.html +39 -0
  44. package/docs/interfaces/LiveReact.html +52 -0
  45. package/docs/interfaces/MeetingResponse.html +1 -0
  46. package/docs/interfaces/MeetingSessionConfigurationOptions.html +1 -0
  47. package/docs/interfaces/RTCJoinedInfo.html +3 -0
  48. package/docs/interfaces/RTCProtocol.html +70 -0
  49. package/docs/interfaces/VRWebViewRTCOptions.html +1 -0
  50. package/docs/modules.html +133 -0
  51. package/package.json +15 -11
package/README.md CHANGED
@@ -338,6 +338,28 @@ const live = createLive({
338
338
  });
339
339
  ```
340
340
 
341
+ ### 使用内置的 JsBridge 和 RTC 实现
342
+
343
+ 使用方式:
344
+
345
+ ```tsx
346
+ import { createLive } from '@realsee/live';
347
+
348
+ const live = createLive({
349
+ useBuiltInRTC: true, // 使用内置rtc
350
+ builtInRTCType: BuiltInRTCType.RealseeXChimeRTC, // 内置 rtc 类型,不填则默认trtc,chime请指明
351
+ useBuiltInJsBridge: true, // 使用内置的jsBridge
352
+ getVoiceSign, // 内置的rtc还是要把 getVoiceSign 方法传递进去
353
+ getTicket: async () => '' /* 必须提供 */,
354
+ });
355
+
356
+ // 可以直接使用里面的 jsBridge, 该实例由 @realsee/jsbridge-x 提供支持
357
+ const jsBridge = live.jsBridge;
358
+ jsBridge
359
+ .ready()
360
+ .then(() => console.info(`${jsBridge.webViewType} jsBridge is ready`));
361
+ ```
362
+
341
363
  ## TypeScript & React 支持
342
364
 
343
365
  **Live** 有完整的 [TypeScript Generics](https://www.typescriptlang.org/docs/handbook/2/generics.html)
@@ -1265,12 +1265,16 @@ function createLive(options) {
1265
1265
  };
1266
1266
  class LiveTpl extends Subscribe {
1267
1267
  constructor() {
1268
- var _a, _b, _c;
1268
+ var _a, _b;
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;
1271
+ const jsBridge = (() => {
1272
+ if (!options.jsBridge)
1273
+ return options.jsBridge;
1274
+ if (options.useBuiltInJsBridge)
1275
+ return new JSBridge__default["default"]();
1276
+ return undefined;
1277
+ })();
1274
1278
  liveController.options.jsBridge = jsBridge;
1275
1279
  // 没有传rtc实例时
1276
1280
  if (!options.rtc) {
@@ -1279,7 +1283,7 @@ function createLive(options) {
1279
1283
  if (!options.getVoiceSign) {
1280
1284
  throw new Error('GetVoiceSign method must be passed when using built-in RTC instances');
1281
1285
  }
1282
- const getVoiceSign = (_b = options.getVoiceSign) !== null && _b !== void 0 ? _b : unimplementedGetVoiceSign;
1286
+ const getVoiceSign = (_a = options.getVoiceSign) !== null && _a !== void 0 ? _a : unimplementedGetVoiceSign;
1283
1287
  switch (options.rtcType) {
1284
1288
  case exports.RTCType.RealseeVRWebViewRTC: {
1285
1289
  // 内置的 VRWebViewRTC
@@ -1317,7 +1321,7 @@ function createLive(options) {
1317
1321
  if (!options.getVoiceSign) {
1318
1322
  throw new Error('GetVoiceSign method must be passed when using built-in RTC instances');
1319
1323
  }
1320
- const getVoiceSign = (_c = options.getVoiceSign) !== null && _c !== void 0 ? _c : unimplementedGetVoiceSign;
1324
+ const getVoiceSign = (_b = options.getVoiceSign) !== null && _b !== void 0 ? _b : unimplementedGetVoiceSign;
1321
1325
  if (!jsBridge) {
1322
1326
  throw new Error('jsBridge instance must be passed when using built-in RTC instances');
1323
1327
  }