@realsee/live 0.5.3 → 0.5.4

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.
@@ -2,7 +2,7 @@ import { LiveMsg } from '../typings';
2
2
  import { LiveState } from '../typings/live/LiveState';
3
3
  import { RobustWebSocketEventDetail } from '../utils/RobustWebSocket';
4
4
  import { Subscribe } from '../utils/subscribe';
5
- export type LiveControllerEventMap = {
5
+ export declare type LiveControllerEventMap = {
6
6
  stateChange: (state: LiveState, prevState: LiveState) => void;
7
7
  message: (message: LiveMsg) => void;
8
8
  reconnected: (detail: RobustWebSocketEventDetail) => void;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { BuiltinActionType, BuiltinEventType, KeyframeTypes, LiveConnectOptions, LiveEventType, LiveOptions, MicroStatus, RTCEventType, RTCType, UserInfo } from '../typings';
3
3
  import { LiveState } from '../typings/live/LiveState';
4
4
  import { Live } from './live';
5
- export type LiveProviderPropTypes<KeyframesSnapshot extends Record<string, any>> = {
5
+ export declare type LiveProviderPropTypes<KeyframesSnapshot extends Record<string, any>> = {
6
6
  children?: React.ReactNode;
7
7
  live?: Live<KeyframesSnapshot>;
8
8
  };
@@ -3,7 +3,7 @@ import { RTCProtocol } from '../rtc';
3
3
  import { EventType, KeyframeTypes, LiveOptions, RoomInfo, RTCType, UserInfo, BuiltinEventType, BuiltinActionType, MicroStatus, LiveConnectOptions } from '../typings';
4
4
  import { LiveState } from '../typings/live/LiveState';
5
5
  import { Subscribe } from '../utils/subscribe';
6
- export type LiveBuiltInData<KeyframesSnapshot> = {
6
+ export declare type LiveBuiltInData<KeyframesSnapshot> = {
7
7
  selfInfo?: UserInfo;
8
8
  userList?: UserInfo[];
9
9
  roomInfo?: RoomInfo;
@@ -69,7 +69,7 @@ function __generator$1(thisArg, body) {
69
69
  function verb(n) { return function (v) { return step([n, v]); }; }
70
70
  function step(op) {
71
71
  if (f) throw new TypeError("Generator is already executing.");
72
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
72
+ while (_) try {
73
73
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
74
74
  if (y = 0, t) op = [op[0] & 2, t.value];
75
75
  switch (op[0]) {
@@ -657,7 +657,7 @@ var BrowserRTC4Chime = /** @class */ (function (_super) {
657
657
  // 挂载签名钩子
658
658
  _this._getVoiceSign = options.getVoiceSign;
659
659
  _this._initDom();
660
- _this.logger = new amazonChimeSdkJs.ConsoleLogger('WebRTCLogger', options.logLevel || amazonChimeSdkJs.LogLevel.OFF);
660
+ _this.logger = new amazonChimeSdkJs.ConsoleLogger('WebRTCLogger', options.logLevel || amazonChimeSdkJs.LogLevel.INFO);
661
661
  _this.deviceController = new amazonChimeSdkJs.DefaultDeviceController(_this.logger);
662
662
  _this.initObservers();
663
663
  return _this;
@@ -681,7 +681,7 @@ var BrowserRTC4Chime = /** @class */ (function (_super) {
681
681
  this.emit('joinWillStart');
682
682
  _d.label = 1;
683
683
  case 1:
684
- _d.trys.push([1, 6, , 7]);
684
+ _d.trys.push([1, 5, , 6]);
685
685
  return [4 /*yield*/, this._getVoiceSign(__assign$1(__assign$1({}, options), { roomId: options.roomId || 0 }))];
686
686
  case 2:
687
687
  _a = _d.sent(), userId = _a.userId, userSig = _a.userSig;
@@ -725,21 +725,18 @@ var BrowserRTC4Chime = /** @class */ (function (_super) {
725
725
  defaultAudioInput = audioInputDevices.find(function (device) { return device.deviceId === 'default'; });
726
726
  otherAudioInput = audioInputDevices.find(function (device) { return device.deviceId !== ''; });
727
727
  this.audioInput = defaultAudioInput || otherAudioInput;
728
- return [4 /*yield*/, this.meetingSession.audioVideo.chooseVideoInputDevice(null)];
728
+ return [4 /*yield*/, this.meetingSession.audioVideo.startAudioInput(((_c = this.audioInput) === null || _c === void 0 ? void 0 : _c.deviceId) || 'default')];
729
729
  case 4:
730
- _d.sent();
731
- return [4 /*yield*/, this.meetingSession.audioVideo.chooseAudioInputDevice(((_c = this.audioInput) === null || _c === void 0 ? void 0 : _c.deviceId) || 'default')];
732
- case 5:
733
730
  _d.sent();
734
731
  this.meetingSession.audioVideo.start();
735
- return [3 /*break*/, 7];
736
- case 6:
732
+ return [3 /*break*/, 6];
733
+ case 5:
737
734
  e_1 = _d.sent();
738
735
  this.emit('error', e_1);
739
736
  this.logger.error(e_1.message);
740
737
  success(false);
741
- return [3 /*break*/, 7];
742
- case 7: return [2 /*return*/];
738
+ return [3 /*break*/, 6];
739
+ case 6: return [2 /*return*/];
743
740
  }
744
741
  });
745
742
  }); })];
@@ -754,21 +751,27 @@ var BrowserRTC4Chime = /** @class */ (function (_super) {
754
751
  var _a, _b;
755
752
  _this.joined = false;
756
753
  var observer = {
757
- audioVideoDidStop: function (sessionStatus) {
758
- var sessionStatusCode = sessionStatus.statusCode();
759
- if (sessionStatusCode === amazonChimeSdkJs.MeetingSessionStatusCode.Left) {
760
- /*
761
- - You called meetingSession.audioVideo.stop().
762
- - When closing a browser window or page, Chime SDK attempts to leave the session.
763
- */
764
- _this.logger.info('You left the session');
765
- success(true);
766
- }
767
- else {
768
- _this.logger.info("Stopped with a session status code: ".concat(sessionStatusCode));
769
- success(true);
770
- }
771
- },
754
+ audioVideoDidStop: function (sessionStatus) { return __awaiter$1(_this, void 0, void 0, function () {
755
+ var sessionStatusCode;
756
+ var _a;
757
+ return __generator$1(this, function (_b) {
758
+ sessionStatusCode = sessionStatus.statusCode();
759
+ (_a = this.meetingSession) === null || _a === void 0 ? void 0 : _a.deviceController.destroy();
760
+ if (sessionStatusCode === amazonChimeSdkJs.MeetingSessionStatusCode.Left) {
761
+ /*
762
+ - You called meetingSession.audioVideo.stop().
763
+ - When closing a browser window or page, Chime SDK attempts to leave the session.
764
+ */
765
+ this.logger.info('You left the session');
766
+ success(true);
767
+ }
768
+ else {
769
+ this.logger.info("Stopped with a session status code: ".concat(sessionStatusCode));
770
+ success(true);
771
+ }
772
+ return [2 /*return*/];
773
+ });
774
+ }); },
772
775
  };
773
776
  (_a = _this.meetingSession) === null || _a === void 0 ? void 0 : _a.audioVideo.addObserver(observer);
774
777
  (_b = _this.meetingSession) === null || _b === void 0 ? void 0 : _b.audioVideo.stop();