vani-meeting-client 1.4.2 → 1.4.3

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.
@@ -76,23 +76,17 @@ var UserMediaHandler = /** @class */ (function (_super) {
76
76
  mediaDevice.ondevicechange = (function (event) { return __awaiter(_this, void 0, void 0, function () {
77
77
  var oldTrack, isAudioInDeviceFound, canFetchAudioIn, audioInDevices, audioDevice, oldVideoTrack, isCameraDeviceFound, canFetchVideoIn, cameraDevices, cameraDevice;
78
78
  var _this = this;
79
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
80
- return __generator(this, function (_k) {
81
- switch (_k.label) {
79
+ var _a, _b, _c, _d, _e;
80
+ return __generator(this, function (_f) {
81
+ switch (_f.label) {
82
82
  case 0:
83
83
  oldTrack = (_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.getSelfTrackByType(TrackKind.Audio);
84
84
  isAudioInDeviceFound = false;
85
85
  canFetchAudioIn = false;
86
- if (!(!oldTrack && ((_b = this.meetingStartRequest) === null || _b === void 0 ? void 0 : _b.audioInDevice) && ((_d = (_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.getSelfParticipant()) === null || _d === void 0 ? void 0 : _d.isAudioEnable))) return [3 /*break*/, 1];
87
- isAudioInDeviceFound = false;
88
- canFetchAudioIn = true;
89
- this.meetingStartRequest.audioInDevice = undefined;
90
- return [3 /*break*/, 3];
91
- case 1:
92
- if (!oldTrack) return [3 /*break*/, 3];
86
+ if (!(oldTrack || (!oldTrack && ((_b = this.meetingStartRequest) === null || _b === void 0 ? void 0 : _b.audioInDevice)))) return [3 /*break*/, 2];
93
87
  return [4 /*yield*/, this.getDevice(GetDevicesType.AudioIn)];
94
- case 2:
95
- audioInDevices = _k.sent();
88
+ case 1:
89
+ audioInDevices = _f.sent();
96
90
  if (this.meetingStartRequest && this.meetingStartRequest.audioInDevice) {
97
91
  audioDevice = audioInDevices.find(function (device) { return device.id === _this.meetingStartRequest.audioInDevice; });
98
92
  if (audioDevice) {
@@ -103,22 +97,16 @@ var UserMediaHandler = /** @class */ (function (_super) {
103
97
  }
104
98
  }
105
99
  canFetchAudioIn = true;
106
- _k.label = 3;
107
- case 3:
108
- oldVideoTrack = (_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.getSelfTrackByType(TrackKind.Video);
100
+ _f.label = 2;
101
+ case 2:
102
+ oldVideoTrack = (_c = this.communicationHandler) === null || _c === void 0 ? void 0 : _c.getSelfTrackByType(TrackKind.Video);
109
103
  isCameraDeviceFound = false;
110
104
  canFetchVideoIn = false;
111
- if (!(!oldVideoTrack && ((_f = this.meetingStartRequest) === null || _f === void 0 ? void 0 : _f.cameraDevice) && ((_h = (_g = this.communicationHandler) === null || _g === void 0 ? void 0 : _g.getSelfParticipant()) === null || _h === void 0 ? void 0 : _h.isVideoEnable))) return [3 /*break*/, 4];
112
- isCameraDeviceFound = false;
113
- canFetchVideoIn = true;
114
- this.meetingStartRequest.cameraDevice = undefined;
115
- return [3 /*break*/, 6];
116
- case 4:
117
- if (!oldVideoTrack) return [3 /*break*/, 6];
105
+ if (!(oldVideoTrack || (!oldVideoTrack && ((_d = this.meetingStartRequest) === null || _d === void 0 ? void 0 : _d.cameraDevice)))) return [3 /*break*/, 4];
118
106
  canFetchVideoIn = true;
119
107
  return [4 /*yield*/, this.getDevice(GetDevicesType.VideoIn)];
120
- case 5:
121
- cameraDevices = _k.sent();
108
+ case 3:
109
+ cameraDevices = _f.sent();
122
110
  if (this.meetingStartRequest && this.meetingStartRequest.cameraDevice) {
123
111
  cameraDevice = cameraDevices.find(function (device) { return device.id === _this.meetingStartRequest.cameraDevice; });
124
112
  if (cameraDevice) {
@@ -128,12 +116,12 @@ var UserMediaHandler = /** @class */ (function (_super) {
128
116
  this.meetingStartRequest.cameraDevice = undefined;
129
117
  }
130
118
  }
131
- _k.label = 6;
132
- case 6:
119
+ _f.label = 4;
120
+ case 4:
133
121
  if ((!isAudioInDeviceFound && canFetchAudioIn) || (!isCameraDeviceFound && canFetchVideoIn)) {
134
122
  this.startLocalStream(!isCameraDeviceFound && canFetchVideoIn, !isAudioInDeviceFound && canFetchAudioIn, true);
135
123
  }
136
- (_j = this.communicationHandler) === null || _j === void 0 ? void 0 : _j.emitMessageToSource(VaniEvent.OnDevicesChanged, {});
124
+ (_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.emitMessageToSource(VaniEvent.OnDevicesChanged, {});
137
125
  return [2 /*return*/];
138
126
  }
139
127
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",