vani-meeting-client 2.0.8 → 2.1.0
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/MeetingHandler.d.ts
CHANGED
|
@@ -15,10 +15,10 @@ export declare class MeetingHandler {
|
|
|
15
15
|
meetingStartRequestObject(roomId: string, userId: string, appId: string, wssUrl: string, shouldIgnoreCaseForRoomId?: boolean): MeetingStartRequest;
|
|
16
16
|
endAndDestory(): void;
|
|
17
17
|
requestToCloseTheRoom: () => void;
|
|
18
|
-
init(): Promise<
|
|
18
|
+
init(): Promise<boolean>;
|
|
19
19
|
recreateVideoCallHandler: () => Promise<BaseVideoCallHandler>;
|
|
20
20
|
switchCamera(): void;
|
|
21
|
-
startLocalStream(isVideoRequired: boolean, isAudioRequired: boolean, shouldAddTrackImmediately?: boolean, userMediaPayload?: any): Promise<
|
|
21
|
+
startLocalStream(isVideoRequired: boolean, isAudioRequired: boolean, shouldAddTrackImmediately?: boolean, userMediaPayload?: any): Promise<boolean>;
|
|
22
22
|
startScreenShare(isAudioRequired?: boolean, shouldAddTrackImmediately?: boolean, screensharePayload?: any): Promise<void>;
|
|
23
23
|
stopScreenSharing(): Promise<void>;
|
|
24
24
|
getDevices(deviceType: GetDevicesType): Promise<Device[] | undefined>;
|
|
@@ -48,9 +48,9 @@ export declare class MeetingHandler {
|
|
|
48
48
|
sendMessage(message: MessagePayload): TaskResponse;
|
|
49
49
|
getOldMessages(): Promise<void>;
|
|
50
50
|
onOldMessages(data: any): Promise<void>;
|
|
51
|
-
checkSocket(): Promise<
|
|
51
|
+
checkSocket(): Promise<boolean>;
|
|
52
52
|
startMeeting(): Promise<void>;
|
|
53
|
-
getMeetingStartTime(): Promise<
|
|
53
|
+
getMeetingStartTime(): Promise<boolean>;
|
|
54
54
|
startRTMPStream(urls: string[]): Promise<void>;
|
|
55
55
|
getEventEmitter(): VaniEventListener | undefined;
|
|
56
56
|
restartTransport: () => Promise<void>;
|
package/lib/MeetingHandler.js
CHANGED
|
@@ -123,7 +123,7 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
123
123
|
case 0:
|
|
124
124
|
if (!this.meetingStartRequest) {
|
|
125
125
|
log.error("meetingStartRequestObject not found");
|
|
126
|
-
return [2 /*return
|
|
126
|
+
return [2 /*return*/, false];
|
|
127
127
|
}
|
|
128
128
|
log.setLevel("trace");
|
|
129
129
|
(_a = this.communicationHandler) === null || _a === void 0 ? void 0 : _a.setMeetingStartRequest(this.meetingStartRequest);
|
|
@@ -147,7 +147,7 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
147
147
|
}
|
|
148
148
|
// this.handleGA();
|
|
149
149
|
this.emitMessageToSource(VaniEvent.OnInitDone, {});
|
|
150
|
-
return [2 /*return
|
|
150
|
+
return [2 /*return*/, true];
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
});
|
|
@@ -163,7 +163,7 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
163
163
|
return __generator(this, function (_c) {
|
|
164
164
|
if (!this.meetingStartRequest) {
|
|
165
165
|
log.error("meetingStartRequestObject not found");
|
|
166
|
-
return [2 /*return
|
|
166
|
+
return [2 /*return*/, false];
|
|
167
167
|
}
|
|
168
168
|
if ((((_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.isMobileApp) && !this.reactNativeWebrtcPlugin) || ((_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.isReady()) === false) {
|
|
169
169
|
log.error("Init method not called");
|
|
@@ -176,7 +176,7 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
176
176
|
return [2 /*return*/];
|
|
177
177
|
}
|
|
178
178
|
this.userMediaHandler.startLocalStream(isVideoRequired, isAudioRequired, shouldAddTrackImmediately, userMediaPayload);
|
|
179
|
-
return [2 /*return
|
|
179
|
+
return [2 /*return*/, true];
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
};
|
|
@@ -452,15 +452,15 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
452
452
|
return __generator(this, function (_a) {
|
|
453
453
|
if (!this.meetingStartRequest) {
|
|
454
454
|
log.error("meetingStartRequestObject not found");
|
|
455
|
-
return [2 /*return
|
|
455
|
+
return [2 /*return*/, false];
|
|
456
456
|
}
|
|
457
457
|
if (!this.websocketCallHandler) {
|
|
458
458
|
log.error("Init method not called");
|
|
459
|
-
return [2 /*return
|
|
459
|
+
return [2 /*return*/, false];
|
|
460
460
|
}
|
|
461
461
|
this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && log.info("checkSocket");
|
|
462
462
|
this.websocketCallHandler.startSocketConnection();
|
|
463
|
-
return [2 /*return
|
|
463
|
+
return [2 /*return*/, true];
|
|
464
464
|
});
|
|
465
465
|
});
|
|
466
466
|
};
|
|
@@ -480,15 +480,15 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
480
480
|
return __generator(this, function (_c) {
|
|
481
481
|
if (!this.meetingStartRequest) {
|
|
482
482
|
log.error("meetingStartRequestObject not found");
|
|
483
|
-
return [2 /*return
|
|
483
|
+
return [2 /*return*/, false];
|
|
484
484
|
}
|
|
485
485
|
if (!this.websocketCallHandler) {
|
|
486
486
|
log.error("Init method not called");
|
|
487
|
-
return [2 /*return
|
|
487
|
+
return [2 /*return*/, false];
|
|
488
488
|
}
|
|
489
489
|
meetingStartTimeObject = { type: WebSocketBasicEvents.GetMeetingStartTime, to: (_a = this.meetingStartRequest) === null || _a === void 0 ? void 0 : _a.userId };
|
|
490
490
|
(_b = this.websocketCallHandler) === null || _b === void 0 ? void 0 : _b.sendSocketMessage(WebSocketBasicEvents.GetMeetingStartTime, meetingStartTimeObject);
|
|
491
|
-
return [2 /*return
|
|
491
|
+
return [2 /*return*/, true];
|
|
492
492
|
});
|
|
493
493
|
});
|
|
494
494
|
};
|
|
@@ -886,11 +886,19 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
886
886
|
SFUHandler.prototype.cleanup = function (shouldStopTracks) {
|
|
887
887
|
if (shouldStopTracks === void 0) { shouldStopTracks = true; }
|
|
888
888
|
if (this.sendTransport) {
|
|
889
|
-
|
|
889
|
+
try {
|
|
890
|
+
this.sendTransport.close();
|
|
891
|
+
}
|
|
892
|
+
catch (err) {
|
|
893
|
+
}
|
|
890
894
|
this.sendTransport = undefined;
|
|
891
895
|
}
|
|
892
896
|
if (this.consumerTransport) {
|
|
893
|
-
|
|
897
|
+
try {
|
|
898
|
+
this.consumerTransport.close();
|
|
899
|
+
}
|
|
900
|
+
catch (err) {
|
|
901
|
+
}
|
|
894
902
|
this.consumerTransport = undefined;
|
|
895
903
|
}
|
|
896
904
|
if (this.producers) {
|
|
@@ -898,26 +906,42 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
898
906
|
var _a;
|
|
899
907
|
try {
|
|
900
908
|
if (shouldStopTracks) {
|
|
901
|
-
|
|
909
|
+
try {
|
|
910
|
+
(_a = producer.track) === null || _a === void 0 ? void 0 : _a.stop();
|
|
911
|
+
}
|
|
912
|
+
catch (err) {
|
|
913
|
+
}
|
|
902
914
|
}
|
|
903
915
|
}
|
|
904
916
|
catch (err) {
|
|
905
917
|
}
|
|
906
918
|
if (producer.closed === false) {
|
|
907
|
-
|
|
919
|
+
try {
|
|
920
|
+
producer.close();
|
|
921
|
+
}
|
|
922
|
+
catch (err) {
|
|
923
|
+
}
|
|
908
924
|
}
|
|
909
925
|
});
|
|
910
926
|
}
|
|
911
927
|
this.dataProducers.forEach(function (producer) {
|
|
912
928
|
if (producer.closed === false) {
|
|
913
929
|
if (shouldStopTracks) {
|
|
914
|
-
|
|
930
|
+
try {
|
|
931
|
+
producer.close();
|
|
932
|
+
}
|
|
933
|
+
catch (err) {
|
|
934
|
+
}
|
|
915
935
|
}
|
|
916
936
|
}
|
|
917
937
|
});
|
|
918
938
|
this.dataConsumer.forEach(function (consumer) {
|
|
919
939
|
if (consumer.closed === false) {
|
|
920
|
-
|
|
940
|
+
try {
|
|
941
|
+
consumer.close();
|
|
942
|
+
}
|
|
943
|
+
catch (err) {
|
|
944
|
+
}
|
|
921
945
|
}
|
|
922
946
|
});
|
|
923
947
|
this.consumers.forEach(function (consumer) {
|