vani-meeting-client 1.4.0 → 1.4.2

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