@100mslive/react-native-hms 1.10.7 → 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 (197) hide show
  1. package/README.md +6 -5
  2. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +47 -8
  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/HMSConstants.swift +1 -0
  6. package/ios/HMSManager.m +39 -0
  7. package/ios/HMSManager.swift +116 -1
  8. package/ios/HMSRNSDK.swift +276 -2
  9. package/ios/PIPMode/HMSPipModel.swift +18 -0
  10. package/ios/PIPMode/HMSPipView.swift +36 -0
  11. package/ios/PIPMode/HMSSampleBufferSwiftUIView.swift +45 -0
  12. package/lib/commonjs/classes/HMSAudioDevice.js +9 -0
  13. package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
  14. package/lib/commonjs/classes/HMSAudioMixingMode.js +11 -0
  15. package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
  16. package/lib/commonjs/classes/HMSAudioTrack.js +9 -0
  17. package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
  18. package/lib/commonjs/classes/HMSCameraFacing.js +9 -0
  19. package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
  20. package/lib/commonjs/classes/HMSConfig.js +27 -0
  21. package/lib/commonjs/classes/HMSConfig.js.map +1 -1
  22. package/lib/commonjs/classes/HMSException.js +18 -0
  23. package/lib/commonjs/classes/HMSException.js.map +1 -1
  24. package/lib/commonjs/classes/HMSHLSTimedMetadata.js.map +1 -1
  25. package/lib/commonjs/classes/HMSIOSAudioMode.js +15 -0
  26. package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
  27. package/lib/commonjs/classes/HMSLogAlarmManager.js +12 -0
  28. package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
  29. package/lib/commonjs/classes/HMSLogLevel.js +12 -0
  30. package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
  31. package/lib/commonjs/classes/HMSLogSettings.js +14 -0
  32. package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
  33. package/lib/commonjs/classes/HMSNetworkQuality.js +11 -0
  34. package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
  35. package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +40 -10
  36. package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -1
  37. package/lib/commonjs/classes/HMSPIPConfig.js +4 -0
  38. package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -1
  39. package/lib/commonjs/classes/HMSPIPListenerActions.js +9 -0
  40. package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
  41. package/lib/commonjs/classes/HMSPeer.js +148 -0
  42. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  43. package/lib/commonjs/classes/HMSPeerType.js +12 -1
  44. package/lib/commonjs/classes/HMSPeerType.js.map +1 -1
  45. package/lib/commonjs/classes/HMSRTMPConfig.js +14 -0
  46. package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
  47. package/lib/commonjs/classes/HMSRole.js +17 -0
  48. package/lib/commonjs/classes/HMSRole.js.map +1 -1
  49. package/lib/commonjs/classes/HMSRtmpVideoResolution.js +13 -0
  50. package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
  51. package/lib/commonjs/classes/HMSSDK.js +1153 -233
  52. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  53. package/lib/commonjs/classes/HMSSessionStore.js +14 -15
  54. package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
  55. package/lib/commonjs/classes/HMSTrack.js +13 -0
  56. package/lib/commonjs/classes/HMSTrack.js.map +1 -1
  57. package/lib/commonjs/classes/HMSTrackSettings.js +10 -0
  58. package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
  59. package/lib/commonjs/classes/HMSTrackSettingsInitState.js +9 -0
  60. package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
  61. package/lib/commonjs/classes/HMSTrackSource.js +10 -0
  62. package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
  63. package/lib/commonjs/classes/HMSTrackType.js +7 -0
  64. package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
  65. package/lib/commonjs/classes/HMSUpdateListenerActions.js +42 -3
  66. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  67. package/lib/commonjs/classes/HMSVideoTrack.js +17 -0
  68. package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
  69. package/lib/commonjs/classes/HMSVideoTrackSettings.js +12 -2
  70. package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
  71. package/lib/commonjs/classes/HmsView.js +42 -0
  72. package/lib/commonjs/classes/HmsView.js.map +1 -1
  73. package/lib/module/classes/HMSAudioDevice.js +9 -0
  74. package/lib/module/classes/HMSAudioDevice.js.map +1 -1
  75. package/lib/module/classes/HMSAudioMixingMode.js +11 -0
  76. package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
  77. package/lib/module/classes/HMSAudioTrack.js +9 -0
  78. package/lib/module/classes/HMSAudioTrack.js.map +1 -1
  79. package/lib/module/classes/HMSCameraFacing.js +9 -0
  80. package/lib/module/classes/HMSCameraFacing.js.map +1 -1
  81. package/lib/module/classes/HMSConfig.js +27 -0
  82. package/lib/module/classes/HMSConfig.js.map +1 -1
  83. package/lib/module/classes/HMSException.js +18 -0
  84. package/lib/module/classes/HMSException.js.map +1 -1
  85. package/lib/module/classes/HMSHLSTimedMetadata.js.map +1 -1
  86. package/lib/module/classes/HMSIOSAudioMode.js +15 -0
  87. package/lib/module/classes/HMSIOSAudioMode.js.map +1 -1
  88. package/lib/module/classes/HMSLogAlarmManager.js +12 -0
  89. package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
  90. package/lib/module/classes/HMSLogLevel.js +12 -0
  91. package/lib/module/classes/HMSLogLevel.js.map +1 -1
  92. package/lib/module/classes/HMSLogSettings.js +14 -0
  93. package/lib/module/classes/HMSLogSettings.js.map +1 -1
  94. package/lib/module/classes/HMSNetworkQuality.js +11 -0
  95. package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
  96. package/lib/module/classes/HMSNoiseCancellationPlugin.js +40 -10
  97. package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -1
  98. package/lib/module/classes/HMSPIPConfig.js +1 -1
  99. package/lib/module/classes/HMSPIPConfig.js.map +1 -1
  100. package/lib/module/classes/HMSPIPListenerActions.js +9 -0
  101. package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
  102. package/lib/module/classes/HMSPeer.js +149 -0
  103. package/lib/module/classes/HMSPeer.js.map +1 -1
  104. package/lib/module/classes/HMSPeerType.js +12 -1
  105. package/lib/module/classes/HMSPeerType.js.map +1 -1
  106. package/lib/module/classes/HMSRTMPConfig.js +14 -0
  107. package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
  108. package/lib/module/classes/HMSRole.js +17 -0
  109. package/lib/module/classes/HMSRole.js.map +1 -1
  110. package/lib/module/classes/HMSRtmpVideoResolution.js +13 -0
  111. package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
  112. package/lib/module/classes/HMSSDK.js +1153 -233
  113. package/lib/module/classes/HMSSDK.js.map +1 -1
  114. package/lib/module/classes/HMSSessionStore.js +14 -15
  115. package/lib/module/classes/HMSSessionStore.js.map +1 -1
  116. package/lib/module/classes/HMSTrack.js +13 -0
  117. package/lib/module/classes/HMSTrack.js.map +1 -1
  118. package/lib/module/classes/HMSTrackSettings.js +10 -0
  119. package/lib/module/classes/HMSTrackSettings.js.map +1 -1
  120. package/lib/module/classes/HMSTrackSettingsInitState.js +9 -0
  121. package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
  122. package/lib/module/classes/HMSTrackSource.js +10 -0
  123. package/lib/module/classes/HMSTrackSource.js.map +1 -1
  124. package/lib/module/classes/HMSTrackType.js +7 -0
  125. package/lib/module/classes/HMSTrackType.js.map +1 -1
  126. package/lib/module/classes/HMSUpdateListenerActions.js +42 -3
  127. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  128. package/lib/module/classes/HMSVideoTrack.js +17 -0
  129. package/lib/module/classes/HMSVideoTrack.js.map +1 -1
  130. package/lib/module/classes/HMSVideoTrackSettings.js +12 -2
  131. package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
  132. package/lib/module/classes/HmsView.js +43 -0
  133. package/lib/module/classes/HmsView.js.map +1 -1
  134. package/lib/typescript/classes/HMSAudioDevice.d.ts +14 -0
  135. package/lib/typescript/classes/HMSAudioMixingMode.d.ts +11 -0
  136. package/lib/typescript/classes/HMSAudioTrack.d.ts +9 -0
  137. package/lib/typescript/classes/HMSCameraFacing.d.ts +11 -0
  138. package/lib/typescript/classes/HMSConfig.d.ts +27 -0
  139. package/lib/typescript/classes/HMSException.d.ts +18 -0
  140. package/lib/typescript/classes/HMSHLSTimedMetadata.d.ts +12 -0
  141. package/lib/typescript/classes/HMSIOSAudioMode.d.ts +15 -0
  142. package/lib/typescript/classes/HMSLogAlarmManager.d.ts +12 -0
  143. package/lib/typescript/classes/HMSLogLevel.d.ts +12 -0
  144. package/lib/typescript/classes/HMSLogSettings.d.ts +14 -0
  145. package/lib/typescript/classes/HMSNetworkQuality.d.ts +11 -0
  146. package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +36 -6
  147. package/lib/typescript/classes/HMSPIPConfig.d.ts +40 -0
  148. package/lib/typescript/classes/HMSPIPListenerActions.d.ts +17 -0
  149. package/lib/typescript/classes/HMSPeer.d.ts +137 -0
  150. package/lib/typescript/classes/HMSPeerType.d.ts +11 -0
  151. package/lib/typescript/classes/HMSRTMPConfig.d.ts +14 -0
  152. package/lib/typescript/classes/HMSRole.d.ts +17 -0
  153. package/lib/typescript/classes/HMSRtmpVideoResolution.d.ts +13 -0
  154. package/lib/typescript/classes/HMSSDK.d.ts +1083 -235
  155. package/lib/typescript/classes/HMSSessionStore.d.ts +14 -15
  156. package/lib/typescript/classes/HMSTrack.d.ts +13 -0
  157. package/lib/typescript/classes/HMSTrackSettings.d.ts +10 -0
  158. package/lib/typescript/classes/HMSTrackSettingsInitState.d.ts +11 -0
  159. package/lib/typescript/classes/HMSTrackSource.d.ts +10 -0
  160. package/lib/typescript/classes/HMSTrackType.d.ts +7 -0
  161. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +290 -4
  162. package/lib/typescript/classes/HMSVideoTrack.d.ts +17 -0
  163. package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +12 -2
  164. package/lib/typescript/classes/HmsView.d.ts +16 -0
  165. package/package.json +1 -1
  166. package/sdk-versions.json +2 -2
  167. package/src/classes/HMSAudioDevice.ts +18 -0
  168. package/src/classes/HMSAudioMixingMode.ts +11 -0
  169. package/src/classes/HMSAudioTrack.ts +9 -0
  170. package/src/classes/HMSCameraFacing.ts +11 -0
  171. package/src/classes/HMSConfig.ts +27 -0
  172. package/src/classes/HMSException.ts +18 -0
  173. package/src/classes/HMSHLSTimedMetadata.ts +12 -0
  174. package/src/classes/HMSIOSAudioMode.ts +15 -0
  175. package/src/classes/HMSLogAlarmManager.ts +12 -0
  176. package/src/classes/HMSLogLevel.ts +12 -0
  177. package/src/classes/HMSLogSettings.ts +14 -0
  178. package/src/classes/HMSNetworkQuality.ts +11 -0
  179. package/src/classes/HMSNoiseCancellationPlugin.ts +41 -10
  180. package/src/classes/HMSPIPConfig.ts +47 -0
  181. package/src/classes/HMSPIPListenerActions.ts +18 -0
  182. package/src/classes/HMSPeer.ts +137 -0
  183. package/src/classes/HMSPeerType.ts +13 -2
  184. package/src/classes/HMSRTMPConfig.ts +14 -0
  185. package/src/classes/HMSRole.ts +17 -0
  186. package/src/classes/HMSRtmpVideoResolution.ts +13 -0
  187. package/src/classes/HMSSDK.tsx +1211 -269
  188. package/src/classes/HMSSessionStore.ts +14 -15
  189. package/src/classes/HMSTrack.ts +13 -0
  190. package/src/classes/HMSTrackSettings.ts +10 -0
  191. package/src/classes/HMSTrackSettingsInitState.ts +11 -0
  192. package/src/classes/HMSTrackSource.ts +10 -0
  193. package/src/classes/HMSTrackType.ts +7 -0
  194. package/src/classes/HMSUpdateListenerActions.ts +312 -3
  195. package/src/classes/HMSVideoTrack.ts +17 -0
  196. package/src/classes/HMSVideoTrackSettings.ts +12 -2
  197. package/src/classes/HmsView.tsx +39 -0
