vani-meeting-client 0.3.9 → 0.4.2
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.
|
@@ -241,7 +241,7 @@ var SFUHandler = /** @class */ (function (_super) {
|
|
|
241
241
|
};
|
|
242
242
|
SFUHandler.prototype.sendMessageViaDataChannel = function (messagePayload) {
|
|
243
243
|
if (this.dataProducers && this.dataProducers.length > 0) {
|
|
244
|
-
this.dataProducers[0].send(messagePayload);
|
|
244
|
+
this.dataProducers[0].send(JSON.stringify(messagePayload));
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
SFUHandler.prototype.init = function () {
|
|
@@ -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;
|