@100mslive/react-native-hms 1.7.2 → 1.9.0

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.
Files changed (178) hide show
  1. package/android/build.gradle +3 -3
  2. package/android/local.properties +8 -1
  3. package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +1 -0
  4. package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +43 -15
  5. package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +113 -68
  6. package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +17 -4
  7. package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +75 -21
  8. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +483 -184
  9. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +587 -177
  10. package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +26 -7
  11. package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +32 -12
  12. package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +1 -0
  13. package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +10 -6
  14. package/android/src/main/res/layout/player_view.xml +3 -2
  15. package/ios/HMSConstants.swift +1 -0
  16. package/ios/HMSDecoder.swift +18 -7
  17. package/ios/HMSHLSPlayerManager.swift +18 -2
  18. package/ios/HMSHelper.swift +33 -4
  19. package/ios/HMSManager.m +256 -73
  20. package/ios/HMSManager.swift +47 -3
  21. package/ios/HMSRNSDK.swift +224 -140
  22. package/ios/HMSView.swift +17 -3
  23. package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  24. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  25. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  26. package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  27. package/lib/commonjs/classes/HMSAudioCodec.js +1 -2
  28. package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
  29. package/lib/commonjs/classes/HMSAudioDevice.js +1 -2
  30. package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
  31. package/lib/commonjs/classes/HMSAudioMixingMode.js +1 -2
  32. package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
  33. package/lib/commonjs/classes/HMSAudioMode.js +1 -2
  34. package/lib/commonjs/classes/HMSAudioMode.js.map +1 -1
  35. package/lib/commonjs/classes/HMSCameraFacing.js +1 -2
  36. package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
  37. package/lib/commonjs/classes/HMSConstants.js +1 -2
  38. package/lib/commonjs/classes/HMSConstants.js.map +1 -1
  39. package/lib/commonjs/classes/HMSEncoder.js +6 -0
  40. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  41. package/lib/commonjs/classes/HMSEventEmitter.js +1 -2
  42. package/lib/commonjs/classes/HMSEventEmitter.js.map +1 -1
  43. package/lib/commonjs/classes/HMSIOSAudioMode.js +1 -2
  44. package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
  45. package/lib/commonjs/classes/HMSLayer.js +1 -2
  46. package/lib/commonjs/classes/HMSLayer.js.map +1 -1
  47. package/lib/commonjs/classes/HMSLogAlarmManager.js +1 -2
  48. package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
  49. package/lib/commonjs/classes/HMSLogLevel.js +1 -2
  50. package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
  51. package/lib/commonjs/classes/HMSLogger.js +1 -2
  52. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  53. package/lib/commonjs/classes/HMSManagerModule.js +1 -2
  54. package/lib/commonjs/classes/HMSManagerModule.js.map +1 -1
  55. package/lib/commonjs/classes/HMSMessageRecipientType.js +1 -2
  56. package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -1
  57. package/lib/commonjs/classes/HMSNativeEventListener.js +1 -2
  58. package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -1
  59. package/lib/commonjs/classes/HMSPIPListenerActions.js +2 -2
  60. package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
  61. package/lib/commonjs/classes/HMSPeer.js +15 -0
  62. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  63. package/lib/commonjs/classes/HMSPeerListIterator.js +64 -0
  64. package/lib/commonjs/classes/HMSPeerListIterator.js.map +1 -0
  65. package/lib/commonjs/classes/HMSPeerListIteratorOptions.js +2 -0
  66. package/lib/commonjs/classes/HMSPeerListIteratorOptions.js.map +1 -0
  67. package/lib/commonjs/classes/HMSPeerUpdate.js +3 -4
  68. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  69. package/lib/commonjs/classes/HMSPeersCache.js +8 -2
  70. package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
  71. package/lib/commonjs/classes/HMSQualityLimitationReason.js +1 -2
  72. package/lib/commonjs/classes/HMSQualityLimitationReason.js.map +1 -1
  73. package/lib/commonjs/classes/HMSRoomCache.js +1 -2
  74. package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
  75. package/lib/commonjs/classes/HMSRoomUpdate.js +1 -2
  76. package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
  77. package/lib/commonjs/classes/HMSSDK.js +192 -32
  78. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  79. package/lib/commonjs/classes/HMSTrackSettingsInitState.js +1 -2
  80. package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
  81. package/lib/commonjs/classes/HMSTrackSource.js +1 -2
  82. package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
  83. package/lib/commonjs/classes/HMSTrackType.js +1 -2
  84. package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
  85. package/lib/commonjs/classes/HMSTrackUpdate.js +1 -2
  86. package/lib/commonjs/classes/HMSTrackUpdate.js.map +1 -1
  87. package/lib/commonjs/classes/HMSUpdateListenerActions.js +2 -2
  88. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  89. package/lib/commonjs/classes/HMSVideoCodec.js +1 -2
  90. package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
  91. package/lib/commonjs/classes/HMSVideoViewMode.js +1 -2
  92. package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
  93. package/lib/commonjs/classes/HmsView.js +3 -4
  94. package/lib/commonjs/classes/HmsView.js.map +1 -1
  95. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +13 -9
  96. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  97. package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +2 -4
  98. package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
  99. package/lib/commonjs/components/HMSHLSPlayer/hooks.js +5 -10
  100. package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
  101. package/lib/commonjs/hooks/useHMSPeerUpdates.js +2 -2
  102. package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -1
  103. package/lib/commonjs/index.js +1 -2
  104. package/lib/commonjs/index.js.map +1 -1
  105. package/lib/commonjs/stores/hls-player-stats-store.js +1 -2
  106. package/lib/commonjs/stores/hls-player-stats-store.js.map +1 -1
  107. package/lib/commonjs/stores/hms-store.js +1 -2
  108. package/lib/commonjs/stores/hms-store.js.map +1 -1
  109. package/lib/commonjs/types.js +4 -6
  110. package/lib/commonjs/types.js.map +1 -1
  111. package/lib/module/classes/HMSEncoder.js +6 -0
  112. package/lib/module/classes/HMSEncoder.js.map +1 -1
  113. package/lib/module/classes/HMSPIPListenerActions.js +1 -0
  114. package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
  115. package/lib/module/classes/HMSPeer.js +15 -0
  116. package/lib/module/classes/HMSPeer.js.map +1 -1
  117. package/lib/module/classes/HMSPeerListIterator.js +58 -0
  118. package/lib/module/classes/HMSPeerListIterator.js.map +1 -0
  119. package/lib/module/classes/HMSPeerListIteratorOptions.js +2 -0
  120. package/lib/module/classes/HMSPeerListIteratorOptions.js.map +1 -0
  121. package/lib/module/classes/HMSPeerUpdate.js +2 -1
  122. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  123. package/lib/module/classes/HMSPeersCache.js +7 -0
  124. package/lib/module/classes/HMSPeersCache.js.map +1 -1
  125. package/lib/module/classes/HMSSDK.js +193 -33
  126. package/lib/module/classes/HMSSDK.js.map +1 -1
  127. package/lib/module/classes/HMSUpdateListenerActions.js +1 -0
  128. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  129. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +11 -6
  130. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  131. package/lib/module/index.js.map +1 -1
  132. package/lib/module/types.js +1 -0
  133. package/lib/module/types.js.map +1 -1
  134. package/lib/typescript/classes/HMSEncoder.d.ts +1 -0
  135. package/lib/typescript/classes/HMSPIPListenerActions.d.ts +1 -0
  136. package/lib/typescript/classes/HMSPeer.d.ts +3 -0
  137. package/lib/typescript/classes/HMSPeerListIterator.d.ts +9 -0
  138. package/lib/typescript/classes/HMSPeerListIteratorOptions.d.ts +24 -0
  139. package/lib/typescript/classes/HMSPeerUpdate.d.ts +2 -1
  140. package/lib/typescript/classes/HMSPeersCache.d.ts +1 -0
  141. package/lib/typescript/classes/HMSSDK.d.ts +69 -13
  142. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +2 -1
  143. package/lib/typescript/index.d.ts +1 -1
  144. package/lib/typescript/types.d.ts +3 -1
  145. package/package.json +1 -1
  146. package/sdk-versions.json +2 -2
  147. package/src/classes/HMSEncoder.ts +9 -0
  148. package/src/classes/HMSPIPListenerActions.ts +1 -0
  149. package/src/classes/HMSPeer.ts +25 -0
  150. package/src/classes/HMSPeerListIterator.ts +60 -0
  151. package/src/classes/HMSPeerListIteratorOptions.ts +26 -0
  152. package/src/classes/HMSPeerUpdate.ts +2 -0
  153. package/src/classes/HMSPeersCache.ts +7 -0
  154. package/src/classes/HMSSDK.tsx +235 -28
  155. package/src/classes/HMSUpdateListenerActions.ts +1 -0
  156. package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +15 -13
  157. package/src/index.ts +4 -1
  158. package/src/types.ts +2 -0
  159. package/android/.gradle/6.7.1/executionHistory/executionHistory.bin +0 -0
  160. package/android/.gradle/6.7.1/executionHistory/executionHistory.lock +0 -0
  161. package/android/.gradle/6.7.1/fileChanges/last-build.bin +0 -0
  162. package/android/.gradle/6.7.1/fileHashes/fileHashes.bin +0 -0
  163. package/android/.gradle/6.7.1/fileHashes/fileHashes.lock +0 -0
  164. package/android/.gradle/6.7.1/gc.properties +0 -0
  165. package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
  166. package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
  167. package/android/.gradle/6.9/fileChanges/last-build.bin +0 -0
  168. package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
  169. package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
  170. package/android/.gradle/6.9/gc.properties +0 -0
  171. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  172. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  173. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  174. package/android/.gradle/checksums/checksums.lock +0 -0
  175. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  176. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  177. package/android/.gradle/configuration-cache/gc.properties +0 -0
  178. package/android/.gradle/vcs-1/gc.properties +0 -0
