@100mslive/react-native-hms 1.10.8 → 1.10.9

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 (189) hide show
  1. package/README.md +6 -5
  2. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +19 -2
  3. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +34 -3
  4. package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +3 -1
  5. package/ios/HMSRNSDK.swift +13 -8
  6. package/lib/commonjs/classes/HMSAudioDevice.js +9 -0
  7. package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
  8. package/lib/commonjs/classes/HMSAudioMixingMode.js +11 -0
  9. package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
  10. package/lib/commonjs/classes/HMSAudioTrack.js +9 -0
  11. package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
  12. package/lib/commonjs/classes/HMSCameraFacing.js +9 -0
  13. package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
  14. package/lib/commonjs/classes/HMSConfig.js +27 -0
  15. package/lib/commonjs/classes/HMSConfig.js.map +1 -1
  16. package/lib/commonjs/classes/HMSException.js +18 -0
  17. package/lib/commonjs/classes/HMSException.js.map +1 -1
  18. package/lib/commonjs/classes/HMSHLSTimedMetadata.js.map +1 -1
  19. package/lib/commonjs/classes/HMSIOSAudioMode.js +15 -0
  20. package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
  21. package/lib/commonjs/classes/HMSLogAlarmManager.js +12 -0
  22. package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
  23. package/lib/commonjs/classes/HMSLogLevel.js +12 -0
  24. package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
  25. package/lib/commonjs/classes/HMSLogSettings.js +14 -0
  26. package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
  27. package/lib/commonjs/classes/HMSNetworkQuality.js +11 -0
  28. package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
  29. package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +40 -10
  30. package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -1
  31. package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -1
  32. package/lib/commonjs/classes/HMSPIPListenerActions.js +9 -0
  33. package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
  34. package/lib/commonjs/classes/HMSPeer.js +148 -0
  35. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  36. package/lib/commonjs/classes/HMSPeerType.js +12 -1
  37. package/lib/commonjs/classes/HMSPeerType.js.map +1 -1
  38. package/lib/commonjs/classes/HMSRTMPConfig.js +14 -0
  39. package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
  40. package/lib/commonjs/classes/HMSRole.js +17 -0
  41. package/lib/commonjs/classes/HMSRole.js.map +1 -1
  42. package/lib/commonjs/classes/HMSRtmpVideoResolution.js +13 -0
  43. package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
  44. package/lib/commonjs/classes/HMSSDK.js +1126 -248
  45. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  46. package/lib/commonjs/classes/HMSSessionStore.js +14 -15
  47. package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
  48. package/lib/commonjs/classes/HMSTrack.js +13 -0
  49. package/lib/commonjs/classes/HMSTrack.js.map +1 -1
  50. package/lib/commonjs/classes/HMSTrackSettings.js +10 -0
  51. package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
  52. package/lib/commonjs/classes/HMSTrackSettingsInitState.js +9 -0
  53. package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
  54. package/lib/commonjs/classes/HMSTrackSource.js +10 -0
  55. package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
  56. package/lib/commonjs/classes/HMSTrackType.js +7 -0
  57. package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
  58. package/lib/commonjs/classes/HMSUpdateListenerActions.js +42 -3
  59. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  60. package/lib/commonjs/classes/HMSVideoTrack.js +17 -0
  61. package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
  62. package/lib/commonjs/classes/HMSVideoTrackSettings.js +12 -2
  63. package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
  64. package/lib/commonjs/classes/HmsView.js +42 -0
  65. package/lib/commonjs/classes/HmsView.js.map +1 -1
  66. package/lib/module/classes/HMSAudioDevice.js +9 -0
  67. package/lib/module/classes/HMSAudioDevice.js.map +1 -1
  68. package/lib/module/classes/HMSAudioMixingMode.js +11 -0
  69. package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
  70. package/lib/module/classes/HMSAudioTrack.js +9 -0
  71. package/lib/module/classes/HMSAudioTrack.js.map +1 -1
  72. package/lib/module/classes/HMSCameraFacing.js +9 -0
  73. package/lib/module/classes/HMSCameraFacing.js.map +1 -1
  74. package/lib/module/classes/HMSConfig.js +27 -0
  75. package/lib/module/classes/HMSConfig.js.map +1 -1
  76. package/lib/module/classes/HMSException.js +18 -0
  77. package/lib/module/classes/HMSException.js.map +1 -1
  78. package/lib/module/classes/HMSHLSTimedMetadata.js.map +1 -1
  79. package/lib/module/classes/HMSIOSAudioMode.js +15 -0
  80. package/lib/module/classes/HMSIOSAudioMode.js.map +1 -1
  81. package/lib/module/classes/HMSLogAlarmManager.js +12 -0
  82. package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
  83. package/lib/module/classes/HMSLogLevel.js +12 -0
  84. package/lib/module/classes/HMSLogLevel.js.map +1 -1
  85. package/lib/module/classes/HMSLogSettings.js +14 -0
  86. package/lib/module/classes/HMSLogSettings.js.map +1 -1
  87. package/lib/module/classes/HMSNetworkQuality.js +11 -0
  88. package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
  89. package/lib/module/classes/HMSNoiseCancellationPlugin.js +40 -10
  90. package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -1
  91. package/lib/module/classes/HMSPIPConfig.js.map +1 -1
  92. package/lib/module/classes/HMSPIPListenerActions.js +9 -0
  93. package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
  94. package/lib/module/classes/HMSPeer.js +149 -0
  95. package/lib/module/classes/HMSPeer.js.map +1 -1
  96. package/lib/module/classes/HMSPeerType.js +12 -1
  97. package/lib/module/classes/HMSPeerType.js.map +1 -1
  98. package/lib/module/classes/HMSRTMPConfig.js +14 -0
  99. package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
  100. package/lib/module/classes/HMSRole.js +17 -0
  101. package/lib/module/classes/HMSRole.js.map +1 -1
  102. package/lib/module/classes/HMSRtmpVideoResolution.js +13 -0
  103. package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
  104. package/lib/module/classes/HMSSDK.js +1126 -248
  105. package/lib/module/classes/HMSSDK.js.map +1 -1
  106. package/lib/module/classes/HMSSessionStore.js +14 -15
  107. package/lib/module/classes/HMSSessionStore.js.map +1 -1
  108. package/lib/module/classes/HMSTrack.js +13 -0
  109. package/lib/module/classes/HMSTrack.js.map +1 -1
  110. package/lib/module/classes/HMSTrackSettings.js +10 -0
  111. package/lib/module/classes/HMSTrackSettings.js.map +1 -1
  112. package/lib/module/classes/HMSTrackSettingsInitState.js +9 -0
  113. package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
  114. package/lib/module/classes/HMSTrackSource.js +10 -0
  115. package/lib/module/classes/HMSTrackSource.js.map +1 -1
  116. package/lib/module/classes/HMSTrackType.js +7 -0
  117. package/lib/module/classes/HMSTrackType.js.map +1 -1
  118. package/lib/module/classes/HMSUpdateListenerActions.js +42 -3
  119. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  120. package/lib/module/classes/HMSVideoTrack.js +17 -0
  121. package/lib/module/classes/HMSVideoTrack.js.map +1 -1
  122. package/lib/module/classes/HMSVideoTrackSettings.js +12 -2
  123. package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
  124. package/lib/module/classes/HmsView.js +43 -0
  125. package/lib/module/classes/HmsView.js.map +1 -1
  126. package/lib/typescript/classes/HMSAudioDevice.d.ts +14 -0
  127. package/lib/typescript/classes/HMSAudioMixingMode.d.ts +11 -0
  128. package/lib/typescript/classes/HMSAudioTrack.d.ts +9 -0
  129. package/lib/typescript/classes/HMSCameraFacing.d.ts +11 -0
  130. package/lib/typescript/classes/HMSConfig.d.ts +27 -0
  131. package/lib/typescript/classes/HMSException.d.ts +18 -0
  132. package/lib/typescript/classes/HMSHLSTimedMetadata.d.ts +12 -0
  133. package/lib/typescript/classes/HMSIOSAudioMode.d.ts +15 -0
  134. package/lib/typescript/classes/HMSLogAlarmManager.d.ts +12 -0
  135. package/lib/typescript/classes/HMSLogLevel.d.ts +12 -0
  136. package/lib/typescript/classes/HMSLogSettings.d.ts +14 -0
  137. package/lib/typescript/classes/HMSNetworkQuality.d.ts +11 -0
  138. package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +36 -6
  139. package/lib/typescript/classes/HMSPIPConfig.d.ts +37 -0
  140. package/lib/typescript/classes/HMSPIPListenerActions.d.ts +17 -0
  141. package/lib/typescript/classes/HMSPeer.d.ts +137 -0
  142. package/lib/typescript/classes/HMSPeerType.d.ts +11 -0
  143. package/lib/typescript/classes/HMSRTMPConfig.d.ts +14 -0
  144. package/lib/typescript/classes/HMSRole.d.ts +17 -0
  145. package/lib/typescript/classes/HMSRtmpVideoResolution.d.ts +13 -0
  146. package/lib/typescript/classes/HMSSDK.d.ts +1080 -235
  147. package/lib/typescript/classes/HMSSessionStore.d.ts +14 -15
  148. package/lib/typescript/classes/HMSTrack.d.ts +13 -0
  149. package/lib/typescript/classes/HMSTrackSettings.d.ts +10 -0
  150. package/lib/typescript/classes/HMSTrackSettingsInitState.d.ts +11 -0
  151. package/lib/typescript/classes/HMSTrackSource.d.ts +10 -0
  152. package/lib/typescript/classes/HMSTrackType.d.ts +7 -0
  153. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +290 -4
  154. package/lib/typescript/classes/HMSVideoTrack.d.ts +17 -0
  155. package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +12 -2
  156. package/lib/typescript/classes/HmsView.d.ts +16 -0
  157. package/package.json +1 -1
  158. package/sdk-versions.json +2 -2
  159. package/src/classes/HMSAudioDevice.ts +18 -0
  160. package/src/classes/HMSAudioMixingMode.ts +11 -0
  161. package/src/classes/HMSAudioTrack.ts +9 -0
  162. package/src/classes/HMSCameraFacing.ts +11 -0
  163. package/src/classes/HMSConfig.ts +27 -0
  164. package/src/classes/HMSException.ts +18 -0
  165. package/src/classes/HMSHLSTimedMetadata.ts +12 -0
  166. package/src/classes/HMSIOSAudioMode.ts +15 -0
  167. package/src/classes/HMSLogAlarmManager.ts +12 -0
  168. package/src/classes/HMSLogLevel.ts +12 -0
  169. package/src/classes/HMSLogSettings.ts +14 -0
  170. package/src/classes/HMSNetworkQuality.ts +11 -0
  171. package/src/classes/HMSNoiseCancellationPlugin.ts +41 -10
  172. package/src/classes/HMSPIPConfig.ts +25 -8
  173. package/src/classes/HMSPIPListenerActions.ts +18 -0
  174. package/src/classes/HMSPeer.ts +137 -0
  175. package/src/classes/HMSPeerType.ts +13 -2
  176. package/src/classes/HMSRTMPConfig.ts +14 -0
  177. package/src/classes/HMSRole.ts +17 -0
  178. package/src/classes/HMSRtmpVideoResolution.ts +13 -0
  179. package/src/classes/HMSSDK.tsx +1182 -277
  180. package/src/classes/HMSSessionStore.ts +14 -15
  181. package/src/classes/HMSTrack.ts +13 -0
  182. package/src/classes/HMSTrackSettings.ts +10 -0
  183. package/src/classes/HMSTrackSettingsInitState.ts +11 -0
  184. package/src/classes/HMSTrackSource.ts +10 -0
  185. package/src/classes/HMSTrackType.ts +7 -0
  186. package/src/classes/HMSUpdateListenerActions.ts +312 -3
  187. package/src/classes/HMSVideoTrack.ts +17 -0
  188. package/src/classes/HMSVideoTrackSettings.ts +12 -2
  189. package/src/classes/HmsView.tsx +39 -0
