@realsee/live 0.4.0-beta.2 → 0.4.0-beta.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.
- package/dist/live/controller.d.ts +2 -2
- package/dist/realsee-live.cjs.development.js +14 -7
- package/dist/realsee-live.cjs.development.js.map +1 -1
- package/dist/realsee-live.cjs.production.js +1 -1
- package/dist/realsee-live.cjs.production.js.map +1 -1
- package/dist/realsee-live.esm.js +14 -7
- package/dist/realsee-live.esm.js.map +1 -1
- package/dist/realsee-live.umd.development.js +14 -7
- package/dist/realsee-live.umd.development.js.map +1 -1
- package/dist/realsee-live.umd.production.js +1 -1
- package/dist/realsee-live.umd.production.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,11 +24,11 @@ export declare class LiveController<Snapshot extends Record<string, any>> {
|
|
|
24
24
|
onEvtMsgListener?: (evt: MessageEvent) => void;
|
|
25
25
|
onEvtErrListener?: (evt: Event) => void;
|
|
26
26
|
onEvtCLEListener?: (evt: CloseEvent) => void;
|
|
27
|
-
dispose: () =>
|
|
27
|
+
dispose: () => boolean;
|
|
28
28
|
/**
|
|
29
29
|
* 销毁WebSocket相关依赖。
|
|
30
30
|
*/
|
|
31
|
-
disposeWebSocket: () =>
|
|
31
|
+
disposeWebSocket: () => true | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* 解析数据
|
|
34
34
|
* @param liveMsg
|
|
@@ -1066,6 +1066,7 @@ class LiveController {
|
|
|
1066
1066
|
clearInterval(this.healthCheckId);
|
|
1067
1067
|
this.healthCheckId = undefined;
|
|
1068
1068
|
}
|
|
1069
|
+
return true;
|
|
1069
1070
|
};
|
|
1070
1071
|
/**
|
|
1071
1072
|
* 销毁WebSocket相关依赖。
|
|
@@ -1091,6 +1092,7 @@ class LiveController {
|
|
|
1091
1092
|
}
|
|
1092
1093
|
this.webSocket.close();
|
|
1093
1094
|
this.webSocket = undefined;
|
|
1095
|
+
return true;
|
|
1094
1096
|
};
|
|
1095
1097
|
this.options = Object.assign({ autoConnect: true, healthCheck: 3000 }, options);
|
|
1096
1098
|
}
|
|
@@ -1265,12 +1267,16 @@ function createLive(options) {
|
|
|
1265
1267
|
};
|
|
1266
1268
|
class LiveTpl extends Subscribe {
|
|
1267
1269
|
constructor() {
|
|
1268
|
-
var _a, _b
|
|
1270
|
+
var _a, _b;
|
|
1269
1271
|
super();
|
|
1270
1272
|
this.keyframes = new Subscribe();
|
|
1271
|
-
const jsBridge = ((
|
|
1272
|
-
|
|
1273
|
-
|
|
1273
|
+
const jsBridge = (() => {
|
|
1274
|
+
if (options.jsBridge)
|
|
1275
|
+
return options.jsBridge;
|
|
1276
|
+
if (options.useBuiltInJsBridge)
|
|
1277
|
+
return new JSBridge__default["default"]();
|
|
1278
|
+
return undefined;
|
|
1279
|
+
})();
|
|
1274
1280
|
liveController.options.jsBridge = jsBridge;
|
|
1275
1281
|
// 没有传rtc实例时
|
|
1276
1282
|
if (!options.rtc) {
|
|
@@ -1279,7 +1285,7 @@ function createLive(options) {
|
|
|
1279
1285
|
if (!options.getVoiceSign) {
|
|
1280
1286
|
throw new Error('GetVoiceSign method must be passed when using built-in RTC instances');
|
|
1281
1287
|
}
|
|
1282
|
-
const getVoiceSign = (
|
|
1288
|
+
const getVoiceSign = (_a = options.getVoiceSign) !== null && _a !== void 0 ? _a : unimplementedGetVoiceSign;
|
|
1283
1289
|
switch (options.rtcType) {
|
|
1284
1290
|
case exports.RTCType.RealseeVRWebViewRTC: {
|
|
1285
1291
|
// 内置的 VRWebViewRTC
|
|
@@ -1317,7 +1323,7 @@ function createLive(options) {
|
|
|
1317
1323
|
if (!options.getVoiceSign) {
|
|
1318
1324
|
throw new Error('GetVoiceSign method must be passed when using built-in RTC instances');
|
|
1319
1325
|
}
|
|
1320
|
-
const getVoiceSign = (
|
|
1326
|
+
const getVoiceSign = (_b = options.getVoiceSign) !== null && _b !== void 0 ? _b : unimplementedGetVoiceSign;
|
|
1321
1327
|
if (!jsBridge) {
|
|
1322
1328
|
throw new Error('jsBridge instance must be passed when using built-in RTC instances');
|
|
1323
1329
|
}
|
|
@@ -1497,7 +1503,8 @@ function createLive(options) {
|
|
|
1497
1503
|
async exit() {
|
|
1498
1504
|
/** 退出强制关闭语音(?) */
|
|
1499
1505
|
await this.$RTC.quit();
|
|
1500
|
-
|
|
1506
|
+
await this.updateStatus(exports.BuiltinEventType.RoomChange, exports.BuiltinActionType.RoomClose, {});
|
|
1507
|
+
return liveController.dispose();
|
|
1501
1508
|
}
|
|
1502
1509
|
async connect(options = {}) {
|
|
1503
1510
|
// 连接 WebSocket 前验证麦克风权限
|