vani-meeting-client 0.4.0 → 0.4.3
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.
|
@@ -133,14 +133,18 @@ var CommunicationHandler = /** @class */ (function () {
|
|
|
133
133
|
if (shouldInfrom === void 0) { shouldInfrom = false; }
|
|
134
134
|
var oldParticipant = this.participantByUserId(participant.userId);
|
|
135
135
|
if (oldParticipant) {
|
|
136
|
+
console.log("oldParticipant");
|
|
136
137
|
oldParticipant = Object.assign(oldParticipant, participant);
|
|
137
138
|
if (shouldInfrom) {
|
|
138
139
|
this.emitMessageToSource(VaniEvent.OnParticipantDataUpdated, oldParticipant);
|
|
139
140
|
}
|
|
141
|
+
console.log(oldParticipant);
|
|
140
142
|
return oldParticipant;
|
|
141
143
|
}
|
|
142
144
|
else {
|
|
145
|
+
console.log("new participant");
|
|
143
146
|
participant = Object.assign(new Participant(participant.userId, participant.roomId, participant.userData, participant.isAdmin), participant);
|
|
147
|
+
console.log(participant);
|
|
144
148
|
this.allParticipants.push(participant);
|
|
145
149
|
if (shouldInfrom) {
|
|
146
150
|
this.emitMessageToSource(VaniEvent.OnUserJoined, participant);
|
|
@@ -473,19 +473,15 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
473
473
|
var _this = this;
|
|
474
474
|
return __generator(this, function (_a) {
|
|
475
475
|
log.info("onServerConsumer");
|
|
476
|
-
log.info(data);
|
|
477
476
|
if (this.consumerTransport && data && data.message && data.message.consumer) {
|
|
477
|
+
log.info(data);
|
|
478
478
|
if (data.message.consumer.appData.producerData.trackKind === TrackKind.DataChannel) {
|
|
479
479
|
consumerObj = data.message.consumer;
|
|
480
480
|
this.consumerTransport.consumeData(consumerObj).then(function (consumer) {
|
|
481
481
|
_this.dataConsumer.push(consumer);
|
|
482
482
|
consumer.on("message", function (message, ppid) {
|
|
483
483
|
var _a;
|
|
484
|
-
|
|
485
|
-
if (ppid === 51)
|
|
486
|
-
console.log("text message received:", message.toString("utf-8"));
|
|
487
|
-
else if (ppid === 53)
|
|
488
|
-
console.log("binary message received");
|
|
484
|
+
message = JSON.parse(message);
|
|
489
485
|
if (message && message.message) {
|
|
490
486
|
(_a = _this.communicationHandler) === null || _a === void 0 ? void 0 : _a.onMessage(message.message);
|
|
491
487
|
}
|
|
@@ -495,8 +491,10 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
495
491
|
}
|
|
496
492
|
else {
|
|
497
493
|
consumerObj = data.message.consumer;
|
|
494
|
+
log.info("consume");
|
|
498
495
|
this.consumerTransport.consume(consumerObj).then(function (consumer) {
|
|
499
496
|
var _a, _b;
|
|
497
|
+
log.info("on consumed");
|
|
500
498
|
_this.consumers.push(consumer);
|
|
501
499
|
var mediaTrack = consumer.track;
|
|
502
500
|
var data = consumer.appData.producerData;
|