@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.
@@ -48513,7 +48513,7 @@
48513
48513
  this.voiceId = '';
48514
48514
  this.options = { jsBridge, getVoiceSign };
48515
48515
  // TO-DO: 在微信小程序下有个音量上报的BUG会导致消息体过大从而jsbridge异常断开
48516
- if (this.jsBridge.webViewType !== "WxMiniProgramWebView") {
48516
+ if (this.jsBridge.webViewType !== 'WxMiniProgramWebView') {
48517
48517
  this.jsBridge.callAndListen('live/userVolumes', (userVolumes) => {
48518
48518
  this.emit('userVolumes', userVolumes);
48519
48519
  });
@@ -48528,25 +48528,37 @@
48528
48528
  }
48529
48529
  join(options) {
48530
48530
  return __awaiter$$(this, void 0, void 0, function* () {
48531
- this.emit('joinWillStart');
48532
- const { sdkAppId, userId, userSig } = yield this.options.getVoiceSign(options);
48533
- this.type = options.type;
48534
- const [res, error] = yield this.jsBridge.callAndBackfeed(`live/join?sdkAppID=${sdkAppId}&userID=${userId}&roomID=${Number(options.voiceId)}&userSig=${userSig}`);
48535
- if (!res) {
48536
- this.emit('error', error ? error : new Error('加入房间失败:未知异常。'));
48537
- this.joined = false;
48538
- }
48539
- else {
48540
- if (res.code === exports.RTCJoinedInfoCodeEnum.Success) {
48541
- this.emit('joined');
48542
- this.joined = true;
48531
+ try {
48532
+ this.emit('joinWillStart');
48533
+ const { sdkAppId, userId, userSig } = yield this.options.getVoiceSign(options);
48534
+ if (!(Boolean(sdkAppId) && Boolean(userId) && Boolean(userSig))) {
48535
+ this.emit('error', new Error('加入房间失败:rtc 签名请求异常'));
48536
+ this.joined = false;
48537
+ return this.joined;
48543
48538
  }
48544
- else {
48545
- this.emit('error', res);
48539
+ this.type = options.type;
48540
+ const [res, error] = yield this.jsBridge.callAndBackfeed(`live/join?sdkAppID=${sdkAppId}&userID=${userId}&roomID=${Number(options.voiceId)}&userSig=${userSig}`);
48541
+ if (!res) {
48542
+ this.emit('error', error ? error : new Error('加入房间失败:未知异常。'));
48546
48543
  this.joined = false;
48547
48544
  }
48545
+ else {
48546
+ if (res.code === exports.RTCJoinedInfoCodeEnum.Success) {
48547
+ this.emit('joined');
48548
+ this.joined = true;
48549
+ }
48550
+ else {
48551
+ this.emit('error', res);
48552
+ this.joined = false;
48553
+ }
48554
+ }
48555
+ return this.joined;
48556
+ }
48557
+ catch (e) {
48558
+ this.emit('error', new Error('加入房间失败:' + e.message));
48559
+ this.joined = false;
48560
+ return this.joined;
48548
48561
  }
48549
- return this.joined;
48550
48562
  });
48551
48563
  }
48552
48564
  quit() {