@100mslive/hms-video-store 0.2.76 → 0.2.77

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.
@@ -984,6 +984,8 @@ var HMSNotificationTypes;
984
984
  HMSNotificationTypes["REMOVED_FROM_ROOM"] = "REMOVED_FROM_ROOM";
985
985
  HMSNotificationTypes["DEVICE_CHANGE_UPDATE"] = "DEVICE_CHANGE_UPDATE";
986
986
  HMSNotificationTypes["PLAYLIST_TRACK_ENDED"] = "PLAYLIST_TRACK_ENDED";
987
+ HMSNotificationTypes["NAME_UPDATED"] = "NAME_UPDATED";
988
+ HMSNotificationTypes["METADATA_UPDATED"] = "METADATA_UPDATED";
987
989
  })(HMSNotificationTypes || (HMSNotificationTypes = {}));
988
990
 
989
991
  var HMSPlaylistType;
@@ -2710,6 +2712,11 @@ var HMSPlaylist = /*#__PURE__*/function () {
2710
2712
  return HMSPlaylist;
2711
2713
  }();
2712
2714
 
2715
+ var _PEER_NOTIFICATION_TY, _TRACK_NOTIFICATION_T, _ACTION_TYPES;
2716
+ var PEER_NOTIFICATION_TYPES = (_PEER_NOTIFICATION_TY = {}, _PEER_NOTIFICATION_TY[HMSPeerUpdate.PEER_JOINED] = HMSNotificationTypes.PEER_JOINED, _PEER_NOTIFICATION_TY[HMSPeerUpdate.PEER_LEFT] = HMSNotificationTypes.PEER_LEFT, _PEER_NOTIFICATION_TY[HMSPeerUpdate.ROLE_UPDATED] = HMSNotificationTypes.ROLE_UPDATED, _PEER_NOTIFICATION_TY[HMSPeerUpdate.AUDIO_TOGGLED] = 'PEER_AUDIO_UPDATED', _PEER_NOTIFICATION_TY[HMSPeerUpdate.VIDEO_TOGGLED] = 'PEER_VIDEO_UPDATED', _PEER_NOTIFICATION_TY[HMSPeerUpdate.NAME_UPDATED] = HMSNotificationTypes.NAME_UPDATED, _PEER_NOTIFICATION_TY[HMSPeerUpdate.METADATA_UPDATED] = HMSNotificationTypes.METADATA_UPDATED, _PEER_NOTIFICATION_TY);
2717
+ var TRACK_NOTIFICATION_TYPES = (_TRACK_NOTIFICATION_T = {}, _TRACK_NOTIFICATION_T[HMSTrackUpdate.TRACK_ADDED] = HMSNotificationTypes.TRACK_ADDED, _TRACK_NOTIFICATION_T[HMSTrackUpdate.TRACK_REMOVED] = HMSNotificationTypes.TRACK_REMOVED, _TRACK_NOTIFICATION_T[HMSTrackUpdate.TRACK_MUTED] = HMSNotificationTypes.TRACK_MUTED, _TRACK_NOTIFICATION_T[HMSTrackUpdate.TRACK_UNMUTED] = HMSNotificationTypes.TRACK_UNMUTED, _TRACK_NOTIFICATION_T);
2718
+ var ACTION_TYPES = (_ACTION_TYPES = {}, _ACTION_TYPES[HMSPeerUpdate.PEER_JOINED] = 'peerJoined', _ACTION_TYPES[HMSPeerUpdate.PEER_LEFT] = 'peerLeft', _ACTION_TYPES[HMSPeerUpdate.NAME_UPDATED] = 'nameUpdated', _ACTION_TYPES[HMSPeerUpdate.METADATA_UPDATED] = 'metadataUpdated', _ACTION_TYPES);
2719
+
2713
2720
  /**
2714
2721
  * This class implements the IHMSActions interface for 100ms SDK. It connects with SDK
2715
2722
  * and takes control of data management by letting every action pass through it. The
@@ -2765,12 +2772,7 @@ var HMSSDKActions = /*#__PURE__*/function () {
2765
2772
  var peer = _this.store.getState(selectPeerByID(sdkPeer.peerId));
2766
2773
 
2767
2774
  var actionName = 'peerUpdate';
2768
-
2769
- if (type === HMSPeerUpdate.PEER_JOINED) {
2770
- actionName = 'peerJoined';
2771
- } else if (type === HMSPeerUpdate.PEER_LEFT) {
2772
- actionName = 'peerLeft';
2773
- }
2775
+ actionName = ACTION_TYPES[type];
2774
2776
 
2775
2777
  _this.syncRoomState(actionName); // if peer wasn't available before sync(will happen if event is peer join)
2776
2778
 
@@ -3825,39 +3827,72 @@ var HMSSDKActions = /*#__PURE__*/function () {
3825
3827
  return stopRTMPAndRecording;
3826
3828
  }();
3827
3829
 
3830
+ _proto.updatePeer = /*#__PURE__*/function () {
3831
+ var _updatePeer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(params) {
3832
+ return runtime_1.wrap(function _callee28$(_context28) {
3833
+ while (1) {
3834
+ switch (_context28.prev = _context28.next) {
3835
+ case 0:
3836
+ _context28.next = 2;
3837
+ return this.sdk.updatePeer(params);
3838
+
3839
+ case 2:
3840
+ if (params.name) {
3841
+ this.syncRoomState('nameUpdated');
3842
+ }
3843
+
3844
+ if (params.metadata) {
3845
+ this.syncRoomState('metadataUpdated');
3846
+ }
3847
+
3848
+ case 4:
3849
+ case "end":
3850
+ return _context28.stop();
3851
+ }
3852
+ }
3853
+ }, _callee28, this);
3854
+ }));
3855
+
3856
+ function updatePeer(_x40) {
3857
+ return _updatePeer.apply(this, arguments);
3858
+ }
3859
+
3860
+ return updatePeer;
3861
+ }();
3862
+
3828
3863
  _proto.setRemoteTrackEnabled = /*#__PURE__*/function () {
3829
- var _setRemoteTrackEnabled = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(trackID, enabled) {
3864
+ var _setRemoteTrackEnabled = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(trackID, enabled) {
3830
3865
  var _this6 = this;
3831
3866
 
3832
3867
  var track;
3833
- return runtime_1.wrap(function _callee28$(_context28) {
3868
+ return runtime_1.wrap(function _callee29$(_context29) {
3834
3869
  while (1) {
3835
- switch (_context28.prev = _context28.next) {
3870
+ switch (_context29.prev = _context29.next) {
3836
3871
  case 0:
3837
3872
  if (!(typeof trackID === 'string')) {
3838
- _context28.next = 10;
3873
+ _context29.next = 10;
3839
3874
  break;
3840
3875
  }
3841
3876
 
3842
3877
  track = this.hmsSDKTracks[trackID];
3843
3878
 
3844
3879
  if (!(track && isRemoteTrack(track))) {
3845
- _context28.next = 7;
3880
+ _context29.next = 7;
3846
3881
  break;
3847
3882
  }
3848
3883
 
3849
- _context28.next = 5;
3884
+ _context29.next = 5;
3850
3885
  return this.sdk.changeTrackState(track, enabled);
3851
3886
 
3852
3887
  case 5:
3853
- _context28.next = 8;
3888
+ _context29.next = 8;
3854
3889
  break;
3855
3890
 
3856
3891
  case 7:
3857
3892
  this.logPossibleInconsistency("No remote track with ID " + trackID + " found for change track state");
3858
3893
 
3859
3894
  case 8:
3860
- _context28.next = 11;
3895
+ _context29.next = 11;
3861
3896
  break;
3862
3897
 
3863
3898
  case 10:
@@ -3869,13 +3904,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
3869
3904
 
3870
3905
  case 11:
3871
3906
  case "end":
3872
- return _context28.stop();
3907
+ return _context29.stop();
3873
3908
  }
3874
3909
  }
3875
- }, _callee28, this);
3910
+ }, _callee29, this);
3876
3911
  }));
3877
3912
 
3878
- function setRemoteTrackEnabled(_x40, _x41) {
3913
+ function setRemoteTrackEnabled(_x41, _x42) {
3879
3914
  return _setRemoteTrackEnabled.apply(this, arguments);
3880
3915
  }
3881
3916
 
@@ -3883,11 +3918,11 @@ var HMSSDKActions = /*#__PURE__*/function () {
3883
3918
  }();
3884
3919
 
3885
3920
  _proto.setRemoteTracksEnabled = /*#__PURE__*/function () {
3886
- var _setRemoteTracksEnabled = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(params) {
3921
+ var _setRemoteTracksEnabled = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(params) {
3887
3922
  var sdkRequest, rolesMap;
3888
- return runtime_1.wrap(function _callee29$(_context29) {
3923
+ return runtime_1.wrap(function _callee30$(_context30) {
3889
3924
  while (1) {
3890
- switch (_context29.prev = _context29.next) {
3925
+ switch (_context30.prev = _context30.next) {
3891
3926
  case 0:
3892
3927
  sdkRequest = {
3893
3928
  enabled: params.enabled,
@@ -3902,18 +3937,18 @@ var HMSSDKActions = /*#__PURE__*/function () {
3902
3937
  });
3903
3938
  }
3904
3939
 
3905
- _context29.next = 4;
3940
+ _context30.next = 4;
3906
3941
  return this.sdk.changeMultiTrackState(sdkRequest);
3907
3942
 
3908
3943
  case 4:
3909
3944
  case "end":
3910
- return _context29.stop();
3945
+ return _context30.stop();
3911
3946
  }
3912
3947
  }
3913
- }, _callee29, this);
3948
+ }, _callee30, this);
3914
3949
  }));
3915
3950
 
3916
- function setRemoteTracksEnabled(_x42) {
3951
+ function setRemoteTracksEnabled(_x43) {
3917
3952
  return _setRemoteTracksEnabled.apply(this, arguments);
3918
3953
  }
3919
3954
 
@@ -3961,18 +3996,14 @@ var HMSSDKActions = /*#__PURE__*/function () {
3961
3996
  };
3962
3997
 
3963
3998
  _proto.onRemovedFromRoom = function onRemovedFromRoom(request) {
3964
- var requestedBy = this.store.getState(selectPeerByID(request.requestedBy.peerId));
3965
-
3966
- if (!requestedBy) {
3967
- this.logPossibleInconsistency("Not found peer who requested leave room, " + request.requestedBy);
3968
- return;
3969
- }
3999
+ var _request$requestedBy;
3970
4000
 
4001
+ var requestedBy = this.store.getState(selectPeerByID((_request$requestedBy = request.requestedBy) == null ? void 0 : _request$requestedBy.peerId));
3971
4002
  this.hmsNotifications.sendLeaveRoom(_extends({}, request, {
3972
- requestedBy: requestedBy
4003
+ requestedBy: requestedBy || undefined
3973
4004
  }));
3974
4005
  HMSLogger.i('resetting state after peer removed', request);
3975
- this.resetState(request.roomEnded ? 'roomEnded' : 'removedFromRoom');
4006
+ this.resetState(request.roomEnded || !requestedBy ? 'roomEnded' : 'removedFromRoom');
3976
4007
  };
3977
4008
 
3978
4009
  _proto.onDeviceChange = function onDeviceChange(event) {
@@ -4012,12 +4043,12 @@ var HMSSDKActions = /*#__PURE__*/function () {
4012
4043
  };
4013
4044
 
4014
4045
  _proto.sdkPreviewWithListeners = /*#__PURE__*/function () {
4015
- var _sdkPreviewWithListeners = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(config) {
4016
- return runtime_1.wrap(function _callee30$(_context30) {
4046
+ var _sdkPreviewWithListeners = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(config) {
4047
+ return runtime_1.wrap(function _callee31$(_context31) {
4017
4048
  while (1) {
4018
- switch (_context30.prev = _context30.next) {
4049
+ switch (_context31.prev = _context31.next) {
4019
4050
  case 0:
4020
- _context30.next = 2;
4051
+ _context31.next = 2;
4021
4052
  return this.sdk.preview(config, {
4022
4053
  onPreview: this.onPreview.bind(this),
4023
4054
  onError: this.onError.bind(this),
@@ -4031,13 +4062,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4031
4062
 
4032
4063
  case 3:
4033
4064
  case "end":
4034
- return _context30.stop();
4065
+ return _context31.stop();
4035
4066
  }
4036
4067
  }
4037
- }, _callee30, this);
4068
+ }, _callee31, this);
4038
4069
  }));
4039
4070
 
4040
- function sdkPreviewWithListeners(_x43) {
4071
+ function sdkPreviewWithListeners(_x44) {
4041
4072
  return _sdkPreviewWithListeners.apply(this, arguments);
4042
4073
  }
4043
4074
 
@@ -4045,29 +4076,29 @@ var HMSSDKActions = /*#__PURE__*/function () {
4045
4076
  }();
4046
4077
 
4047
4078
  _proto.startScreenShare = /*#__PURE__*/function () {
4048
- var _startScreenShare = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(audioOnly) {
4079
+ var _startScreenShare = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(audioOnly) {
4049
4080
  var _this8 = this;
4050
4081
 
4051
4082
  var isScreenShared;
4052
- return runtime_1.wrap(function _callee31$(_context31) {
4083
+ return runtime_1.wrap(function _callee32$(_context32) {
4053
4084
  while (1) {
4054
- switch (_context31.prev = _context31.next) {
4085
+ switch (_context32.prev = _context32.next) {
4055
4086
  case 0:
4056
4087
  isScreenShared = this.store.getState(selectIsLocalScreenShared);
4057
4088
 
4058
4089
  if (isScreenShared) {
4059
- _context31.next = 7;
4090
+ _context32.next = 7;
4060
4091
  break;
4061
4092
  }
4062
4093
 
4063
- _context31.next = 4;
4094
+ _context32.next = 4;
4064
4095
  return this.sdk.startScreenShare(function () {
4065
4096
  return _this8.syncRoomState('screenshareStopped');
4066
4097
  }, audioOnly);
4067
4098
 
4068
4099
  case 4:
4069
4100
  this.syncRoomState('startScreenShare');
4070
- _context31.next = 8;
4101
+ _context32.next = 8;
4071
4102
  break;
4072
4103
 
4073
4104
  case 7:
@@ -4075,13 +4106,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4075
4106
 
4076
4107
  case 8:
4077
4108
  case "end":
4078
- return _context31.stop();
4109
+ return _context32.stop();
4079
4110
  }
4080
4111
  }
4081
- }, _callee31, this);
4112
+ }, _callee32, this);
4082
4113
  }));
4083
4114
 
4084
- function startScreenShare(_x44) {
4115
+ function startScreenShare(_x45) {
4085
4116
  return _startScreenShare.apply(this, arguments);
4086
4117
  }
4087
4118
 
@@ -4089,25 +4120,25 @@ var HMSSDKActions = /*#__PURE__*/function () {
4089
4120
  }();
4090
4121
 
4091
4122
  _proto.stopScreenShare = /*#__PURE__*/function () {
4092
- var _stopScreenShare = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32() {
4123
+ var _stopScreenShare = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33() {
4093
4124
  var isScreenShared;
4094
- return runtime_1.wrap(function _callee32$(_context32) {
4125
+ return runtime_1.wrap(function _callee33$(_context33) {
4095
4126
  while (1) {
4096
- switch (_context32.prev = _context32.next) {
4127
+ switch (_context33.prev = _context33.next) {
4097
4128
  case 0:
4098
4129
  isScreenShared = this.store.getState(selectIsLocalScreenShared);
4099
4130
 
4100
4131
  if (!isScreenShared) {
4101
- _context32.next = 7;
4132
+ _context33.next = 7;
4102
4133
  break;
4103
4134
  }
4104
4135
 
4105
- _context32.next = 4;
4136
+ _context33.next = 4;
4106
4137
  return this.sdk.stopScreenShare();
4107
4138
 
4108
4139
  case 4:
4109
4140
  this.syncRoomState('stopScreenShare');
4110
- _context32.next = 8;
4141
+ _context33.next = 8;
4111
4142
  break;
4112
4143
 
4113
4144
  case 7:
@@ -4115,10 +4146,10 @@ var HMSSDKActions = /*#__PURE__*/function () {
4115
4146
 
4116
4147
  case 8:
4117
4148
  case "end":
4118
- return _context32.stop();
4149
+ return _context33.stop();
4119
4150
  }
4120
4151
  }
4121
- }, _callee32, this);
4152
+ }, _callee33, this);
4122
4153
  }));
4123
4154
 
4124
4155
  function stopScreenShare() {
@@ -4129,25 +4160,25 @@ var HMSSDKActions = /*#__PURE__*/function () {
4129
4160
  }();
4130
4161
 
4131
4162
  _proto.attachVideoInternal = /*#__PURE__*/function () {
4132
- var _attachVideoInternal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(trackID, videoElement) {
4163
+ var _attachVideoInternal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(trackID, videoElement) {
4133
4164
  var sdkTrack;
4134
- return runtime_1.wrap(function _callee33$(_context33) {
4165
+ return runtime_1.wrap(function _callee34$(_context34) {
4135
4166
  while (1) {
4136
- switch (_context33.prev = _context33.next) {
4167
+ switch (_context34.prev = _context34.next) {
4137
4168
  case 0:
4138
4169
  sdkTrack = this.hmsSDKTracks[trackID];
4139
4170
 
4140
4171
  if (!(sdkTrack && sdkTrack.type === 'video')) {
4141
- _context33.next = 7;
4172
+ _context34.next = 7;
4142
4173
  break;
4143
4174
  }
4144
4175
 
4145
- _context33.next = 4;
4176
+ _context34.next = 4;
4146
4177
  return sdkTrack.addSink(videoElement);
4147
4178
 
4148
4179
  case 4:
4149
4180
  this.updateVideoLayer(trackID, 'attachVideo');
4150
- _context33.next = 8;
4181
+ _context34.next = 8;
4151
4182
  break;
4152
4183
 
4153
4184
  case 7:
@@ -4155,13 +4186,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4155
4186
 
4156
4187
  case 8:
4157
4188
  case "end":
4158
- return _context33.stop();
4189
+ return _context34.stop();
4159
4190
  }
4160
4191
  }
4161
- }, _callee33, this);
4192
+ }, _callee34, this);
4162
4193
  }));
4163
4194
 
4164
- function attachVideoInternal(_x45, _x46) {
4195
+ function attachVideoInternal(_x46, _x47) {
4165
4196
  return _attachVideoInternal.apply(this, arguments);
4166
4197
  }
4167
4198
 
@@ -4516,24 +4547,24 @@ var HMSSDKActions = /*#__PURE__*/function () {
4516
4547
  };
4517
4548
 
4518
4549
  _proto.setEnabledSDKTrack = /*#__PURE__*/function () {
4519
- var _setEnabledSDKTrack = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(trackID, enabled) {
4550
+ var _setEnabledSDKTrack = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(trackID, enabled) {
4520
4551
  var track;
4521
- return runtime_1.wrap(function _callee34$(_context34) {
4552
+ return runtime_1.wrap(function _callee35$(_context35) {
4522
4553
  while (1) {
4523
- switch (_context34.prev = _context34.next) {
4554
+ switch (_context35.prev = _context35.next) {
4524
4555
  case 0:
4525
4556
  track = this.hmsSDKTracks[trackID];
4526
4557
 
4527
4558
  if (!track) {
4528
- _context34.next = 6;
4559
+ _context35.next = 6;
4529
4560
  break;
4530
4561
  }
4531
4562
 
4532
- _context34.next = 4;
4563
+ _context35.next = 4;
4533
4564
  return track.setEnabled(enabled);
4534
4565
 
4535
4566
  case 4:
4536
- _context34.next = 7;
4567
+ _context35.next = 7;
4537
4568
  break;
4538
4569
 
4539
4570
  case 6:
@@ -4541,13 +4572,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4541
4572
 
4542
4573
  case 7:
4543
4574
  case "end":
4544
- return _context34.stop();
4575
+ return _context35.stop();
4545
4576
  }
4546
4577
  }
4547
- }, _callee34, this);
4578
+ }, _callee35, this);
4548
4579
  }));
4549
4580
 
4550
- function setEnabledSDKTrack(_x47, _x48) {
4581
+ function setEnabledSDKTrack(_x48, _x49) {
4551
4582
  return _setEnabledSDKTrack.apply(this, arguments);
4552
4583
  }
4553
4584
 
@@ -4555,24 +4586,24 @@ var HMSSDKActions = /*#__PURE__*/function () {
4555
4586
  }();
4556
4587
 
4557
4588
  _proto.setSDKLocalVideoTrackSettings = /*#__PURE__*/function () {
4558
- var _setSDKLocalVideoTrackSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(trackID, settings) {
4589
+ var _setSDKLocalVideoTrackSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(trackID, settings) {
4559
4590
  var track;
4560
- return runtime_1.wrap(function _callee35$(_context35) {
4591
+ return runtime_1.wrap(function _callee36$(_context36) {
4561
4592
  while (1) {
4562
- switch (_context35.prev = _context35.next) {
4593
+ switch (_context36.prev = _context36.next) {
4563
4594
  case 0:
4564
4595
  track = this.hmsSDKTracks[trackID];
4565
4596
 
4566
4597
  if (!track) {
4567
- _context35.next = 6;
4598
+ _context36.next = 6;
4568
4599
  break;
4569
4600
  }
4570
4601
 
4571
- _context35.next = 4;
4602
+ _context36.next = 4;
4572
4603
  return track.setSettings(settings);
4573
4604
 
4574
4605
  case 4:
4575
- _context35.next = 7;
4606
+ _context36.next = 7;
4576
4607
  break;
4577
4608
 
4578
4609
  case 6:
@@ -4580,13 +4611,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4580
4611
 
4581
4612
  case 7:
4582
4613
  case "end":
4583
- return _context35.stop();
4614
+ return _context36.stop();
4584
4615
  }
4585
4616
  }
4586
- }, _callee35, this);
4617
+ }, _callee36, this);
4587
4618
  }));
4588
4619
 
4589
- function setSDKLocalVideoTrackSettings(_x49, _x50) {
4620
+ function setSDKLocalVideoTrackSettings(_x50, _x51) {
4590
4621
  return _setSDKLocalVideoTrackSettings.apply(this, arguments);
4591
4622
  }
4592
4623
 
@@ -4594,24 +4625,24 @@ var HMSSDKActions = /*#__PURE__*/function () {
4594
4625
  }();
4595
4626
 
4596
4627
  _proto.setSDKLocalAudioTrackSettings = /*#__PURE__*/function () {
4597
- var _setSDKLocalAudioTrackSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(trackID, settings) {
4628
+ var _setSDKLocalAudioTrackSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(trackID, settings) {
4598
4629
  var track;
4599
- return runtime_1.wrap(function _callee36$(_context36) {
4630
+ return runtime_1.wrap(function _callee37$(_context37) {
4600
4631
  while (1) {
4601
- switch (_context36.prev = _context36.next) {
4632
+ switch (_context37.prev = _context37.next) {
4602
4633
  case 0:
4603
4634
  track = this.hmsSDKTracks[trackID];
4604
4635
 
4605
4636
  if (!track) {
4606
- _context36.next = 6;
4637
+ _context37.next = 6;
4607
4638
  break;
4608
4639
  }
4609
4640
 
4610
- _context36.next = 4;
4641
+ _context37.next = 4;
4611
4642
  return track.setSettings(settings);
4612
4643
 
4613
4644
  case 4:
4614
- _context36.next = 7;
4645
+ _context37.next = 7;
4615
4646
  break;
4616
4647
 
4617
4648
  case 6:
@@ -4619,13 +4650,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4619
4650
 
4620
4651
  case 7:
4621
4652
  case "end":
4622
- return _context36.stop();
4653
+ return _context37.stop();
4623
4654
  }
4624
4655
  }
4625
- }, _callee36, this);
4656
+ }, _callee37, this);
4626
4657
  }));
4627
4658
 
4628
- function setSDKLocalAudioTrackSettings(_x51, _x52) {
4659
+ function setSDKLocalAudioTrackSettings(_x52, _x53) {
4629
4660
  return _setSDKLocalAudioTrackSettings.apply(this, arguments);
4630
4661
  }
4631
4662
 
@@ -4688,59 +4719,59 @@ var HMSSDKActions = /*#__PURE__*/function () {
4688
4719
  };
4689
4720
 
4690
4721
  _proto.addRemoveVideoPlugin = /*#__PURE__*/function () {
4691
- var _addRemoveVideoPlugin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(plugin, action, pluginFrameRate) {
4722
+ var _addRemoveVideoPlugin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(plugin, action, pluginFrameRate) {
4692
4723
  var trackID, sdkTrack;
4693
- return runtime_1.wrap(function _callee37$(_context37) {
4724
+ return runtime_1.wrap(function _callee38$(_context38) {
4694
4725
  while (1) {
4695
- switch (_context37.prev = _context37.next) {
4726
+ switch (_context38.prev = _context38.next) {
4696
4727
  case 0:
4697
4728
  if (plugin) {
4698
- _context37.next = 3;
4729
+ _context38.next = 3;
4699
4730
  break;
4700
4731
  }
4701
4732
 
4702
4733
  HMSLogger.w('Invalid plugin received in store');
4703
- return _context37.abrupt("return");
4734
+ return _context38.abrupt("return");
4704
4735
 
4705
4736
  case 3:
4706
4737
  trackID = this.store.getState(selectLocalVideoTrackID);
4707
4738
 
4708
4739
  if (!trackID) {
4709
- _context37.next = 19;
4740
+ _context38.next = 19;
4710
4741
  break;
4711
4742
  }
4712
4743
 
4713
4744
  sdkTrack = this.hmsSDKTracks[trackID];
4714
4745
 
4715
4746
  if (!sdkTrack) {
4716
- _context37.next = 18;
4747
+ _context38.next = 18;
4717
4748
  break;
4718
4749
  }
4719
4750
 
4720
4751
  if (!(action === 'add')) {
4721
- _context37.next = 12;
4752
+ _context38.next = 12;
4722
4753
  break;
4723
4754
  }
4724
4755
 
4725
- _context37.next = 10;
4756
+ _context38.next = 10;
4726
4757
  return sdkTrack.addPlugin(plugin, pluginFrameRate);
4727
4758
 
4728
4759
  case 10:
4729
- _context37.next = 15;
4760
+ _context38.next = 15;
4730
4761
  break;
4731
4762
 
4732
4763
  case 12:
4733
4764
  if (!(action === 'remove')) {
4734
- _context37.next = 15;
4765
+ _context38.next = 15;
4735
4766
  break;
4736
4767
  }
4737
4768
 
4738
- _context37.next = 15;
4769
+ _context38.next = 15;
4739
4770
  return sdkTrack.removePlugin(plugin);
4740
4771
 
4741
4772
  case 15:
4742
4773
  this.syncRoomState(action + "VideoPlugin");
4743
- _context37.next = 19;
4774
+ _context38.next = 19;
4744
4775
  break;
4745
4776
 
4746
4777
  case 18:
@@ -4748,13 +4779,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4748
4779
 
4749
4780
  case 19:
4750
4781
  case "end":
4751
- return _context37.stop();
4782
+ return _context38.stop();
4752
4783
  }
4753
4784
  }
4754
- }, _callee37, this);
4785
+ }, _callee38, this);
4755
4786
  }));
4756
4787
 
4757
- function addRemoveVideoPlugin(_x53, _x54, _x55) {
4788
+ function addRemoveVideoPlugin(_x54, _x55, _x56) {
4758
4789
  return _addRemoveVideoPlugin.apply(this, arguments);
4759
4790
  }
4760
4791
 
@@ -4762,59 +4793,59 @@ var HMSSDKActions = /*#__PURE__*/function () {
4762
4793
  }();
4763
4794
 
4764
4795
  _proto.addRemoveAudioPlugin = /*#__PURE__*/function () {
4765
- var _addRemoveAudioPlugin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(plugin, action) {
4796
+ var _addRemoveAudioPlugin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(plugin, action) {
4766
4797
  var trackID, sdkTrack;
4767
- return runtime_1.wrap(function _callee38$(_context38) {
4798
+ return runtime_1.wrap(function _callee39$(_context39) {
4768
4799
  while (1) {
4769
- switch (_context38.prev = _context38.next) {
4800
+ switch (_context39.prev = _context39.next) {
4770
4801
  case 0:
4771
4802
  if (plugin) {
4772
- _context38.next = 3;
4803
+ _context39.next = 3;
4773
4804
  break;
4774
4805
  }
4775
4806
 
4776
4807
  HMSLogger.w('Invalid plugin received in store');
4777
- return _context38.abrupt("return");
4808
+ return _context39.abrupt("return");
4778
4809
 
4779
4810
  case 3:
4780
4811
  trackID = this.store.getState(selectLocalAudioTrackID);
4781
4812
 
4782
4813
  if (!trackID) {
4783
- _context38.next = 19;
4814
+ _context39.next = 19;
4784
4815
  break;
4785
4816
  }
4786
4817
 
4787
4818
  sdkTrack = this.hmsSDKTracks[trackID];
4788
4819
 
4789
4820
  if (!sdkTrack) {
4790
- _context38.next = 18;
4821
+ _context39.next = 18;
4791
4822
  break;
4792
4823
  }
4793
4824
 
4794
4825
  if (!(action === 'add')) {
4795
- _context38.next = 12;
4826
+ _context39.next = 12;
4796
4827
  break;
4797
4828
  }
4798
4829
 
4799
- _context38.next = 10;
4830
+ _context39.next = 10;
4800
4831
  return sdkTrack.addPlugin(plugin);
4801
4832
 
4802
4833
  case 10:
4803
- _context38.next = 15;
4834
+ _context39.next = 15;
4804
4835
  break;
4805
4836
 
4806
4837
  case 12:
4807
4838
  if (!(action === 'remove')) {
4808
- _context38.next = 15;
4839
+ _context39.next = 15;
4809
4840
  break;
4810
4841
  }
4811
4842
 
4812
- _context38.next = 15;
4843
+ _context39.next = 15;
4813
4844
  return sdkTrack.removePlugin(plugin);
4814
4845
 
4815
4846
  case 15:
4816
4847
  this.syncRoomState(action + "AudioPlugin");
4817
- _context38.next = 19;
4848
+ _context39.next = 19;
4818
4849
  break;
4819
4850
 
4820
4851
  case 18:
@@ -4822,13 +4853,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4822
4853
 
4823
4854
  case 19:
4824
4855
  case "end":
4825
- return _context38.stop();
4856
+ return _context39.stop();
4826
4857
  }
4827
4858
  }
4828
- }, _callee38, this);
4859
+ }, _callee39, this);
4829
4860
  }));
4830
4861
 
4831
- function addRemoveAudioPlugin(_x56, _x57) {
4862
+ function addRemoveAudioPlugin(_x57, _x58) {
4832
4863
  return _addRemoveAudioPlugin.apply(this, arguments);
4833
4864
  }
4834
4865
 
@@ -4891,10 +4922,6 @@ var HMSSDKActions = /*#__PURE__*/function () {
4891
4922
  return HMSSDKActions;
4892
4923
  }();
4893
4924
 
4894
- var _PEER_NOTIFICATION_TY, _TRACK_NOTIFICATION_T;
4895
- var PEER_NOTIFICATION_TYPES = (_PEER_NOTIFICATION_TY = {}, _PEER_NOTIFICATION_TY[HMSPeerUpdate.PEER_JOINED] = HMSNotificationTypes.PEER_JOINED, _PEER_NOTIFICATION_TY[HMSPeerUpdate.PEER_LEFT] = HMSNotificationTypes.PEER_LEFT, _PEER_NOTIFICATION_TY[HMSPeerUpdate.ROLE_UPDATED] = HMSNotificationTypes.ROLE_UPDATED, _PEER_NOTIFICATION_TY[HMSPeerUpdate.AUDIO_TOGGLED] = 'PEER_AUDIO_UPDATED', _PEER_NOTIFICATION_TY[HMSPeerUpdate.VIDEO_TOGGLED] = 'PEER_VIDEO_UPDATED', _PEER_NOTIFICATION_TY);
4896
- var TRACK_NOTIFICATION_TYPES = (_TRACK_NOTIFICATION_T = {}, _TRACK_NOTIFICATION_T[HMSTrackUpdate.TRACK_ADDED] = HMSNotificationTypes.TRACK_ADDED, _TRACK_NOTIFICATION_T[HMSTrackUpdate.TRACK_REMOVED] = HMSNotificationTypes.TRACK_REMOVED, _TRACK_NOTIFICATION_T[HMSTrackUpdate.TRACK_MUTED] = HMSNotificationTypes.TRACK_MUTED, _TRACK_NOTIFICATION_T[HMSTrackUpdate.TRACK_UNMUTED] = HMSNotificationTypes.TRACK_UNMUTED, _TRACK_NOTIFICATION_T);
4897
-
4898
4925
  var HMS_NOTIFICATION_EVENT = 'hmsNotification';
4899
4926
  var HMSNotifications = /*#__PURE__*/function () {
4900
4927
  function HMSNotifications(store) {
@@ -4931,7 +4958,10 @@ var HMSNotifications = /*#__PURE__*/function () {
4931
4958
  };
4932
4959
 
4933
4960
  _proto.sendLeaveRoom = function sendLeaveRoom(request) {
4934
- var notification = this.createNotification(request.roomEnded ? HMSNotificationTypes.ROOM_ENDED : HMSNotificationTypes.REMOVED_FROM_ROOM, request, HMSNotificationSeverity.INFO, (request.roomEnded ? "Room ended" : 'Removed from room') + " by " + request.requestedBy.name);
4961
+ var _request$requestedBy;
4962
+
4963
+ var peerName = (_request$requestedBy = request.requestedBy) == null ? void 0 : _request$requestedBy.name;
4964
+ var notification = this.createNotification(request.roomEnded || !peerName ? HMSNotificationTypes.ROOM_ENDED : HMSNotificationTypes.REMOVED_FROM_ROOM, request, HMSNotificationSeverity.INFO, (request.roomEnded ? "Room ended" : 'Removed from room') + " " + (peerName ? "by " + peerName : ''));
4935
4965
  this.emitEvent(notification);
4936
4966
  };
4937
4967