@realsee/live 0.5.0-alpha.6 → 0.5.0-alpha.9
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/realsee-live.cjs.development.js +39 -17
- 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 +39 -17
- package/dist/realsee-live.esm.js.map +1 -1
- package/dist/realsee-live.umd.development.js +433 -492
- 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/docs/classes/VRWebViewRTC.html +4 -4
- package/package.json +1 -1
package/dist/realsee-live.esm.js
CHANGED
|
@@ -609,7 +609,7 @@ class VRWebViewRTC extends CoreRTC {
|
|
|
609
609
|
this.voiceId = '';
|
|
610
610
|
this.options = { jsBridge, getVoiceSign };
|
|
611
611
|
// TO-DO: 在微信小程序下有个音量上报的BUG会导致消息体过大从而jsbridge异常断开
|
|
612
|
-
if (this.jsBridge.webViewType !==
|
|
612
|
+
if (this.jsBridge.webViewType !== 'WxMiniProgramWebView') {
|
|
613
613
|
this.jsBridge.callAndListen('live/userVolumes', (userVolumes) => {
|
|
614
614
|
this.emit('userVolumes', userVolumes);
|
|
615
615
|
});
|
|
@@ -624,25 +624,37 @@ class VRWebViewRTC extends CoreRTC {
|
|
|
624
624
|
}
|
|
625
625
|
join(options) {
|
|
626
626
|
return __awaiter(this, void 0, void 0, function* () {
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
635
|
-
else {
|
|
636
|
-
if (res.code === RTCJoinedInfoCodeEnum.Success) {
|
|
637
|
-
this.emit('joined');
|
|
638
|
-
this.joined = true;
|
|
627
|
+
try {
|
|
628
|
+
this.emit('joinWillStart');
|
|
629
|
+
const { sdkAppId, userId, userSig } = yield this.options.getVoiceSign(options);
|
|
630
|
+
if (!(Boolean(sdkAppId) && Boolean(userId) && Boolean(userSig))) {
|
|
631
|
+
this.emit('error', new Error('加入房间失败:rtc 签名请求异常'));
|
|
632
|
+
this.joined = false;
|
|
633
|
+
return this.joined;
|
|
639
634
|
}
|
|
640
|
-
|
|
641
|
-
|
|
635
|
+
this.type = options.type;
|
|
636
|
+
const [res, error] = yield this.jsBridge.callAndBackfeed(`live/join?sdkAppID=${sdkAppId}&userID=${userId}&roomID=${Number(options.voiceId)}&userSig=${userSig}`);
|
|
637
|
+
if (!res) {
|
|
638
|
+
this.emit('error', error ? error : new Error('加入房间失败:未知异常。'));
|
|
642
639
|
this.joined = false;
|
|
643
640
|
}
|
|
641
|
+
else {
|
|
642
|
+
if (res.code === RTCJoinedInfoCodeEnum.Success) {
|
|
643
|
+
this.emit('joined');
|
|
644
|
+
this.joined = true;
|
|
645
|
+
}
|
|
646
|
+
else {
|
|
647
|
+
this.emit('error', res);
|
|
648
|
+
this.joined = false;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
return this.joined;
|
|
652
|
+
}
|
|
653
|
+
catch (e) {
|
|
654
|
+
this.emit('error', new Error('加入房间失败:' + e.message));
|
|
655
|
+
this.joined = false;
|
|
656
|
+
return this.joined;
|
|
644
657
|
}
|
|
645
|
-
return this.joined;
|
|
646
658
|
});
|
|
647
659
|
}
|
|
648
660
|
quit() {
|
|
@@ -1456,7 +1468,10 @@ class LiveController extends Subscribe {
|
|
|
1456
1468
|
/**
|
|
1457
1469
|
* ws代理器
|
|
1458
1470
|
*/
|
|
1459
|
-
this._ws = new RobustWebSocket(
|
|
1471
|
+
this._ws = new RobustWebSocket({
|
|
1472
|
+
url: '',
|
|
1473
|
+
robustOptions: { timeout: 180000 },
|
|
1474
|
+
});
|
|
1460
1475
|
/**
|
|
1461
1476
|
* 带看连接状态
|
|
1462
1477
|
*/
|
|
@@ -1859,6 +1874,13 @@ class Live extends Subscribe {
|
|
|
1859
1874
|
return false;
|
|
1860
1875
|
}
|
|
1861
1876
|
const { force = false } = options;
|
|
1877
|
+
// 检测一下麦克风权限,hack
|
|
1878
|
+
if (this._options.rtc && this._options.jsBridge) {
|
|
1879
|
+
const res = yield this._options.jsBridge.detectMicro();
|
|
1880
|
+
if (!res) {
|
|
1881
|
+
return new Error('Failed to obtain microphone authorization');
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1862
1884
|
// 检查是否已有实例在使用
|
|
1863
1885
|
const currentState = this.state;
|
|
1864
1886
|
if (currentState === LiveState.CONNECTING ||
|