@100mslive/hms-video-store 0.2.75-1 → 0.2.78

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;
@@ -2415,6 +2417,19 @@ var selectMessagesByPeerID = /*#__PURE__*/byIDCurry(selectMessagesByPeerIDIntern
2415
2417
  var selectMessagesByRole = /*#__PURE__*/byIDCurry(selectMessagesByRoleInternal);
2416
2418
  var selectMessagesUnreadCountByRole = /*#__PURE__*/byIDCurry(selectUnreadMessageCountByRole);
2417
2419
  var selectMessagesUnreadCountByPeerID = /*#__PURE__*/byIDCurry(selectUnreadMessageCountByPeerID);
2420
+ /**
2421
+ * Select an array of peers of a particular role
2422
+ * @param role HMSRoleName
2423
+ * @returns HMSPeer[]
2424
+ */
2425
+
2426
+ var selectPeersByRole = function selectPeersByRole(role) {
2427
+ return createSelector([selectPeers], function (peers) {
2428
+ return peers.filter(function (p) {
2429
+ return p.roleName === role;
2430
+ });
2431
+ });
2432
+ };
2418
2433
 
2419
2434
  var selectPeersWithAudioStatus = /*#__PURE__*/createSelector([selectPeersMap, selectTracksMap], function (peersMap, tracksMap) {
2420
2435
  var participants = Object.values(peersMap).map(function (peer) {
@@ -2710,6 +2725,11 @@ var HMSPlaylist = /*#__PURE__*/function () {
2710
2725
  return HMSPlaylist;
2711
2726
  }();
2712
2727
 
2728
+ var _PEER_NOTIFICATION_TY, _TRACK_NOTIFICATION_T, _ACTION_TYPES;
2729
+ 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);
2730
+ 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);
2731
+ 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);
2732
+
2713
2733
  /**
2714
2734
  * This class implements the IHMSActions interface for 100ms SDK. It connects with SDK
2715
2735
  * and takes control of data management by letting every action pass through it. The
@@ -2765,12 +2785,7 @@ var HMSSDKActions = /*#__PURE__*/function () {
2765
2785
  var peer = _this.store.getState(selectPeerByID(sdkPeer.peerId));
2766
2786
 
2767
2787
  var actionName = 'peerUpdate';
2768
-
2769
- if (type === HMSPeerUpdate.PEER_JOINED) {
2770
- actionName = 'peerJoined';
2771
- } else if (type === HMSPeerUpdate.PEER_LEFT) {
2772
- actionName = 'peerLeft';
2773
- }
2788
+ actionName = ACTION_TYPES[type];
2774
2789
 
2775
2790
  _this.syncRoomState(actionName); // if peer wasn't available before sync(will happen if event is peer join)
2776
2791
 
@@ -3825,39 +3840,72 @@ var HMSSDKActions = /*#__PURE__*/function () {
3825
3840
  return stopRTMPAndRecording;
3826
3841
  }();
3827
3842
 
3843
+ _proto.updatePeer = /*#__PURE__*/function () {
3844
+ var _updatePeer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(params) {
3845
+ return runtime_1.wrap(function _callee28$(_context28) {
3846
+ while (1) {
3847
+ switch (_context28.prev = _context28.next) {
3848
+ case 0:
3849
+ _context28.next = 2;
3850
+ return this.sdk.updatePeer(params);
3851
+
3852
+ case 2:
3853
+ if (params.name) {
3854
+ this.syncRoomState('nameUpdated');
3855
+ }
3856
+
3857
+ if (params.metadata) {
3858
+ this.syncRoomState('metadataUpdated');
3859
+ }
3860
+
3861
+ case 4:
3862
+ case "end":
3863
+ return _context28.stop();
3864
+ }
3865
+ }
3866
+ }, _callee28, this);
3867
+ }));
3868
+
3869
+ function updatePeer(_x40) {
3870
+ return _updatePeer.apply(this, arguments);
3871
+ }
3872
+
3873
+ return updatePeer;
3874
+ }();
3875
+
3828
3876
  _proto.setRemoteTrackEnabled = /*#__PURE__*/function () {
3829
- var _setRemoteTrackEnabled = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(trackID, enabled) {
3877
+ var _setRemoteTrackEnabled = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(trackID, enabled) {
3830
3878
  var _this6 = this;
3831
3879
 
3832
3880
  var track;
3833
- return runtime_1.wrap(function _callee28$(_context28) {
3881
+ return runtime_1.wrap(function _callee29$(_context29) {
3834
3882
  while (1) {
3835
- switch (_context28.prev = _context28.next) {
3883
+ switch (_context29.prev = _context29.next) {
3836
3884
  case 0:
3837
3885
  if (!(typeof trackID === 'string')) {
3838
- _context28.next = 10;
3886
+ _context29.next = 10;
3839
3887
  break;
3840
3888
  }
3841
3889
 
3842
3890
  track = this.hmsSDKTracks[trackID];
3843
3891
 
3844
3892
  if (!(track && isRemoteTrack(track))) {
3845
- _context28.next = 7;
3893
+ _context29.next = 7;
3846
3894
  break;
3847
3895
  }
3848
3896
 
3849
- _context28.next = 5;
3897
+ _context29.next = 5;
3850
3898
  return this.sdk.changeTrackState(track, enabled);
3851
3899
 
3852
3900
  case 5:
3853
- _context28.next = 8;
3901
+ _context29.next = 8;
3854
3902
  break;
3855
3903
 
3856
3904
  case 7:
3857
3905
  this.logPossibleInconsistency("No remote track with ID " + trackID + " found for change track state");
3858
3906
 
3859
3907
  case 8:
3860
- _context28.next = 11;
3908
+ _context29.next = 11;
3861
3909
  break;
3862
3910
 
3863
3911
  case 10:
@@ -3869,13 +3917,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
3869
3917
 
3870
3918
  case 11:
3871
3919
  case "end":
3872
- return _context28.stop();
3920
+ return _context29.stop();
3873
3921
  }
3874
3922
  }
3875
- }, _callee28, this);
3923
+ }, _callee29, this);
3876
3924
  }));
3877
3925
 
3878
- function setRemoteTrackEnabled(_x40, _x41) {
3926
+ function setRemoteTrackEnabled(_x41, _x42) {
3879
3927
  return _setRemoteTrackEnabled.apply(this, arguments);
3880
3928
  }
3881
3929
 
@@ -3883,11 +3931,11 @@ var HMSSDKActions = /*#__PURE__*/function () {
3883
3931
  }();
3884
3932
 
3885
3933
  _proto.setRemoteTracksEnabled = /*#__PURE__*/function () {
3886
- var _setRemoteTracksEnabled = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(params) {
3934
+ var _setRemoteTracksEnabled = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(params) {
3887
3935
  var sdkRequest, rolesMap;
3888
- return runtime_1.wrap(function _callee29$(_context29) {
3936
+ return runtime_1.wrap(function _callee30$(_context30) {
3889
3937
  while (1) {
3890
- switch (_context29.prev = _context29.next) {
3938
+ switch (_context30.prev = _context30.next) {
3891
3939
  case 0:
3892
3940
  sdkRequest = {
3893
3941
  enabled: params.enabled,
@@ -3902,18 +3950,18 @@ var HMSSDKActions = /*#__PURE__*/function () {
3902
3950
  });
3903
3951
  }
3904
3952
 
3905
- _context29.next = 4;
3953
+ _context30.next = 4;
3906
3954
  return this.sdk.changeMultiTrackState(sdkRequest);
3907
3955
 
3908
3956
  case 4:
3909
3957
  case "end":
3910
- return _context29.stop();
3958
+ return _context30.stop();
3911
3959
  }
3912
3960
  }
3913
- }, _callee29, this);
3961
+ }, _callee30, this);
3914
3962
  }));
3915
3963
 
3916
- function setRemoteTracksEnabled(_x42) {
3964
+ function setRemoteTracksEnabled(_x43) {
3917
3965
  return _setRemoteTracksEnabled.apply(this, arguments);
3918
3966
  }
3919
3967
 
@@ -3961,18 +4009,14 @@ var HMSSDKActions = /*#__PURE__*/function () {
3961
4009
  };
3962
4010
 
3963
4011
  _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
- }
4012
+ var _request$requestedBy;
3970
4013
 
4014
+ var requestedBy = this.store.getState(selectPeerByID((_request$requestedBy = request.requestedBy) == null ? void 0 : _request$requestedBy.peerId));
3971
4015
  this.hmsNotifications.sendLeaveRoom(_extends({}, request, {
3972
- requestedBy: requestedBy
4016
+ requestedBy: requestedBy || undefined
3973
4017
  }));
3974
4018
  HMSLogger.i('resetting state after peer removed', request);
3975
- this.resetState(request.roomEnded ? 'roomEnded' : 'removedFromRoom');
4019
+ this.resetState(request.roomEnded || !requestedBy ? 'roomEnded' : 'removedFromRoom');
3976
4020
  };
3977
4021
 
3978
4022
  _proto.onDeviceChange = function onDeviceChange(event) {
@@ -4012,12 +4056,12 @@ var HMSSDKActions = /*#__PURE__*/function () {
4012
4056
  };
4013
4057
 
4014
4058
  _proto.sdkPreviewWithListeners = /*#__PURE__*/function () {
4015
- var _sdkPreviewWithListeners = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(config) {
4016
- return runtime_1.wrap(function _callee30$(_context30) {
4059
+ var _sdkPreviewWithListeners = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(config) {
4060
+ return runtime_1.wrap(function _callee31$(_context31) {
4017
4061
  while (1) {
4018
- switch (_context30.prev = _context30.next) {
4062
+ switch (_context31.prev = _context31.next) {
4019
4063
  case 0:
4020
- _context30.next = 2;
4064
+ _context31.next = 2;
4021
4065
  return this.sdk.preview(config, {
4022
4066
  onPreview: this.onPreview.bind(this),
4023
4067
  onError: this.onError.bind(this),
@@ -4031,13 +4075,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4031
4075
 
4032
4076
  case 3:
4033
4077
  case "end":
4034
- return _context30.stop();
4078
+ return _context31.stop();
4035
4079
  }
4036
4080
  }
4037
- }, _callee30, this);
4081
+ }, _callee31, this);
4038
4082
  }));
4039
4083
 
4040
- function sdkPreviewWithListeners(_x43) {
4084
+ function sdkPreviewWithListeners(_x44) {
4041
4085
  return _sdkPreviewWithListeners.apply(this, arguments);
4042
4086
  }
4043
4087
 
@@ -4045,29 +4089,29 @@ var HMSSDKActions = /*#__PURE__*/function () {
4045
4089
  }();
4046
4090
 
4047
4091
  _proto.startScreenShare = /*#__PURE__*/function () {
4048
- var _startScreenShare = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(audioOnly) {
4092
+ var _startScreenShare = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(audioOnly) {
4049
4093
  var _this8 = this;
4050
4094
 
4051
4095
  var isScreenShared;
4052
- return runtime_1.wrap(function _callee31$(_context31) {
4096
+ return runtime_1.wrap(function _callee32$(_context32) {
4053
4097
  while (1) {
4054
- switch (_context31.prev = _context31.next) {
4098
+ switch (_context32.prev = _context32.next) {
4055
4099
  case 0:
4056
4100
  isScreenShared = this.store.getState(selectIsLocalScreenShared);
4057
4101
 
4058
4102
  if (isScreenShared) {
4059
- _context31.next = 7;
4103
+ _context32.next = 7;
4060
4104
  break;
4061
4105
  }
4062
4106
 
4063
- _context31.next = 4;
4107
+ _context32.next = 4;
4064
4108
  return this.sdk.startScreenShare(function () {
4065
4109
  return _this8.syncRoomState('screenshareStopped');
4066
4110
  }, audioOnly);
4067
4111
 
4068
4112
  case 4:
4069
4113
  this.syncRoomState('startScreenShare');
4070
- _context31.next = 8;
4114
+ _context32.next = 8;
4071
4115
  break;
4072
4116
 
4073
4117
  case 7:
@@ -4075,13 +4119,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4075
4119
 
4076
4120
  case 8:
4077
4121
  case "end":
4078
- return _context31.stop();
4122
+ return _context32.stop();
4079
4123
  }
4080
4124
  }
4081
- }, _callee31, this);
4125
+ }, _callee32, this);
4082
4126
  }));
4083
4127
 
4084
- function startScreenShare(_x44) {
4128
+ function startScreenShare(_x45) {
4085
4129
  return _startScreenShare.apply(this, arguments);
4086
4130
  }
4087
4131
 
@@ -4089,25 +4133,25 @@ var HMSSDKActions = /*#__PURE__*/function () {
4089
4133
  }();
4090
4134
 
4091
4135
  _proto.stopScreenShare = /*#__PURE__*/function () {
4092
- var _stopScreenShare = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32() {
4136
+ var _stopScreenShare = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33() {
4093
4137
  var isScreenShared;
4094
- return runtime_1.wrap(function _callee32$(_context32) {
4138
+ return runtime_1.wrap(function _callee33$(_context33) {
4095
4139
  while (1) {
4096
- switch (_context32.prev = _context32.next) {
4140
+ switch (_context33.prev = _context33.next) {
4097
4141
  case 0:
4098
4142
  isScreenShared = this.store.getState(selectIsLocalScreenShared);
4099
4143
 
4100
4144
  if (!isScreenShared) {
4101
- _context32.next = 7;
4145
+ _context33.next = 7;
4102
4146
  break;
4103
4147
  }
4104
4148
 
4105
- _context32.next = 4;
4149
+ _context33.next = 4;
4106
4150
  return this.sdk.stopScreenShare();
4107
4151
 
4108
4152
  case 4:
4109
4153
  this.syncRoomState('stopScreenShare');
4110
- _context32.next = 8;
4154
+ _context33.next = 8;
4111
4155
  break;
4112
4156
 
4113
4157
  case 7:
@@ -4115,10 +4159,10 @@ var HMSSDKActions = /*#__PURE__*/function () {
4115
4159
 
4116
4160
  case 8:
4117
4161
  case "end":
4118
- return _context32.stop();
4162
+ return _context33.stop();
4119
4163
  }
4120
4164
  }
4121
- }, _callee32, this);
4165
+ }, _callee33, this);
4122
4166
  }));
4123
4167
 
4124
4168
  function stopScreenShare() {
@@ -4129,25 +4173,25 @@ var HMSSDKActions = /*#__PURE__*/function () {
4129
4173
  }();
4130
4174
 
4131
4175
  _proto.attachVideoInternal = /*#__PURE__*/function () {
4132
- var _attachVideoInternal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(trackID, videoElement) {
4176
+ var _attachVideoInternal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(trackID, videoElement) {
4133
4177
  var sdkTrack;
4134
- return runtime_1.wrap(function _callee33$(_context33) {
4178
+ return runtime_1.wrap(function _callee34$(_context34) {
4135
4179
  while (1) {
4136
- switch (_context33.prev = _context33.next) {
4180
+ switch (_context34.prev = _context34.next) {
4137
4181
  case 0:
4138
4182
  sdkTrack = this.hmsSDKTracks[trackID];
4139
4183
 
4140
4184
  if (!(sdkTrack && sdkTrack.type === 'video')) {
4141
- _context33.next = 7;
4185
+ _context34.next = 7;
4142
4186
  break;
4143
4187
  }
4144
4188
 
4145
- _context33.next = 4;
4189
+ _context34.next = 4;
4146
4190
  return sdkTrack.addSink(videoElement);
4147
4191
 
4148
4192
  case 4:
4149
4193
  this.updateVideoLayer(trackID, 'attachVideo');
4150
- _context33.next = 8;
4194
+ _context34.next = 8;
4151
4195
  break;
4152
4196
 
4153
4197
  case 7:
@@ -4155,13 +4199,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4155
4199
 
4156
4200
  case 8:
4157
4201
  case "end":
4158
- return _context33.stop();
4202
+ return _context34.stop();
4159
4203
  }
4160
4204
  }
4161
- }, _callee33, this);
4205
+ }, _callee34, this);
4162
4206
  }));
4163
4207
 
4164
- function attachVideoInternal(_x45, _x46) {
4208
+ function attachVideoInternal(_x46, _x47) {
4165
4209
  return _attachVideoInternal.apply(this, arguments);
4166
4210
  }
4167
4211
 
@@ -4516,24 +4560,24 @@ var HMSSDKActions = /*#__PURE__*/function () {
4516
4560
  };
4517
4561
 
4518
4562
  _proto.setEnabledSDKTrack = /*#__PURE__*/function () {
4519
- var _setEnabledSDKTrack = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(trackID, enabled) {
4563
+ var _setEnabledSDKTrack = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(trackID, enabled) {
4520
4564
  var track;
4521
- return runtime_1.wrap(function _callee34$(_context34) {
4565
+ return runtime_1.wrap(function _callee35$(_context35) {
4522
4566
  while (1) {
4523
- switch (_context34.prev = _context34.next) {
4567
+ switch (_context35.prev = _context35.next) {
4524
4568
  case 0:
4525
4569
  track = this.hmsSDKTracks[trackID];
4526
4570
 
4527
4571
  if (!track) {
4528
- _context34.next = 6;
4572
+ _context35.next = 6;
4529
4573
  break;
4530
4574
  }
4531
4575
 
4532
- _context34.next = 4;
4576
+ _context35.next = 4;
4533
4577
  return track.setEnabled(enabled);
4534
4578
 
4535
4579
  case 4:
4536
- _context34.next = 7;
4580
+ _context35.next = 7;
4537
4581
  break;
4538
4582
 
4539
4583
  case 6:
@@ -4541,13 +4585,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4541
4585
 
4542
4586
  case 7:
4543
4587
  case "end":
4544
- return _context34.stop();
4588
+ return _context35.stop();
4545
4589
  }
4546
4590
  }
4547
- }, _callee34, this);
4591
+ }, _callee35, this);
4548
4592
  }));
4549
4593
 
4550
- function setEnabledSDKTrack(_x47, _x48) {
4594
+ function setEnabledSDKTrack(_x48, _x49) {
4551
4595
  return _setEnabledSDKTrack.apply(this, arguments);
4552
4596
  }
4553
4597
 
@@ -4555,24 +4599,24 @@ var HMSSDKActions = /*#__PURE__*/function () {
4555
4599
  }();
4556
4600
 
4557
4601
  _proto.setSDKLocalVideoTrackSettings = /*#__PURE__*/function () {
4558
- var _setSDKLocalVideoTrackSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(trackID, settings) {
4602
+ var _setSDKLocalVideoTrackSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(trackID, settings) {
4559
4603
  var track;
4560
- return runtime_1.wrap(function _callee35$(_context35) {
4604
+ return runtime_1.wrap(function _callee36$(_context36) {
4561
4605
  while (1) {
4562
- switch (_context35.prev = _context35.next) {
4606
+ switch (_context36.prev = _context36.next) {
4563
4607
  case 0:
4564
4608
  track = this.hmsSDKTracks[trackID];
4565
4609
 
4566
4610
  if (!track) {
4567
- _context35.next = 6;
4611
+ _context36.next = 6;
4568
4612
  break;
4569
4613
  }
4570
4614
 
4571
- _context35.next = 4;
4615
+ _context36.next = 4;
4572
4616
  return track.setSettings(settings);
4573
4617
 
4574
4618
  case 4:
4575
- _context35.next = 7;
4619
+ _context36.next = 7;
4576
4620
  break;
4577
4621
 
4578
4622
  case 6:
@@ -4580,13 +4624,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4580
4624
 
4581
4625
  case 7:
4582
4626
  case "end":
4583
- return _context35.stop();
4627
+ return _context36.stop();
4584
4628
  }
4585
4629
  }
4586
- }, _callee35, this);
4630
+ }, _callee36, this);
4587
4631
  }));
4588
4632
 
4589
- function setSDKLocalVideoTrackSettings(_x49, _x50) {
4633
+ function setSDKLocalVideoTrackSettings(_x50, _x51) {
4590
4634
  return _setSDKLocalVideoTrackSettings.apply(this, arguments);
4591
4635
  }
4592
4636
 
@@ -4594,24 +4638,24 @@ var HMSSDKActions = /*#__PURE__*/function () {
4594
4638
  }();
4595
4639
 
4596
4640
  _proto.setSDKLocalAudioTrackSettings = /*#__PURE__*/function () {
4597
- var _setSDKLocalAudioTrackSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(trackID, settings) {
4641
+ var _setSDKLocalAudioTrackSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(trackID, settings) {
4598
4642
  var track;
4599
- return runtime_1.wrap(function _callee36$(_context36) {
4643
+ return runtime_1.wrap(function _callee37$(_context37) {
4600
4644
  while (1) {
4601
- switch (_context36.prev = _context36.next) {
4645
+ switch (_context37.prev = _context37.next) {
4602
4646
  case 0:
4603
4647
  track = this.hmsSDKTracks[trackID];
4604
4648
 
4605
4649
  if (!track) {
4606
- _context36.next = 6;
4650
+ _context37.next = 6;
4607
4651
  break;
4608
4652
  }
4609
4653
 
4610
- _context36.next = 4;
4654
+ _context37.next = 4;
4611
4655
  return track.setSettings(settings);
4612
4656
 
4613
4657
  case 4:
4614
- _context36.next = 7;
4658
+ _context37.next = 7;
4615
4659
  break;
4616
4660
 
4617
4661
  case 6:
@@ -4619,13 +4663,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4619
4663
 
4620
4664
  case 7:
4621
4665
  case "end":
4622
- return _context36.stop();
4666
+ return _context37.stop();
4623
4667
  }
4624
4668
  }
4625
- }, _callee36, this);
4669
+ }, _callee37, this);
4626
4670
  }));
4627
4671
 
4628
- function setSDKLocalAudioTrackSettings(_x51, _x52) {
4672
+ function setSDKLocalAudioTrackSettings(_x52, _x53) {
4629
4673
  return _setSDKLocalAudioTrackSettings.apply(this, arguments);
4630
4674
  }
4631
4675
 
@@ -4688,59 +4732,59 @@ var HMSSDKActions = /*#__PURE__*/function () {
4688
4732
  };
4689
4733
 
4690
4734
  _proto.addRemoveVideoPlugin = /*#__PURE__*/function () {
4691
- var _addRemoveVideoPlugin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(plugin, action, pluginFrameRate) {
4735
+ var _addRemoveVideoPlugin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(plugin, action, pluginFrameRate) {
4692
4736
  var trackID, sdkTrack;
4693
- return runtime_1.wrap(function _callee37$(_context37) {
4737
+ return runtime_1.wrap(function _callee38$(_context38) {
4694
4738
  while (1) {
4695
- switch (_context37.prev = _context37.next) {
4739
+ switch (_context38.prev = _context38.next) {
4696
4740
  case 0:
4697
4741
  if (plugin) {
4698
- _context37.next = 3;
4742
+ _context38.next = 3;
4699
4743
  break;
4700
4744
  }
4701
4745
 
4702
4746
  HMSLogger.w('Invalid plugin received in store');
4703
- return _context37.abrupt("return");
4747
+ return _context38.abrupt("return");
4704
4748
 
4705
4749
  case 3:
4706
4750
  trackID = this.store.getState(selectLocalVideoTrackID);
4707
4751
 
4708
4752
  if (!trackID) {
4709
- _context37.next = 19;
4753
+ _context38.next = 19;
4710
4754
  break;
4711
4755
  }
4712
4756
 
4713
4757
  sdkTrack = this.hmsSDKTracks[trackID];
4714
4758
 
4715
4759
  if (!sdkTrack) {
4716
- _context37.next = 18;
4760
+ _context38.next = 18;
4717
4761
  break;
4718
4762
  }
4719
4763
 
4720
4764
  if (!(action === 'add')) {
4721
- _context37.next = 12;
4765
+ _context38.next = 12;
4722
4766
  break;
4723
4767
  }
4724
4768
 
4725
- _context37.next = 10;
4769
+ _context38.next = 10;
4726
4770
  return sdkTrack.addPlugin(plugin, pluginFrameRate);
4727
4771
 
4728
4772
  case 10:
4729
- _context37.next = 15;
4773
+ _context38.next = 15;
4730
4774
  break;
4731
4775
 
4732
4776
  case 12:
4733
4777
  if (!(action === 'remove')) {
4734
- _context37.next = 15;
4778
+ _context38.next = 15;
4735
4779
  break;
4736
4780
  }
4737
4781
 
4738
- _context37.next = 15;
4782
+ _context38.next = 15;
4739
4783
  return sdkTrack.removePlugin(plugin);
4740
4784
 
4741
4785
  case 15:
4742
4786
  this.syncRoomState(action + "VideoPlugin");
4743
- _context37.next = 19;
4787
+ _context38.next = 19;
4744
4788
  break;
4745
4789
 
4746
4790
  case 18:
@@ -4748,13 +4792,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4748
4792
 
4749
4793
  case 19:
4750
4794
  case "end":
4751
- return _context37.stop();
4795
+ return _context38.stop();
4752
4796
  }
4753
4797
  }
4754
- }, _callee37, this);
4798
+ }, _callee38, this);
4755
4799
  }));
4756
4800
 
4757
- function addRemoveVideoPlugin(_x53, _x54, _x55) {
4801
+ function addRemoveVideoPlugin(_x54, _x55, _x56) {
4758
4802
  return _addRemoveVideoPlugin.apply(this, arguments);
4759
4803
  }
4760
4804
 
@@ -4762,59 +4806,59 @@ var HMSSDKActions = /*#__PURE__*/function () {
4762
4806
  }();
4763
4807
 
4764
4808
  _proto.addRemoveAudioPlugin = /*#__PURE__*/function () {
4765
- var _addRemoveAudioPlugin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(plugin, action) {
4809
+ var _addRemoveAudioPlugin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(plugin, action) {
4766
4810
  var trackID, sdkTrack;
4767
- return runtime_1.wrap(function _callee38$(_context38) {
4811
+ return runtime_1.wrap(function _callee39$(_context39) {
4768
4812
  while (1) {
4769
- switch (_context38.prev = _context38.next) {
4813
+ switch (_context39.prev = _context39.next) {
4770
4814
  case 0:
4771
4815
  if (plugin) {
4772
- _context38.next = 3;
4816
+ _context39.next = 3;
4773
4817
  break;
4774
4818
  }
4775
4819
 
4776
4820
  HMSLogger.w('Invalid plugin received in store');
4777
- return _context38.abrupt("return");
4821
+ return _context39.abrupt("return");
4778
4822
 
4779
4823
  case 3:
4780
4824
  trackID = this.store.getState(selectLocalAudioTrackID);
4781
4825
 
4782
4826
  if (!trackID) {
4783
- _context38.next = 19;
4827
+ _context39.next = 19;
4784
4828
  break;
4785
4829
  }
4786
4830
 
4787
4831
  sdkTrack = this.hmsSDKTracks[trackID];
4788
4832
 
4789
4833
  if (!sdkTrack) {
4790
- _context38.next = 18;
4834
+ _context39.next = 18;
4791
4835
  break;
4792
4836
  }
4793
4837
 
4794
4838
  if (!(action === 'add')) {
4795
- _context38.next = 12;
4839
+ _context39.next = 12;
4796
4840
  break;
4797
4841
  }
4798
4842
 
4799
- _context38.next = 10;
4843
+ _context39.next = 10;
4800
4844
  return sdkTrack.addPlugin(plugin);
4801
4845
 
4802
4846
  case 10:
4803
- _context38.next = 15;
4847
+ _context39.next = 15;
4804
4848
  break;
4805
4849
 
4806
4850
  case 12:
4807
4851
  if (!(action === 'remove')) {
4808
- _context38.next = 15;
4852
+ _context39.next = 15;
4809
4853
  break;
4810
4854
  }
4811
4855
 
4812
- _context38.next = 15;
4856
+ _context39.next = 15;
4813
4857
  return sdkTrack.removePlugin(plugin);
4814
4858
 
4815
4859
  case 15:
4816
4860
  this.syncRoomState(action + "AudioPlugin");
4817
- _context38.next = 19;
4861
+ _context39.next = 19;
4818
4862
  break;
4819
4863
 
4820
4864
  case 18:
@@ -4822,13 +4866,13 @@ var HMSSDKActions = /*#__PURE__*/function () {
4822
4866
 
4823
4867
  case 19:
4824
4868
  case "end":
4825
- return _context38.stop();
4869
+ return _context39.stop();
4826
4870
  }
4827
4871
  }
4828
- }, _callee38, this);
4872
+ }, _callee39, this);
4829
4873
  }));
4830
4874
 
4831
- function addRemoveAudioPlugin(_x56, _x57) {
4875
+ function addRemoveAudioPlugin(_x57, _x58) {
4832
4876
  return _addRemoveAudioPlugin.apply(this, arguments);
4833
4877
  }
4834
4878
 
@@ -4891,10 +4935,6 @@ var HMSSDKActions = /*#__PURE__*/function () {
4891
4935
  return HMSSDKActions;
4892
4936
  }();
4893
4937
 
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
4938
  var HMS_NOTIFICATION_EVENT = 'hmsNotification';
4899
4939
  var HMSNotifications = /*#__PURE__*/function () {
4900
4940
  function HMSNotifications(store) {
@@ -4931,7 +4971,10 @@ var HMSNotifications = /*#__PURE__*/function () {
4931
4971
  };
4932
4972
 
4933
4973
  _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);
4974
+ var _request$requestedBy;
4975
+
4976
+ var peerName = (_request$requestedBy = request.requestedBy) == null ? void 0 : _request$requestedBy.name;
4977
+ 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
4978
  this.emitEvent(notification);
4936
4979
  };
4937
4980
 
@@ -5291,5 +5334,5 @@ var HMSReactiveStore = /*#__PURE__*/function () {
5291
5334
  return HMSReactiveStore;
5292
5335
  }();
5293
5336
 
5294
- export { HMSMessageType, HMSNotificationSeverity, HMSNotificationTypes, HMSPlaylistType, HMSReactiveStore, HMSRoomState, createDefaultStoreState, selectAudioPlaylist, selectAudioPlaylistTrackByPeerID, selectAudioTrackByPeerID, selectAudioTrackVolume, selectAudioVolumeByPeerID, selectAuxiliaryAudioByPeerID, selectAuxiliaryTracksByPeerID, selectAvailableRoleNames, selectBroadcastMessages, selectBroadcastMessagesUnreadCount, selectCameraStreamByPeerID, selectDegradedTracks, selectDevices, selectDominantSpeaker, selectHMSMessages, selectHMSMessagesCount, selectIsAllowedToPublish, selectIsAllowedToSubscribe, selectIsAudioLocallyMuted, selectIsConnectedToRoom, selectIsInPreview, selectIsLocalAudioEnabled, selectIsLocalAudioPluginPresent, selectIsLocalScreenShared, selectIsLocalVideoDisplayEnabled, selectIsLocalVideoEnabled, selectIsLocalVideoPluginPresent, selectIsLocallyMutedByPeerID, selectIsPeerAudioEnabled, selectIsPeerVideoEnabled, selectIsScreenShareLocallyMutedByPeerID, selectIsSomeoneScreenSharing, selectLocalAudioTrackID, selectLocalMediaSettings, selectLocalPeer, selectLocalPeerID, selectLocalPeerRole, selectLocalTrackIDs, selectLocalVideoTrackID, selectMessageIDsInOrder, selectMessagesByPeerID, selectMessagesByRole, selectMessagesMap, selectMessagesUnreadCountByPeerID, selectMessagesUnreadCountByRole, selectPeerAudioByID, selectPeerByID, selectPeerCount, selectPeerNameByID, selectPeerScreenSharing, selectPeerSharingAudio, selectPeerSharingAudioPlaylist, selectPeerSharingVideoPlaylist, selectPeers, selectPeersMap, selectPeersScreenSharing, selectPeersWithAudioStatus, selectPermissions, selectRTMPState, selectRecordingState, selectRemotePeers, selectRoleByRoleName, selectRoleChangeRequest, selectRolesMap, selectRoom, selectRoomStarted, selectRoomState, selectScreenShareAudioByPeerID, selectScreenShareByPeerID, selectScreenSharesByPeerId, selectScreenshareAudioVolumeByPeerID, selectSimulcastLayerByTrack, selectSpeakers, selectTrackAudioByID, selectTrackByID, selectTracksMap, selectUnreadHMSMessagesCount, selectVideoPlaylist, selectVideoPlaylistAudioTrackByPeerID, selectVideoPlaylistVideoTrackByPeerID, selectVideoTrackByPeerID };
5337
+ export { HMSMessageType, HMSNotificationSeverity, HMSNotificationTypes, HMSPlaylistType, HMSReactiveStore, HMSRoomState, createDefaultStoreState, selectAudioPlaylist, selectAudioPlaylistTrackByPeerID, selectAudioTrackByPeerID, selectAudioTrackVolume, selectAudioVolumeByPeerID, selectAuxiliaryAudioByPeerID, selectAuxiliaryTracksByPeerID, selectAvailableRoleNames, selectBroadcastMessages, selectBroadcastMessagesUnreadCount, selectCameraStreamByPeerID, selectDegradedTracks, selectDevices, selectDominantSpeaker, selectHMSMessages, selectHMSMessagesCount, selectIsAllowedToPublish, selectIsAllowedToSubscribe, selectIsAudioLocallyMuted, selectIsConnectedToRoom, selectIsInPreview, selectIsLocalAudioEnabled, selectIsLocalAudioPluginPresent, selectIsLocalScreenShared, selectIsLocalVideoDisplayEnabled, selectIsLocalVideoEnabled, selectIsLocalVideoPluginPresent, selectIsLocallyMutedByPeerID, selectIsPeerAudioEnabled, selectIsPeerVideoEnabled, selectIsScreenShareLocallyMutedByPeerID, selectIsSomeoneScreenSharing, selectLocalAudioTrackID, selectLocalMediaSettings, selectLocalPeer, selectLocalPeerID, selectLocalPeerRole, selectLocalTrackIDs, selectLocalVideoTrackID, selectMessageIDsInOrder, selectMessagesByPeerID, selectMessagesByRole, selectMessagesMap, selectMessagesUnreadCountByPeerID, selectMessagesUnreadCountByRole, selectPeerAudioByID, selectPeerByID, selectPeerCount, selectPeerNameByID, selectPeerScreenSharing, selectPeerSharingAudio, selectPeerSharingAudioPlaylist, selectPeerSharingVideoPlaylist, selectPeers, selectPeersByRole, selectPeersMap, selectPeersScreenSharing, selectPeersWithAudioStatus, selectPermissions, selectRTMPState, selectRecordingState, selectRemotePeers, selectRoleByRoleName, selectRoleChangeRequest, selectRolesMap, selectRoom, selectRoomStarted, selectRoomState, selectScreenShareAudioByPeerID, selectScreenShareByPeerID, selectScreenSharesByPeerId, selectScreenshareAudioVolumeByPeerID, selectSimulcastLayerByTrack, selectSpeakers, selectTrackAudioByID, selectTrackByID, selectTracksMap, selectUnreadHMSMessagesCount, selectVideoPlaylist, selectVideoPlaylistAudioTrackByPeerID, selectVideoPlaylistVideoTrackByPeerID, selectVideoTrackByPeerID };
5295
5338
  //# sourceMappingURL=hms-video-store.esm.js.map