vani-meeting-client 0.3.3 → 0.3.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.
|
@@ -10,6 +10,8 @@ export declare class SFUHandler extends BaseVideoCallHandler {
|
|
|
10
10
|
private isProduceTrackIntialWorkDone;
|
|
11
11
|
private producers;
|
|
12
12
|
private consumers;
|
|
13
|
+
private dataProducers;
|
|
14
|
+
private dataConsumer;
|
|
13
15
|
onReconnect(): Promise<void>;
|
|
14
16
|
stopTrack(track: Track): void;
|
|
15
17
|
pauseTrack(track: Track): void;
|
|
@@ -18,6 +20,7 @@ export declare class SFUHandler extends BaseVideoCallHandler {
|
|
|
18
20
|
resumeIncomingTrack(track: Track): void;
|
|
19
21
|
updateSpatialForTrack(track: Track, spatialLayerIndex: number): Promise<void>;
|
|
20
22
|
sendTrack(track: Track): Promise<void>;
|
|
23
|
+
createDataChannel(): Promise<void>;
|
|
21
24
|
onParticipantUpdated(): void;
|
|
22
25
|
init(): Promise<void>;
|
|
23
26
|
private onTransportNotFound;
|
|
@@ -75,6 +75,8 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
75
75
|
_this.isProduceTrackIntialWorkDone = false;
|
|
76
76
|
_this.producers = [];
|
|
77
77
|
_this.consumers = [];
|
|
78
|
+
_this.dataProducers = [];
|
|
79
|
+
_this.dataConsumer = [];
|
|
78
80
|
return _this;
|
|
79
81
|
}
|
|
80
82
|
SFUHandler.prototype.onReconnect = function () {
|
|
@@ -196,6 +198,7 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
196
198
|
if (webcamProducer) {
|
|
197
199
|
this.producers.push(webcamProducer);
|
|
198
200
|
this.onParticipantUpdated();
|
|
201
|
+
this.createDataChannel();
|
|
199
202
|
// this.sendMessageReadyToConsume();
|
|
200
203
|
}
|
|
201
204
|
_d.label = 4;
|
|
@@ -204,6 +207,26 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
204
207
|
});
|
|
205
208
|
});
|
|
206
209
|
};
|
|
210
|
+
SFUHandler.prototype.createDataChannel = function () {
|
|
211
|
+
var _a;
|
|
212
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
213
|
+
var webcamProducer;
|
|
214
|
+
return __generator(this, function (_b) {
|
|
215
|
+
switch (_b.label) {
|
|
216
|
+
case 0:
|
|
217
|
+
if (!(this.dataProducers.length === 0)) return [3 /*break*/, 2];
|
|
218
|
+
return [4 /*yield*/, ((_a = this.sendTransport) === null || _a === void 0 ? void 0 : _a.produceData())];
|
|
219
|
+
case 1:
|
|
220
|
+
webcamProducer = _b.sent();
|
|
221
|
+
if (webcamProducer) {
|
|
222
|
+
this.dataProducers.push(webcamProducer);
|
|
223
|
+
}
|
|
224
|
+
_b.label = 2;
|
|
225
|
+
case 2: return [2 /*return*/];
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
};
|
|
207
230
|
SFUHandler.prototype.onParticipantUpdated = function () {
|
|
208
231
|
if (!this.communicationHandler || this.communicationHandler.getAllParticipants().length < 2) {
|
|
209
232
|
this.producers.forEach(function (producer) {
|
|
@@ -400,6 +423,8 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
400
423
|
return __awaiter(this, void 0, void 0, function () {
|
|
401
424
|
var producer, producerId, consumerAppData, cosumeObj, message;
|
|
402
425
|
return __generator(this, function (_a) {
|
|
426
|
+
console.log("onNewProducer");
|
|
427
|
+
console.log(data);
|
|
403
428
|
if (this.consumerTransport && data && data.message && data.message.producer) {
|
|
404
429
|
producer = data.message.producer;
|
|
405
430
|
producerId = producer.id;
|
|
@@ -91,6 +91,13 @@ var WebrtcHandler = /** @class */ (function (_super) {
|
|
|
91
91
|
WebrtcHandler.prototype.sendTrack = function (track) {
|
|
92
92
|
throw new Error("Method not implemented.");
|
|
93
93
|
};
|
|
94
|
+
WebrtcHandler.prototype.createDataChannel = function () {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
return [2 /*return*/];
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
94
101
|
return WebrtcHandler;
|
|
95
102
|
}(BaseVideoCallHandler));
|
|
96
103
|
export { WebrtcHandler };
|