vani-meeting-client-native 0.3.7-beta5 → 0.3.7-beta6

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.
@@ -219,13 +219,25 @@ var WebrtcHandler = /** @class */ (function (_super) {
219
219
  });
220
220
  }); };
221
221
  _this.sendTrackToParticipant = function (track, participant) { return __awaiter(_this, void 0, void 0, function () {
222
- var selfParticpant, peerConnection;
222
+ var selfParticpant, peerConnection, senders, _i, senders_1, eachSender;
223
223
  return __generator(this, function (_a) {
224
224
  selfParticpant = this.communicationHandler.getSelfParticipant();
225
225
  if (selfParticpant) {
226
226
  peerConnection = selfParticpant.getPeerConnectionsViaUserId(participant.userId, this.meetingStartRequest);
227
227
  if (peerConnection && peerConnection.rtcPeerConnection) {
228
228
  this.printLogIfRequired("Send Track", participant);
229
+ senders = peerConnection.rtcPeerConnection.getSenders();
230
+ if (senders && senders.length > 0) {
231
+ for (_i = 0, senders_1 = senders; _i < senders_1.length; _i++) {
232
+ eachSender = senders_1[_i];
233
+ if (eachSender && eachSender.track && eachSender.track.kind === track.track.kind) {
234
+ this.printLogIfRequired("Send Replace track", participant, track);
235
+ eachSender.replaceTrack(track.track);
236
+ return [2 /*return*/];
237
+ }
238
+ }
239
+ }
240
+ this.printLogIfRequired("Send add track - reaplce track not found", participant, track);
229
241
  peerConnection.rtcPeerConnection.addTrack(track.track);
230
242
  // peerConnection.rtcPeerConnection.addStream(new MediaStream([track.track]))
231
243
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-client-native",
3
- "version": "0.3.7beta5",
3
+ "version": "0.3.7beta6",
4
4
  "description": "Vani Meeting Clinet SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",