vani-meeting-client 1.4.2 → 1.4.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.
|
@@ -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
|
|
80
|
-
return __generator(this, function (
|
|
81
|
-
switch (
|
|
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)
|
|
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
|
|
95
|
-
audioInDevices =
|
|
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
|
-
|
|
107
|
-
case
|
|
108
|
-
oldVideoTrack = (
|
|
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 && ((
|
|
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
|
|
121
|
-
cameraDevices =
|
|
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
|
-
|
|
132
|
-
case
|
|
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
|
-
(
|
|
124
|
+
(_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.emitMessageToSource(VaniEvent.OnDevicesChanged, {});
|
|
137
125
|
return [2 /*return*/];
|
|
138
126
|
}
|
|
139
127
|
});
|
|
@@ -509,7 +509,7 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
509
509
|
};
|
|
510
510
|
SFUHandler.prototype.produceTracks = function () {
|
|
511
511
|
var _this = this;
|
|
512
|
-
var _a
|
|
512
|
+
var _a;
|
|
513
513
|
log.info("produceTracks");
|
|
514
514
|
if (!this.sendTransport || !this.consumerTransport || this.isProduceTrackIntialWorkDone) {
|
|
515
515
|
return;
|
|
@@ -525,9 +525,9 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
525
525
|
else {
|
|
526
526
|
this.sendMessageReadyToConsume();
|
|
527
527
|
}
|
|
528
|
-
if (
|
|
529
|
-
|
|
530
|
-
}
|
|
528
|
+
// if (this.meetingStartRequest?.isDataChannelRequired) {
|
|
529
|
+
// this.createDataChannel()
|
|
530
|
+
// }
|
|
531
531
|
};
|
|
532
532
|
SFUHandler.prototype.onProduceSyncDone = function (data) {
|
|
533
533
|
if (data.message.appData && data.message.appData.trackId && data.message.producerId) {
|