vani-meeting-client 0.7.6 → 0.7.7
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.
package/lib/model/Event.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessagePayload } from "..";
|
|
2
2
|
import { Participant } from "./Participant";
|
|
3
|
-
import { Track } from "./Track";
|
|
3
|
+
import { Track, TrackKind } from "./Track";
|
|
4
4
|
export declare enum VaniEvent {
|
|
5
5
|
OnInitDone = "onInitDone",
|
|
6
6
|
OnSocketError = "onSocketError",
|
|
@@ -39,7 +39,7 @@ interface VaniConnectionEvents {
|
|
|
39
39
|
[VaniEvent.OnConnected]: () => any;
|
|
40
40
|
[VaniEvent.OnConnectionBack]: () => any;
|
|
41
41
|
[VaniEvent.OnPermissionError]: (error: DOMException) => any;
|
|
42
|
-
[VaniEvent.OnPermissionApproved]: () => any;
|
|
42
|
+
[VaniEvent.OnPermissionApproved]: (forTrackKinds: TrackKind[]) => any;
|
|
43
43
|
[VaniEvent.OnDevicesChanged]: () => any;
|
|
44
44
|
[VaniEvent.OnUserJoined]: (participant: Participant) => any;
|
|
45
45
|
[VaniEvent.OnAudioVideoStatusUpdated]: (participant: Participant) => any;
|
|
@@ -253,12 +253,13 @@ var UserMediaHandler = /** @class */ (function (_super) {
|
|
|
253
253
|
UserMediaHandler.prototype.onStreamGot = function (stream, isForAudio, isForVideo, shouldAddTrackImmediately) {
|
|
254
254
|
var _a, _b, _c, _d, _e;
|
|
255
255
|
return __awaiter(this, void 0, void 0, function () {
|
|
256
|
-
var data, audioPause, data, audioPause;
|
|
256
|
+
var permissionApprovedFor, data, audioPause, data, audioPause;
|
|
257
257
|
return __generator(this, function (_f) {
|
|
258
258
|
if (!stream || (isForAudio === false && isForVideo === false)) {
|
|
259
259
|
this.isVideoAudioFetchInProgress = false;
|
|
260
260
|
return [2 /*return*/];
|
|
261
261
|
}
|
|
262
|
+
permissionApprovedFor = [];
|
|
262
263
|
if (isForAudio && stream.getAudioTracks().length > 0) {
|
|
263
264
|
this.onTrack(stream.getAudioTracks()[0], TrackKind.Audio, shouldAddTrackImmediately);
|
|
264
265
|
// removeAndStreamInLocalStream(stream.getAudioTracks()[0])
|
|
@@ -279,6 +280,7 @@ var UserMediaHandler = /** @class */ (function (_super) {
|
|
|
279
280
|
&& stream.getAudioTracks()[0].getConstraints() && stream.getAudioTracks()[0].getConstraints().deviceId) {
|
|
280
281
|
this.meetingStartRequest.audioInDevice = (_b = stream.getAudioTracks()[0].getConstraints().deviceId) === null || _b === void 0 ? void 0 : _b.toString();
|
|
281
282
|
}
|
|
283
|
+
permissionApprovedFor.push(TrackKind.Audio);
|
|
282
284
|
}
|
|
283
285
|
if (isForVideo && stream.getVideoTracks().length > 0) {
|
|
284
286
|
this.onTrack(stream.getVideoTracks()[0], TrackKind.Video, shouldAddTrackImmediately);
|
|
@@ -300,24 +302,31 @@ var UserMediaHandler = /** @class */ (function (_super) {
|
|
|
300
302
|
&& stream.getVideoTracks()[0].getConstraints() && stream.getVideoTracks()[0].getConstraints().deviceId) {
|
|
301
303
|
this.meetingStartRequest.cameraDevice = (_d = stream.getVideoTracks()[0].getConstraints().deviceId) === null || _d === void 0 ? void 0 : _d.toString();
|
|
302
304
|
}
|
|
305
|
+
permissionApprovedFor.push(TrackKind.Video);
|
|
303
306
|
}
|
|
304
307
|
this.isVideoAudioFetchInProgress = false;
|
|
305
|
-
(_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.emitMessageToSource(VaniEvent.OnPermissionApproved,
|
|
308
|
+
(_e = this.communicationHandler) === null || _e === void 0 ? void 0 : _e.emitMessageToSource(VaniEvent.OnPermissionApproved, permissionApprovedFor);
|
|
306
309
|
this.registerForDeviceChange();
|
|
307
310
|
return [2 /*return*/];
|
|
308
311
|
});
|
|
309
312
|
});
|
|
310
313
|
};
|
|
311
314
|
UserMediaHandler.prototype.onScreenShareStreamGot = function (stream, shouldAddTrackImmediately) {
|
|
315
|
+
var _a;
|
|
312
316
|
return __awaiter(this, void 0, void 0, function () {
|
|
313
|
-
|
|
317
|
+
var permissionApprovedFor;
|
|
318
|
+
return __generator(this, function (_b) {
|
|
319
|
+
permissionApprovedFor = [];
|
|
314
320
|
if (stream.getVideoTracks().length > 0) {
|
|
315
321
|
this.onTrack(stream.getVideoTracks()[0], TrackKind.ScreenshareVideo, shouldAddTrackImmediately);
|
|
322
|
+
permissionApprovedFor.push(TrackKind.ScreenshareVideo);
|
|
316
323
|
}
|
|
317
324
|
if (stream.getAudioTracks().length > 0) {
|
|
318
325
|
this.onTrack(stream.getAudioTracks()[0], TrackKind.ScreenshareAudio, shouldAddTrackImmediately);
|
|
326
|
+
permissionApprovedFor.push(TrackKind.ScreenshareAudio);
|
|
319
327
|
}
|
|
320
328
|
this.isScreenShareFetchInProgress = false;
|
|
329
|
+
(_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.emitMessageToSource(VaniEvent.OnPermissionApproved, permissionApprovedFor);
|
|
321
330
|
return [2 /*return*/];
|
|
322
331
|
});
|
|
323
332
|
});
|