@realsee/live 0.5.0-alpha.7 → 0.5.0-alpha.8
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 +28 -16
- 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 +28 -16
- package/dist/realsee-live.esm.js.map +1 -1
- package/dist/realsee-live.umd.development.js +28 -16
- 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
|
@@ -619,7 +619,7 @@ class VRWebViewRTC extends CoreRTC {
|
|
|
619
619
|
this.voiceId = '';
|
|
620
620
|
this.options = { jsBridge, getVoiceSign };
|
|
621
621
|
// TO-DO: 在微信小程序下有个音量上报的BUG会导致消息体过大从而jsbridge异常断开
|
|
622
|
-
if (this.jsBridge.webViewType !==
|
|
622
|
+
if (this.jsBridge.webViewType !== 'WxMiniProgramWebView') {
|
|
623
623
|
this.jsBridge.callAndListen('live/userVolumes', (userVolumes) => {
|
|
624
624
|
this.emit('userVolumes', userVolumes);
|
|
625
625
|
});
|
|
@@ -634,25 +634,37 @@ class VRWebViewRTC extends CoreRTC {
|
|
|
634
634
|
}
|
|
635
635
|
join(options) {
|
|
636
636
|
return __awaiter(this, void 0, void 0, function* () {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
else {
|
|
646
|
-
if (res.code === exports.RTCJoinedInfoCodeEnum.Success) {
|
|
647
|
-
this.emit('joined');
|
|
648
|
-
this.joined = true;
|
|
637
|
+
try {
|
|
638
|
+
this.emit('joinWillStart');
|
|
639
|
+
const { sdkAppId, userId, userSig } = yield this.options.getVoiceSign(options);
|
|
640
|
+
if (!(Boolean(sdkAppId) && Boolean(userId) && Boolean(userSig))) {
|
|
641
|
+
this.emit('error', new Error('加入房间失败:rtc 签名请求异常'));
|
|
642
|
+
this.joined = false;
|
|
643
|
+
return this.joined;
|
|
649
644
|
}
|
|
650
|
-
|
|
651
|
-
|
|
645
|
+
this.type = options.type;
|
|
646
|
+
const [res, error] = yield this.jsBridge.callAndBackfeed(`live/join?sdkAppID=${sdkAppId}&userID=${userId}&roomID=${Number(options.voiceId)}&userSig=${userSig}`);
|
|
647
|
+
if (!res) {
|
|
648
|
+
this.emit('error', error ? error : new Error('加入房间失败:未知异常。'));
|
|
652
649
|
this.joined = false;
|
|
653
650
|
}
|
|
651
|
+
else {
|
|
652
|
+
if (res.code === exports.RTCJoinedInfoCodeEnum.Success) {
|
|
653
|
+
this.emit('joined');
|
|
654
|
+
this.joined = true;
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
this.emit('error', res);
|
|
658
|
+
this.joined = false;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return this.joined;
|
|
662
|
+
}
|
|
663
|
+
catch (e) {
|
|
664
|
+
this.emit('error', new Error('加入房间失败:' + e.message));
|
|
665
|
+
this.joined = false;
|
|
666
|
+
return this.joined;
|
|
654
667
|
}
|
|
655
|
-
return this.joined;
|
|
656
668
|
});
|
|
657
669
|
}
|
|
658
670
|
quit() {
|