vani-meeting-client 2.2.3-beta1 → 2.2.3-beta2
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.
|
@@ -10,6 +10,7 @@ export declare class WebrtcHandler extends BaseVideoCallHandler {
|
|
|
10
10
|
onSocketMessage(websocketCallHandler: WebSocketMessageBody): void;
|
|
11
11
|
onAllParticipants(participants: Participant[]): Promise<void>;
|
|
12
12
|
onUserJoined(participant: Participant): Promise<void>;
|
|
13
|
+
private sendWebrtcMessage;
|
|
13
14
|
init(): Promise<void>;
|
|
14
15
|
onReconnect(): Promise<void>;
|
|
15
16
|
stopTrack(track: Track): void;
|
|
@@ -49,6 +49,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49
49
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
+
import { WebrtcMessageType } from "../websocket-handler/WebsocketHandler";
|
|
52
53
|
import { BaseVideoCallHandler } from "./BaseVideoCallHandler";
|
|
53
54
|
import log from 'loglevel';
|
|
54
55
|
import { LogLevel } from "../model/MeetingStartRequest";
|
|
@@ -59,6 +60,9 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
59
60
|
function WebrtcHandler() {
|
|
60
61
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
61
62
|
_this.dynamicLibHelper = (new DynamicLibHelper());
|
|
63
|
+
_this.sendWebrtcMessage = function (data) {
|
|
64
|
+
_this.communicationHandler.sendWebSocketMessage(WebrtcMessageType.SendOffer, data);
|
|
65
|
+
};
|
|
62
66
|
_this.isOfferInitParticipant = function (participant) {
|
|
63
67
|
var selfParticpant = _this.communicationHandler.getSelfParticipant();
|
|
64
68
|
if (participant.userId > selfParticpant.userId) {
|
|
@@ -94,7 +98,7 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
94
98
|
};
|
|
95
99
|
WebrtcHandler.prototype.onUserJoined = function (participant) {
|
|
96
100
|
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
-
var selfParticpant, isOfferInitParticipant, peerConnectionObject, peerConnection, offer;
|
|
101
|
+
var selfParticpant, isOfferInitParticipant, peerConnectionObject, peerConnection, offer, messageJson;
|
|
98
102
|
return __generator(this, function (_a) {
|
|
99
103
|
switch (_a.label) {
|
|
100
104
|
case 0:
|
|
@@ -120,6 +124,8 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
120
124
|
peerConnectionObject.offer = offer;
|
|
121
125
|
// send offer to peer
|
|
122
126
|
console.log("offer", offer);
|
|
127
|
+
messageJson = { to: participant.userId, type: WebrtcMessageType.SendOffer, message: { offer: offer } };
|
|
128
|
+
this.sendWebrtcMessage(messageJson);
|
|
123
129
|
_a.label = 2;
|
|
124
130
|
case 2: return [2 /*return*/];
|
|
125
131
|
}
|