vani-meeting-client 1.9.5 → 1.9.7

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 CommunicationHandler {
10
10
  private allParticipants;
11
11
  private selfTracks;
12
12
  private allTracks;
13
+ private allSelfTracksForRestartSFU;
13
14
  private meetingStartRequest?;
14
15
  private websocketCallHandler?;
15
16
  private videoCallHandler?;
@@ -62,6 +63,7 @@ export declare class CommunicationHandler {
62
63
  checkIfInternetReachable: (count: number) => void;
63
64
  private onApiResponded;
64
65
  restartSFU: () => Promise<void>;
66
+ onSFUInitDone: () => Promise<void>;
65
67
  private reloadSFUCleanUpDone;
66
68
  cleanup(): void;
67
69
  }
@@ -49,6 +49,7 @@ var CommunicationHandler = /** @class */ (function () {
49
49
  this.allParticipants = [];
50
50
  this.selfTracks = [];
51
51
  this.allTracks = [];
52
+ this.allSelfTracksForRestartSFU = undefined;
52
53
  this.isReachable = true;
53
54
  this.restartTransport = function () { return __awaiter(_this, void 0, void 0, function () {
54
55
  var _a;
@@ -114,6 +115,18 @@ var CommunicationHandler = /** @class */ (function () {
114
115
  return [2 /*return*/];
115
116
  });
116
117
  }); };
118
+ this.onSFUInitDone = function () { return __awaiter(_this, void 0, void 0, function () {
119
+ return __generator(this, function (_a) {
120
+ this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug &&
121
+ console.log("onSFUInitDone", this.allSelfTracksForRestartSFU);
122
+ this.emitMessageToSource(VaniEvent.OnSFUConnected, undefined);
123
+ if (this.allSelfTracksForRestartSFU) {
124
+ this.emitMessageToSource(VaniEvent.ResendTracks, this.allSelfTracksForRestartSFU);
125
+ this.allSelfTracksForRestartSFU = undefined;
126
+ }
127
+ return [2 /*return*/];
128
+ });
129
+ }); };
117
130
  this.reloadSFUCleanUpDone = function () { return __awaiter(_this, void 0, void 0, function () {
118
131
  var videoCallHandler;
119
132
  var _a;
@@ -121,7 +134,10 @@ var CommunicationHandler = /** @class */ (function () {
121
134
  switch (_b.label) {
122
135
  case 0:
123
136
  this.videoCallHandler = undefined;
124
- this.allTracks = this.allTracks.filter(function (eachTrack) { return eachTrack.isLocalTrack === true; });
137
+ this.allSelfTracksForRestartSFU = this.allTracks.filter(function (eachTrack) { return eachTrack.isLocalTrack === true; });
138
+ this.allTracks = [];
139
+ this.selfTracks = [];
140
+ this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && console.log("reloadSFUCleanUpDone", this.allSelfTracksForRestartSFU);
125
141
  return [4 /*yield*/, ((_a = this.meetingHandler) === null || _a === void 0 ? void 0 : _a.recreateVideoCallHandler())];
126
142
  case 1:
127
143
  videoCallHandler = _b.sent();
@@ -546,6 +562,7 @@ var CommunicationHandler = /** @class */ (function () {
546
562
  this.selfTracks.forEach(function (eachTrack) {
547
563
  _this.removeTrack(eachTrack, false);
548
564
  });
565
+ this.allSelfTracksForRestartSFU = undefined;
549
566
  this.eventEmitter.removeAllListeners();
550
567
  this.videoCallHandler = undefined;
551
568
  this.meetingStartRequest = undefined;
@@ -36,7 +36,9 @@ export declare enum VaniEvent {
36
36
  OnNewPingFromServer = "OnNewPingFromServer",
37
37
  OnConsumerScoreChange = "OnConsumerScoreChange",
38
38
  OnProducerScoreChange = "OnProducerScoreChange",
39
- OnConsumerLayerChange = "OnConsumerLayerChange"
39
+ OnConsumerLayerChange = "OnConsumerLayerChange",
40
+ OnSFUConnected = "OnSFUReconnected",
41
+ ResendTracks = "ResendTracks"
40
42
  }
41
43
  interface VaniConnectionEvents {
42
44
  [VaniEvent.OnInitDone]: () => any;
@@ -88,6 +90,8 @@ interface VaniConnectionEvents {
88
90
  [VaniEvent.OnVideoBlocked]: (participant: Participant) => any;
89
91
  [VaniEvent.OnAudioBlocked]: (participant: Participant) => any;
90
92
  [VaniEvent.OnSocketDisconnected]: () => any;
93
+ [VaniEvent.OnSFUConnected]: () => any;
94
+ [VaniEvent.ResendTracks]: (tracks: Track[]) => any;
91
95
  [VaniEvent.OnAskedToCloseTheRoom]: () => any;
92
96
  }
93
97
  export declare interface VaniEventListener {
@@ -35,4 +35,6 @@ export var VaniEvent;
35
35
  VaniEvent["OnConsumerScoreChange"] = "OnConsumerScoreChange";
36
36
  VaniEvent["OnProducerScoreChange"] = "OnProducerScoreChange";
37
37
  VaniEvent["OnConsumerLayerChange"] = "OnConsumerLayerChange";
38
+ VaniEvent["OnSFUConnected"] = "OnSFUReconnected";
39
+ VaniEvent["ResendTracks"] = "ResendTracks";
38
40
  })(VaniEvent || (VaniEvent = {}));
@@ -666,7 +666,7 @@ var SFUHandler = /** @class */ (function (_super) {
666
666
  };
667
667
  SFUHandler.prototype.produceTracks = function () {
668
668
  var _this = this;
669
- var _a;
669
+ var _a, _b;
670
670
  this.meetingStartRequest && this.meetingStartRequest.logLevel === LogLevel.Debug && log.info("produceTracks");
671
671
  if (!this.sendTransport || !this.consumerTransport || this.isProduceTrackIntialWorkDone) {
672
672
  return;
@@ -682,6 +682,8 @@ var SFUHandler = /** @class */ (function (_super) {
682
682
  else {
683
683
  this.sendMessageReadyToConsume();
684
684
  }
685
+ //inform init is done(mainly used when restart SFU)
686
+ (_b = this.communicationHandler) === null || _b === void 0 ? void 0 : _b.onSFUInitDone();
685
687
  // if (this.meetingStartRequest?.isDataChannelRequired) {
686
688
  // this.createDataChannel()
687
689
  // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client",
3
- "version": "1.9.5",
3
+ "version": "1.9.7",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",