@@ -15,9 +15,9 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
15
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
16
16
  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); }
17
17
  /**
18
- * Session store is a shared realtime key-value store that is accessible by everyone in the room.
18
+ * Session store is a shared realtime key-value store that is accessible by all Peers in a Room.
19
19
  * It can be utilized to implement features such as pinned text, spotlight (which brings a particular
20
- * peer to the center stage for everyone in the room) and more.
20
+ * peer to the center stage for everyone in the room) and more, enhancing interactive experiences.
21
21
  *
22
22
  * To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`
23
23
  * event on the `HMSSDK` instance
@@ -40,9 +40,9 @@ class HMSSessionStore {
40
40
  * Once a value is assigned, it will be available for other peers in the room
41
41
  * who are listening for changes in value for that specific key.
42
42
  *
43
- * @param {JsonValue} value
44
- * @param {string} key
45
- * @returns {Promise}
43
+ * @param {JsonValue} value - The value to set, which can be any JSON-compatible type.
44
+ * @param {string} key - The key under which to store the value.
45
+ * @returns {Promise} A promise that resolves when the operation is complete.
46
46
  */
47
47
  async set(value, key) {
48
48
  const data = await _HMSManagerModule.default.setSessionMetadataForKey({
@@ -54,14 +54,13 @@ class HMSSessionStore {
54
54
  }
55
55
 
56
56
  /**
57
- * This method returns the value of any specified key on session store.
58
- * Note that you will not get updates for any change in value of the specified key,
59
- * It returns the latest value at the time it was called.
57
+ * Retrieves the value for a given key from the session store. This method does not subscribe
58
+ * to changes; it only returns the current value at the time of the call.
60
59
  *
61
60
  * To listen to value change updates use `addKeyChangeListener` method instead.
62
61
  *
63
- * @param {string} key
64
- * @returns {Promise}
62
+ * @param {string} key - The key whose value is to be retrieved.
63
+ * @returns {Promise} A promise that resolves with the value of the key.
65
64
  */
66
65
  async get(key) {
67
66
  const data = await _HMSManagerModule.default.getSessionMetadataForKey({
@@ -72,12 +71,12 @@ class HMSSessionStore {
72
71
  }
73
72
 
74
73
  /**
75
- * This method registers a callback function for listening to value changes of a particular key.
76
- * Registered Callback function will be called initially with latest value and whenever the value updates
74
+ * Registers a callback to listen for changes to specified keys in the session store.
75
+ * The callback is called with the initial value and again whenever any value changes.
77
76
  *
78
- * @param {string[]} forKeys
79
- * @param {Function} callback
80
- * @returns {Object} subscription object
77
+ * @param {string[]} forKeys - An array of keys to listen for changes on.
78
+ * @param {Function} callback - The function to call when a value changes.
79
+ * @returns {Object} An object with a `remove` method to unregister the listener.
81
80
  */
82
81
  addKeyChangeListener(forKeys, callback) {
83
82
  // Add Native Device Event Emitter if it is not already added
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_HMSManagerModule","_interopRequireDefault","_HMSConstants","_HMSLogger","_HMSUpdateListenerActions","_utils","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSSessionStore","constructor","set","key","data","HMSManager","setSessionMetadataForKey","id","HMSConstants","DEFAULT_SDK_ID","get","getSessionMetadataForKey","addKeyChangeListener","forKeys","callback","_deviceEventEmitterSubscription","DeviceEventEmitter","addListener","HMSUpdateListenerActions","ON_SESSION_STORE_CHANGED","_deviceEventEmitterListener","bind","_eventEmitter","EventEmitter","uniqueId","join","Date","now","toString","eventEmitter","subscriptions","map","cleanupHandler","_cleanup","keys","catch","err","_addedKeyChangeListenerCount","remove","subscriptionsToRemove","length","context","forEach","subscription","removeKeyChangeListener","error","logger","getLogger","verbose","removeListener","undefined","_getLogger","_this$_eventEmitter","emit","exports"],"sources":["HMSSessionStore.ts"],"sourcesContent":["import { DeviceEventEmitter } from 'react-native';\nimport type { EmitterSubscription as RNEmitterSubscription } from 'react-native';\n\nimport HMSManager from '../modules/HMSManagerModule';\n\nimport { HMSConstants } from './HMSConstants';\nimport { getLogger } from './HMSLogger';\nimport { HMSUpdateListenerActions } from './HMSUpdateListenerActions';\nimport { EventEmitter } from '../utils';\nimport type { EmitterSubscription } from '../utils';\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonMap = {\n [key: string]: JsonPrimitive | JsonMap | JsonArray;\n};\nexport type JsonArray = Array<JsonPrimitive | JsonMap | JsonArray>;\nexport type JsonValue = JsonPrimitive | JsonMap | JsonArray;\n\n/**\n * Session store is a shared realtime key-value store that is accessible by everyone in the room.\n * It can be utilized to implement features such as pinned text, spotlight (which brings a particular\n * peer to the center stage for everyone in the room) and more.\n *\n * To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`\n * event on the `HMSSDK` instance\n *\n * For example:\n * ```\n * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);\n * ```\n *\n * Checkout Session Store docs fore more details ${@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store}\n */\nexport class HMSSessionStore {\n private _deviceEventEmitterSubscription?: RNEmitterSubscription;\n private _eventEmitter?: EventEmitter;\n private _addedKeyChangeListenerCount = 0;\n\n /**\n * This method sets a value for a specific key on session store.\n * Once a value is assigned, it will be available for other peers in the room\n * who are listening for changes in value for that specific key.\n *\n * @param {JsonValue} value\n * @param {string} key\n * @returns {Promise}\n */\n async set(value: JsonValue, key: string) {\n const data: { success: true } = await HMSManager.setSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n value,\n });\n return data;\n }\n\n /**\n * This method returns the value of any specified key on session store.\n * Note that you will not get updates for any change in value of the specified key,\n * It returns the latest value at the time it was called.\n *\n * To listen to value change updates use `addKeyChangeListener` method instead.\n *\n * @param {string} key\n * @returns {Promise}\n */\n async get(key: string) {\n const data: JsonValue = await HMSManager.getSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n });\n return data;\n }\n\n /**\n * This method registers a callback function for listening to value changes of a particular key.\n * Registered Callback function will be called initially with latest value and whenever the value updates\n *\n * @param {string[]} forKeys\n * @param {Function} callback\n * @returns {Object} subscription object\n */\n addKeyChangeListener<T extends string[]>(\n forKeys: T,\n callback: (\n error: string | null,\n data: { key: T[number]; value: JsonValue } | null\n ) => void\n ) {\n // Add Native Device Event Emitter if it is not already added\n if (!this._deviceEventEmitterSubscription) {\n this._deviceEventEmitterSubscription = DeviceEventEmitter.addListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener.bind(this)\n );\n }\n\n // Create JS side EventEmitter\n if (!this._eventEmitter) {\n this._eventEmitter = new EventEmitter();\n }\n\n // Unique Identifier for adding native event listener\n const uniqueId = forKeys.join('') + '_' + Date.now().toString();\n\n const eventEmitter = this._eventEmitter;\n\n // Add listeners on eventEmitter for each key\n const subscriptions = forKeys.map((key) =>\n eventEmitter.addListener(key, callback, { uniqueId })\n );\n\n //\n let cleanupHandler: (() => void) | null = () => {\n this._cleanup(subscriptions);\n };\n\n // Adding 'KeyChangeListener' on native side\n HMSManager.addKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n keys: forKeys,\n uniqueId,\n })\n // Adding 'KeyChangeListener' fails on native side\n .catch((err: any) => {\n if (typeof cleanupHandler === 'function') {\n callback(err, null);\n cleanupHandler();\n cleanupHandler = null;\n }\n });\n\n this._addedKeyChangeListenerCount += 1;\n\n return {\n remove: () => {\n if (typeof cleanupHandler === 'function') {\n cleanupHandler();\n cleanupHandler = null;\n }\n },\n };\n }\n\n private _cleanup(subscriptionsToRemove: EmitterSubscription[]) {\n // Extracting `uniqueId` from first subscription (all subscriptions have same uniqueId)\n // this `uniqueId` will be used to remove 'KeyChangeListener' from native side\n const uniqueId =\n subscriptionsToRemove.length > 0\n ? (subscriptionsToRemove[0]!.context as { uniqueId: string }).uniqueId\n : null;\n\n // Removing required subscriptions from 'eventEmitter'\n subscriptionsToRemove.forEach((subscription) => subscription.remove());\n\n // Removing 'KeyChangeListener' from native side\n HMSManager.removeKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n uniqueId,\n }).catch((error: any) => {\n const logger = getLogger();\n logger?.verbose(\n \"Error while removing key change listener, Listener didn't get registerred at first place or was already removed\",\n error\n );\n });\n\n this._addedKeyChangeListenerCount -= 1;\n\n if (this._addedKeyChangeListenerCount <= 0) {\n this._addedKeyChangeListenerCount = 0;\n if (\n this._deviceEventEmitterSubscription &&\n typeof this._deviceEventEmitterSubscription.remove === 'function'\n ) {\n this._deviceEventEmitterSubscription.remove();\n } else {\n DeviceEventEmitter.removeListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener\n );\n }\n\n this._deviceEventEmitterSubscription = undefined;\n\n this._eventEmitter = undefined;\n }\n }\n\n private _deviceEventEmitterListener(data: {\n id: string;\n key: string;\n value: JsonValue;\n }) {\n // if id is different from default sdk_id, return early\n if (data.id !== HMSConstants.DEFAULT_SDK_ID) {\n return;\n }\n\n // emit event for the key\n getLogger()?.verbose('#Listener ON_SESSION_STORE_CHANGED event: ', data);\n\n this._eventEmitter?.emit(data.key, null, data);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,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,+BAA+B,CAACuB,MAAM,KAAK,UAAU,EACjE;QACA,IAAI,CAACvB,+BAA+B,CAACuB,MAAM,CAAC,CAAC;MAC/C,CAAC,MAAM;QACLtB,+BAAkB,CAACiC,cAAc,CAC/B/B,kDAAwB,CAACC,wBAAwB,EACjD,IAAI,CAACC,2BACP,CAAC;MACH;MAEA,IAAI,CAACL,+BAA+B,GAAGmC,SAAS;MAEhD,IAAI,CAAC5B,aAAa,GAAG4B,SAAS;IAChC;EACF;EAEQ9B,2BAA2BA,CAAChB,IAInC,EAAE;IAAA,IAAA+C,UAAA,EAAAC,mBAAA;IACD;IACA,IAAIhD,IAAI,CAACG,EAAE,KAAKC,0BAAY,CAACC,cAAc,EAAE;MAC3C;IACF;;IAEA;IACA,CAAA0C,UAAA,OAAAJ,oBAAS,EAAC,CAAC,cAAAI,UAAA,eAAXA,UAAA,CAAaH,OAAO,CAAC,4CAA4C,EAAE5C,IAAI,CAAC;IAExE,CAAAgD,mBAAA,OAAI,CAAC9B,aAAa,cAAA8B,mBAAA,eAAlBA,mBAAA,CAAoBC,IAAI,CAACjD,IAAI,CAACD,GAAG,EAAE,IAAI,EAAEC,IAAI,CAAC;EAChD;AACF;AAACkD,OAAA,CAAAtD,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_HMSManagerModule","_interopRequireDefault","_HMSConstants","_HMSLogger","_HMSUpdateListenerActions","_utils","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSSessionStore","constructor","set","key","data","HMSManager","setSessionMetadataForKey","id","HMSConstants","DEFAULT_SDK_ID","get","getSessionMetadataForKey","addKeyChangeListener","forKeys","callback","_deviceEventEmitterSubscription","DeviceEventEmitter","addListener","HMSUpdateListenerActions","ON_SESSION_STORE_CHANGED","_deviceEventEmitterListener","bind","_eventEmitter","EventEmitter","uniqueId","join","Date","now","toString","eventEmitter","subscriptions","map","cleanupHandler","_cleanup","keys","catch","err","_addedKeyChangeListenerCount","remove","subscriptionsToRemove","length","context","forEach","subscription","removeKeyChangeListener","error","logger","getLogger","verbose","removeListener","undefined","_getLogger","_this$_eventEmitter","emit","exports"],"sources":["HMSSessionStore.ts"],"sourcesContent":["import { DeviceEventEmitter } from 'react-native';\nimport type { EmitterSubscription as RNEmitterSubscription } from 'react-native';\n\nimport HMSManager from '../modules/HMSManagerModule';\n\nimport { HMSConstants } from './HMSConstants';\nimport { getLogger } from './HMSLogger';\nimport { HMSUpdateListenerActions } from './HMSUpdateListenerActions';\nimport { EventEmitter } from '../utils';\nimport type { EmitterSubscription } from '../utils';\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonMap = {\n [key: string]: JsonPrimitive | JsonMap | JsonArray;\n};\nexport type JsonArray = Array<JsonPrimitive | JsonMap | JsonArray>;\nexport type JsonValue = JsonPrimitive | JsonMap | JsonArray;\n\n/**\n * Session store is a shared realtime key-value store that is accessible by all Peers in a Room.\n * It can be utilized to implement features such as pinned text, spotlight (which brings a particular\n * peer to the center stage for everyone in the room) and more, enhancing interactive experiences.\n *\n * To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`\n * event on the `HMSSDK` instance\n *\n * For example:\n * ```\n * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);\n * ```\n *\n * Checkout Session Store docs fore more details ${@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store}\n */\nexport class HMSSessionStore {\n private _deviceEventEmitterSubscription?: RNEmitterSubscription;\n private _eventEmitter?: EventEmitter;\n private _addedKeyChangeListenerCount = 0;\n\n /**\n * This method sets a value for a specific key on session store.\n * Once a value is assigned, it will be available for other peers in the room\n * who are listening for changes in value for that specific key.\n *\n * @param {JsonValue} value - The value to set, which can be any JSON-compatible type.\n * @param {string} key - The key under which to store the value.\n * @returns {Promise} A promise that resolves when the operation is complete.\n */\n async set(value: JsonValue, key: string) {\n const data: { success: true } = await HMSManager.setSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n value,\n });\n return data;\n }\n\n /**\n * Retrieves the value for a given key from the session store. This method does not subscribe\n * to changes; it only returns the current value at the time of the call.\n *\n * To listen to value change updates use `addKeyChangeListener` method instead.\n *\n * @param {string} key - The key whose value is to be retrieved.\n * @returns {Promise} A promise that resolves with the value of the key.\n */\n async get(key: string) {\n const data: JsonValue = await HMSManager.getSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n });\n return data;\n }\n\n /**\n * Registers a callback to listen for changes to specified keys in the session store.\n * The callback is called with the initial value and again whenever any value changes.\n *\n * @param {string[]} forKeys - An array of keys to listen for changes on.\n * @param {Function} callback - The function to call when a value changes.\n * @returns {Object} An object with a `remove` method to unregister the listener.\n */\n addKeyChangeListener<T extends string[]>(\n forKeys: T,\n callback: (\n error: string | null,\n data: { key: T[number]; value: JsonValue } | null\n ) => void\n ) {\n // Add Native Device Event Emitter if it is not already added\n if (!this._deviceEventEmitterSubscription) {\n this._deviceEventEmitterSubscription = DeviceEventEmitter.addListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener.bind(this)\n );\n }\n\n // Create JS side EventEmitter\n if (!this._eventEmitter) {\n this._eventEmitter = new EventEmitter();\n }\n\n // Unique Identifier for adding native event listener\n const uniqueId = forKeys.join('') + '_' + Date.now().toString();\n\n const eventEmitter = this._eventEmitter;\n\n // Add listeners on eventEmitter for each key\n const subscriptions = forKeys.map((key) =>\n eventEmitter.addListener(key, callback, { uniqueId })\n );\n\n //\n let cleanupHandler: (() => void) | null = () => {\n this._cleanup(subscriptions);\n };\n\n // Adding 'KeyChangeListener' on native side\n HMSManager.addKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n keys: forKeys,\n uniqueId,\n })\n // Adding 'KeyChangeListener' fails on native side\n .catch((err: any) => {\n if (typeof cleanupHandler === 'function') {\n callback(err, null);\n cleanupHandler();\n cleanupHandler = null;\n }\n });\n\n this._addedKeyChangeListenerCount += 1;\n\n return {\n remove: () => {\n if (typeof cleanupHandler === 'function') {\n cleanupHandler();\n cleanupHandler = null;\n }\n },\n };\n }\n\n private _cleanup(subscriptionsToRemove: EmitterSubscription[]) {\n // Extracting `uniqueId` from first subscription (all subscriptions have same uniqueId)\n // this `uniqueId` will be used to remove 'KeyChangeListener' from native side\n const uniqueId =\n subscriptionsToRemove.length > 0\n ? (subscriptionsToRemove[0]!.context as { uniqueId: string }).uniqueId\n : null;\n\n // Removing required subscriptions from 'eventEmitter'\n subscriptionsToRemove.forEach((subscription) => subscription.remove());\n\n // Removing 'KeyChangeListener' from native side\n HMSManager.removeKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n uniqueId,\n }).catch((error: any) => {\n const logger = getLogger();\n logger?.verbose(\n \"Error while removing key change listener, Listener didn't get registerred at first place or was already removed\",\n error\n );\n });\n\n this._addedKeyChangeListenerCount -= 1;\n\n if (this._addedKeyChangeListenerCount <= 0) {\n this._addedKeyChangeListenerCount = 0;\n if (\n this._deviceEventEmitterSubscription &&\n typeof this._deviceEventEmitterSubscription.remove === 'function'\n ) {\n this._deviceEventEmitterSubscription.remove();\n } else {\n DeviceEventEmitter.removeListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener\n );\n }\n\n this._deviceEventEmitterSubscription = undefined;\n\n this._eventEmitter = undefined;\n }\n }\n\n private _deviceEventEmitterListener(data: {\n id: string;\n key: string;\n value: JsonValue;\n }) {\n // if id is different from default sdk_id, return early\n if (data.id !== HMSConstants.DEFAULT_SDK_ID) {\n return;\n }\n\n // emit event for the key\n getLogger()?.verbose('#Listener ON_SESSION_STORE_CHANGED event: ', data);\n\n this._eventEmitter?.emit(data.key, null, data);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAG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AE;MAC1C,IAAI,CAACA,4BAA4B,GAAG,CAAC;MACrC,IACE,IAAI,CAACtB,+BAA+B,IACpC,OAAO,IAAI,CAACA,+BAA+B,CAACuB,MAAM,KAAK,UAAU,EACjE;QACA,IAAI,CAACvB,+BAA+B,CAACuB,MAAM,CAAC,CAAC;MAC/C,CAAC,MAAM;QACLtB,+BAAkB,CAACiC,cAAc,CAC/B/B,kDAAwB,CAACC,wBAAwB,EACjD,IAAI,CAACC,2BACP,CAAC;MACH;MAEA,IAAI,CAACL,+BAA+B,GAAGmC,SAAS;MAEhD,IAAI,CAAC5B,aAAa,GAAG4B,SAAS;IAChC;EACF;EAEQ9B,2BAA2BA,CAAChB,IAInC,EAAE;IAAA,IAAA+C,UAAA,EAAAC,mBAAA;IACD;IACA,IAAIhD,IAAI,CAACG,EAAE,KAAKC,0BAAY,CAACC,cAAc,EAAE;MAC3C;IACF;;IAEA;IACA,CAAA0C,UAAA,OAAAJ,oBAAS,EAAC,CAAC,cAAAI,UAAA,eAAXA,UAAA,CAAaH,OAAO,CAAC,4CAA4C,EAAE5C,IAAI,CAAC;IAExE,CAAAgD,mBAAA,OAAI,CAAC9B,aAAa,cAAA8B,mBAAA,eAAlBA,mBAAA,CAAoBC,IAAI,CAACjD,IAAI,CAACD,GAAG,EAAE,IAAI,EAAEC,IAAI,CAAC;EAChD;AACF;AAACkD,OAAA,CAAAtD,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -7,6 +7,19 @@ exports.HMSTrack = 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 generic track within the HMS (100ms) system.
12
+ *
13
+ * This class serves as a base for different types of tracks (audio, video, etc.) within the HMS system. It encapsulates
14
+ * common properties and functionalities that are shared across different track types.
15
+ *
16
+ * @property {string} trackId - The unique identifier for the track.
17
+ * @property {HMSTrackSource} [source] - The source of the track, indicating whether it's from a plugin, regular input, or screen sharing.
18
+ * @property {string} [trackDescription] - A brief description of the track.
19
+ * @property {boolean} [mute] - Indicates whether the track is currently muted.
20
+ * @property {string} id - A secondary identifier for the track.
21
+ * @property {HMSTrackType} [type] - The type of the track, distinguishing between audio and video.
22
+ */
10
23
  class HMSTrack {
11
24
  constructor(params) {
12
25
  _defineProperty(this, "trackId", void 0);
@@ -1 +1 @@
1
- {"version":3,"names":["HMSTrack","constructor","params","_defineProperty","mute","trackId","source","trackDescription","isMute","id","type","exports"],"sources":["HMSTrack.ts"],"sourcesContent":["import type { HMSTrackSource } from './HMSTrackSource';\nimport type { HMSTrackType } from './HMSTrackType';\n\nexport class HMSTrack {\n trackId: string;\n source?: HMSTrackSource;\n trackDescription?: string;\n mute?: boolean;\n id: string;\n type?: HMSTrackType;\n\n isMute = () => {\n return this.mute;\n };\n\n constructor(params: {\n trackId: string;\n source?: HMSTrackSource;\n trackDescription?: string;\n isMute?: boolean;\n id: string;\n type?: HMSTrackType;\n }) {\n this.trackId = params.trackId;\n this.source = params.source;\n this.trackDescription = params.trackDescription;\n this.mute = params.isMute;\n this.id = params.id;\n this.type = params.type;\n }\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,QAAQ,CAAC;EAYpBC,WAAWA,CAACC,MAOX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,iBAXM,MAAM;MACb,OAAO,IAAI,CAACC,IAAI;IAClB,CAAC;IAUC,IAAI,CAACC,OAAO,GAAGH,MAAM,CAACG,OAAO;IAC7B,IAAI,CAACC,MAAM,GAAGJ,MAAM,CAACI,MAAM;IAC3B,IAAI,CAACC,gBAAgB,GAAGL,MAAM,CAACK,gBAAgB;IAC/C,IAAI,CAACH,IAAI,GAAGF,MAAM,CAACM,MAAM;IACzB,IAAI,CAACC,EAAE,GAAGP,MAAM,CAACO,EAAE;IACnB,IAAI,CAACC,IAAI,GAAGR,MAAM,CAACQ,IAAI;EACzB;AACF;AAACC,OAAA,CAAAX,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSTrack","constructor","params","_defineProperty","mute","trackId","source","trackDescription","isMute","id","type","exports"],"sources":["HMSTrack.ts"],"sourcesContent":["import type { HMSTrackSource } from './HMSTrackSource';\nimport type { HMSTrackType } from './HMSTrackType';\n\n/**\n * Represents a generic track within the HMS (100ms) system.\n *\n * This class serves as a base for different types of tracks (audio, video, etc.) within the HMS system. It encapsulates\n * common properties and functionalities that are shared across different track types.\n *\n * @property {string} trackId - The unique identifier for the track.\n * @property {HMSTrackSource} [source] - The source of the track, indicating whether it's from a plugin, regular input, or screen sharing.\n * @property {string} [trackDescription] - A brief description of the track.\n * @property {boolean} [mute] - Indicates whether the track is currently muted.\n * @property {string} id - A secondary identifier for the track.\n * @property {HMSTrackType} [type] - The type of the track, distinguishing between audio and video.\n */\nexport class HMSTrack {\n trackId: string;\n source?: HMSTrackSource;\n trackDescription?: string;\n mute?: boolean;\n id: string;\n type?: HMSTrackType;\n\n isMute = () => {\n return this.mute;\n };\n\n constructor(params: {\n trackId: string;\n source?: HMSTrackSource;\n trackDescription?: string;\n isMute?: boolean;\n id: string;\n type?: HMSTrackType;\n }) {\n this.trackId = params.trackId;\n this.source = params.source;\n this.trackDescription = params.trackDescription;\n this.mute = params.isMute;\n this.id = params.id;\n this.type = params.type;\n }\n}\n"],"mappings":";;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,CAAC;EAYpBC,WAAWA,CAACC,MAOX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,iBAXM,MAAM;MACb,OAAO,IAAI,CAACC,IAAI;IAClB,CAAC;IAUC,IAAI,CAACC,OAAO,GAAGH,MAAM,CAACG,OAAO;IAC7B,IAAI,CAACC,MAAM,GAAGJ,MAAM,CAACI,MAAM;IAC3B,IAAI,CAACC,gBAAgB,GAAGL,MAAM,CAACK,gBAAgB;IAC/C,IAAI,CAACH,IAAI,GAAGF,MAAM,CAACM,MAAM;IACzB,IAAI,CAACC,EAAE,GAAGP,MAAM,CAACO,EAAE;IACnB,IAAI,CAACC,IAAI,GAAGR,MAAM,CAACQ,IAAI;EACzB;AACF;AAACC,OAAA,CAAAX,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -7,6 +7,16 @@ exports.HMSTrackSettings = 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 the settings for both video and audio tracks in a HMS (100ms) application.
12
+ *
13
+ * This class encapsulates the configurations for video and audio tracks that can be used
14
+ * in a HMS session.
15
+ *
16
+ * @property {HMSVideoTrackSettings} video - Optional video track settings.
17
+ * @property {HMSAudioTrackSettings} audio - Optional audio track settings.
18
+ *
19
+ */
10
20
  class HMSTrackSettings {
11
21
  constructor(params) {
12
22
  _defineProperty(this, "video", void 0);
@@ -1 +1 @@
1
- {"version":3,"names":["HMSTrackSettings","constructor","params","_defineProperty","video","audio","exports"],"sources":["HMSTrackSettings.ts"],"sourcesContent":["import type { HMSAudioTrackSettings } from './HMSAudioTrackSettings';\nimport type { HMSVideoTrackSettings } from './HMSVideoTrackSettings';\n\nexport class HMSTrackSettings {\n video?: HMSVideoTrackSettings;\n audio?: HMSAudioTrackSettings;\n\n constructor(params?: {\n video?: HMSVideoTrackSettings;\n audio?: HMSAudioTrackSettings;\n }) {\n if (params) {\n this.video = params.video;\n this.audio = params.audio;\n }\n }\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,gBAAgB,CAAC;EAI5BC,WAAWA,CAACC,MAGX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IACD,IAAID,MAAM,EAAE;MACV,IAAI,CAACE,KAAK,GAAGF,MAAM,CAACE,KAAK;MACzB,IAAI,CAACC,KAAK,GAAGH,MAAM,CAACG,KAAK;IAC3B;EACF;AACF;AAACC,OAAA,CAAAN,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSTrackSettings","constructor","params","_defineProperty","video","audio","exports"],"sources":["HMSTrackSettings.ts"],"sourcesContent":["import type { HMSAudioTrackSettings } from './HMSAudioTrackSettings';\nimport type { HMSVideoTrackSettings } from './HMSVideoTrackSettings';\n\n/**\n * Represents the settings for both video and audio tracks in a HMS (100ms) application.\n *\n * This class encapsulates the configurations for video and audio tracks that can be used\n * in a HMS session.\n *\n * @property {HMSVideoTrackSettings} video - Optional video track settings.\n * @property {HMSAudioTrackSettings} audio - Optional audio track settings.\n *\n */\nexport class HMSTrackSettings {\n video?: HMSVideoTrackSettings;\n audio?: HMSAudioTrackSettings;\n\n constructor(params?: {\n video?: HMSVideoTrackSettings;\n audio?: HMSAudioTrackSettings;\n }) {\n if (params) {\n this.video = params.video;\n this.audio = params.audio;\n }\n }\n}\n"],"mappings":";;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,CAAC;EAI5BC,WAAWA,CAACC,MAGX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IACD,IAAID,MAAM,EAAE;MACV,IAAI,CAACE,KAAK,GAAGF,MAAM,CAACE,KAAK;MACzB,IAAI,CAACC,KAAK,GAAGH,MAAM,CAACG,KAAK;IAC3B;EACF;AACF;AAACC,OAAA,CAAAN,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -4,6 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HMSTrackSettingsInitState = void 0;
7
+ /**
8
+ * Enum for the initial state of tracks in a 100ms (HMS) application.
9
+ *
10
+ * This enumeration defines the initial mute state for tracks (audio or video) in a 100ms (HMS) application.
11
+ * It allows developers to specify whether a track should start in a muted or unmuted state, providing control over the user's media state upon joining a Room.
12
+ *
13
+ * @enum {string}
14
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/join#join-with-muted-audio-video
15
+ */
7
16
  let HMSTrackSettingsInitState = exports.HMSTrackSettingsInitState = /*#__PURE__*/function (HMSTrackSettingsInitState) {
8
17
  HMSTrackSettingsInitState["MUTED"] = "MUTED";
9
18
  HMSTrackSettingsInitState["UNMUTED"] = "UNMUTED";
@@ -1 +1 @@
1
- {"version":3,"names":["HMSTrackSettingsInitState","exports"],"sources":["HMSTrackSettingsInitState.ts"],"sourcesContent":["export enum HMSTrackSettingsInitState {\n MUTED = 'MUTED',\n UNMUTED = 'UNMUTED',\n}\n"],"mappings":";;;;;;IAAYA,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSTrackSettingsInitState","exports"],"sources":["HMSTrackSettingsInitState.ts"],"sourcesContent":["/**\n * Enum for the initial state of tracks in a 100ms (HMS) application.\n *\n * This enumeration defines the initial mute state for tracks (audio or video) in a 100ms (HMS) application.\n * It allows developers to specify whether a track should start in a muted or unmuted state, providing control over the user's media state upon joining a Room.\n *\n * @enum {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/join#join-with-muted-audio-video\n */\nexport enum HMSTrackSettingsInitState {\n /** Represents the state where the track is initially muted. */\n MUTED = 'MUTED',\n /** Represents the state where the track is initially unmuted. */\n UNMUTED = 'UNMUTED',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IASYA,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
@@ -4,6 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HMSTrackSource = void 0;
7
+ /**
8
+ * Enum for HMS Track Source types.
9
+ *
10
+ * Defines the source of an HMS track, indicating whether the track originates from a plugin, is a regular track, or is a screen-sharing track.
11
+ *
12
+ * @enum {string}
13
+ * @property {string} REGULAR - Represents a regular track, typically from a user's camera or microphone.
14
+ * @property {string} SCREEN - Represents a track that shares the screen.
15
+ * @property {string} PLUGIN - Represents a track sourced from a plugin.
16
+ */
7
17
  let HMSTrackSource = exports.HMSTrackSource = /*#__PURE__*/function (HMSTrackSource) {
8
18
  HMSTrackSource["PLUGIN"] = "plugin";
9
19
  HMSTrackSource["REGULAR"] = "regular";
@@ -1 +1 @@
1
- {"version":3,"names":["HMSTrackSource","exports"],"sources":["HMSTrackSource.ts"],"sourcesContent":["export enum HMSTrackSource {\n PLUGIN = 'plugin',\n REGULAR = 'regular',\n SCREEN = 'screen',\n}\n"],"mappings":";;;;;;IAAYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSTrackSource","exports"],"sources":["HMSTrackSource.ts"],"sourcesContent":["/**\n * Enum for HMS Track Source types.\n *\n * Defines the source of an HMS track, indicating whether the track originates from a plugin, is a regular track, or is a screen-sharing track.\n *\n * @enum {string}\n * @property {string} REGULAR - Represents a regular track, typically from a user's camera or microphone.\n * @property {string} SCREEN - Represents a track that shares the screen.\n * @property {string} PLUGIN - Represents a track sourced from a plugin.\n */\nexport enum HMSTrackSource {\n PLUGIN = 'plugin',\n REGULAR = 'regular',\n SCREEN = 'screen',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,IAUYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HMSTrackType = void 0;
7
+ /**
8
+ * Enum for HMS Track Types.
9
+ *
10
+ * This enumeration defines the types of tracks that can be handled within the HMS (100ms) system, specifically distinguishing between audio and video tracks.
11
+ * - `AUDIO`: Represents an audio track, typically containing sound or voice data.
12
+ * - `VIDEO`: Represents a video track, typically containing visual data from a camera or other video sources.
13
+ */
7
14
  let HMSTrackType = exports.HMSTrackType = /*#__PURE__*/function (HMSTrackType) {
8
15
  HMSTrackType["AUDIO"] = "AUDIO";
9
16
  HMSTrackType["VIDEO"] = "VIDEO";
@@ -1 +1 @@
1
- {"version":3,"names":["HMSTrackType","exports"],"sources":["HMSTrackType.ts"],"sourcesContent":["export enum HMSTrackType {\n AUDIO = 'AUDIO',\n VIDEO = 'VIDEO',\n}\n"],"mappings":";;;;;;IAAYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSTrackType","exports"],"sources":["HMSTrackType.ts"],"sourcesContent":["/**\n * Enum for HMS Track Types.\n *\n * This enumeration defines the types of tracks that can be handled within the HMS (100ms) system, specifically distinguishing between audio and video tracks.\n * - `AUDIO`: Represents an audio track, typically containing sound or voice data.\n * - `VIDEO`: Represents a video track, typically containing visual data from a camera or other video sources.\n */\nexport enum HMSTrackType {\n AUDIO = 'AUDIO',\n VIDEO = 'VIDEO',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
@@ -5,16 +5,55 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.HMSUpdateListenerActions = void 0;
7
7
  /**
8
- * These are the available events emitted by the `HMSSDK`
8
+ * Enum for HMSUpdateListenerActions.
9
9
  *
10
+ * This enumeration defines the set of possible events that can be emitted by the HMSSDK during a Session.
11
+ * These events cover a wide range of actions, from joining a room to receiving updates about peers and tracks, and more.
10
12
  * For more info about these events, checkout Event Listener docs
11
- * {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners}
13
+ *
14
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners
15
+ *
16
+ * @enum {string}
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_JOIN, ({ room: HMSRoom }}) => {
21
+ * console.log('Joined room', data);
22
+ * // Handle the event
23
+ * });
24
+ * ```
25
+ *
26
+ * @property {string} ON_PREVIEW - Emitted when the local preview is available.
27
+ * @property {string} ON_JOIN - Emitted when the local user joins the room.
28
+ * @property {string} ON_ROOM_UPDATE - Emitted when there is an update related to the room.
29
+ * @property {string} ON_PEER_UPDATE - Emitted when there is an update related to a peer in the room.
30
+ * @property {string} ON_TRACK_UPDATE - Emitted when there is an update related to a track in the room.
31
+ * @property {string} ON_ERROR - Emitted when an error occurs.
32
+ * @property {string} ON_MESSAGE - Emitted when a message is received.
33
+ * @property {string} ON_SPEAKER - Emitted when there is an update on the current speaker.
34
+ * @property {string} RECONNECTING - Emitted when the SDK is attempting to reconnect to the room.
35
+ * @property {string} RECONNECTED - Emitted when the SDK has successfully reconnected to the room.
36
+ * @property {string} ON_ROLE_CHANGE_REQUEST - Emitted when there is a request to change the role of a peer.
37
+ * @property {string} ON_CHANGE_TRACK_STATE_REQUEST - Emitted when there is a request to change the state of a track.
38
+ * @property {string} ON_REMOVED_FROM_ROOM - Emitted when the local user is removed from the room.
39
+ * @property {string} ON_RTC_STATS - Emitted when RTC stats are available.
40
+ * @property {string} ON_LOCAL_AUDIO_STATS - Emitted when stats for the local audio track are available.
41
+ * @property {string} ON_LOCAL_VIDEO_STATS - Emitted when stats for the local video track are available.
42
+ * @property {string} ON_REMOTE_AUDIO_STATS - Emitted when stats for a remote audio track are available.
43
+ * @property {string} ON_REMOTE_VIDEO_STATS - Emitted when stats for a remote video track are available.
44
+ * @property {string} ON_AUDIO_DEVICE_CHANGED - Emitted when the audio device has changed.
45
+ * @property {string} ON_SESSION_STORE_AVAILABLE - Emitted when the session store is available.
46
+ * @property {string} ON_SESSION_STORE_CHANGED - Emitted when the session store has changed.
47
+ * @property {string} ON_PEER_LIST_UPDATED - Emitted when the list of peers is updated.
48
+ * @property {string} ON_TRANSCRIPTS - Emitted when transcripts are available.
49
+ * @property {string} ON_PERMISSIONS_REQUESTED - Emitted when permissions are requested.
12
50
  */
13
51
  let HMSUpdateListenerActions = exports.HMSUpdateListenerActions = /*#__PURE__*/function (HMSUpdateListenerActions) {
14
52
  HMSUpdateListenerActions["ON_PREVIEW"] = "ON_PREVIEW";
15
53
  HMSUpdateListenerActions["ON_JOIN"] = "ON_JOIN";
16
54
  HMSUpdateListenerActions["ON_ROOM_UPDATE"] = "ON_ROOM_UPDATE";
17
55
  HMSUpdateListenerActions["ON_PEER_UPDATE"] = "3";
56
+ HMSUpdateListenerActions["ON_PEER_LIST_UPDATED"] = "ON_PEER_LIST_UPDATED";
18
57
  HMSUpdateListenerActions["ON_TRACK_UPDATE"] = "ON_TRACK_UPDATE";
19
58
  HMSUpdateListenerActions["ON_ERROR"] = "ON_ERROR";
20
59
  HMSUpdateListenerActions["ON_MESSAGE"] = "ON_MESSAGE";
@@ -32,8 +71,8 @@ let HMSUpdateListenerActions = exports.HMSUpdateListenerActions = /*#__PURE__*/f
32
71
  HMSUpdateListenerActions["ON_AUDIO_DEVICE_CHANGED"] = "ON_AUDIO_DEVICE_CHANGED";
33
72
  HMSUpdateListenerActions["ON_SESSION_STORE_AVAILABLE"] = "ON_SESSION_STORE_AVAILABLE";
34
73
  HMSUpdateListenerActions["ON_SESSION_STORE_CHANGED"] = "ON_SESSION_STORE_CHANGED";
35
- HMSUpdateListenerActions["ON_PEER_LIST_UPDATED"] = "ON_PEER_LIST_UPDATED";
36
74
  HMSUpdateListenerActions["ON_TRANSCRIPTS"] = "ON_TRANSCRIPTS";
75
+ HMSUpdateListenerActions["ON_PERMISSIONS_REQUESTED"] = "ON_PERMISSIONS_REQUESTED";
37
76
  return HMSUpdateListenerActions;
38
77
  }({});
39
78
  //# sourceMappingURL=HMSUpdateListenerActions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["HMSUpdateListenerActions","exports"],"sources":["HMSUpdateListenerActions.ts"],"sourcesContent":["/**\n * These are the available events emitted by the `HMSSDK`\n *\n * For more info about these events, checkout Event Listener docs\n * {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners}\n */\nexport enum HMSUpdateListenerActions {\n ON_PREVIEW = 'ON_PREVIEW',\n ON_JOIN = 'ON_JOIN',\n ON_ROOM_UPDATE = 'ON_ROOM_UPDATE',\n ON_PEER_UPDATE = '3',\n ON_TRACK_UPDATE = 'ON_TRACK_UPDATE',\n ON_ERROR = 'ON_ERROR',\n ON_MESSAGE = 'ON_MESSAGE',\n ON_SPEAKER = 'ON_SPEAKER',\n RECONNECTING = 'RECONNECTING',\n RECONNECTED = 'RECONNECTED',\n ON_ROLE_CHANGE_REQUEST = 'ON_ROLE_CHANGE_REQUEST',\n ON_CHANGE_TRACK_STATE_REQUEST = 'ON_CHANGE_TRACK_STATE_REQUEST',\n ON_REMOVED_FROM_ROOM = 'ON_REMOVED_FROM_ROOM',\n ON_RTC_STATS = 'ON_RTC_STATS',\n ON_LOCAL_AUDIO_STATS = 'ON_LOCAL_AUDIO_STATS',\n ON_LOCAL_VIDEO_STATS = 'ON_LOCAL_VIDEO_STATS',\n ON_REMOTE_AUDIO_STATS = 'ON_REMOTE_AUDIO_STATS',\n ON_REMOTE_VIDEO_STATS = 'ON_REMOTE_VIDEO_STATS',\n ON_AUDIO_DEVICE_CHANGED = 'ON_AUDIO_DEVICE_CHANGED',\n ON_SESSION_STORE_AVAILABLE = 'ON_SESSION_STORE_AVAILABLE',\n ON_SESSION_STORE_CHANGED = 'ON_SESSION_STORE_CHANGED',\n ON_PEER_LIST_UPDATED = 'ON_PEER_LIST_UPDATED',\n ON_TRANSCRIPTS = 'ON_TRANSCRIPTS',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AALA,IAMYA,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,0BAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAA,OAAxBA,wBAAwB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSUpdateListenerActions","exports"],"sources":["HMSUpdateListenerActions.ts"],"sourcesContent":["/**\n * Enum for HMSUpdateListenerActions.\n *\n * This enumeration defines the set of possible events that can be emitted by the HMSSDK during a Session.\n * These events cover a wide range of actions, from joining a room to receiving updates about peers and tracks, and more.\n * For more info about these events, checkout Event Listener docs\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners\n *\n * @enum {string}\n *\n * @example\n * ```typescript\n * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_JOIN, ({ room: HMSRoom }}) => {\n * console.log('Joined room', data);\n * // Handle the event\n * });\n * ```\n *\n * @property {string} ON_PREVIEW - Emitted when the local preview is available.\n * @property {string} ON_JOIN - Emitted when the local user joins the room.\n * @property {string} ON_ROOM_UPDATE - Emitted when there is an update related to the room.\n * @property {string} ON_PEER_UPDATE - Emitted when there is an update related to a peer in the room.\n * @property {string} ON_TRACK_UPDATE - Emitted when there is an update related to a track in the room.\n * @property {string} ON_ERROR - Emitted when an error occurs.\n * @property {string} ON_MESSAGE - Emitted when a message is received.\n * @property {string} ON_SPEAKER - Emitted when there is an update on the current speaker.\n * @property {string} RECONNECTING - Emitted when the SDK is attempting to reconnect to the room.\n * @property {string} RECONNECTED - Emitted when the SDK has successfully reconnected to the room.\n * @property {string} ON_ROLE_CHANGE_REQUEST - Emitted when there is a request to change the role of a peer.\n * @property {string} ON_CHANGE_TRACK_STATE_REQUEST - Emitted when there is a request to change the state of a track.\n * @property {string} ON_REMOVED_FROM_ROOM - Emitted when the local user is removed from the room.\n * @property {string} ON_RTC_STATS - Emitted when RTC stats are available.\n * @property {string} ON_LOCAL_AUDIO_STATS - Emitted when stats for the local audio track are available.\n * @property {string} ON_LOCAL_VIDEO_STATS - Emitted when stats for the local video track are available.\n * @property {string} ON_REMOTE_AUDIO_STATS - Emitted when stats for a remote audio track are available.\n * @property {string} ON_REMOTE_VIDEO_STATS - Emitted when stats for a remote video track are available.\n * @property {string} ON_AUDIO_DEVICE_CHANGED - Emitted when the audio device has changed.\n * @property {string} ON_SESSION_STORE_AVAILABLE - Emitted when the session store is available.\n * @property {string} ON_SESSION_STORE_CHANGED - Emitted when the session store has changed.\n * @property {string} ON_PEER_LIST_UPDATED - Emitted when the list of peers is updated.\n * @property {string} ON_TRANSCRIPTS - Emitted when transcripts are available.\n * @property {string} ON_PERMISSIONS_REQUESTED - Emitted when permissions are requested.\n */\nexport enum HMSUpdateListenerActions {\n /**\n * Event emitted when the local preview is available.\n *\n * This event is triggered once the local user's video preview becomes available.\n * It allows the application to display the local video stream to the user,\n * ensuring they can see their own feed before interacting with others in the room.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/preview\n */\n ON_PREVIEW = 'ON_PREVIEW',\n\n /**\n * Event emitted when the local user joins the room.\n *\n * This event signifies that the local user has successfully connected to the room and is now part of the session.\n * It is a critical event for initiating further actions within the room, such as fetching current participants,\n * subscribing to tracks, or sending messages. Handling this event properly is essential for setting up the user's\n * environment and ensuring a smooth experience in the room.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/join\n */\n ON_JOIN = 'ON_JOIN',\n\n /**\n * Event emitted when there is an update related to the room.\n *\n * This event is triggered by various room-related changes, such as updates to the room's metadata, changes in the room's state,\n * or modifications to the list of available tracks. It serves as a general notification to the application that some aspect of the\n * room's configuration or status has changed, enabling the application to respond appropriately, such as updating the UI or querying\n * for new information to reflect the current state of the room.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners\n */\n ON_ROOM_UPDATE = 'ON_ROOM_UPDATE',\n\n /**\n * Event emitted when there is an update related to a peer in the room.\n *\n * This event is triggered whenever a peer's state changes within the room, such as when a peer's video or audio track is enabled or disabled,\n * or when a peer's metadata is updated. It provides a way for the application to react to changes in a peer's status, ensuring that the UI\n * and application state can be updated to reflect the current state of peers in the room.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners\n */\n ON_PEER_UPDATE = '3',\n\n /**\n * Event emitted when the list of peers in the room is updated.\n *\n * This event is triggered whenever there is a change in the list of peers present in the room, such as when a new peer joins,\n * an existing peer leaves. It allows the application to react to changes in the room's\n * participant list, enabling dynamic updates to the UI or other logic based on the current set of participants.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room\n */\n ON_PEER_LIST_UPDATED = 'ON_PEER_LIST_UPDATED',\n\n /**\n * Event emitted when there is an update related to a track in the room.\n *\n * This event is triggered whenever a track's state changes within the room, such as when a video or audio track is enabled or disabled,\n * or when a track's settings are modified. It provides a way for the application to react to changes in a track's status, ensuring that\n * the UI and application state can be updated to reflect the current state of tracks in the room.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners\n */\n ON_TRACK_UPDATE = 'ON_TRACK_UPDATE',\n\n /**\n * Event emitted when an error occurs.\n *\n * This event is triggered whenever the HMS SDK encounters an error during its operation. It could be due to network issues,\n * permissions being denied, or any other error that prevents the SDK from functioning as expected. Handling this event allows\n * the application to inform the user about the issue and possibly take corrective action or log the error for further analysis.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/debugging/error-handling\n */\n ON_ERROR = 'ON_ERROR',\n\n /**\n * Event emitted when a message is received.\n *\n * This event is triggered whenever a message is sent by a peer in the room and received by the local user.\n * It is crucial for enabling real-time communication within the room, allowing participants to exchange text messages,\n * notifications, or commands. Handling this event is essential for applications that support chat or command-based interactions\n * among participants.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/chat\n */\n ON_MESSAGE = 'ON_MESSAGE',\n\n /**\n * Event emitted when there is an update on the current speaker.\n *\n * This event is triggered whenever the active speaker in the room changes, such as when a new participant starts speaking or the current speaker stops.\n * It allows the application to highlight the current speaker in the UI, enhancing the user experience by making it easier to follow the conversation flow.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/show-audio-level\n */\n ON_SPEAKER = 'ON_SPEAKER',\n\n /**\n * Event emitted when the SDK is attempting to reconnect to the room.\n *\n * This event is triggered when the connection to the room is lost, and the HMS SDK is trying to re-establish the connection.\n * It indicates that the SDK is in the process of reconnecting, allowing the application to notify users about the reconnection attempt\n * and possibly display a loading or waiting indicator. Handling this event is crucial for maintaining a smooth user experience during\n * network interruptions.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/handle-interruptions/reconnection-handling\n */\n RECONNECTING = 'RECONNECTING',\n\n /**\n * Event emitted when the SDK has successfully reconnected to the room.\n *\n * This event signifies that after a disconnection, the HMS SDK has managed to re-establish the connection to the room successfully.\n * It is crucial for applications to handle this event to update the UI and inform the user that the connection has been restored,\n * ensuring a seamless experience. This event can trigger re-initialization of room-related functionalities or refreshes of the UI\n * to reflect the current state of the room.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/handle-interruptions/reconnection-handling\n */\n RECONNECTED = 'RECONNECTED',\n\n /**\n * Event emitted when there is a request to change the role of a peer.\n *\n * This event is triggered whenever a request is made to change the role of a participant in the room, such as from a viewer to a speaker or vice versa.\n * Handling this event allows the application to manage user roles dynamically, ensuring that participants have the correct permissions for their intended\n * actions within the room. It is crucial for applications that implement role-based access control or need to change user permissions on the fly.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role\n */\n ON_ROLE_CHANGE_REQUEST = 'ON_ROLE_CHANGE_REQUEST',\n\n /**\n * Event emitted when there is a request to change the state of a track.\n *\n * This event is triggered whenever a request is made to change the state of a track within the room, such as enabling or disabling a video or audio track.\n * Handling this event allows the application to respond to changes in track states, ensuring that participants can control their audio and video streams\n * as needed. It is crucial for applications that allow users to manage their media streams dynamically during a session.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/remote-mute\n */\n ON_CHANGE_TRACK_STATE_REQUEST = 'ON_CHANGE_TRACK_STATE_REQUEST',\n\n /**\n * Event emitted when the local user is removed from the room.\n *\n * This event is triggered whenever the local user is explicitly removed from the room by an action from another participant with sufficient permissions or due to room policy violations. Handling this event is crucial for applications to gracefully disconnect the user from the session, possibly clear user-related data, and inform the user about the removal reason if applicable.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/end-room\n */\n ON_REMOVED_FROM_ROOM = 'ON_REMOVED_FROM_ROOM',\n\n /**\n * Event emitted when RTC stats are available.\n *\n * This event is triggered when real-time communication (RTC) statistics become available from the HMS SDK.\n * RTC stats provide detailed information about the performance and quality of the media streams in the session,\n * including metrics such as packet loss, jitter, round-trip time (RTT), and more. Handling this event allows\n * the application to monitor and react to the quality of the connection, potentially informing users about\n * the current call quality or troubleshooting issues in real-time.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/rtc-stats\n */\n ON_RTC_STATS = 'ON_RTC_STATS',\n\n /**\n * Event emitted when stats for the local audio track are available.\n *\n * This event is triggered when statistics related to the local user's audio track become available from the HMS SDK.\n * These statistics can include metrics such as round trip time, bitrate, and bytesSent, which are crucial for monitoring\n * the quality of the audio being transmitted. Handling this event allows the application to react to the audio quality,\n * potentially adjusting settings or notifying the user about issues in real-time.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/rtc-stats\n */\n ON_LOCAL_AUDIO_STATS = 'ON_LOCAL_AUDIO_STATS',\n\n /**\n * Event emitted when stats for the local video track are available.\n *\n * This event is triggered when statistics related to the local user's video track become available from the HMS SDK.\n * These statistics can include metrics such as frame rate, resolution, and bitrate, which are crucial for monitoring\n * the quality of the video being transmitted. Handling this event allows the application to react to the video quality,\n * potentially adjusting settings or notifying the user about issues in real-time.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/rtc-stats\n */\n ON_LOCAL_VIDEO_STATS = 'ON_LOCAL_VIDEO_STATS',\n\n /**\n * Event emitted when statistics for a remote audio track are available.\n *\n * This event is triggered when statistics related to an audio track from a remote user become available from the HMS SDK.\n * These statistics can include metrics such as bitrate, packet loss, and jitter, which are crucial for monitoring\n * the quality of the audio being received. Handling this event allows the application to react to the audio quality,\n * potentially adjusting settings or notifying the user about issues in real-time.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/rtc-stats\n */\n ON_REMOTE_AUDIO_STATS = 'ON_REMOTE_AUDIO_STATS',\n\n /**\n * Event emitted when statistics for a remote video track are available.\n *\n * This event is triggered when statistics related to a video track from a remote user become available from the HMS SDK.\n * These statistics can include metrics such as frame rate, resolution, bitrate, and packet loss, which are crucial for monitoring\n * the quality of the video being received. Handling this event allows the application to react to the video quality,\n * potentially adjusting settings or notifying the user about issues in real-time.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/rtc-stats\n */\n ON_REMOTE_VIDEO_STATS = 'ON_REMOTE_VIDEO_STATS',\n\n /**\n * Event emitted when the audio device has changed. Android only.\n *\n * This event is triggered whenever there is a change in the audio output device, such as switching from the built-in speaker to a Bluetooth headset.\n * Handling this event allows the application to update any UI elements or settings related to the current audio device, ensuring that the user is always aware of which device is being used for audio output.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-output-routing\n */\n ON_AUDIO_DEVICE_CHANGED = 'ON_AUDIO_DEVICE_CHANGED',\n\n /**\n * Event emitted when the session store becomes available.\n *\n * This event is triggered when the session store, which may contain critical data for the ongoing session such as user tokens, room state, or other metadata, becomes available to the application.\n * Handling this event allows the application to perform actions that depend on session-specific data, such as initializing user interfaces or fetching additional room details.\n * It is crucial for applications that need to ensure all necessary data is loaded before proceeding with further operations.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store\n */\n ON_SESSION_STORE_AVAILABLE = 'ON_SESSION_STORE_AVAILABLE',\n\n /**\n * Event emitted when the session store has changed.\n *\n * This event is triggered whenever there is a change in the session store, which may include updates to user tokens, room state, or other metadata critical for the ongoing session.\n * Handling this event allows the application to react to changes in session-specific data in real-time, ensuring that the application's state is always synchronized with the session store.\n * This is crucial for applications that rely on up-to-date session information for functionalities like UI updates, access control, and room management.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store\n */\n ON_SESSION_STORE_CHANGED = 'ON_SESSION_STORE_CHANGED',\n\n /**\n * Event emitted when transcripts are available.\n *\n * This event is triggered when the HMS SDK has generated transcripts from the audio streams in the room.\n * It allows the application to receive real-time or post-processed text versions of spoken content, which can be used for\n * accessibility features, content analysis, or storing meeting minutes. The availability of this feature depends on the\n * HMS service configuration and may require additional setup or permissions.\n *\n * @type {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/live-captions\n */\n ON_TRANSCRIPTS = 'ON_TRANSCRIPTS',\n\n /**\n * Event emitted when the HMS SDK requests permissions from the user. Android only.\n *\n * This event is triggered whenever the application needs to request permissions from the user, such as access to the camera or microphone.\n * It is used in conjunction with the platform's permissions API to prompt the user for the necessary permissions and to inform the HMS SDK\n * of the user's response. This is crucial for features that require explicit user consent before they can be used.\n *\n * @type {string}\n */\n ON_PERMISSIONS_REQUESTED = 'ON_PERMISSIONS_REQUESTED',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3CA,IA4CYA,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,0BAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAA,OAAxBA,wBAAwB;AAAA","ignoreList":[]}
@@ -8,9 +8,26 @@ var _HMSTrack = require("./HMSTrack");
8
8
  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; }
9
9
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
10
  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); }
11
+ /**
12
+ * Represents a video track within the HMS (100ms) system.
13
+ *
14
+ * This class extends `HMSTrack` to provide functionalities specific to video tracks. It includes additional
15
+ * property `isDegraded` to indicate whether the video quality has been intentionally reduced, typically for
16
+ * performance reasons. The constructor allows for the initialization of the video track with various parameters
17
+ * such as track ID, source, description, mute state, degradation state, ID, and type. These parameters provide
18
+ * detailed information about the video track and its characteristics.
19
+ *
20
+ * @extends HMSTrack
21
+ *
22
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview
23
+ */
11
24
  class HMSVideoTrack extends _HMSTrack.HMSTrack {
12
25
  constructor(params) {
13
26
  super(params);
27
+ /**
28
+ * Indicates whether the video quality of the track is degraded.
29
+ * @type {boolean | undefined}
30
+ */
14
31
  _defineProperty(this, "isDegraded", void 0);
15
32
  this.isDegraded = params.isDegraded;
16
33
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_HMSTrack","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSVideoTrack","HMSTrack","constructor","params","isDegraded","exports"],"sources":["HMSVideoTrack.ts"],"sourcesContent":["import { HMSTrack } from './HMSTrack';\nimport type { HMSTrackSource } from './HMSTrackSource';\nimport type { HMSTrackType } from './HMSTrackType';\n\nexport class HMSVideoTrack extends HMSTrack {\n isDegraded?: boolean;\n\n constructor(params: {\n trackId: string;\n source?: HMSTrackSource;\n trackDescription?: string;\n isMute?: boolean;\n id: string;\n isDegraded?: boolean;\n type?: HMSTrackType;\n }) {\n super(params);\n this.isDegraded = params.isDegraded;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAsC,SAAAC,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;AAI/B,MAAMgB,aAAa,SAASC,kBAAQ,CAAC;EAG1CC,WAAWA,CAACC,MAQX,EAAE;IACD,KAAK,CAACA,MAAM,CAAC;IAACtB,eAAA;IACd,IAAI,CAACuB,UAAU,GAAGD,MAAM,CAACC,UAAU;EACrC;AACF;AAACC,OAAA,CAAAL,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_HMSTrack","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HMSVideoTrack","HMSTrack","constructor","params","isDegraded","exports"],"sources":["HMSVideoTrack.ts"],"sourcesContent":["import { HMSTrack } from './HMSTrack';\nimport type { HMSTrackSource } from './HMSTrackSource';\nimport type { HMSTrackType } from './HMSTrackType';\n\n/**\n * Represents a video track within the HMS (100ms) system.\n *\n * This class extends `HMSTrack` to provide functionalities specific to video tracks. It includes additional\n * property `isDegraded` to indicate whether the video quality has been intentionally reduced, typically for\n * performance reasons. The constructor allows for the initialization of the video track with various parameters\n * such as track ID, source, description, mute state, degradation state, ID, and type. These parameters provide\n * detailed information about the video track and its characteristics.\n *\n * @extends HMSTrack\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview\n */\nexport class HMSVideoTrack extends HMSTrack {\n /**\n * Indicates whether the video quality of the track is degraded.\n * @type {boolean | undefined}\n */\n isDegraded?: boolean;\n\n constructor(params: {\n trackId: string;\n source?: HMSTrackSource;\n trackDescription?: string;\n isMute?: boolean;\n id: string;\n isDegraded?: boolean;\n type?: HMSTrackType;\n }) {\n super(params);\n this.isDegraded = params.isDegraded;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAsC,SAAAC,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;AAItC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMgB,aAAa,SAASC,kBAAQ,CAAC;EAO1CC,WAAWA,CAACC,MAQX,EAAE;IACD,KAAK,CAACA,MAAM,CAAC;IAff;AACF;AACA;AACA;IAHEtB,eAAA;IAgBE,IAAI,CAACuB,UAAU,GAAGD,MAAM,CAACC,UAAU;EACrC;AACF;AAACC,OAAA,CAAAL,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -8,9 +8,19 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
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
10
  /**
11
- * Customize local peer's Video track settings before Joining the Room.
11
+ * Represents the settings for a video track in a HMS (100ms) application.
12
12
  *
13
- * Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}
13
+ * This class encapsulates the configurations for video tracks that can be used
14
+ * in a HMS session.
15
+ *
16
+ * @property {HMSSimulcastLayerSettings[]} simulcastSettings - Optional simulcast settings.
17
+ * @property {HMSTrackSettingsInitState} initialState - Optional initial state for the track.
18
+ * @property {HMSCameraFacing} cameraFacing - Optional camera facing for the track.
19
+ * @property {boolean} forceSoftwareDecoder - Optional flag to force software decoder.
20
+ * @property {boolean} disableAutoResize - Optional flag to disable auto resize.
21
+ * @property {HMSVirtualBackgroundPlugin} videoPlugin - Optional video plugin settings.
22
+ *
23
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings
14
24
  */
15
25
  class HMSVideoTrackSettings {
16
26
  constructor(params) {
@@ -1 +1 @@
1
- {"version":3,"names":["HMSVideoTrackSettings","constructor","params","_defineProperty","simulcastSettings","initialState","cameraFacing","forceSoftwareDecoder","disableAutoResize","videoPlugin","exports"],"sources":["HMSVideoTrackSettings.ts"],"sourcesContent":["import type { ImageURISource, ImageRequireSource } from 'react-native';\nimport type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';\nimport type { HMSCameraFacing } from './HMSCameraFacing';\nimport type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';\n\nexport declare class HMSVirtualBackgroundPlugin {\n static NAME: string;\n constructor();\n enable(): Promise<boolean>;\n disable(): Promise<boolean>;\n setBlur(blurRadius: number): Promise<boolean>;\n setBackground(\n backgroundImage: ImageURISource | ImageRequireSource\n ): Promise<boolean>;\n}\n\n/**\n * Customize local peer's Video track settings before Joining the Room.\n *\n * Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}\n */\nexport class HMSVideoTrackSettings {\n readonly simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean; // android only\n disableAutoResize?: boolean; // android only\n videoPlugin?: HMSVirtualBackgroundPlugin;\n\n constructor(params: {\n simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean;\n disableAutoResize?: boolean;\n videoPlugin?: HMSVirtualBackgroundPlugin;\n }) {\n this.simulcastSettings = params.simulcastSettings;\n this.initialState = params.initialState;\n this.cameraFacing = params.cameraFacing;\n this.forceSoftwareDecoder = params.forceSoftwareDecoder;\n this.disableAutoResize = params.disableAutoResize;\n this.videoPlugin = params.videoPlugin;\n }\n}\n"],"mappings":";;;;;;;;;AAgBA;AACA;AACA;AACA;AACA;AACO,MAAMA,qBAAqB,CAAC;EAQjCC,WAAWA,CAACC,MAOX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAX6B;IAAAA,eAAA;IACH;IAAAA,eAAA;IAW3B,IAAI,CAACC,iBAAiB,GAAGF,MAAM,CAACE,iBAAiB;IACjD,IAAI,CAACC,YAAY,GAAGH,MAAM,CAACG,YAAY;IACvC,IAAI,CAACC,YAAY,GAAGJ,MAAM,CAACI,YAAY;IACvC,IAAI,CAACC,oBAAoB,GAAGL,MAAM,CAACK,oBAAoB;IACvD,IAAI,CAACC,iBAAiB,GAAGN,MAAM,CAACM,iBAAiB;IACjD,IAAI,CAACC,WAAW,GAAGP,MAAM,CAACO,WAAW;EACvC;AACF;AAACC,OAAA,CAAAV,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["HMSVideoTrackSettings","constructor","params","_defineProperty","simulcastSettings","initialState","cameraFacing","forceSoftwareDecoder","disableAutoResize","videoPlugin","exports"],"sources":["HMSVideoTrackSettings.ts"],"sourcesContent":["import type { ImageURISource, ImageRequireSource } from 'react-native';\nimport type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';\nimport type { HMSCameraFacing } from './HMSCameraFacing';\nimport type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';\n\nexport declare class HMSVirtualBackgroundPlugin {\n static NAME: string;\n constructor();\n enable(): Promise<boolean>;\n disable(): Promise<boolean>;\n setBlur(blurRadius: number): Promise<boolean>;\n setBackground(\n backgroundImage: ImageURISource | ImageRequireSource\n ): Promise<boolean>;\n}\n\n/**\n * Represents the settings for a video track in a HMS (100ms) application.\n *\n * This class encapsulates the configurations for video tracks that can be used\n * in a HMS session.\n *\n * @property {HMSSimulcastLayerSettings[]} simulcastSettings - Optional simulcast settings.\n * @property {HMSTrackSettingsInitState} initialState - Optional initial state for the track.\n * @property {HMSCameraFacing} cameraFacing - Optional camera facing for the track.\n * @property {boolean} forceSoftwareDecoder - Optional flag to force software decoder.\n * @property {boolean} disableAutoResize - Optional flag to disable auto resize.\n * @property {HMSVirtualBackgroundPlugin} videoPlugin - Optional video plugin settings.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings\n */\nexport class HMSVideoTrackSettings {\n readonly simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean; // android only\n disableAutoResize?: boolean; // android only\n videoPlugin?: HMSVirtualBackgroundPlugin;\n\n constructor(params: {\n simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean;\n disableAutoResize?: boolean;\n videoPlugin?: HMSVirtualBackgroundPlugin;\n }) {\n this.simulcastSettings = params.simulcastSettings;\n this.initialState = params.initialState;\n this.cameraFacing = params.cameraFacing;\n this.forceSoftwareDecoder = params.forceSoftwareDecoder;\n this.disableAutoResize = params.disableAutoResize;\n this.videoPlugin = params.videoPlugin;\n }\n}\n"],"mappings":";;;;;;;;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,qBAAqB,CAAC;EAQjCC,WAAWA,CAACC,MAOX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAX6B;IAAAA,eAAA;IACH;IAAAA,eAAA;IAW3B,IAAI,CAACC,iBAAiB,GAAGF,MAAM,CAACE,iBAAiB;IACjD,IAAI,CAACC,YAAY,GAAGH,MAAM,CAACG,YAAY;IACvC,IAAI,CAACC,YAAY,GAAGJ,MAAM,CAACI,YAAY;IACvC,IAAI,CAACC,oBAAoB,GAAGL,MAAM,CAACK,oBAAoB;IACvD,IAAI,CAACC,iBAAiB,GAAGN,MAAM,CAACM,iBAAiB;IACjD,IAAI,CAACC,WAAW,GAAGP,MAAM,CAACO,WAAW;EACvC;AACF;AAACC,OAAA,CAAAV,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -11,9 +11,51 @@ var _HMSVideoViewMode = require("./HMSVideoViewMode");
11
11
  var _hmsviews = require("../hooks/hmsviews");
12
12
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
13
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ /**
15
+ * Interface defining the properties for the `HmsView` component.
16
+ *
17
+ * This interface specifies the structure of the props that the `HmsView` component expects. It includes
18
+ * properties for configuring the video track display, such as the track ID, mirroring options,
19
+ * and scale type. It also includes properties for handling events and customizing the component's style.
20
+ *
21
+ * @interface HmsViewProps
22
+ * @property {Object} data - An object containing the track ID, instance ID, mirroring option, and scale type for the video or audio track.
23
+ * @property {string} data.trackId - The unique identifier for the track to be displayed.
24
+ * @property {string} data.id - The identifier for the `HmsViewComponent` instance.
25
+ * @property {boolean} data.mirror - Indicates whether the video should be mirrored. This is commonly used for local video tracks.
26
+ * @property {HMSVideoViewMode} data.scaleType - Determines how the video fits within the bounds of the view (e.g., aspect fill, aspect fit).
27
+ * @property {boolean} autoSimulcast - Enables automatic simulcast layer switching based on network conditions, if supported.
28
+ * @property {boolean} setZOrderMediaOverlay - When true, the video view will be rendered above the regular view hierarchy.
29
+ * @property {ViewStyle} style - Custom styles to apply to the view.
30
+ * @property {Function} onChange - A callback function that is invoked when the `HmsView` component emits a change event.
31
+ * @property {Function} onDataReturned - A callback function that is invoked when the `HmsView` component returns data in response to a capture frame event.
32
+ *
33
+ * @see {https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview}
34
+ */
35
+
36
+ // Imports the `HmsView` component from the native side using the `requireNativeComponent` function.
37
+ // This component is used to render video tracks in the application.
14
38
  const HmsView = (0, _reactNative.requireNativeComponent)('HMSView');
15
39
  let _nextRequestId = 1;
16
40
  let _requestMap = new Map();
41
+
42
+ /**
43
+ * Defines the properties for the `HmsViewComponent`.
44
+ *
45
+ * This interface outlines the props that can be passed to the `HmsViewComponent` to configure its behavior and appearance.
46
+ *
47
+ * @interface HmsComponentProps
48
+ * @property {string} trackId - The unique identifier for the track to be displayed.
49
+ * @property {ViewStyle} [style] - Optional. Custom styles to apply to the view.
50
+ * @property {boolean} [mirror] - Optional. If true, the video will be mirrored. This is commonly used for local video tracks.
51
+ * @property {boolean} [autoSimulcast] - Optional. Enables automatic simulcast layer switching based on network conditions, if supported.
52
+ * @property {HMSVideoViewMode} [scaleType] - Optional. Determines how the video fits within the bounds of the view (e.g., aspect fill, aspect fit).
53
+ * @property {boolean} [setZOrderMediaOverlay] - Optional. When true, the video view will be rendered above the regular view hierarchy.
54
+ * @property {string} id - The identifier for the `HmsViewComponent` instance.
55
+ *
56
+ * @see {https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview}
57
+ */
58
+
17
59
  const HmsViewComponent = exports.HmsViewComponent = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
18
60
  const {
19
61
  trackId,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_HMSConstants","_HMSVideoViewMode","_hmsviews","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HmsView","requireNativeComponent","_nextRequestId","_requestMap","Map","HmsViewComponent","exports","React","forwardRef","props","ref","trackId","style","styles","hmsView","id","HMSConstants","DEFAULT_SDK_ID","mirror","setZOrderMediaOverlay","autoSimulcast","scaleType","HMSVideoViewMode","ASPECT_FILL","hmsViewRef","useRef","applyStyles_ANDROID","setApplyStyles_ANDROID","useState","data","onChange","nativeEvent","event","setHmsViewsResolutionsState","_onDataReturned","requestId","result","error","promise","resolve","reject","delete","capture","viewManagerConfig","UIManager","getViewManagerConfig","requestMap","Promise","dispatchViewManagerCommand","findNodeHandle","current","Commands","useImperativeHandle","createElement","Platform","OS","onDataReturned","StyleSheet","create","flex"],"sources":["HmsView.tsx"],"sourcesContent":["import React, { useState, useImperativeHandle, useRef } from 'react';\nimport {\n findNodeHandle,\n requireNativeComponent,\n StyleSheet,\n UIManager,\n Platform,\n} from 'react-native';\nimport type { NativeSyntheticEvent, ViewStyle } from 'react-native';\nimport { HMSConstants } from './HMSConstants';\nimport { HMSVideoViewMode } from './HMSVideoViewMode';\nimport { setHmsViewsResolutionsState } from '../hooks/hmsviews';\n\ninterface HmsViewProps {\n data: {\n trackId: string;\n id: string;\n mirror: boolean;\n scaleType: HMSVideoViewMode;\n };\n autoSimulcast: boolean;\n setZOrderMediaOverlay: boolean;\n scaleType: HMSVideoViewMode;\n style: ViewStyle;\n onChange: Function;\n onDataReturned: Function;\n}\n\nconst HmsView = requireNativeComponent<HmsViewProps>('HMSView');\nlet _nextRequestId = 1;\nlet _requestMap = new Map();\n\nexport interface HmsComponentProps {\n trackId: string;\n style?: ViewStyle;\n mirror?: boolean;\n autoSimulcast?: boolean;\n scaleType?: HMSVideoViewMode;\n setZOrderMediaOverlay?: boolean;\n id: string;\n}\n\nexport const HmsViewComponent = React.forwardRef<any, HmsComponentProps>(\n (props, ref) => {\n const {\n trackId,\n style = styles.hmsView,\n id = HMSConstants.DEFAULT_SDK_ID,\n mirror = false,\n setZOrderMediaOverlay = false,\n autoSimulcast = true,\n scaleType = HMSVideoViewMode.ASPECT_FILL,\n } = props;\n\n const hmsViewRef: any = useRef();\n const [applyStyles_ANDROID, setApplyStyles_ANDROID] = useState(false);\n const data = {\n trackId,\n id,\n mirror,\n scaleType,\n };\n\n /**\n * This method is passed to `onChange` prop of `HmsView` Native Component.\n * It is invoked when `HmsView` emits 'topChange' event.\n */\n const onChange = ({\n nativeEvent,\n }: NativeSyntheticEvent<{\n data: { height: number; width: number };\n event: 'ON_RESOLUTION_CHANGE_EVENT';\n }>) => {\n const { event, data } = nativeEvent;\n\n setApplyStyles_ANDROID(true);\n\n if (event === 'ON_RESOLUTION_CHANGE_EVENT') {\n setHmsViewsResolutionsState(trackId, data);\n }\n };\n\n /**\n * This method is passed to `onDataReturned` prop of `HmsView` Native Component.\n * It is invoked when `HmsView` emits 'captureFrame' event.\n */\n const _onDataReturned = (event: {\n nativeEvent: { requestId: any; result: any; error: any };\n }) => {\n // We grab the relevant data out of our event.\n let { requestId, result, error } = event.nativeEvent;\n // Then we get the promise we saved earlier for the given request ID.\n let promise = _requestMap.get(requestId);\n if (result) {\n // If it was successful, we resolve the promise.\n promise.resolve(result);\n } else {\n // Otherwise, we reject it.\n promise.reject(error);\n }\n // Finally, we clean up our request map.\n _requestMap.delete(requestId);\n };\n\n const capture = async () => {\n const viewManagerConfig = UIManager.getViewManagerConfig('HMSView');\n\n let requestId = _nextRequestId++;\n let requestMap = _requestMap;\n\n // We create a promise here that will be resolved once `_onRequestDone` is\n // called.\n let promise = new Promise(function (resolve, reject) {\n requestMap.set(requestId, { resolve, reject });\n });\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsViewRef.current),\n viewManagerConfig.Commands.capture,\n [requestId]\n );\n return promise;\n };\n\n useImperativeHandle(ref, () => {\n return {\n capture,\n };\n });\n\n return (\n <HmsView\n ref={hmsViewRef}\n onChange={onChange}\n data={data}\n style={\n Platform.OS === 'android' ? (applyStyles_ANDROID ? style : {}) : style\n }\n autoSimulcast={autoSimulcast}\n scaleType={scaleType}\n setZOrderMediaOverlay={setZOrderMediaOverlay}\n onDataReturned={_onDataReturned}\n />\n );\n }\n);\n\nconst styles = StyleSheet.create({\n hmsView: {\n flex: 1,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAgE,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,C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S,CAAC;IAEnE,IAAIV,SAAS,GAAGjC,cAAc,EAAE;IAChC,IAAI4C,UAAU,GAAG3C,WAAW;;IAE5B;IACA;IACA,IAAImC,OAAO,GAAG,IAAIS,OAAO,CAAC,UAAUR,OAAO,EAAEC,MAAM,EAAE;MACnDM,UAAU,CAAC/C,GAAG,CAACoC,SAAS,EAAE;QAAEI,OAAO;QAAEC;MAAO,CAAC,CAAC;IAChD,CAAC,CAAC;IAEFI,sBAAS,CAACI,0BAA0B,CAClC,IAAAC,2BAAc,EAACzB,UAAU,CAAC0B,OAAO,CAAC,EAClCP,iBAAiB,CAACQ,QAAQ,CAACT,OAAO,EAClC,CAACP,SAAS,CACZ,CAAC;IACD,OAAOG,OAAO;EAChB,CAAC;EAED,IAAAc,0BAAmB,EAAC1C,GAAG,EAAE,MAAM;IAC7B,OAAO;MACLgC;IACF,CAAC;EACH,CAAC,CAAC;EAEF,oBACErE,MAAA,CAAAa,OAAA,CAAAmE,aAAA,CAACrD,OAAO;IACNU,GAAG,EAAEc,UAAW;IAChBM,QAAQ,EAAEA,QAAS;IACnBD,IAAI,EAAEA,IAAK;IACXjB,KAAK,EACH0C,qBAAQ,CAACC,EAAE,KAAK,SAAS,GAAI7B,mBAAmB,GAAGd,KAAK,GAAG,CAAC,CAAC,GAAIA,KAClE;IACDQ,aAAa,EAAEA,aAAc;IAC7BC,SAAS,EAAEA,SAAU;IACrBF,qBAAqB,EAAEA,qBAAsB;IAC7CqC,cAAc,EAAEtB;EAAgB,CACjC,CAAC;AAEN,CACF,CAAC;AAED,MAAMrB,MAAM,GAAG4C,uBAAU,CAACC,MAAM,CAAC;EAC/B5C,OAAO,EAAE;IACP6C,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_HMSConstants","_HMSVideoViewMode","_hmsviews","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HmsView","requireNativeComponent","_nextRequestId","_requestMap","Map","HmsViewComponent","exports","React","forwardRef","props","ref","trackId","style","styles","hmsView","id","HMSConstants","DEFAULT_SDK_ID","mirror","setZOrderMediaOverlay","autoSimulcast","scaleType","HMSVideoViewMode","ASPECT_FILL","hmsViewRef","useRef","applyStyles_ANDROID","setApplyStyles_ANDROID","useState","data","onChange","nativeEvent","event","setHmsViewsResolutionsState","_onDataReturned","requestId","result","error","promise","resolve","reject","delete","capture","viewManagerConfig","UIManager","getViewManagerConfig","requestMap","Promise","dispatchViewManagerCommand","findNodeHandle","current","Commands","useImperativeHandle","createElement","Platform","OS","onDataReturned","StyleSheet","create","flex"],"sources":["HmsView.tsx"],"sourcesContent":["import React, { useState, useImperativeHandle, useRef } from 'react';\nimport {\n findNodeHandle,\n requireNativeComponent,\n StyleSheet,\n UIManager,\n Platform,\n} from 'react-native';\nimport type { NativeSyntheticEvent, ViewStyle } from 'react-native';\nimport { HMSConstants } from './HMSConstants';\nimport { HMSVideoViewMode } from './HMSVideoViewMode';\nimport { setHmsViewsResolutionsState } from '../hooks/hmsviews';\n\n/**\n * Interface defining the properties for the `HmsView` component.\n *\n * This interface specifies the structure of the props that the `HmsView` component expects. It includes\n * properties for configuring the video track display, such as the track ID, mirroring options,\n * and scale type. It also includes properties for handling events and customizing the component's style.\n *\n * @interface HmsViewProps\n * @property {Object} data - An object containing the track ID, instance ID, mirroring option, and scale type for the video or audio track.\n * @property {string} data.trackId - The unique identifier for the track to be displayed.\n * @property {string} data.id - The identifier for the `HmsViewComponent` instance.\n * @property {boolean} data.mirror - Indicates whether the video should be mirrored. This is commonly used for local video tracks.\n * @property {HMSVideoViewMode} data.scaleType - Determines how the video fits within the bounds of the view (e.g., aspect fill, aspect fit).\n * @property {boolean} autoSimulcast - Enables automatic simulcast layer switching based on network conditions, if supported.\n * @property {boolean} setZOrderMediaOverlay - When true, the video view will be rendered above the regular view hierarchy.\n * @property {ViewStyle} style - Custom styles to apply to the view.\n * @property {Function} onChange - A callback function that is invoked when the `HmsView` component emits a change event.\n * @property {Function} onDataReturned - A callback function that is invoked when the `HmsView` component returns data in response to a capture frame event.\n *\n * @see {https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview}\n */\ninterface HmsViewProps {\n data: {\n trackId: string;\n id: string;\n mirror: boolean;\n scaleType: HMSVideoViewMode;\n };\n autoSimulcast: boolean;\n setZOrderMediaOverlay: boolean;\n scaleType: HMSVideoViewMode;\n style: ViewStyle;\n onChange: Function;\n onDataReturned: Function;\n}\n\n// Imports the `HmsView` component from the native side using the `requireNativeComponent` function.\n// This component is used to render video tracks in the application.\nconst HmsView = requireNativeComponent<HmsViewProps>('HMSView');\nlet _nextRequestId = 1;\nlet _requestMap = new Map();\n\n/**\n * Defines the properties for the `HmsViewComponent`.\n *\n * This interface outlines the props that can be passed to the `HmsViewComponent` to configure its behavior and appearance.\n *\n * @interface HmsComponentProps\n * @property {string} trackId - The unique identifier for the track to be displayed.\n * @property {ViewStyle} [style] - Optional. Custom styles to apply to the view.\n * @property {boolean} [mirror] - Optional. If true, the video will be mirrored. This is commonly used for local video tracks.\n * @property {boolean} [autoSimulcast] - Optional. Enables automatic simulcast layer switching based on network conditions, if supported.\n * @property {HMSVideoViewMode} [scaleType] - Optional. Determines how the video fits within the bounds of the view (e.g., aspect fill, aspect fit).\n * @property {boolean} [setZOrderMediaOverlay] - Optional. When true, the video view will be rendered above the regular view hierarchy.\n * @property {string} id - The identifier for the `HmsViewComponent` instance.\n *\n * @see {https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview}\n */\nexport interface HmsComponentProps {\n trackId: string;\n style?: ViewStyle;\n mirror?: boolean;\n autoSimulcast?: boolean;\n scaleType?: HMSVideoViewMode;\n setZOrderMediaOverlay?: boolean;\n id: string;\n}\n\nexport const HmsViewComponent = React.forwardRef<any, HmsComponentProps>(\n (props, ref) => {\n const {\n trackId,\n style = styles.hmsView,\n id = HMSConstants.DEFAULT_SDK_ID,\n mirror = false,\n setZOrderMediaOverlay = false,\n autoSimulcast = true,\n scaleType = HMSVideoViewMode.ASPECT_FILL,\n } = props;\n\n const hmsViewRef: any = useRef();\n const [applyStyles_ANDROID, setApplyStyles_ANDROID] = useState(false);\n const data = {\n trackId,\n id,\n mirror,\n scaleType,\n };\n\n /**\n * This method is passed to `onChange` prop of `HmsView` Native Component.\n * It is invoked when `HmsView` emits 'topChange' event.\n */\n const onChange = ({\n nativeEvent,\n }: NativeSyntheticEvent<{\n data: { height: number; width: number };\n event: 'ON_RESOLUTION_CHANGE_EVENT';\n }>) => {\n const { event, data } = nativeEvent;\n\n setApplyStyles_ANDROID(true);\n\n if (event === 'ON_RESOLUTION_CHANGE_EVENT') {\n setHmsViewsResolutionsState(trackId, data);\n }\n };\n\n /**\n * This method is passed to `onDataReturned` prop of `HmsView` Native Component.\n * It is invoked when `HmsView` emits 'captureFrame' event.\n */\n const _onDataReturned = (event: {\n nativeEvent: { requestId: any; result: any; error: any };\n }) => {\n // We grab the relevant data out of our event.\n let { requestId, result, error } = event.nativeEvent;\n // Then we get the promise we saved earlier for the given request ID.\n let promise = _requestMap.get(requestId);\n if (result) {\n // If it was successful, we resolve the promise.\n promise.resolve(result);\n } else {\n // Otherwise, we reject it.\n promise.reject(error);\n }\n // Finally, we clean up our request map.\n _requestMap.delete(requestId);\n };\n\n const capture = async () => {\n const viewManagerConfig = UIManager.getViewManagerConfig('HMSView');\n\n let requestId = _nextRequestId++;\n let requestMap = _requestMap;\n\n // We create a promise here that will be resolved once `_onRequestDone` is\n // called.\n let promise = new Promise(function (resolve, reject) {\n requestMap.set(requestId, { resolve, reject });\n });\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsViewRef.current),\n viewManagerConfig.Commands.capture,\n [requestId]\n );\n return promise;\n };\n\n useImperativeHandle(ref, () => {\n return {\n capture,\n };\n });\n\n return (\n <HmsView\n ref={hmsViewRef}\n onChange={onChange}\n data={data}\n style={\n Platform.OS === 'android' ? (applyStyles_ANDROID ? style : {}) : style\n }\n autoSimulcast={autoSimulcast}\n scaleType={scaleType}\n setZOrderMediaOverlay={setZOrderMediaOverlay}\n onDataReturned={_onDataReturned}\n />\n );\n }\n);\n\nconst styles = StyleSheet.create({\n hmsView: {\n flex: 1,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAgE,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA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AC1C,GAAG,EAAE,MAAM;IAC7B,OAAO;MACLgC;IACF,CAAC;EACH,CAAC,CAAC;EAEF,oBACErE,MAAA,CAAAa,OAAA,CAAAmE,aAAA,CAACrD,OAAO;IACNU,GAAG,EAAEc,UAAW;IAChBM,QAAQ,EAAEA,QAAS;IACnBD,IAAI,EAAEA,IAAK;IACXjB,KAAK,EACH0C,qBAAQ,CAACC,EAAE,KAAK,SAAS,GAAI7B,mBAAmB,GAAGd,KAAK,GAAG,CAAC,CAAC,GAAIA,KAClE;IACDQ,aAAa,EAAEA,aAAc;IAC7BC,SAAS,EAAEA,SAAU;IACrBF,qBAAqB,EAAEA,qBAAsB;IAC7CqC,cAAc,EAAEtB;EAAgB,CACjC,CAAC;AAEN,CACF,CAAC;AAED,MAAMrB,MAAM,GAAG4C,uBAAU,CAACC,MAAM,CAAC;EAC/B5C,OAAO,EAAE;IACP6C,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Enum for HMSAudioDevice types.
3
+ *
4
+ * This enum represents the different types of audio devices that can be used
5
+ * in the context of the HMS SDK. It provides a way to specify the preferred
6
+ * audio output device for audio playback.
7
+ *
8
+ * @enum {string}
9
+ */
1
10
  export let HMSAudioDevice = /*#__PURE__*/function (HMSAudioDevice) {
2
11
  HMSAudioDevice["SPEAKER_PHONE"] = "SPEAKER_PHONE";
3
12
  HMSAudioDevice["WIRED_HEADSET"] = "WIRED_HEADSET";