vani-meeting-server 2.7.3 → 2.7.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.
@@ -5,19 +5,21 @@ import { Participant } from "./models/Participant";
5
5
  import { WebSocketServerStartRequest } from "./models/WebSocketServerStartRequest";
6
6
  import { SFUHandler } from "./sfu/SFUHandler";
7
7
  import { WebSocketHandler } from "./websocket/WebSocketHandler";
8
+ import { RtpCapabilities } from "mediasoup/node/lib/rtpParametersTypes";
8
9
  export interface PlainTransportPayload {
9
10
  remoteIpAddress: string;
10
11
  isAudioRequired: boolean;
11
12
  isVideoRequired: boolean;
12
- audioPort: number;
13
- audioRtcpPort: number;
14
- videoPort: number;
15
- videoRtcpPort: number;
13
+ audioPort?: number;
14
+ audioRtcpPort?: number;
15
+ videoPort?: number;
16
+ videoRtcpPort?: number;
16
17
  extraData?: any;
17
18
  }
18
19
  export interface PlainTransportCreatedCallback {
19
20
  roomId: string;
20
21
  plainTransportPayload: PlainTransportPayload;
22
+ rtpCapabilities?: RtpCapabilities;
21
23
  }
22
24
  export declare class ServerHandler {
23
25
  serverStartRequest: WebSocketServerStartRequest;
@@ -417,7 +417,7 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
417
417
  }
418
418
  });
419
419
  }
420
- const response = { plainTransportPayload: plainTransportPayload, roomId: this.roomId };
420
+ const response = { plainTransportPayload: plainTransportPayload, roomId: this.roomId, rtpCapabilities: this.sendRouter?.rtpCapabilities };
421
421
  EventEmitterHandler_1.EventEmitterHandler.getInstance().vaniEventEmitter.emit(Event_1.VaniEvent.OnPlainTransportCreated, response);
422
422
  }
423
423
  async consumeProducerForPlainTransport(plainTransport, producer) {
@@ -121,13 +121,13 @@ class SFUEachRoomUserHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
121
121
  if (ServerHandler_1.ServerHandler.getInstance().serverStartRequest.shouldShareStreamScoreChange) {
122
122
  consumer.on("score", async (score) => {
123
123
  ServerHandler_1.ServerHandler.getInstance().serverStartRequest && ServerHandler_1.ServerHandler.getInstance().serverStartRequest.logLevel !== WebSocketServerStartRequest_1.LogLevel.None && console.log("Consumer score Change - ", JSON.stringify(score), "App Data", JSON.stringify(consumer.appData));
124
- EventEmitterHandler_1.EventEmitterHandler.getInstance().vaniEventEmitter.emit(Event_1.VaniEvent.OnConsumerScoreChange, { score: score, consumerId: consumer.id, appData: consumer.appData, participant: this.selfParticipant });
125
- this.redisBroadcastMessageToTopic(Utility_1.Utility.getTopicForRoomIdAndIp(this.selfParticipant.roomId, (await Constant_1.default.getPublicIp())), this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(EachSocketConnectionHandler_1.SFUMessageType.OnConsumerScoreChange, { score: score, consumerId: consumer.id, appData: consumer.appData, participant: this.selfParticipant })));
124
+ EventEmitterHandler_1.EventEmitterHandler.getInstance().vaniEventEmitter.emit(Event_1.VaniEvent.OnConsumerScoreChange, { score: score, consumerId: consumer.id, participant: this.selfParticipant });
125
+ this.redisBroadcastMessageToTopic(Utility_1.Utility.getTopicForRoomIdAndIp(this.selfParticipant.roomId, (await Constant_1.default.getPublicIp())), this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(EachSocketConnectionHandler_1.SFUMessageType.OnConsumerScoreChange, { score: score, consumerId: consumer.id, participant: this.selfParticipant })));
126
126
  });
127
127
  consumer.on("layerschange", async (layers) => {
128
128
  ServerHandler_1.ServerHandler.getInstance().serverStartRequest && ServerHandler_1.ServerHandler.getInstance().serverStartRequest.logLevel !== WebSocketServerStartRequest_1.LogLevel.None && console.log("Consumer layerschange Change - ", JSON.stringify(layers), "App Data", JSON.stringify(consumer.appData));
129
- EventEmitterHandler_1.EventEmitterHandler.getInstance().vaniEventEmitter.emit(Event_1.VaniEvent.OnConsumerLayerChange, { layer: layers, consumerId: consumer.id, appData: consumer.appData, participant: this.selfParticipant });
130
- this.redisBroadcastMessageToTopic(Utility_1.Utility.getTopicForRoomIdAndIp(this.selfParticipant.roomId, (await Constant_1.default.getPublicIp())), this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(EachSocketConnectionHandler_1.SFUMessageType.OnConsumerLayerChange, { layer: layers, consumerId: consumer.id, appData: consumer.appData, participant: this.selfParticipant })));
129
+ EventEmitterHandler_1.EventEmitterHandler.getInstance().vaniEventEmitter.emit(Event_1.VaniEvent.OnConsumerLayerChange, { layer: layers, consumerId: consumer.id, participant: this.selfParticipant });
130
+ this.redisBroadcastMessageToTopic(Utility_1.Utility.getTopicForRoomIdAndIp(this.selfParticipant.roomId, (await Constant_1.default.getPublicIp())), this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(EachSocketConnectionHandler_1.SFUMessageType.OnConsumerLayerChange, { layer: layers, consumerId: consumer.id, participant: this.selfParticipant })));
131
131
  });
132
132
  }
133
133
  consumer.on("producerresume", () => {
@@ -239,8 +239,8 @@ class SFUEachRoomUserHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
239
239
  if (ServerHandler_1.ServerHandler.getInstance().serverStartRequest.shouldShareStreamScoreChange) {
240
240
  producer.on("score", async (score) => {
241
241
  ServerHandler_1.ServerHandler.getInstance().serverStartRequest && ServerHandler_1.ServerHandler.getInstance().serverStartRequest.logLevel !== WebSocketServerStartRequest_1.LogLevel.None && console.log("producer score Change - ", JSON.stringify(score), "App Data", JSON.stringify(producer.appData));
242
- EventEmitterHandler_1.EventEmitterHandler.getInstance().vaniEventEmitter.emit(Event_1.VaniEvent.OnProducerScoreChange, { score: score, producerId: producer.id, appData: producer.appData, participant: this.selfParticipant });
243
- this.redisBroadcastMessageToTopic(Utility_1.Utility.getTopicForRoomIdAndIp(this.selfParticipant.roomId, (await Constant_1.default.getPublicIp())), this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(EachSocketConnectionHandler_1.SFUMessageType.OnProducerScoreChange, { score: score, producerId: producer.id, appData: producer.appData, participant: this.selfParticipant })));
242
+ EventEmitterHandler_1.EventEmitterHandler.getInstance().vaniEventEmitter.emit(Event_1.VaniEvent.OnProducerScoreChange, { score: score, producerId: producer.id, participant: this.selfParticipant });
243
+ this.redisBroadcastMessageToTopic(Utility_1.Utility.getTopicForRoomIdAndIp(this.selfParticipant.roomId, (await Constant_1.default.getPublicIp())), this.preapreClientMessageBody(true, this.selfParticipant, this.preapreWebSocketMessageBody(EachSocketConnectionHandler_1.SFUMessageType.OnProducerScoreChange, { score: score, producerId: producer.id, participant: this.selfParticipant })));
244
244
  });
245
245
  }
246
246
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-server",
3
- "version": "2.7.3",
3
+ "version": "2.7.4",
4
4
  "description": "Vani Meeting Server SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",