vani-meeting-client 0.7.4 → 0.7.6
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.js +4 -15
- package/lib/model/MeetingStartRequest.d.ts +1 -0
- package/lib/model/MeetingStartRequest.js +1 -0
- package/lib/utility/DynamicLibHelper.d.ts +1 -2
- package/lib/utility/DynamicLibHelper.js +12 -10
- package/lib/video-call-handler/SFUHandler.js +4 -5
- package/package.json +1 -1
package/lib/MeetingHandler.js
CHANGED
|
@@ -61,7 +61,7 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
61
61
|
MeetingHandler.prototype.init = function () {
|
|
62
62
|
var _a, _b, _c;
|
|
63
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
-
var _d, _e
|
|
64
|
+
var _d, _e;
|
|
65
65
|
return __generator(this, function (_f) {
|
|
66
66
|
switch (_f.label) {
|
|
67
67
|
case 0:
|
|
@@ -79,26 +79,15 @@ var MeetingHandler = /** @class */ (function () {
|
|
|
79
79
|
this.reactNativeWebrtcPlugin.registerGlobals();
|
|
80
80
|
_f.label = 2;
|
|
81
81
|
case 2:
|
|
82
|
-
_f.trys.push([2, 5, , 6]);
|
|
83
82
|
if (!!this.videoCallHandler) return [3 /*break*/, 4];
|
|
84
83
|
_e = this;
|
|
85
84
|
return [4 /*yield*/, new DynamicLibHelper().getVideoCallClassHandler((_c = this.meetingStartRequest) === null || _c === void 0 ? void 0 : _c.meetingType, this.meetingStartRequest, this.communicationHandler)];
|
|
86
85
|
case 3:
|
|
87
86
|
_e.videoCallHandler = _f.sent();
|
|
88
87
|
_f.label = 4;
|
|
89
|
-
case 4:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
console.log("his.videoCallHandler error", err_1);
|
|
93
|
-
return [3 /*break*/, 6];
|
|
94
|
-
case 6:
|
|
95
|
-
try {
|
|
96
|
-
if (!this.websocketCallHandler) {
|
|
97
|
-
this.websocketCallHandler = new WebsocketHandler(this.meetingStartRequest, this.communicationHandler);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
catch (err) {
|
|
101
|
-
console.log("his.websocketCallHandler error", err);
|
|
88
|
+
case 4:
|
|
89
|
+
if (!this.websocketCallHandler) {
|
|
90
|
+
this.websocketCallHandler = new WebsocketHandler(this.meetingStartRequest, this.communicationHandler);
|
|
102
91
|
}
|
|
103
92
|
// this.handleGA();
|
|
104
93
|
this.emitMessageToSource(VaniEvent.OnInitDone, {});
|
|
@@ -34,6 +34,7 @@ export declare class MeetingStartRequest {
|
|
|
34
34
|
defaultAudioBlocked: boolean;
|
|
35
35
|
defaultVideoBlocked: boolean;
|
|
36
36
|
defaultScreenShareBlocked: boolean;
|
|
37
|
+
mediasoupDeviceHandlerName?: String;
|
|
37
38
|
defaultCameraFacingMode: CameraFacingMode;
|
|
38
39
|
simulcastEncodings: RTCRtpEncodingParameters[];
|
|
39
40
|
isDataChannelRequired: boolean;
|
|
@@ -29,6 +29,7 @@ var MeetingStartRequest = /** @class */ (function () {
|
|
|
29
29
|
this.defaultAudioBlocked = false;
|
|
30
30
|
this.defaultVideoBlocked = false;
|
|
31
31
|
this.defaultScreenShareBlocked = false;
|
|
32
|
+
this.mediasoupDeviceHandlerName = undefined;
|
|
32
33
|
this.defaultCameraFacingMode = CameraFacingMode.Front;
|
|
33
34
|
this.simulcastEncodings = [{ maxBitrate: 40000, scaleResolutionDownBy: 2.0 }, { maxBitrate: 620000, scaleResolutionDownBy: 1.0 },];
|
|
34
35
|
this.isDataChannelRequired = false;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { MeetingStartRequest, MeetingType } from '..';
|
|
2
2
|
import { CommunicationHandler } from '../inter-communication-handler/CommunicationHandler';
|
|
3
|
-
import { SFUHandler } from '../video-call-handler/SFUHandler';
|
|
4
3
|
export declare class DynamicLibHelper {
|
|
5
4
|
getReactNativeWebrtcPlugin(meetingStartRequest: MeetingStartRequest): Promise<any>;
|
|
6
|
-
getVideoCallClassHandler(meetingType: MeetingType, meetingStartRequest: MeetingStartRequest, _communicationHandler: CommunicationHandler): Promise<SFUHandler | import("../video-call-handler/WebrtcHandler").WebrtcHandler | undefined>;
|
|
5
|
+
getVideoCallClassHandler(meetingType: MeetingType, meetingStartRequest: MeetingStartRequest, _communicationHandler: CommunicationHandler): Promise<import("../video-call-handler/SFUHandler").SFUHandler | import("../video-call-handler/WebrtcHandler").WebrtcHandler | undefined>;
|
|
7
6
|
getMediaDevicesVariable(meetingStartRequest: MeetingStartRequest): any;
|
|
8
7
|
getMediaStreamVariable(meetingStartRequest: MeetingStartRequest): any;
|
|
9
8
|
}
|
|
@@ -36,7 +36,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
import { MeetingType } from '..';
|
|
38
38
|
import * as log from 'loglevel';
|
|
39
|
-
import { SFUHandler } from '../video-call-handler/SFUHandler';
|
|
40
39
|
var DynamicLibHelper = /** @class */ (function () {
|
|
41
40
|
function DynamicLibHelper() {
|
|
42
41
|
}
|
|
@@ -62,18 +61,21 @@ var DynamicLibHelper = /** @class */ (function () {
|
|
|
62
61
|
return __generator(this, function (_a) {
|
|
63
62
|
switch (_a.label) {
|
|
64
63
|
case 0:
|
|
65
|
-
if (meetingType === MeetingType.SFU)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
if (!(meetingType === MeetingType.SFU)) return [3 /*break*/, 2];
|
|
65
|
+
return [4 /*yield*/, import("../video-call-handler/SFUHandler")];
|
|
66
|
+
case 1:
|
|
67
|
+
baseVideoCallHandler = _a.sent();
|
|
68
|
+
if (baseVideoCallHandler) {
|
|
69
|
+
return [2 /*return*/, new baseVideoCallHandler.SFUHandler(meetingStartRequest, _communicationHandler)];
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
_a.label = 2;
|
|
72
|
+
case 2:
|
|
73
|
+
if (!(meetingType === MeetingType.WEBRTC)) return [3 /*break*/, 4];
|
|
72
74
|
baseVideoCallHandler = import("../video-call-handler/WebrtcHandler");
|
|
73
|
-
if (!baseVideoCallHandler) return [3 /*break*/,
|
|
75
|
+
if (!baseVideoCallHandler) return [3 /*break*/, 4];
|
|
74
76
|
return [4 /*yield*/, baseVideoCallHandler];
|
|
75
|
-
case
|
|
76
|
-
case
|
|
77
|
+
case 3: return [2 /*return*/, new (_a.sent()).WebrtcHandler(meetingStartRequest, _communicationHandler)];
|
|
78
|
+
case 4: return [2 /*return*/, undefined];
|
|
77
79
|
}
|
|
78
80
|
});
|
|
79
81
|
});
|
|
@@ -79,16 +79,15 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
79
79
|
_this.dataConsumer = [];
|
|
80
80
|
var handlerName = detectDevice();
|
|
81
81
|
if (handlerName) {
|
|
82
|
+
_this.device = new Device();
|
|
82
83
|
console.log("detected handler: %s", handlerName);
|
|
83
84
|
}
|
|
84
85
|
else {
|
|
86
|
+
if (_this.meetingStartRequest && _this.meetingStartRequest.mediasoupDeviceHandlerName) {
|
|
87
|
+
_this.device = new Device({ handlerName: _this.meetingStartRequest.mediasoupDeviceHandlerName });
|
|
88
|
+
}
|
|
85
89
|
console.warn("no suitable handler found for current browser/device");
|
|
86
90
|
}
|
|
87
|
-
try {
|
|
88
|
-
_this.device = new Device({ handlerName: "Safari12" });
|
|
89
|
-
}
|
|
90
|
-
catch (err) {
|
|
91
|
-
}
|
|
92
91
|
return _this;
|
|
93
92
|
}
|
|
94
93
|
SFUHandler.prototype.onReconnect = function () {
|