@@ -12,18 +12,48 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
12
12
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
13
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
14
  /**
15
- * Class representing an HMS Noise Cancellation Plugin.
16
- * Checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation} for more info
15
+ * Represents the HMS Noise Cancellation Plugin.
16
+ * This class encapsulates the functionality for managing noise cancellation within a room, including enabling, disabling, and checking the availability and current state of noise cancellation.
17
+ *
18
+ * @property {HMSNoiseCancellationModels} modelName - Specifies the model of noise cancellation to be used.
19
+ * This property determines the algorithm and intensity of noise cancellation, allowing for customization
20
+ * based on the requirements of the room or application.
21
+ *
22
+ * @property {HMSNoiseCancellationInitialState} initialState - Defines the initial state of noise cancellation
23
+ * when the plugin is instantiated. This can be either enabled or disabled, providing control over the
24
+ * noise cancellation feature's activation upon initialization.
25
+ *
26
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation
17
27
  */
18
28
  class HMSNoiseCancellationPlugin {
19
29
  /**
20
- * Creates an instance of HMSNoiseCancellationPlugin.
21
- * @param {Object} [config] - The configuration options.
22
- * @param {HMSNoiseCancellationModels} [config.modelName] - The model name for noise cancellation.
23
- * @param {HMSNoiseCancellationInitialState} [config.initialState] - The initial state for noise cancellation.
30
+ * Constructs a new HMSNoiseCancellationPlugin instance with optional configuration settings.
31
+ * This constructor allows for the initialization of the plugin with specific noise cancellation
32
+ * model and initial state settings, providing flexibility in how noise cancellation is applied
33
+ * within the application.
34
+ *
35
+ * @param {Object} [config] - Optional configuration object for the plugin.
36
+ * @param {HMSNoiseCancellationModels} [config.modelName] - Specifies the noise cancellation model to be used.
37
+ * This determines the algorithm and intensity of noise cancellation. If not provided, a default
38
+ * model is used.
39
+ * @param {HMSNoiseCancellationInitialState} [config.initialState] - Sets the initial state of noise cancellation
40
+ * (enabled or disabled) when the plugin is instantiated. Defaults to disabled if not specified.
24
41
  */
25
42
  constructor(config) {
43
+ /**
44
+ * The `modelName` property specifies the model of noise cancellation to be used within the HMS Noise Cancellation Plugin.
45
+ * This property determines the algorithm and intensity of noise cancellation, allowing for customization
46
+ * based on the specific requirements of the room or application. It is of type `HMSNoiseCancellationModels`,
47
+ * an enum that defines the available noise cancellation models.
48
+ */
26
49
  _defineProperty(this, "modelName", void 0);
50
+ /**
51
+ * Defines the initial state of noise cancellation when the plugin is instantiated.
52
+ * This property can be set to either `HMSNoiseCancellationInitialState.Enabled`
53
+ * or `HMSNoiseCancellationInitialState.Disabled`, determining whether noise cancellation should be active
54
+ * immediately upon the plugin's instantiation. This allows for control over the feature's initial activation state,
55
+ * catering to scenarios where noise cancellation needs to be either immediately available or manually activated later.
56
+ */
27
57
  _defineProperty(this, "initialState", void 0);
28
58
  const data = {
29
59
  modelName: HMSNoiseCancellationModels.SmallFullBand,
@@ -48,7 +78,7 @@ class HMSNoiseCancellationPlugin {
48
78
  };
49
79
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable', data);
50
80
  try {
51
- return _HMSManagerModule.default.isNoiseCancellationPluginAvailable(data);
81
+ return await _HMSManagerModule.default.isNoiseCancellationPluginAvailable(data);
52
82
  } catch (e) {
53
83
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.error('#Error in #Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable ', e);
54
84
  return Promise.reject(e);
@@ -65,7 +95,7 @@ class HMSNoiseCancellationPlugin {
65
95
  };
66
96
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function HMSNoiseCancellationPlugin#enable', data);
67
97
  try {
68
- return _HMSManagerModule.default.enableNoiseCancellationPlugin(data);
98
+ return await _HMSManagerModule.default.enableNoiseCancellationPlugin(data);
69
99
  } catch (e) {
70
100
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.error('#Error in #Function HMSNoiseCancellationPlugin#enable ', e);
71
101
  return Promise.reject(e);
@@ -82,7 +112,7 @@ class HMSNoiseCancellationPlugin {
82
112
  };
83
113
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function HMSNoiseCancellationPlugin#disable', data);
84
114
  try {
85
- return _HMSManagerModule.default.disableNoiseCancellationPlugin(data);
115
+ return await _HMSManagerModule.default.disableNoiseCancellationPlugin(data);
86
116
  } catch (e) {
87
117
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.error('#Error in #Function HMSNoiseCancellationPlugin#disable ', e);
88
118
  return Promise.reject(e);
@@ -99,7 +129,7 @@ class HMSNoiseCancellationPlugin {
99
129
  };
100
130
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.verbose('#Function HMSNoiseCancellationPlugin#isEnabled', data);
101
131
  try {
102
- return _HMSManagerModule.default.isNoiseCancellationPluginEnabled(data);
132
+ return await _HMSManagerModule.default.isNoiseCancellationPluginEnabled(data);
103
133
  } catch (e) {
104
134
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 || _HMSLogger.logger.error('#Error in #Function HMSNoiseCancellationPlugin#isEnabled ', e);
105
135
  return Promise.reject(e);
@@ -1 +1 @@
1
- {"version":3,"names":["_HMSManagerModule","_interopRequireDefault","require","_HMSConstants","_HMSLogger","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSNoiseCancellationPlugin","constructor","config","data","modelName","HMSNoiseCancellationModels","SmallFullBand","initialState","HMSNoiseCancellationInitialState","Disabled","isNoiseCancellationAvailable","id","HMSConstants","DEFAULT_SDK_ID","logger","verbose","HMSManagerModule","isNoiseCancellationPluginAvailable","error","Promise","reject","enable","enableNoiseCancellationPlugin","disable","disableNoiseCancellationPlugin","isEnabled","isNoiseCancellationPluginEnabled","exports"],"sources":["HMSNoiseCancellationPlugin.ts"],"sourcesContent":["import HMSManagerModule from '../modules/HMSManagerModule';\nimport { HMSConstants } from './HMSConstants';\nimport { logger } from './HMSLogger';\n\n/**\n * Class representing an HMS Noise Cancellation Plugin.\n * Checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation} for more info\n */\nexport class HMSNoiseCancellationPlugin {\n modelName: HMSNoiseCancellationModels;\n initialState: HMSNoiseCancellationInitialState;\n\n /**\n * Creates an instance of HMSNoiseCancellationPlugin.\n * @param {Object} [config] - The configuration options.\n * @param {HMSNoiseCancellationModels} [config.modelName] - The model name for noise cancellation.\n * @param {HMSNoiseCancellationInitialState} [config.initialState] - The initial state for noise cancellation.\n */\n constructor(config?: {\n modelName: HMSNoiseCancellationModels;\n initialState: HMSNoiseCancellationInitialState;\n }) {\n const data = {\n modelName: HMSNoiseCancellationModels.SmallFullBand,\n initialState: HMSNoiseCancellationInitialState.Disabled,\n ...config,\n };\n this.modelName = data.modelName;\n this.initialState = data.initialState;\n }\n\n /**\n * To make noise cancellation work your room needs to have noise cancellation feature enabled.\n *\n * Gets whether noise cancellation is available for your room.\n * @returns {boolean} True if noise cancellation is available, false otherwise.\n *\n * Note: You can call this API to check the state of noise cancellation only after successfully joining the room.\n */\n async isNoiseCancellationAvailable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose(\n '#Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable',\n data\n );\n\n try {\n return HMSManagerModule.isNoiseCancellationPluginAvailable(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Enables noise cancellation.\n * @returns {Promise<boolean>} A promise that resolves to true if noise cancellation is enabled, otherwise, rejected promise is returned\n */\n async enable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#enable', data);\n\n try {\n return HMSManagerModule.enableNoiseCancellationPlugin(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#enable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Disables noise cancellation.\n * @returns {Promise<boolean>} A promise that resolves to true if noise cancellation is disabled, otherwise, rejected promise is returned\n */\n async disable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#disable', data);\n\n try {\n return HMSManagerModule.disableNoiseCancellationPlugin(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#disable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Checks if noise cancellation is enabled.\n * @returns {boolean} true if noise cancellation is enabled, false otherwise.\n */\n async isEnabled(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#isEnabled', data);\n\n try {\n return HMSManagerModule.isNoiseCancellationPluginEnabled(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#isEnabled ',\n e\n );\n return Promise.reject(e);\n }\n }\n}\n\n/**\n * Enum for HMS Noise Cancellation Models.\n * @enum {String}\n */\nexport enum HMSNoiseCancellationModels {\n SmallFullBand = 'SMALL_FULL_BAND',\n}\n\n/**\n * Enum for HMS Noise Cancellation Initial State.\n * @enum {String}\n */\nexport enum HMSNoiseCancellationInitialState {\n Enabled = 'ENABLED',\n Disabled = 'DISABLED',\n}\n"],"mappings":";;;;;;AAAA,IAAA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C;IAErE,IAAI;MACF,OAAOa,yBAAgB,CAACQ,8BAA8B,CAACrB,IAAI,CAAC;IAC9D,CAAC,CAAC,OAAOxB,CAAC,EAAE;MACVmC,iBAAM,aAANA,iBAAM,eAANA,iBAAM,CAAEI,KAAK,CACX,yDAAyD,EACzDvC,CACF,CAAC;MACD,OAAOwC,OAAO,CAACC,MAAM,CAACzC,CAAC,CAAC;IAC1B;EACF;;EAEA;AACF;AACA;AACA;EACE,MAAM8C,SAASA,CAAA,EAAqB;IAClC,MAAMtB,IAAI,GAAG;MAAEQ,EAAE,EAAEC,0BAAY,CAACC;IAAe,CAAC;IAChDC,iBAAM,aAANA,iBAAM,eAANA,iBAAM,CAAEC,OAAO,CAAC,gDAAgD,EAAEZ,IAAI,CAAC;IAEvE,IAAI;MACF,OAAOa,yBAAgB,CAACU,gCAAgC,CAACvB,IAAI,CAAC;IAChE,CAAC,CAAC,OAAOxB,CAAC,EAAE;MACVmC,iBAAM,aAANA,iBAAM,eAANA,iBAAM,CAAEI,KAAK,CACX,2DAA2D,EAC3DvC,CACF,CAAC;MACD,OAAOwC,OAAO,CAACC,MAAM,CAACzC,CAAC,CAAC;IAC1B;EACF;AACF;;AAEA;AACA;AACA;AACA;AAHAgD,OAAA,CAAA3B,0BAAA,GAAAA,0BAAA;AAAA,IAIYK,0BAA0B,GAAAsB,OAAA,CAAAtB,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAItC;AACA;AACA;AACA;AAHA,IAIYG,gCAAgC,GAAAmB,OAAA,CAAAnB,gCAAA,0BAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAA,OAAhCA,gCAAgC;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_HMSManagerModule","_interopRequireDefault","require","_HMSConstants","_HMSLogger","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSNoiseCancellationPlugin","constructor","config","data","modelName","HMSNoiseCancellationModels","SmallFullBand","initialState","HMSNoiseCancellationInitialState","Disabled","isNoiseCancellationAvailable","id","HMSConstants","DEFAULT_SDK_ID","logger","verbose","HMSManagerModule","isNoiseCancellationPluginAvailable","error","Promise","reject","enable","enableNoiseCancellationPlugin","disable","disableNoiseCancellationPlugin","isEnabled","isNoiseCancellationPluginEnabled","exports"],"sources":["HMSNoiseCancellationPlugin.ts"],"sourcesContent":["import HMSManagerModule from '../modules/HMSManagerModule';\nimport { HMSConstants } from './HMSConstants';\nimport { logger } from './HMSLogger';\n\n/**\n * Represents the HMS Noise Cancellation Plugin.\n * This class encapsulates the functionality for managing noise cancellation within a room, including enabling, disabling, and checking the availability and current state of noise cancellation.\n *\n * @property {HMSNoiseCancellationModels} modelName - Specifies the model of noise cancellation to be used.\n * This property determines the algorithm and intensity of noise cancellation, allowing for customization\n * based on the requirements of the room or application.\n *\n * @property {HMSNoiseCancellationInitialState} initialState - Defines the initial state of noise cancellation\n * when the plugin is instantiated. This can be either enabled or disabled, providing control over the\n * noise cancellation feature's activation upon initialization.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation\n */\nexport class HMSNoiseCancellationPlugin {\n /**\n * The `modelName` property specifies the model of noise cancellation to be used within the HMS Noise Cancellation Plugin.\n * This property determines the algorithm and intensity of noise cancellation, allowing for customization\n * based on the specific requirements of the room or application. It is of type `HMSNoiseCancellationModels`,\n * an enum that defines the available noise cancellation models.\n */\n modelName: HMSNoiseCancellationModels;\n\n /**\n * Defines the initial state of noise cancellation when the plugin is instantiated.\n * This property can be set to either `HMSNoiseCancellationInitialState.Enabled`\n * or `HMSNoiseCancellationInitialState.Disabled`, determining whether noise cancellation should be active\n * immediately upon the plugin's instantiation. This allows for control over the feature's initial activation state,\n * catering to scenarios where noise cancellation needs to be either immediately available or manually activated later.\n */\n initialState: HMSNoiseCancellationInitialState;\n\n /**\n * Constructs a new HMSNoiseCancellationPlugin instance with optional configuration settings.\n * This constructor allows for the initialization of the plugin with specific noise cancellation\n * model and initial state settings, providing flexibility in how noise cancellation is applied\n * within the application.\n *\n * @param {Object} [config] - Optional configuration object for the plugin.\n * @param {HMSNoiseCancellationModels} [config.modelName] - Specifies the noise cancellation model to be used.\n * This determines the algorithm and intensity of noise cancellation. If not provided, a default\n * model is used.\n * @param {HMSNoiseCancellationInitialState} [config.initialState] - Sets the initial state of noise cancellation\n * (enabled or disabled) when the plugin is instantiated. Defaults to disabled if not specified.\n */\n constructor(config?: {\n modelName: HMSNoiseCancellationModels;\n initialState: HMSNoiseCancellationInitialState;\n }) {\n const data = {\n modelName: HMSNoiseCancellationModels.SmallFullBand,\n initialState: HMSNoiseCancellationInitialState.Disabled,\n ...config,\n };\n this.modelName = data.modelName;\n this.initialState = data.initialState;\n }\n\n /**\n * To make noise cancellation work your room needs to have noise cancellation feature enabled.\n *\n * Gets whether noise cancellation is available for your room.\n * @returns {boolean} True if noise cancellation is available, false otherwise.\n *\n * Note: You can call this API to check the state of noise cancellation only after successfully joining the room.\n */\n async isNoiseCancellationAvailable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose(\n '#Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable',\n data\n );\n\n try {\n return await HMSManagerModule.isNoiseCancellationPluginAvailable(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#isNoiseCancellationAvailable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Enables noise cancellation.\n * @returns {Promise<boolean>} A promise that resolves to true if noise cancellation is enabled, otherwise, rejected promise is returned\n */\n async enable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#enable', data);\n\n try {\n return await HMSManagerModule.enableNoiseCancellationPlugin(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#enable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Disables noise cancellation.\n * @returns {Promise<boolean>} A promise that resolves to true if noise cancellation is disabled, otherwise, rejected promise is returned\n */\n async disable(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#disable', data);\n\n try {\n return await HMSManagerModule.disableNoiseCancellationPlugin(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#disable ',\n e\n );\n return Promise.reject(e);\n }\n }\n\n /**\n * Checks if noise cancellation is enabled.\n * @returns {boolean} true if noise cancellation is enabled, false otherwise.\n */\n async isEnabled(): Promise<boolean> {\n const data = { id: HMSConstants.DEFAULT_SDK_ID };\n logger?.verbose('#Function HMSNoiseCancellationPlugin#isEnabled', data);\n\n try {\n return await HMSManagerModule.isNoiseCancellationPluginEnabled(data);\n } catch (e) {\n logger?.error(\n '#Error in #Function HMSNoiseCancellationPlugin#isEnabled ',\n e\n );\n return Promise.reject(e);\n }\n }\n}\n\n/**\n * Enum for HMS Noise Cancellation Models.\n * @enum {String}\n */\nexport enum HMSNoiseCancellationModels {\n SmallFullBand = 'SMALL_FULL_BAND',\n}\n\n/**\n * Enum for HMS Noise Cancellation Initial State.\n * @enum {String}\n */\nexport enum HMSNoiseCancellationInitialState {\n Enabled = 'ENABLED',\n Disabled = 'DISABLED',\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAAqC,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,G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CAAEI,KAAK,CACX,yDAAyD,EACzDvC,CACF,CAAC;MACD,OAAOwC,OAAO,CAACC,MAAM,CAACzC,CAAC,CAAC;IAC1B;EACF;;EAEA;AACF;AACA;AACA;EACE,MAAM8C,SAASA,CAAA,EAAqB;IAClC,MAAMtB,IAAI,GAAG;MAAEQ,EAAE,EAAEC,0BAAY,CAACC;IAAe,CAAC;IAChDC,iBAAM,aAANA,iBAAM,eAANA,iBAAM,CAAEC,OAAO,CAAC,gDAAgD,EAAEZ,IAAI,CAAC;IAEvE,IAAI;MACF,OAAO,MAAMa,yBAAgB,CAACU,gCAAgC,CAACvB,IAAI,CAAC;IACtE,CAAC,CAAC,OAAOxB,CAAC,EAAE;MACVmC,iBAAM,aAANA,iBAAM,eAANA,iBAAM,CAAEI,KAAK,CACX,2DAA2D,EAC3DvC,CACF,CAAC;MACD,OAAOwC,OAAO,CAACC,MAAM,CAACzC,CAAC,CAAC;IAC1B;EACF;AACF;;AAEA;AACA;AACA;AACA;AAHAgD,OAAA,CAAA3B,0BAAA,GAAAA,0BAAA;AAAA,IAIYK,0BAA0B,GAAAsB,OAAA,CAAAtB,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAItC;AACA;AACA;AACA;AAHA,IAIYG,gCAAgC,GAAAmB,OAAA,CAAAnB,gCAAA,0BAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAA,OAAhCA,gCAAgC;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["HMSPIPConfig.ts"],"sourcesContent":["import type { HMSVideoViewMode } from './HMSVideoViewMode';\n\nexport interface HMSPIPConfig {\n /*\n * Whether to automatically enter PIP mode when app enters background.\n */\n autoEnterPipMode?: boolean;\n\n /*\n * The aspect ratio of the PIP window. Default is [9, 16]. Other values can be [3, 4], [1, 1], [4, 3], [16, 9].\n */\n aspectRatio?: [number, number];\n\n /*\n * The scale type of the PIP window. Default is ASPECT_FILL. Other values can be ASPECT_FIT, ASPECT_BALANCED. iOS Only.\n */\n scaleType?: HMSVideoViewMode;\n\n /*\n * Whether to show the Active Speaker in the PIP window. Default is true. iOS only.\n */\n useActiveSpeaker?: boolean;\n /*\n * Whether to show the end button in the PIP window. Default is true. Android only.\n */\n endButton?: boolean;\n\n /*\n * Whether to show the audio mute/unmute button in the PIP window. Default is true. Android only.\n */\n audioButton?: boolean;\n\n /*\n * Whether to show the video mute/unmute button in the PIP window. Default is true. Android only.\n */\n videoButton?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["HMSPIPConfig.ts"],"sourcesContent":["import type { HMSVideoViewMode } from './HMSVideoViewMode';\n\n/**\n * Configuration options for Picture-in-Picture (PIP) mode in a React Native application using HMS.\n *\n * This interface defines the settings available for customizing the PIP window that can appear when the app enters background mode.\n * It includes options for automatically entering PIP mode, adjusting the aspect ratio and scale type of the PIP window, and toggling\n * the visibility of various control buttons specific to Android or iOS platforms.\n *\n * @interface HMSPIPConfig\n * @property {boolean} [autoEnterPipMode] - Determines whether the app should automatically enter PIP mode when it goes into the background.\n * @property {[number, number]} [aspectRatio] - Sets the aspect ratio of the PIP window. Defaults are platform-specific: [16, 9] for Android and [9, 16] for iOS.\n * @property {HMSVideoViewMode} [scaleType] - Defines the scaling behavior of the video within the PIP window. Options are `ASPECT_FILL` (default), `ASPECT_FIT`, and `ASPECT_BALANCED`. Applies only to iOS.\n * @property {boolean} [useActiveSpeaker] - Whether the PIP window should automatically show the active speaker. Default is true. Applies only to iOS.\n * @property {boolean} [endButton] - Controls the visibility of the end call button within the PIP window. Default is true. Applies only to Android.\n * @property {boolean} [audioButton] - Controls the visibility of the audio mute/unmute button within the PIP window. Default is true. Applies only to Android.\n * @property {boolean} [videoButton] - Controls the visibility of the video mute/unmute button within the PIP window. Default is true. Applies only to Android.\n */\nexport interface HMSPIPConfig {\n /**\n * Whether to automatically enter PIP mode when app enters background.\n */\n autoEnterPipMode?: boolean;\n\n /**\n * The aspect ratio of the PIP window. Default is [16, 9] on Android & [9, 16] on iOS. Other values can be [3, 4], [1, 1], [4, 3], [16, 9].\n */\n aspectRatio?: [number, number];\n\n /**\n * The scale type of the PIP window. Default is ASPECT_FILL. Other values can be ASPECT_FIT, ASPECT_BALANCED. iOS Only.\n */\n scaleType?: HMSVideoViewMode;\n\n /**\n * Whether to show the Active Speaker in the PIP window. Default is true. iOS only.\n */\n useActiveSpeaker?: boolean;\n\n /**\n * Whether to show the end button in the PIP window. Default is true. Android only.\n */\n endButton?: boolean;\n\n /**\n * Whether to show the audio mute/unmute button in the PIP window. Default is true. Android only.\n */\n audioButton?: boolean;\n\n /**\n * Whether to show the video mute/unmute button in the PIP window. Default is true. Android only.\n */\n videoButton?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -4,6 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HMSPIPListenerActions = void 0;
7
+ /**
8
+ * Enum for HMS Picture-in-Picture (PIP) Listener Actions.
9
+ *
10
+ * This enum defines the types of actions/events related to the Picture-in-Picture (PIP) mode that can be listened to
11
+ * within the HMS SDK. These actions allow the application to respond to changes in PIP mode or when the room is left
12
+ * while in PIP mode.
13
+ *
14
+ * @enum {string}
15
+ */
7
16
  let HMSPIPListenerActions = exports.HMSPIPListenerActions = /*#__PURE__*/function (HMSPIPListenerActions) {
8
17
  HMSPIPListenerActions["ON_PIP_MODE_CHANGED"] = "ON_PIP_MODE_CHANGED";
9
18
  HMSPIPListenerActions["ON_PIP_ROOM_LEAVE"] = "ON_PIP_ROOM_LEAVE";
@@ -1 +1 @@
1
- {"version":3,"names":["HMSPIPListenerActions","exports"],"sources":["HMSPIPListenerActions.ts"],"sourcesContent":["export enum HMSPIPListenerActions {\n ON_PIP_MODE_CHANGED = 'ON_PIP_MODE_CHANGED',\n ON_PIP_ROOM_LEAVE = 'ON_PIP_ROOM_LEAVE',\n}\n"],"mappings":";;;;;;IAAYA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSPIPListenerActions","exports"],"sources":["HMSPIPListenerActions.ts"],"sourcesContent":["/**\n * Enum for HMS Picture-in-Picture (PIP) Listener Actions.\n *\n * This enum defines the types of actions/events related to the Picture-in-Picture (PIP) mode that can be listened to\n * within the HMS SDK. These actions allow the application to respond to changes in PIP mode or when the room is left\n * while in PIP mode.\n *\n * @enum {string}\n */\nexport enum HMSPIPListenerActions {\n /**\n * Action triggered when the Picture-in-Picture mode changes.\n * This can be used to handle UI changes or other logic when entering or exiting PIP mode.\n */\n ON_PIP_MODE_CHANGED = 'ON_PIP_MODE_CHANGED',\n\n /**\n * Action triggered when the room is left while in Picture-in-Picture mode. Android only.\n * This can be used to clean up resources or update the UI accordingly.\n */\n ON_PIP_ROOM_LEAVE = 'ON_PIP_ROOM_LEAVE',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IASYA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
@@ -10,6 +10,22 @@ var _HMSPeerType = require("./HMSPeerType");
10
10
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
12
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ /**
14
+ * Represents a peer in the HMS ecosystem.
15
+ *
16
+ * This class encapsulates the properties and state of a peer within a session, including their ID, name, role, and various status flags.
17
+ *
18
+ * @export
19
+ * @class HMSPeer
20
+ * @property {string} peerID - The unique identifier for the peer.
21
+ * @property {string | undefined} _name - The name of the peer. Private access.
22
+ * @property {boolean | undefined} _isLocal - Flag indicating whether the peer is the local user. Private access.
23
+ * @property {string | undefined} _customerUserID - An optional custom user ID set by the application. Private access.
24
+ * @property {string | undefined} _metadata - Optional metadata associated with the peer. Private access.
25
+ * @property {HMSRole | undefined} _role - The role assigned to the peer within the session. Private access.
26
+ * @property {boolean} _isHandRaised - Flag indicating whether the peer has raised their hand. Defaults to false. Private access.
27
+ * @property {HMSPeerType} _type - The type of the peer, e.g., regular, screen share. Defaults to `HMSPeerType.REGULAR`. Private access.
28
+ */
13
29
  class HMSPeer {
14
30
  _updateName(value) {
15
31
  // If `_isLocal` is outdated, update it
@@ -65,6 +81,17 @@ class HMSPeer {
65
81
  this.peerID = params.peerID;
66
82
  this._name = params.name;
67
83
  }
84
+
85
+ /**
86
+ * Gets the name of the peer.
87
+ *
88
+ * This getter method retrieves the name of the peer. If the name has already been set locally, it returns that value.
89
+ * Otherwise, it attempts to retrieve the name from the HMS peers cache. If the cache does not contain the name,
90
+ * it falls back to fetching the name directly from the native layer using the peer's ID.
91
+ * Once a value is retrieved, it updates the local `_name` property to ensure consistency.
92
+ *
93
+ * @returns {string | undefined} The name of the peer if available, otherwise `undefined`.
94
+ */
68
95
  get name() {
69
96
  if (this._name) {
70
97
  return this._name;
@@ -76,6 +103,16 @@ class HMSPeer {
76
103
  }
77
104
  return value ?? this._name;
78
105
  }
106
+
107
+ /**
108
+ * Determines if the peer is the local user.
109
+ *
110
+ * This getter method checks if the peer is the local user by first attempting to retrieve the 'isLocal' property value from the HMS peers cache.
111
+ * If the value is not found in the cache, it falls back to fetching the property directly from the native layer using the peer's ID.
112
+ * Once a value is retrieved, it updates the local `_isLocal` property to ensure the value is current.
113
+ *
114
+ * @returns {boolean | undefined} True if the peer is the local user, false otherwise. Returns `undefined` if the information is not available.
115
+ */
79
116
  get isLocal() {
80
117
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
81
118
  const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'isLocal') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'isLocal');
@@ -84,6 +121,19 @@ class HMSPeer {
84
121
  }
85
122
  return value ?? this._isLocal;
86
123
  }
124
+
125
+ /**
126
+ * Checks if the peer has raised their hand.
127
+ *
128
+ * This getter method determines whether the peer has their hand raised in the session. It first attempts to retrieve the 'isHandRaised' property value
129
+ * from the HMS peers cache. If the value is not found in the cache, it falls back to fetching the property directly from the native layer using the peer's ID.
130
+ * Once a value is retrieved, it updates the local `_isHandRaised` property to ensure the value is current and consistent.
131
+ *
132
+ * @returns {boolean} True if the peer has their hand raised, false otherwise. Defaults to false if the information is not available.
133
+ *
134
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room
135
+ *
136
+ */
87
137
  get isHandRaised() {
88
138
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
89
139
  const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'isHandRaised') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'isHandRaised');
@@ -92,6 +142,19 @@ class HMSPeer {
92
142
  }
93
143
  return value ?? this._isHandRaised;
94
144
  }
145
+
146
+ /**
147
+ * Retrieves the network quality of the peer.
148
+ *
149
+ * This getter method attempts to obtain the network quality of the peer, which is an indicator of the current network conditions affecting the peer's connection.
150
+ * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
151
+ * it falls back to fetching the network quality directly from the native layer using the peer's ID.
152
+ * The network quality is represented by the `HMSNetworkQuality` type, which may include values such as 'good', 'poor', etc., depending on the implementation.
153
+ *
154
+ * @returns {HMSNetworkQuality | undefined} The network quality of the peer if available, otherwise `undefined`.
155
+ *
156
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
157
+ */
95
158
  get networkQuality() {
96
159
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
97
160
  if (hmsPeersCache) {
@@ -99,6 +162,17 @@ class HMSPeer {
99
162
  }
100
163
  return (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'networkQuality');
101
164
  }
165
+
166
+ /**
167
+ * Retrieves the custom user ID of the peer.
168
+ *
169
+ * This getter method attempts to obtain the custom user ID of the peer, which is an optional identifier that can be set by the application.
170
+ * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
171
+ * it falls back to fetching the custom user ID directly from the native layer using the peer's ID.
172
+ * Once a value is retrieved, it updates the local `_customerUserID` property to ensure the value is current and consistent.
173
+ *
174
+ * @returns {string | undefined} The custom user ID of the peer if available, otherwise `undefined`.
175
+ */
102
176
  get customerUserID() {
103
177
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
104
178
  const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'customerUserID') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'customerUserID');
@@ -107,6 +181,19 @@ class HMSPeer {
107
181
  }
108
182
  return value ?? this._customerUserID;
109
183
  }
184
+
185
+ /**
186
+ * Retrieves the metadata associated with the peer.
187
+ *
188
+ * This getter method attempts to obtain the metadata of the peer, which can include any additional information set by the application.
189
+ * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,
190
+ * it falls back to fetching the metadata directly from the native layer using the peer's ID.
191
+ * Once a value is retrieved, it updates the local `_metadata` property to ensure the value is current and consistent.
192
+ *
193
+ * @returns {string | undefined} The metadata of the peer if available, otherwise `undefined`.
194
+ *
195
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-metadata
196
+ */
110
197
  get metadata() {
111
198
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
112
199
  const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'metadata') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'metadata');
@@ -115,6 +202,19 @@ class HMSPeer {
115
202
  }
116
203
  return value ?? this._metadata;
117
204
  }
205
+
206
+ /**
207
+ * Retrieves the role of the peer.
208
+ *
209
+ * This getter method attempts to obtain the role assigned to the peer within the session. The role can define permissions and capabilities
210
+ * within the session context. It first tries to get this information from the HMS peers cache. If the role information is not available in the cache,
211
+ * it falls back to fetching the role directly from the native layer using the peer's ID. Once a value is retrieved, it updates the local `_role`
212
+ * property to ensure the value is current and consistent.
213
+ *
214
+ * @returns {HMSRole | undefined} The role of the peer if available, otherwise `undefined`.
215
+ *
216
+ * @see https://www.100ms.live/docs/get-started/v2/get-started/concepts/templates-and-roles
217
+ */
118
218
  get role() {
119
219
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
120
220
  const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'role') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'role');
@@ -123,6 +223,16 @@ class HMSPeer {
123
223
  }
124
224
  return value ?? this._role;
125
225
  }
226
+
227
+ /**
228
+ * Retrieves the audio track associated with the peer.
229
+ *
230
+ * This getter method attempts to obtain the audio track of the peer. It first tries to get this information from the HMS peers cache.
231
+ * If the audio track information is not available in the cache, it falls back to fetching the audio track directly from the native layer using the peer's ID.
232
+ * This allows for real-time access to the peer's audio track, which can be used for various audio-related functionalities within the application.
233
+ *
234
+ * @returns {HMSAudioTrack | undefined} The audio track of the peer if available, otherwise `undefined`.
235
+ */
126
236
  get audioTrack() {
127
237
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
128
238
  if (hmsPeersCache) {
@@ -130,6 +240,17 @@ class HMSPeer {
130
240
  }
131
241
  return (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'audioTrack');
132
242
  }
243
+
244
+ /**
245
+ * Retrieves the video track associated with the peer.
246
+ *
247
+ * This getter method attempts to obtain the video track of the peer. It first tries to get this information from the HMS peers cache.
248
+ * If the video track information is not available in the cache, it falls back to fetching the video track directly from the native layer using the peer's ID.
249
+ * This allows for real-time access to the peer's video track, which can be used for various video-related functionalities within the application.
250
+ *
251
+ * @returns {HMSVideoTrack | undefined} The video track of the peer if available, otherwise `undefined`.
252
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview
253
+ */
133
254
  get videoTrack() {
134
255
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
135
256
  if (hmsPeersCache) {
@@ -137,6 +258,19 @@ class HMSPeer {
137
258
  }
138
259
  return (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'videoTrack');
139
260
  }
261
+
262
+ /**
263
+ * Retrieves the auxiliary tracks associated with the peer.
264
+ *
265
+ * This getter method attempts to obtain the auxiliary tracks of the peer, which can include tracks like screen shares or additional media streams.
266
+ * It first tries to get this information from the HMS peers cache. If the auxiliary track information is not available in the cache,
267
+ * it falls back to fetching the auxiliary tracks directly from the native layer using the peer's ID.
268
+ * This allows for real-time access to the peer's auxiliary tracks, which can be used for various functionalities within the application,
269
+ * such as displaying a screen share or additional video feeds.
270
+ *
271
+ * @returns {HMSTrack[] | undefined} The auxiliary tracks of the peer if available, otherwise `undefined`.
272
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
273
+ */
140
274
  get auxiliaryTracks() {
141
275
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
142
276
  if (hmsPeersCache) {
@@ -144,6 +278,20 @@ class HMSPeer {
144
278
  }
145
279
  return (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'auxiliaryTracks');
146
280
  }
281
+
282
+ /**
283
+ * Retrieves the type of the peer.
284
+ *
285
+ * This getter method attempts to obtain the type of the peer, which can indicate whether the peer is a regular participant,
286
+ * a screen share, or another type defined within the `HMSPeerType` enum. It first tries to get this information from the HMS peers cache.
287
+ * If the type information is not available in the cache, it falls back to fetching the type directly from the native layer using the peer's ID.
288
+ * This ensures that the application has real-time access to the peer's type, which can be crucial for handling different peer types differently,
289
+ * such as displaying a screen share in a distinct manner. Once a value is retrieved, it updates the local `_type` property to ensure the value is current.
290
+ *
291
+ * @returns {HMSPeerType} The type of the peer, defaulting to the value stored in `_type` if the information is not available.
292
+ *
293
+ * @see https://www.100ms.live/docs/server-side/v2/how-to-guides/Session%20Initiation%20Protocol%20(SIP)/SIP-Interconnect
294
+ */
147
295
  get type() {
148
296
  const hmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)();
149
297
  const value = hmsPeersCache ? hmsPeersCache.getProperty(this.peerID, 'type') : (0, _HMSPeersCache.getPeerPropertyFromNative)(_HMSConstants.HMSConstants.DEFAULT_SDK_ID, this.peerID, 'type');
@@ -1 +1 @@
1
- {"version":3,"names":["_HMSPeersCache","require","_HMSConstants","_HMSPeerType","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSPeer","_updateName","_name","_updateIsLocal","_isLocal","_updateIsHandRaised","_isHandRaised","_updateCustomerUserID","_customerUserID","_updateMetadata","_metadata","_updateRole","_role","_updateType","_type","constructor","params","HMSPeerType","REGULAR","peerID","name","hmsPeersCache","getHmsPeersCache","getProperty","getPeerPropertyFromNative","HMSConstants","DEFAULT_SDK_ID","isLocal","isHandRaised","networkQuality","customerUserID","metadata","role","audioTrack","videoTrack","auxiliaryTracks","type","exports"],"sources":["HMSPeer.ts"],"sourcesContent":["import type { HMSAudioTrack } from './HMSAudioTrack';\nimport type { HMSNetworkQuality } from './HMSNetworkQuality';\nimport type { HMSRole } from './HMSRole';\nimport type { HMSTrack } from './HMSTrack';\nimport type { HMSVideoTrack } from './HMSVideoTrack';\nimport { getHmsPeersCache, getPeerPropertyFromNative } from './HMSPeersCache';\nimport { HMSConstants } from './HMSConstants';\nimport { HMSPeerType } from './HMSPeerType';\n\nexport class HMSPeer {\n peerID: string;\n private _name: string | undefined;\n private _isLocal: boolean | undefined;\n private _customerUserID: string | undefined;\n private _metadata: string | undefined;\n private _role: HMSRole | undefined;\n private _isHandRaised: boolean = false;\n private _type: HMSPeerType = HMSPeerType.REGULAR;\n\n private _updateName(value: string) {\n // If `_isLocal` is outdated, update it\n if (this._name !== value) {\n this._name = value;\n }\n }\n\n private _updateIsLocal(value: boolean) {\n // If `_isLocal` is outdated, update it\n if (this._isLocal !== value) {\n this._isLocal = value;\n }\n }\n\n private _updateIsHandRaised(value: boolean) {\n // If `_isHandRaised` is outdated, update it\n if (this._isHandRaised !== value) {\n this._isHandRaised = value;\n }\n }\n\n private _updateCustomerUserID(value: string) {\n // If `_customerUserID` is outdated, update it\n if (this._customerUserID !== value) {\n this._customerUserID = value;\n }\n }\n\n private _updateMetadata(value: string) {\n // If `_metadata` is outdated, update it\n if (this._metadata !== value) {\n this._metadata = value;\n }\n }\n\n private _updateRole(value: HMSRole) {\n // If `_role` is outdated, update it\n if (this._role !== value) {\n this._role = value;\n }\n }\n\n private _updateType(value: HMSPeerType) {\n // If `_type` is outdated, update it\n if (this._type !== value) {\n this._type = value;\n }\n }\n\n constructor(params: { peerID: string; name: string }) {\n this.peerID = params.peerID;\n this._name = params.name;\n }\n\n get name(): string | undefined {\n if (this._name) {\n return this._name;\n }\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'name')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'name'\n );\n\n if (typeof value === 'string') {\n this._updateName(value);\n }\n return value ?? this._name;\n }\n\n get isLocal(): boolean | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'isLocal')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'isLocal'\n );\n\n if (typeof value === 'boolean') {\n this._updateIsLocal(value);\n }\n return value ?? this._isLocal;\n }\n\n get isHandRaised(): boolean {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'isHandRaised')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'isHandRaised'\n );\n\n if (typeof value === 'boolean') {\n this._updateIsHandRaised(value);\n }\n return value ?? this._isHandRaised;\n }\n\n get networkQuality(): HMSNetworkQuality | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'networkQuality');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'networkQuality'\n );\n }\n\n get customerUserID(): string | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'customerUserID')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'customerUserID'\n );\n\n if (value) {\n this._updateCustomerUserID(value);\n }\n return value ?? this._customerUserID;\n }\n\n get metadata(): string | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'metadata')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'metadata'\n );\n\n if (value) {\n this._updateMetadata(value);\n }\n return value ?? this._metadata;\n }\n\n get role(): HMSRole | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'role')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'role'\n );\n\n if (value) {\n this._updateRole(value);\n }\n return value ?? this._role;\n }\n\n get audioTrack(): HMSAudioTrack | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'audioTrack');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'audioTrack'\n );\n }\n\n get videoTrack(): HMSVideoTrack | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'videoTrack');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'videoTrack'\n );\n }\n\n get auxiliaryTracks(): HMSTrack[] | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'auxiliaryTracks');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'auxiliaryTracks'\n );\n }\n\n get type(): HMSPeerType {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'type')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'type'\n );\n\n if (value) {\n this._updateType(value);\n }\n return value ?? this._type;\n }\n}\n"],"mappings":";;;;;;AAKA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAA4C,SAAAG,gBAAAC,CAAA,EAAAC,CA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;AACF;AAACuB,OAAA,CAAArC,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_HMSPeersCache","require","_HMSConstants","_HMSPeerType","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSPeer","_updateName","_name","_updateIsLocal","_isLocal","_updateIsHandRaised","_isHandRaised","_updateCustomerUserID","_customerUserID","_updateMetadata","_metadata","_updateRole","_role","_updateType","_type","constructor","params","HMSPeerType","REGULAR","peerID","name","hmsPeersCache","getHmsPeersCache","getProperty","getPeerPropertyFromNative","HMSConstants","DEFAULT_SDK_ID","isLocal","isHandRaised","networkQuality","customerUserID","metadata","role","audioTrack","videoTrack","auxiliaryTracks","type","exports"],"sources":["HMSPeer.ts"],"sourcesContent":["import type { HMSAudioTrack } from './HMSAudioTrack';\nimport type { HMSNetworkQuality } from './HMSNetworkQuality';\nimport type { HMSRole } from './HMSRole';\nimport type { HMSTrack } from './HMSTrack';\nimport type { HMSVideoTrack } from './HMSVideoTrack';\nimport { getHmsPeersCache, getPeerPropertyFromNative } from './HMSPeersCache';\nimport { HMSConstants } from './HMSConstants';\nimport { HMSPeerType } from './HMSPeerType';\n\n/**\n * Represents a peer in the HMS ecosystem.\n *\n * This class encapsulates the properties and state of a peer within a session, including their ID, name, role, and various status flags.\n *\n * @export\n * @class HMSPeer\n * @property {string} peerID - The unique identifier for the peer.\n * @property {string | undefined} _name - The name of the peer. Private access.\n * @property {boolean | undefined} _isLocal - Flag indicating whether the peer is the local user. Private access.\n * @property {string | undefined} _customerUserID - An optional custom user ID set by the application. Private access.\n * @property {string | undefined} _metadata - Optional metadata associated with the peer. Private access.\n * @property {HMSRole | undefined} _role - The role assigned to the peer within the session. Private access.\n * @property {boolean} _isHandRaised - Flag indicating whether the peer has raised their hand. Defaults to false. Private access.\n * @property {HMSPeerType} _type - The type of the peer, e.g., regular, screen share. Defaults to `HMSPeerType.REGULAR`. Private access.\n */\nexport class HMSPeer {\n peerID: string;\n private _name: string | undefined;\n private _isLocal: boolean | undefined;\n private _customerUserID: string | undefined;\n private _metadata: string | undefined;\n private _role: HMSRole | undefined;\n private _isHandRaised: boolean = false;\n private _type: HMSPeerType = HMSPeerType.REGULAR;\n\n private _updateName(value: string) {\n // If `_isLocal` is outdated, update it\n if (this._name !== value) {\n this._name = value;\n }\n }\n\n private _updateIsLocal(value: boolean) {\n // If `_isLocal` is outdated, update it\n if (this._isLocal !== value) {\n this._isLocal = value;\n }\n }\n\n private _updateIsHandRaised(value: boolean) {\n // If `_isHandRaised` is outdated, update it\n if (this._isHandRaised !== value) {\n this._isHandRaised = value;\n }\n }\n\n private _updateCustomerUserID(value: string) {\n // If `_customerUserID` is outdated, update it\n if (this._customerUserID !== value) {\n this._customerUserID = value;\n }\n }\n\n private _updateMetadata(value: string) {\n // If `_metadata` is outdated, update it\n if (this._metadata !== value) {\n this._metadata = value;\n }\n }\n\n private _updateRole(value: HMSRole) {\n // If `_role` is outdated, update it\n if (this._role !== value) {\n this._role = value;\n }\n }\n\n private _updateType(value: HMSPeerType) {\n // If `_type` is outdated, update it\n if (this._type !== value) {\n this._type = value;\n }\n }\n\n constructor(params: { peerID: string; name: string }) {\n this.peerID = params.peerID;\n this._name = params.name;\n }\n\n /**\n * Gets the name of the peer.\n *\n * This getter method retrieves the name of the peer. If the name has already been set locally, it returns that value.\n * Otherwise, it attempts to retrieve the name from the HMS peers cache. If the cache does not contain the name,\n * it falls back to fetching the name directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_name` property to ensure consistency.\n *\n * @returns {string | undefined} The name of the peer if available, otherwise `undefined`.\n */\n get name(): string | undefined {\n if (this._name) {\n return this._name;\n }\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'name')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'name'\n );\n\n if (typeof value === 'string') {\n this._updateName(value);\n }\n return value ?? this._name;\n }\n\n /**\n * Determines if the peer is the local user.\n *\n * This getter method checks if the peer is the local user by first attempting to retrieve the 'isLocal' property value from the HMS peers cache.\n * If the value is not found in the cache, it falls back to fetching the property directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_isLocal` property to ensure the value is current.\n *\n * @returns {boolean | undefined} True if the peer is the local user, false otherwise. Returns `undefined` if the information is not available.\n */\n get isLocal(): boolean | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'isLocal')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'isLocal'\n );\n\n if (typeof value === 'boolean') {\n this._updateIsLocal(value);\n }\n return value ?? this._isLocal;\n }\n\n /**\n * Checks if the peer has raised their hand.\n *\n * This getter method determines whether the peer has their hand raised in the session. It first attempts to retrieve the 'isHandRaised' property value\n * from the HMS peers cache. If the value is not found in the cache, it falls back to fetching the property directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_isHandRaised` property to ensure the value is current and consistent.\n *\n * @returns {boolean} True if the peer has their hand raised, false otherwise. Defaults to false if the information is not available.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room\n *\n */\n get isHandRaised(): boolean {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'isHandRaised')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'isHandRaised'\n );\n\n if (typeof value === 'boolean') {\n this._updateIsHandRaised(value);\n }\n return value ?? this._isHandRaised;\n }\n\n /**\n * Retrieves the network quality of the peer.\n *\n * This getter method attempts to obtain the network quality of the peer, which is an indicator of the current network conditions affecting the peer's connection.\n * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,\n * it falls back to fetching the network quality directly from the native layer using the peer's ID.\n * The network quality is represented by the `HMSNetworkQuality` type, which may include values such as 'good', 'poor', etc., depending on the implementation.\n *\n * @returns {HMSNetworkQuality | undefined} The network quality of the peer if available, otherwise `undefined`.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality\n */\n get networkQuality(): HMSNetworkQuality | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'networkQuality');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'networkQuality'\n );\n }\n\n /**\n * Retrieves the custom user ID of the peer.\n *\n * This getter method attempts to obtain the custom user ID of the peer, which is an optional identifier that can be set by the application.\n * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,\n * it falls back to fetching the custom user ID directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_customerUserID` property to ensure the value is current and consistent.\n *\n * @returns {string | undefined} The custom user ID of the peer if available, otherwise `undefined`.\n */\n get customerUserID(): string | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'customerUserID')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'customerUserID'\n );\n\n if (value) {\n this._updateCustomerUserID(value);\n }\n return value ?? this._customerUserID;\n }\n\n /**\n * Retrieves the metadata associated with the peer.\n *\n * This getter method attempts to obtain the metadata of the peer, which can include any additional information set by the application.\n * It first tries to get this information from the HMS peers cache. If the information is not available in the cache,\n * it falls back to fetching the metadata directly from the native layer using the peer's ID.\n * Once a value is retrieved, it updates the local `_metadata` property to ensure the value is current and consistent.\n *\n * @returns {string | undefined} The metadata of the peer if available, otherwise `undefined`.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-metadata\n */\n get metadata(): string | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'metadata')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'metadata'\n );\n\n if (value) {\n this._updateMetadata(value);\n }\n return value ?? this._metadata;\n }\n\n /**\n * Retrieves the role of the peer.\n *\n * This getter method attempts to obtain the role assigned to the peer within the session. The role can define permissions and capabilities\n * within the session context. It first tries to get this information from the HMS peers cache. If the role information is not available in the cache,\n * it falls back to fetching the role directly from the native layer using the peer's ID. Once a value is retrieved, it updates the local `_role`\n * property to ensure the value is current and consistent.\n *\n * @returns {HMSRole | undefined} The role of the peer if available, otherwise `undefined`.\n *\n * @see https://www.100ms.live/docs/get-started/v2/get-started/concepts/templates-and-roles\n */\n get role(): HMSRole | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'role')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'role'\n );\n\n if (value) {\n this._updateRole(value);\n }\n return value ?? this._role;\n }\n\n /**\n * Retrieves the audio track associated with the peer.\n *\n * This getter method attempts to obtain the audio track of the peer. It first tries to get this information from the HMS peers cache.\n * If the audio track information is not available in the cache, it falls back to fetching the audio track directly from the native layer using the peer's ID.\n * This allows for real-time access to the peer's audio track, which can be used for various audio-related functionalities within the application.\n *\n * @returns {HMSAudioTrack | undefined} The audio track of the peer if available, otherwise `undefined`.\n */\n get audioTrack(): HMSAudioTrack | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'audioTrack');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'audioTrack'\n );\n }\n\n /**\n * Retrieves the video track associated with the peer.\n *\n * This getter method attempts to obtain the video track of the peer. It first tries to get this information from the HMS peers cache.\n * If the video track information is not available in the cache, it falls back to fetching the video track directly from the native layer using the peer's ID.\n * This allows for real-time access to the peer's video track, which can be used for various video-related functionalities within the application.\n *\n * @returns {HMSVideoTrack | undefined} The video track of the peer if available, otherwise `undefined`.\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview\n */\n get videoTrack(): HMSVideoTrack | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'videoTrack');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'videoTrack'\n );\n }\n\n /**\n * Retrieves the auxiliary tracks associated with the peer.\n *\n * This getter method attempts to obtain the auxiliary tracks of the peer, which can include tracks like screen shares or additional media streams.\n * It first tries to get this information from the HMS peers cache. If the auxiliary track information is not available in the cache,\n * it falls back to fetching the auxiliary tracks directly from the native layer using the peer's ID.\n * This allows for real-time access to the peer's auxiliary tracks, which can be used for various functionalities within the application,\n * such as displaying a screen share or additional video feeds.\n *\n * @returns {HMSTrack[] | undefined} The auxiliary tracks of the peer if available, otherwise `undefined`.\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare\n */\n get auxiliaryTracks(): HMSTrack[] | undefined {\n const hmsPeersCache = getHmsPeersCache();\n\n if (hmsPeersCache) {\n return hmsPeersCache.getProperty(this.peerID, 'auxiliaryTracks');\n }\n\n return getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'auxiliaryTracks'\n );\n }\n\n /**\n * Retrieves the type of the peer.\n *\n * This getter method attempts to obtain the type of the peer, which can indicate whether the peer is a regular participant,\n * a screen share, or another type defined within the `HMSPeerType` enum. It first tries to get this information from the HMS peers cache.\n * If the type information is not available in the cache, it falls back to fetching the type directly from the native layer using the peer's ID.\n * This ensures that the application has real-time access to the peer's type, which can be crucial for handling different peer types differently,\n * such as displaying a screen share in a distinct manner. Once a value is retrieved, it updates the local `_type` property to ensure the value is current.\n *\n * @returns {HMSPeerType} The type of the peer, defaulting to the value stored in `_type` if the information is not available.\n *\n * @see https://www.100ms.live/docs/server-side/v2/how-to-guides/Session%20Initiation%20Protocol%20(SIP)/SIP-Interconnect\n */\n get type(): HMSPeerType {\n const hmsPeersCache = getHmsPeersCache();\n\n const value = hmsPeersCache\n ? hmsPeersCache.getProperty(this.peerID, 'type')\n : getPeerPropertyFromNative(\n HMSConstants.DEFAULT_SDK_ID,\n this.peerID,\n 'type'\n );\n\n if (value) {\n this._updateType(value);\n }\n return value ?? this._type;\n }\n}\n"],"mappings":";;;;;;AAKA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAA4C,SAAAG,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAA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Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HMSPeerTypeOrdinals = exports.HMSPeerType = void 0;
7
+ /**
8
+ * Enum for HMSPeerType.
9
+ *
10
+ * Defines the types of peers within the HMS (100ms) system. This enumeration is used to distinguish between different
11
+ * kinds of peers, such as SIP (Session Initiation Protocol) peers and regular peers. Each peer type has specific
12
+ * characteristics and roles within the video conferencing or communication context.
13
+ *
14
+ * @enum {string}
15
+ *
16
+ * @see https://www.100ms.live/docs/server-side/v2/how-to-guides/Session%20Initiation%20Protocol%20(SIP)/SIP-Interconnect
17
+ */
7
18
  let HMSPeerType = exports.HMSPeerType = /*#__PURE__*/function (HMSPeerType) {
8
19
  HMSPeerType["SIP"] = "SIP";
9
20
  HMSPeerType["REGULAR"] = "REGULAR";
10
21
  return HMSPeerType;
11
- }({});
22
+ }({}); // Represents a regular peer, such as a standard user in a video call.
12
23
  const HMSPeerTypeOrdinals = exports.HMSPeerTypeOrdinals = new Map([['0', HMSPeerType.SIP], ['1', HMSPeerType.REGULAR]]);
13
24
  //# sourceMappingURL=HMSPeerType.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["HMSPeerType","exports","HMSPeerTypeOrdinals","Map","SIP","REGULAR"],"sources":["HMSPeerType.ts"],"sourcesContent":["export enum HMSPeerType {\n SIP = 'SIP',\n REGULAR = 'REGULAR',\n}\n\nexport const HMSPeerTypeOrdinals = new Map([\n ['0', HMSPeerType.SIP],\n ['1', HMSPeerType.REGULAR],\n]);\n"],"mappings":";;;;;;IAAYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAKhB,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,IAAIC,GAAG,CAAC,CACzC,CAAC,GAAG,EAAEH,WAAW,CAACI,GAAG,CAAC,EACtB,CAAC,GAAG,EAAEJ,WAAW,CAACK,OAAO,CAAC,CAC3B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["HMSPeerType","exports","HMSPeerTypeOrdinals","Map","SIP","REGULAR"],"sources":["HMSPeerType.ts"],"sourcesContent":["/**\n * Enum for HMSPeerType.\n *\n * Defines the types of peers within the HMS (100ms) system. This enumeration is used to distinguish between different\n * kinds of peers, such as SIP (Session Initiation Protocol) peers and regular peers. Each peer type has specific\n * characteristics and roles within the video conferencing or communication context.\n *\n * @enum {string}\n *\n * @see https://www.100ms.live/docs/server-side/v2/how-to-guides/Session%20Initiation%20Protocol%20(SIP)/SIP-Interconnect\n */\nexport enum HMSPeerType {\n SIP = 'SIP', // Represents a SIP peer, typically used for integrating with traditional telephony systems.\n REGULAR = 'REGULAR', // Represents a regular peer, such as a standard user in a video call.\n}\n\nexport const HMSPeerTypeOrdinals = new Map([\n ['0', HMSPeerType.SIP],\n ['1', HMSPeerType.REGULAR],\n]);\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAWYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA,OAEA;AAGhB,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,IAAIC,GAAG,CAAC,CACzC,CAAC,GAAG,EAAEH,WAAW,CAACI,GAAG,CAAC,EACtB,CAAC,GAAG,EAAEJ,WAAW,CAACK,OAAO,CAAC,CAC3B,CAAC","ignoreList":[]}
@@ -7,6 +7,20 @@ exports.HMSRTMPConfig = void 0;
7
7
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
9
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ /**
11
+ * Configuration class for RTMP streaming in the HMS (100ms) system.
12
+ *
13
+ * This class encapsulates the settings required to configure RTMP (Real-Time Messaging Protocol) streaming for a meeting.
14
+ * It includes options for the meeting URL, RTMP URLs for streaming, whether recording should be enabled, and the video resolution for the stream.
15
+ *
16
+ * @param {Object} params - The constructor parameters.
17
+ * @param {string} [params.meetingURL] - The URL of the meeting to be streamed. Optional.
18
+ * @param {Array<string>} [params.rtmpURLs] - An array of RTMP URLs to which the meeting will be streamed. Optional.
19
+ * @param {boolean} params.record - Flag indicating whether the stream should be recorded.
20
+ * @param {HMSRtmpVideoResolution} [params.resolution] - The resolution of the video to be streamed. Optional.
21
+ *
22
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/recording
23
+ */
10
24
  class HMSRTMPConfig {
11
25
  constructor(params) {
12
26
  _defineProperty(this, "meetingURL", void 0);
@@ -1 +1 @@
1
- {"version":3,"names":["HMSRTMPConfig","constructor","params","_defineProperty","meetingURL","rtmpURLs","record","resolution","exports"],"sources":["HMSRTMPConfig.ts"],"sourcesContent":["import type { HMSRtmpVideoResolution } from './HMSRtmpVideoResolution';\n\nexport class HMSRTMPConfig {\n meetingURL?: string;\n rtmpURLs?: Array<string>;\n record: boolean;\n resolution?: HMSRtmpVideoResolution;\n\n constructor(params: {\n meetingURL?: string;\n rtmpURLs?: Array<string>;\n record: boolean;\n resolution?: HMSRtmpVideoResolution;\n }) {\n this.meetingURL = params.meetingURL;\n this.rtmpURLs = params.rtmpURLs;\n this.record = params.record;\n this.resolution = params.resolution;\n }\n}\n"],"mappings":";;;;;;;;;AAEO,MAAMA,aAAa,CAAC;EAMzBC,WAAWA,CAACC,MAKX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACD,IAAI,CAACC,UAAU,GAAGF,MAAM,CAACE,UAAU;IACnC,IAAI,CAACC,QAAQ,GAAGH,MAAM,CAACG,QAAQ;IAC/B,IAAI,CAACC,MAAM,GAAGJ,MAAM,CAACI,MAAM;IAC3B,IAAI,CAACC,UAAU,GAAGL,MAAM,CAACK,UAAU;EACrC;AACF;AAACC,OAAA,CAAAR,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSRTMPConfig","constructor","params","_defineProperty","meetingURL","rtmpURLs","record","resolution","exports"],"sources":["HMSRTMPConfig.ts"],"sourcesContent":["import type { HMSRtmpVideoResolution } from './HMSRtmpVideoResolution';\n\n/**\n * Configuration class for RTMP streaming in the HMS (100ms) system.\n *\n * This class encapsulates the settings required to configure RTMP (Real-Time Messaging Protocol) streaming for a meeting.\n * It includes options for the meeting URL, RTMP URLs for streaming, whether recording should be enabled, and the video resolution for the stream.\n *\n * @param {Object} params - The constructor parameters.\n * @param {string} [params.meetingURL] - The URL of the meeting to be streamed. Optional.\n * @param {Array<string>} [params.rtmpURLs] - An array of RTMP URLs to which the meeting will be streamed. Optional.\n * @param {boolean} params.record - Flag indicating whether the stream should be recorded.\n * @param {HMSRtmpVideoResolution} [params.resolution] - The resolution of the video to be streamed. Optional.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/recording\n */\nexport class HMSRTMPConfig {\n meetingURL?: string;\n rtmpURLs?: Array<string>;\n record: boolean;\n resolution?: HMSRtmpVideoResolution;\n\n constructor(params: {\n meetingURL?: string;\n rtmpURLs?: Array<string>;\n record: boolean;\n resolution?: HMSRtmpVideoResolution;\n }) {\n this.meetingURL = params.meetingURL;\n this.rtmpURLs = params.rtmpURLs;\n this.record = params.record;\n this.resolution = params.resolution;\n }\n}\n"],"mappings":";;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,aAAa,CAAC;EAMzBC,WAAWA,CAACC,MAKX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACD,IAAI,CAACC,UAAU,GAAGF,MAAM,CAACE,UAAU;IACnC,IAAI,CAACC,QAAQ,GAAGH,MAAM,CAACG,QAAQ;IAC/B,IAAI,CAACC,MAAM,GAAGJ,MAAM,CAACI,MAAM;IAC3B,IAAI,CAACC,UAAU,GAAGL,MAAM,CAACK,UAAU;EACrC;AACF;AAACC,OAAA,CAAAR,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -7,6 +7,23 @@ exports.HMSRole = void 0;
7
7
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
9
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ /**
11
+ * Represents a role within the HMS ecosystem.
12
+ *
13
+ * A role defines the capabilities and permissions a user has in a session, such as publishing or subscribing to streams,
14
+ * and the priority of the user in the session. This class encapsulates the properties of a role, including its name,
15
+ * publishing settings, subscribing settings, permissions, and priority.
16
+ *
17
+ * @class HMSRole
18
+ * @property {string} [name] - The name of the role.
19
+ * @property {HMSPublishSettings} [publishSettings] - Settings related to publishing streams for this role.
20
+ * @property {HMSSubscribeSettings} [subscribeSettings] - Settings related to subscribing to streams for this role.
21
+ * @property {HMSPermissions} [permissions] - Permissions granted to this role.
22
+ * @property {number} [priority] - The priority of the role, determining its precedence in the session.
23
+ *
24
+ * @see https://www.100ms.live/docs/get-started/v2/get-started/concepts/templates-and-roles
25
+ *
26
+ */
10
27
  class HMSRole {
11
28
  constructor(params) {
12
29
  _defineProperty(this, "name", void 0);
@@ -1 +1 @@
1
- {"version":3,"names":["HMSRole","constructor","params","_defineProperty","name","priority","permissions","publishSettings","subscribeSettings","exports"],"sources":["HMSRole.ts"],"sourcesContent":["import type { HMSPermissions } from './HMSPermissions';\nimport type { HMSPublishSettings } from './HMSPublishSettings';\nimport type { HMSSubscribeSettings } from './HMSSubscribeSettings';\n\nexport class HMSRole {\n name?: string;\n publishSettings?: HMSPublishSettings;\n subscribeSettings?: HMSSubscribeSettings;\n permissions?: HMSPermissions;\n priority?: number;\n\n constructor(params?: {\n name?: string;\n priority?: number;\n permissions?: HMSPermissions;\n publishSettings?: HMSPublishSettings;\n subscribeSettings?: HMSSubscribeSettings;\n }) {\n if (params) {\n this.name = params.name;\n this.priority = params.priority;\n this.permissions = params.permissions;\n this.publishSettings = params.publishSettings;\n this.subscribeSettings = params.subscribeSettings;\n }\n }\n}\n"],"mappings":";;;;;;;;;AAIO,MAAMA,OAAO,CAAC;EAOnBC,WAAWA,CAACC,MAMX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACD,IAAID,MAAM,EAAE;MACV,IAAI,CAACE,IAAI,GAAGF,MAAM,CAACE,IAAI;MACvB,IAAI,CAACC,QAAQ,GAAGH,MAAM,CAACG,QAAQ;MAC/B,IAAI,CAACC,WAAW,GAAGJ,MAAM,CAACI,WAAW;MACrC,IAAI,CAACC,eAAe,GAAGL,MAAM,CAACK,eAAe;MAC7C,IAAI,CAACC,iBAAiB,GAAGN,MAAM,CAACM,iBAAiB;IACnD;EACF;AACF;AAACC,OAAA,CAAAT,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSRole","constructor","params","_defineProperty","name","priority","permissions","publishSettings","subscribeSettings","exports"],"sources":["HMSRole.ts"],"sourcesContent":["import type { HMSPermissions } from './HMSPermissions';\nimport type { HMSPublishSettings } from './HMSPublishSettings';\nimport type { HMSSubscribeSettings } from './HMSSubscribeSettings';\n\n/**\n * Represents a role within the HMS ecosystem.\n *\n * A role defines the capabilities and permissions a user has in a session, such as publishing or subscribing to streams,\n * and the priority of the user in the session. This class encapsulates the properties of a role, including its name,\n * publishing settings, subscribing settings, permissions, and priority.\n *\n * @class HMSRole\n * @property {string} [name] - The name of the role.\n * @property {HMSPublishSettings} [publishSettings] - Settings related to publishing streams for this role.\n * @property {HMSSubscribeSettings} [subscribeSettings] - Settings related to subscribing to streams for this role.\n * @property {HMSPermissions} [permissions] - Permissions granted to this role.\n * @property {number} [priority] - The priority of the role, determining its precedence in the session.\n *\n * @see https://www.100ms.live/docs/get-started/v2/get-started/concepts/templates-and-roles\n *\n */\nexport class HMSRole {\n name?: string;\n publishSettings?: HMSPublishSettings;\n subscribeSettings?: HMSSubscribeSettings;\n permissions?: HMSPermissions;\n priority?: number;\n\n constructor(params?: {\n name?: string;\n priority?: number;\n permissions?: HMSPermissions;\n publishSettings?: HMSPublishSettings;\n subscribeSettings?: HMSSubscribeSettings;\n }) {\n if (params) {\n this.name = params.name;\n this.priority = params.priority;\n this.permissions = params.permissions;\n this.publishSettings = params.publishSettings;\n this.subscribeSettings = params.subscribeSettings;\n }\n }\n}\n"],"mappings":";;;;;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,OAAO,CAAC;EAOnBC,WAAWA,CAACC,MAMX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACD,IAAID,MAAM,EAAE;MACV,IAAI,CAACE,IAAI,GAAGF,MAAM,CAACE,IAAI;MACvB,IAAI,CAACC,QAAQ,GAAGH,MAAM,CAACG,QAAQ;MAC/B,IAAI,CAACC,WAAW,GAAGJ,MAAM,CAACI,WAAW;MACrC,IAAI,CAACC,eAAe,GAAGL,MAAM,CAACK,eAAe;MAC7C,IAAI,CAACC,iBAAiB,GAAGN,MAAM,CAACM,iBAAiB;IACnD;EACF;AACF;AAACC,OAAA,CAAAT,OAAA,GAAAA,OAAA","ignoreList":[]}