@@ -19,6 +19,7 @@ var _HMSPeersCache = require("./HMSPeersCache");
19
19
  var _HMSRoomCache = require("./HMSRoomCache");
20
20
  var _HMSPeerUpdate = require("./HMSPeerUpdate");
21
21
  var _HMSSessionStore = require("./HMSSessionStore");
22
+ var _HMSPeerListIterator = require("./HMSPeerListIterator");
22
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
24
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
25
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
@@ -37,6 +38,7 @@ class HMSSDK {
37
38
  _defineProperty(this, "onJoinDelegate", void 0);
38
39
  _defineProperty(this, "onRoomDelegate", void 0);
39
40
  _defineProperty(this, "onPeerDelegate", void 0);
41
+ _defineProperty(this, "onPeerListUpdatedDelegate", void 0);
40
42
  _defineProperty(this, "onTrackDelegate", void 0);
41
43
  _defineProperty(this, "onErrorDelegate", void 0);
42
44
  _defineProperty(this, "onMessageDelegate", void 0);
@@ -54,6 +56,7 @@ class HMSSDK {
54
56
  _defineProperty(this, "onAudioDeviceChangedDelegate", void 0);
55
57
  _defineProperty(this, "onSessionStoreAvailableDelegate", void 0);
56
58
  _defineProperty(this, "onPIPRoomLeaveDelegate", void 0);
59
+ _defineProperty(this, "onPIPModeChangedDelegate", void 0);
57
60
  _defineProperty(this, "emitterSubscriptions", {});
58
61
  /**
59
62
  * - Calls removeListeners that in turn breaks all connections with native listeners.
@@ -133,32 +136,6 @@ class HMSSDK {
133
136
  id: this.id
134
137
  });
135
138
  });
136
- /**
137
- * - previewForRole can be used when there is role change request for current localPeer and we want
138
- * to show the localPeer how the tracks look before publishing them to room.
139
- *
140
- * - It requires a role of type [HMSRole]{@link HMSRole} for which we want to preview the tracks.
141
- *
142
- * checkout {@link https://www.100ms.live/docs/react-native} for more info
143
- *
144
- * @param {HMSRole}
145
- * @memberof HMSSDK
146
- */
147
- _defineProperty(this, "previewForRole", async role => {
148
- _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function previewForRole', {
149
- role,
150
- id: this.id
151
- });
152
- if (_reactNative.Platform.OS === 'ios') {
153
- return await _HMSManagerModule.default.previewForRole({
154
- role: role === null || role === void 0 ? void 0 : role.name,
155
- id: this.id
156
- });
157
- } else {
158
- console.log('API currently not available for android');
159
- return 'API currently not available for android';
160
- }
161
- });
162
139
  /**
163
140
  * - HmsView is react component that takes trackId and starts showing that track on a tile.
164
141
  * - The appearance of tile is completely customizable with style prop.
@@ -565,6 +542,46 @@ class HMSSDK {
565
542
  };
566
543
  return await _HMSManagerModule.default.changeName(data);
567
544
  });
545
+ /**
546
+ * -Preview for a specific Role before changing it.
547
+ *
548
+ * By previewing before doing a Role Change, users can see their expected Audio & Video tracks which will be visible to other Peers in Room post changing the Role.
549
+ *
550
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role} for more info
551
+ *
552
+ * @param {role: string}
553
+ * @memberof HMSSDK
554
+ */
555
+ _defineProperty(this, "previewForRole", async role => {
556
+ _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function previewForRole', {
557
+ role,
558
+ id: this.id
559
+ });
560
+ const data = await _HMSManagerModule.default.previewForRole({
561
+ role,
562
+ id: this.id
563
+ });
564
+ const previewTracks = _HMSEncoder.HMSEncoder.encodeHmsPreviewForRoleTracks(data.tracks, this.id);
565
+ return previewTracks;
566
+ });
567
+ /**
568
+ * Cancel the Previewing for Role invocation.
569
+ *
570
+ * If a [previewForRole] call was performed previously then calling this method clears the tracks created anticipating a Change of Role
571
+ *
572
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role} for more info
573
+ *
574
+ * @memberof HMSSDK
575
+ */
576
+ _defineProperty(this, "cancelPreview", async () => {
577
+ _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function cancelPreview', {
578
+ id: this.id
579
+ });
580
+ const data = await _HMSManagerModule.default.cancelPreview({
581
+ id: this.id
582
+ });
583
+ return data;
584
+ });
568
585
  /**
569
586
  * - Calling this function will accept the most recent roleChange request made by anyone in the room
570
587
  *
@@ -1058,6 +1075,75 @@ class HMSSDK {
1058
1075
  peerID: peerId
1059
1076
  });
1060
1077
  });
1078
+ /**
1079
+ * - This function is used to raise hand for the local peer
1080
+ * @memberof HMSSDK
1081
+ */
1082
+ _defineProperty(this, "raiseLocalPeerHand", async () => {
1083
+ const data = {
1084
+ id: this.id
1085
+ };
1086
+ _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function raiseLocalPeerHand', data);
1087
+ return _HMSManagerModule.default.raiseLocalPeerHand(data);
1088
+ });
1089
+ /**
1090
+ * - This function is used to lower hand for the local peer
1091
+ * @memberof HMSSDK
1092
+ */
1093
+ _defineProperty(this, "lowerLocalPeerHand", async () => {
1094
+ const data = {
1095
+ id: this.id
1096
+ };
1097
+ _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function lowerLocalPeerHand', data);
1098
+ return _HMSManagerModule.default.lowerLocalPeerHand(data);
1099
+ });
1100
+ /**
1101
+ * - This function is used to lower hand for the remote peer
1102
+ * @param peer
1103
+ */
1104
+ _defineProperty(this, "lowerRemotePeerHand", async peer => {
1105
+ const data = {
1106
+ peerId: peer.peerID,
1107
+ id: this.id
1108
+ };
1109
+ _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function lowerRemotePeerHand', data);
1110
+ return _HMSManagerModule.default.lowerRemotePeerHand(data);
1111
+ });
1112
+ /**
1113
+ * `getPeerListIterator` method returns an instance of `HMSPeerListIterator` class
1114
+ *
1115
+ * @param options options for configuring iterator
1116
+ * @returns instance of HMSPeerListIterator class
1117
+ *
1118
+ * Example usage:
1119
+ * ```
1120
+ * const peerListIterator = hmsInstance.getPeerListIterator();
1121
+ * ```
1122
+ * OR
1123
+ * ```
1124
+ * const peerListIterator = hmsInstance.getPeerListIterator({
1125
+ * limit: 10,
1126
+ * byRoleName: 'viewer-realtime',
1127
+ * });
1128
+ * ```
1129
+ */
1130
+ _defineProperty(this, "getPeerListIterator", options => {
1131
+ _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function getPeerListIterator', {
1132
+ id: this.id,
1133
+ options
1134
+ });
1135
+ const uniqueId = Math.random().toString(16).slice(2);
1136
+ const data = _HMSManagerModule.default.getPeerListIterator({
1137
+ id: this.id,
1138
+ ...options,
1139
+ limit: (options === null || options === void 0 ? void 0 : options.limit) ?? 10,
1140
+ uniqueId
1141
+ });
1142
+ if (!data) {
1143
+ throw new Error('Unable to create PeerListIterator');
1144
+ }
1145
+ return new _HMSPeerListIterator.HMSPeerListIterator(data.uniqueId, data.totalCount);
1146
+ });
1061
1147
  /**
1062
1148
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
1063
1149
  *
@@ -1119,6 +1205,18 @@ class HMSSDK {
1119
1205
  this.onPeerDelegate = callback;
1120
1206
  break;
1121
1207
  }
1208
+ case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_LIST_UPDATED:
1209
+ {
1210
+ // Checking if we already have ON_PEER_LIST_UPDATED subscription
1211
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_LIST_UPDATED]) {
1212
+ // Adding ON_PEER_LIST_UPDATED native listener
1213
+ const peerListUpdatedSubscription = _HMSNativeEventListener.default.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_LIST_UPDATED, this.onPeerListUpdatedListener);
1214
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_LIST_UPDATED] = peerListUpdatedSubscription;
1215
+ }
1216
+ // Adding App Delegate listener
1217
+ this.onPeerListUpdatedDelegate = callback;
1218
+ break;
1219
+ }
1122
1220
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE:
1123
1221
  {
1124
1222
  // Checking if we already have ON_TRACK_UPDATE subscription
@@ -1325,6 +1423,19 @@ class HMSSDK {
1325
1423
  }
1326
1424
  break;
1327
1425
  }
1426
+ case _HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_MODE_CHANGED:
1427
+ {
1428
+ if (_reactNative.Platform.OS === 'android') {
1429
+ // Checking if we already have ON_PIP_MODE_CHANGED subscription
1430
+ if (!this.emitterSubscriptions[_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_MODE_CHANGED]) {
1431
+ const pipModeChangedSubscription = _HMSNativeEventListener.default.addListener(this.id, _HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_MODE_CHANGED, this.onPIPModeChangedListener);
1432
+ this.emitterSubscriptions[_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_MODE_CHANGED] = pipModeChangedSubscription;
1433
+ }
1434
+ // Adding PIP mode changed Delegate listener
1435
+ this.onPIPModeChangedDelegate = callback;
1436
+ }
1437
+ break;
1438
+ }
1328
1439
  default:
1329
1440
  }
1330
1441
  });
@@ -1595,6 +1706,20 @@ class HMSSDK {
1595
1706
  }
1596
1707
  break;
1597
1708
  }
1709
+ case _HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_MODE_CHANGED:
1710
+ {
1711
+ if (_reactNative.Platform.OS === 'android') {
1712
+ const subscription = this.emitterSubscriptions[_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_MODE_CHANGED];
1713
+ // Removing ON_PIP_MODE_CHANGED native listener
1714
+ if (subscription) {
1715
+ subscription.remove();
1716
+ this.emitterSubscriptions[_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_MODE_CHANGED] = undefined;
1717
+ }
1718
+ // Removing App Delegate listener
1719
+ this.onPIPModeChangedDelegate = null;
1720
+ }
1721
+ break;
1722
+ }
1598
1723
  default:
1599
1724
  }
1600
1725
  });
@@ -1695,7 +1820,6 @@ class HMSSDK {
1695
1820
  }
1696
1821
  });
1697
1822
  _defineProperty(this, "onPeerListener", peerData => {
1698
- var _getHmsPeersCache;
1699
1823
  const data = {
1700
1824
  peer: peerData,
1701
1825
  type: null
@@ -1709,7 +1833,15 @@ class HMSSDK {
1709
1833
  }
1710
1834
  const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
1711
1835
  const type = _HMSEncoder.HMSEncoder.encodeHmsPeerUpdate(data.type) || data.type;
1712
- (_getHmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache === void 0 || _getHmsPeersCache.updatePeerCache(data.peer.peerID, data.peer, type);
1836
+ if (type === _HMSPeerUpdate.HMSPeerUpdate.PEER_LEFT) {
1837
+ this.sendPeerUpdateWhenPeerLeaves(data, peer, type);
1838
+ } else {
1839
+ var _getHmsPeersCache;
1840
+ (_getHmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache === void 0 || _getHmsPeersCache.updatePeerCache(data.peer.peerID, data.peer, type);
1841
+ this.sendPeerUpdate(peer, type);
1842
+ }
1843
+ });
1844
+ _defineProperty(this, "sendPeerUpdate", (peer, type) => {
1713
1845
  if (this.onPeerDelegate) {
1714
1846
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Listener ON_PEER_LISTENER_CALL', {
1715
1847
  peer,
@@ -1721,15 +1853,37 @@ class HMSSDK {
1721
1853
  });
1722
1854
  }
1723
1855
  });
1724
- _defineProperty(this, "onTrackListener", data => {
1856
+ _defineProperty(this, "sendPeerUpdateWhenPeerLeaves", (data, peer, type) => {
1725
1857
  var _getHmsPeersCache2;
1858
+ this.sendPeerUpdate(peer, type);
1859
+ (_getHmsPeersCache2 = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache2 === void 0 || _getHmsPeersCache2.updatePeerCache(data.peer.peerID, data.peer, type);
1860
+ });
1861
+ _defineProperty(this, "onPeerListUpdatedListener", data => {
1862
+ if (data.id !== this.id) {
1863
+ return;
1864
+ }
1865
+ const addedPeers = _HMSEncoder.HMSEncoder.encodeHmsPeers(data.addedPeers);
1866
+ const removedPeers = _HMSEncoder.HMSEncoder.encodeHmsPeers(data.removedPeers);
1867
+ if (this.onPeerListUpdatedDelegate) {
1868
+ _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Listener ON_PEER_LIST_UPDATED_LISTENER_CALL', {
1869
+ totalAddedPeers: addedPeers.length,
1870
+ totalRemovedPeers: removedPeers.length
1871
+ });
1872
+ this.onPeerListUpdatedDelegate({
1873
+ addedPeers,
1874
+ removedPeers
1875
+ });
1876
+ }
1877
+ });
1878
+ _defineProperty(this, "onTrackListener", data => {
1879
+ var _getHmsPeersCache3;
1726
1880
  if (data.id !== this.id) {
1727
1881
  return;
1728
1882
  }
1729
1883
  const track = _HMSEncoder.HMSEncoder.encodeHmsTrack(data.track, this.id);
1730
1884
  const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
1731
1885
  const type = data.type;
1732
- (_getHmsPeersCache2 = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache2 === void 0 || _getHmsPeersCache2.updatePeerCache(data.peer.peerID, {
1886
+ (_getHmsPeersCache3 = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache3 === void 0 || _getHmsPeersCache3.updatePeerCache(data.peer.peerID, {
1733
1887
  track
1734
1888
  }, data.type);
1735
1889
  if (this.muteStatus && (data === null || data === void 0 ? void 0 : data.type) === 'TRACK_ADDED' && track.type === _HMSTrackType.HMSTrackType.AUDIO) {
@@ -1977,6 +2131,12 @@ class HMSSDK {
1977
2131
  });
1978
2132
  }
1979
2133
  });
2134
+ _defineProperty(this, "onPIPModeChangedListener", data => {
2135
+ if (this.onPIPModeChangedDelegate) {
2136
+ _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Listener onPIPModeChanged_CALL', data);
2137
+ this.onPIPModeChangedDelegate(data);
2138
+ }
2139
+ });
1980
2140
  /**
1981
2141
  * - Updates the logger for this instance of HMSSDK
1982
2142
  * @param {HMSLogger} hmsLogger
@@ -2035,8 +2195,8 @@ class HMSSDK {
2035
2195
  id: this.id
2036
2196
  });
2037
2197
  }
2038
- async enablePipMode(data) {
2039
- return _HMSManagerModule.default.handlePipActions('enablePipMode', {
2198
+ async enterPipMode(data) {
2199
+ return _HMSManagerModule.default.handlePipActions('enterPipMode', {
2040
2200
  ...data,
2041
2201
  id: this.id
2042
2202
  });