@realsee/live 0.4.0-alpha.5 → 0.4.0-beta.1
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.
- package/README.md +22 -0
- package/package.json +1 -1
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)
|
package/package.json
CHANGED