@stream-io/video-react-native-sdk 2.0.0-beta.0 → 2.0.0-beta.2

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 (263) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/README.md +15 -0
  3. package/android/build.gradle +7 -1
  4. package/android/src/main/java/com/streamvideo/reactnative/audio/AudioDeviceManager.kt +110 -58
  5. package/android/src/main/java/com/streamvideo/reactnative/audio/CommunicationModeKeepAlive.kt +247 -0
  6. package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +16 -5
  7. package/dist/commonjs/components/Call/CallContent/CallContent.js +1 -1
  8. package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
  9. package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +78 -7
  10. package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
  11. package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +3 -0
  12. package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
  13. package/dist/commonjs/components/Call/Lobby/JoinCallButton.js +3 -2
  14. package/dist/commonjs/components/Call/Lobby/JoinCallButton.js.map +1 -1
  15. package/dist/commonjs/components/Call/Lobby/Lobby.js +4 -3
  16. package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
  17. package/dist/commonjs/components/Call/Lobby/LobbyFooter.js +10 -10
  18. package/dist/commonjs/components/Call/Lobby/LobbyFooter.js.map +1 -1
  19. package/dist/commonjs/components/Call/RingingCallContent/CallLeftIndicator.js +3 -3
  20. package/dist/commonjs/components/Call/RingingCallContent/CallLeftIndicator.js.map +1 -1
  21. package/dist/commonjs/components/Call/RingingCallContent/CallPreparingIndicator.js +3 -3
  22. package/dist/commonjs/components/Call/RingingCallContent/CallPreparingIndicator.js.map +1 -1
  23. package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js +3 -2
  24. package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
  25. package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js +7 -14
  26. package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
  27. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +3 -2
  28. package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
  29. package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamEnded.js +4 -3
  30. package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamEnded.js.map +1 -1
  31. package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js +3 -3
  32. package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -1
  33. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js +9 -4
  34. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
  35. package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js +4 -3
  36. package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
  37. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +27 -4
  38. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
  39. package/dist/commonjs/components/utility/ScreenShareOverlay.js +4 -3
  40. package/dist/commonjs/components/utility/ScreenShareOverlay.js.map +1 -1
  41. package/dist/commonjs/i18n/Streami18n.js +77 -0
  42. package/dist/commonjs/i18n/Streami18n.js.map +1 -0
  43. package/dist/commonjs/i18n/TranslationContext.js +52 -0
  44. package/dist/commonjs/i18n/TranslationContext.js.map +1 -0
  45. package/dist/commonjs/i18n/index.js +85 -0
  46. package/dist/commonjs/i18n/index.js.map +1 -0
  47. package/dist/commonjs/i18n/keys.js +2 -0
  48. package/dist/commonjs/i18n/keys.js.map +1 -0
  49. package/dist/commonjs/i18n/runtimeDefaults.js +24 -0
  50. package/dist/commonjs/i18n/runtimeDefaults.js.map +1 -0
  51. package/dist/commonjs/i18n/types.js +6 -0
  52. package/dist/commonjs/i18n/types.js.map +1 -0
  53. package/dist/commonjs/i18n/useStreami18n.js +61 -0
  54. package/dist/commonjs/i18n/useStreami18n.js.map +1 -0
  55. package/dist/commonjs/index.js +18 -5
  56. package/dist/commonjs/index.js.map +1 -1
  57. package/dist/commonjs/modules/encryption/EncryptionManager.js +305 -0
  58. package/dist/commonjs/modules/encryption/EncryptionManager.js.map +1 -0
  59. package/dist/commonjs/modules/encryption/eventMapping.js +143 -0
  60. package/dist/commonjs/modules/encryption/eventMapping.js.map +1 -0
  61. package/dist/commonjs/modules/encryption/index.js +13 -0
  62. package/dist/commonjs/modules/encryption/index.js.map +1 -0
  63. package/dist/commonjs/modules/encryption/parity.js +6 -0
  64. package/dist/commonjs/modules/encryption/parity.js.map +1 -0
  65. package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js +6 -2
  66. package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
  67. package/dist/commonjs/providers/StreamVideo.js +28 -12
  68. package/dist/commonjs/providers/StreamVideo.js.map +1 -1
  69. package/dist/commonjs/utils/StreamVideoRN/index.js +46 -0
  70. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  71. package/dist/commonjs/utils/internal/callingx/callingx.js +29 -4
  72. package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -1
  73. package/dist/commonjs/utils/internal/iosPipTrack.js +41 -0
  74. package/dist/commonjs/utils/internal/iosPipTrack.js.map +1 -0
  75. package/dist/commonjs/utils/internal/registerSDKGlobals.js +6 -0
  76. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  77. package/dist/commonjs/utils/internal/ringingCallLifecycle.js +142 -0
  78. package/dist/commonjs/utils/internal/ringingCallLifecycle.js.map +1 -0
  79. package/dist/commonjs/utils/push/internal/utils.js +4 -0
  80. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  81. package/dist/commonjs/version.js +1 -1
  82. package/dist/module/components/Call/CallContent/CallContent.js +1 -1
  83. package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
  84. package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +80 -9
  85. package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
  86. package/dist/module/components/Call/CallContent/RTCViewPipNative.js +3 -0
  87. package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
  88. package/dist/module/components/Call/Lobby/JoinCallButton.js +3 -2
  89. package/dist/module/components/Call/Lobby/JoinCallButton.js.map +1 -1
  90. package/dist/module/components/Call/Lobby/Lobby.js +4 -3
  91. package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
  92. package/dist/module/components/Call/Lobby/LobbyFooter.js +10 -10
  93. package/dist/module/components/Call/Lobby/LobbyFooter.js.map +1 -1
  94. package/dist/module/components/Call/RingingCallContent/CallLeftIndicator.js +2 -2
  95. package/dist/module/components/Call/RingingCallContent/CallLeftIndicator.js.map +1 -1
  96. package/dist/module/components/Call/RingingCallContent/CallPreparingIndicator.js +2 -2
  97. package/dist/module/components/Call/RingingCallContent/CallPreparingIndicator.js.map +1 -1
  98. package/dist/module/components/Call/RingingCallContent/IncomingCall.js +3 -2
  99. package/dist/module/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
  100. package/dist/module/components/Call/RingingCallContent/OutgoingCall.js +7 -14
  101. package/dist/module/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
  102. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +3 -2
  103. package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
  104. package/dist/module/components/Livestream/LivestreamPlayer/LivestreamEnded.js +4 -3
  105. package/dist/module/components/Livestream/LivestreamPlayer/LivestreamEnded.js.map +1 -1
  106. package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js +2 -2
  107. package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -1
  108. package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js +9 -4
  109. package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
  110. package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js +4 -3
  111. package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
  112. package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +28 -5
  113. package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
  114. package/dist/module/components/utility/ScreenShareOverlay.js +4 -3
  115. package/dist/module/components/utility/ScreenShareOverlay.js.map +1 -1
  116. package/dist/module/i18n/Streami18n.js +73 -0
  117. package/dist/module/i18n/Streami18n.js.map +1 -0
  118. package/dist/module/i18n/TranslationContext.js +48 -0
  119. package/dist/module/i18n/TranslationContext.js.map +1 -0
  120. package/dist/module/i18n/index.js +20 -0
  121. package/dist/module/i18n/index.js.map +1 -0
  122. package/dist/module/i18n/keys.js +2 -0
  123. package/dist/module/i18n/keys.js.map +1 -0
  124. package/dist/module/i18n/runtimeDefaults.js +20 -0
  125. package/dist/module/i18n/runtimeDefaults.js.map +1 -0
  126. package/dist/module/i18n/types.js +4 -0
  127. package/dist/module/i18n/types.js.map +1 -0
  128. package/dist/module/i18n/useStreami18n.js +56 -0
  129. package/dist/module/i18n/useStreami18n.js.map +1 -0
  130. package/dist/module/index.js +6 -1
  131. package/dist/module/index.js.map +1 -1
  132. package/dist/module/modules/encryption/EncryptionManager.js +301 -0
  133. package/dist/module/modules/encryption/EncryptionManager.js.map +1 -0
  134. package/dist/module/modules/encryption/eventMapping.js +135 -0
  135. package/dist/module/modules/encryption/eventMapping.js.map +1 -0
  136. package/dist/module/modules/encryption/index.js +4 -0
  137. package/dist/module/modules/encryption/index.js.map +1 -0
  138. package/dist/module/modules/encryption/parity.js +4 -0
  139. package/dist/module/modules/encryption/parity.js.map +1 -0
  140. package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js +6 -2
  141. package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
  142. package/dist/module/providers/StreamVideo.js +29 -14
  143. package/dist/module/providers/StreamVideo.js.map +1 -1
  144. package/dist/module/utils/StreamVideoRN/index.js +46 -0
  145. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  146. package/dist/module/utils/internal/callingx/callingx.js +29 -4
  147. package/dist/module/utils/internal/callingx/callingx.js.map +1 -1
  148. package/dist/module/utils/internal/iosPipTrack.js +35 -0
  149. package/dist/module/utils/internal/iosPipTrack.js.map +1 -0
  150. package/dist/module/utils/internal/registerSDKGlobals.js +6 -0
  151. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  152. package/dist/module/utils/internal/ringingCallLifecycle.js +134 -0
  153. package/dist/module/utils/internal/ringingCallLifecycle.js.map +1 -0
  154. package/dist/module/utils/push/internal/utils.js +4 -0
  155. package/dist/module/utils/push/internal/utils.js.map +1 -1
  156. package/dist/module/version.js +1 -1
  157. package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
  158. package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +12 -0
  159. package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
  160. package/dist/typescript/components/Call/Lobby/JoinCallButton.d.ts.map +1 -1
  161. package/dist/typescript/components/Call/Lobby/Lobby.d.ts.map +1 -1
  162. package/dist/typescript/components/Call/Lobby/LobbyFooter.d.ts.map +1 -1
  163. package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts.map +1 -1
  164. package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts.map +1 -1
  165. package/dist/typescript/components/Livestream/LivestreamPlayer/LivestreamEnded.d.ts.map +1 -1
  166. package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLobby.d.ts.map +1 -1
  167. package/dist/typescript/components/Participant/ParticipantView/ParticipantLabel.d.ts.map +1 -1
  168. package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts +11 -0
  169. package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts.map +1 -1
  170. package/dist/typescript/components/utility/ScreenShareOverlay.d.ts.map +1 -1
  171. package/dist/typescript/i18n/Streami18n.d.ts +61 -0
  172. package/dist/typescript/i18n/Streami18n.d.ts.map +1 -0
  173. package/dist/typescript/i18n/TranslationContext.d.ts +31 -0
  174. package/dist/typescript/i18n/TranslationContext.d.ts.map +1 -0
  175. package/dist/typescript/i18n/index.d.ts +17 -0
  176. package/dist/typescript/i18n/index.d.ts.map +1 -0
  177. package/dist/typescript/i18n/keys.d.ts +38 -0
  178. package/dist/typescript/i18n/keys.d.ts.map +1 -0
  179. package/dist/typescript/i18n/runtimeDefaults.d.ts +18 -0
  180. package/dist/typescript/i18n/runtimeDefaults.d.ts.map +1 -0
  181. package/dist/typescript/i18n/types.d.ts +46 -0
  182. package/dist/typescript/i18n/types.d.ts.map +1 -0
  183. package/dist/typescript/i18n/useStreami18n.d.ts +20 -0
  184. package/dist/typescript/i18n/useStreami18n.d.ts.map +1 -0
  185. package/dist/typescript/index.d.ts +2 -1
  186. package/dist/typescript/index.d.ts.map +1 -1
  187. package/dist/typescript/modules/encryption/EncryptionManager.d.ts +190 -0
  188. package/dist/typescript/modules/encryption/EncryptionManager.d.ts.map +1 -0
  189. package/dist/typescript/modules/encryption/eventMapping.d.ts +38 -0
  190. package/dist/typescript/modules/encryption/eventMapping.d.ts.map +1 -0
  191. package/dist/typescript/modules/encryption/index.d.ts +2 -0
  192. package/dist/typescript/modules/encryption/index.d.ts.map +1 -0
  193. package/dist/typescript/modules/encryption/parity.d.ts +55 -0
  194. package/dist/typescript/modules/encryption/parity.d.ts.map +1 -0
  195. package/dist/typescript/providers/NoiseCancellation/NoiseCancellationProvider.d.ts.map +1 -1
  196. package/dist/typescript/providers/StreamVideo.d.ts +17 -4
  197. package/dist/typescript/providers/StreamVideo.d.ts.map +1 -1
  198. package/dist/typescript/utils/StreamVideoRN/index.d.ts +33 -1
  199. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  200. package/dist/typescript/utils/StreamVideoRN/types.d.ts +67 -0
  201. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  202. package/dist/typescript/utils/internal/callingx/callingx.d.ts +1 -1
  203. package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -1
  204. package/dist/typescript/utils/internal/iosPipTrack.d.ts +9 -0
  205. package/dist/typescript/utils/internal/iosPipTrack.d.ts.map +1 -0
  206. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  207. package/dist/typescript/utils/internal/ringingCallLifecycle.d.ts +27 -0
  208. package/dist/typescript/utils/internal/ringingCallLifecycle.d.ts.map +1 -0
  209. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  210. package/dist/typescript/version.d.ts +1 -1
  211. package/ios/RTCViewPip.swift +33 -8
  212. package/ios/RTCViewPipManager.mm +1 -0
  213. package/package.json +17 -13
  214. package/src/components/Call/CallContent/CallContent.tsx +1 -1
  215. package/src/components/Call/CallContent/RTCViewPipIOS.tsx +92 -10
  216. package/src/components/Call/CallContent/RTCViewPipNative.tsx +13 -0
  217. package/src/components/Call/Lobby/JoinCallButton.tsx +5 -2
  218. package/src/components/Call/Lobby/Lobby.tsx +6 -3
  219. package/src/components/Call/Lobby/LobbyFooter.tsx +15 -10
  220. package/src/components/Call/RingingCallContent/CallLeftIndicator.tsx +2 -2
  221. package/src/components/Call/RingingCallContent/CallPreparingIndicator.tsx +2 -2
  222. package/src/components/Call/RingingCallContent/IncomingCall.tsx +2 -2
  223. package/src/components/Call/RingingCallContent/OutgoingCall.tsx +7 -14
  224. package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +5 -8
  225. package/src/components/Livestream/LivestreamPlayer/LivestreamEnded.tsx +11 -3
  226. package/src/components/Livestream/LivestreamTopView/LiveIndicator.tsx +2 -2
  227. package/src/components/Livestream/ViewerLivestream/ViewerLobby.tsx +23 -10
  228. package/src/components/Participant/ParticipantView/ParticipantLabel.tsx +15 -6
  229. package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +58 -5
  230. package/src/components/utility/ScreenShareOverlay.tsx +7 -3
  231. package/src/i18n/Streami18n.ts +71 -0
  232. package/src/i18n/TranslationContext.tsx +55 -0
  233. package/src/i18n/index.ts +22 -0
  234. package/src/i18n/keys.ts +42 -0
  235. package/src/i18n/runtimeDefaults.ts +17 -0
  236. package/src/i18n/types.ts +78 -0
  237. package/src/i18n/useStreami18n.ts +66 -0
  238. package/src/index.ts +6 -1
  239. package/src/modules/call-manager/native-module.d.ts +14 -0
  240. package/src/modules/encryption/EncryptionManager.ts +360 -0
  241. package/src/modules/encryption/eventMapping.ts +151 -0
  242. package/src/modules/encryption/index.ts +1 -0
  243. package/src/modules/encryption/parity.ts +83 -0
  244. package/src/providers/NoiseCancellation/NoiseCancellationProvider.tsx +8 -4
  245. package/src/providers/StreamVideo.tsx +39 -28
  246. package/src/utils/StreamVideoRN/index.ts +51 -1
  247. package/src/utils/StreamVideoRN/types.ts +68 -0
  248. package/src/utils/internal/callingx/callingx.ts +37 -2
  249. package/src/utils/internal/iosPipTrack.ts +39 -0
  250. package/src/utils/internal/registerSDKGlobals.ts +2 -0
  251. package/src/utils/internal/ringingCallLifecycle.ts +148 -0
  252. package/src/utils/push/internal/utils.ts +4 -0
  253. package/src/version.ts +1 -1
  254. package/dist/commonjs/translations/en.json +0 -32
  255. package/dist/commonjs/translations/index.js +0 -12
  256. package/dist/commonjs/translations/index.js.map +0 -1
  257. package/dist/module/translations/en.json +0 -32
  258. package/dist/module/translations/index.js +0 -7
  259. package/dist/module/translations/index.js.map +0 -1
  260. package/dist/typescript/translations/index.d.ts +0 -35
  261. package/dist/typescript/translations/index.d.ts.map +0 -1
  262. package/src/translations/en.json +0 -32
  263. package/src/translations/index.ts +0 -3
@@ -0,0 +1,305 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EncryptionManager = void 0;
7
+ var _reactNativeWebrtc = require("@stream-io/react-native-webrtc");
8
+ var _videoClient = require("@stream-io/video-client");
9
+ var _eventMapping = require("./eventMapping");
10
+ /**
11
+ * Distributes keys to the native encryption manager and attaches
12
+ * encrypt/decrypt transforms to RTCRtpSenders and RTCRtpReceivers.
13
+ *
14
+ * The public surface matches the web
15
+ * {@link https://github.com/GetStream/stream-video-js/blob/main/packages/client/src/rtc/e2ee/EncryptionManager.ts | EncryptionManager}
16
+ * method for method, so host code is portable between the two SDKs.
17
+ *
18
+ * The crypto itself lives in the WebRTC binary, not here: frames never cross
19
+ * the React Native bridge. This class carries key and attach commands over it,
20
+ * and diagnostic events back.
21
+ *
22
+ * Like the keys it installs, the manager is application-owned: create one per
23
+ * call, attach it before {@link https://github.com/GetStream/stream-video-js/blob/main/packages/client/src/Call.ts | Call}`.join()`,
24
+ * and {@link EncryptionManager.dispose | dispose} it when that call is done.
25
+ * Nothing in the SDK will do it for you, and on React Native the leak is native
26
+ * rather than collectable.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * if (EncryptionManager.isSupported()) {
31
+ * const e2ee = await EncryptionManager.create(call.currentUserId);
32
+ * e2ee.setSharedKey(0, keyBytes);
33
+ * call.setE2EEManager(e2ee); // must happen before call.join()
34
+ * }
35
+ * ```
36
+ */
37
+ class EncryptionManager {
38
+ bridged = [];
39
+ disposed = false;
40
+ constructor(native, algorithm) {
41
+ this.native = native;
42
+ this.algorithm = algorithm;
43
+ this.logger = _videoClient.videoLoggerSystem.getLogger('EncryptionManager');
44
+ this.events = new _videoClient.TypedEventEmitter(this.logger);
45
+ // Native dispatches per event name, so the one handler is registered under
46
+ // each of them, and each registration has to be undone on dispose.
47
+ for (const type of _eventMapping.E2EE_EVENT_TYPES) {
48
+ this.native.on(type, this.handleNativeEvent);
49
+ this.bridged.push([type, this.handleNativeEvent]);
50
+ }
51
+ }
52
+ handleNativeEvent = data => {
53
+ const event = (0, _eventMapping.mapNativeEvent)(data);
54
+ if (!event) return;
55
+ this.events.emit(event.type, event.payload);
56
+ };
57
+
58
+ /**
59
+ * Whether E2EE can run here. Use it to guard UI, or to avoid calling
60
+ * {@link create} where it would throw.
61
+ *
62
+ * `false` means the installed `@stream-io/react-native-webrtc` predates E2EE
63
+ * support.
64
+ */
65
+ static isSupported = () => _reactNativeWebrtc.RTCEncryptionManager?.isSupported() ?? false;
66
+
67
+ /**
68
+ * Create an EncryptionManager and initialize the underlying native manager.
69
+ *
70
+ * Attach it with `call.setE2EEManager()` **before** `call.join()`: the join
71
+ * request carries the E2EE flag, and the peer connections are built with the
72
+ * transforms in place.
73
+ *
74
+ * Resolves rather than returning directly because every Stream SDK exposes
75
+ * this as a promise; nothing here is actually asynchronous, since a blocking
76
+ * native create is what keeps a sender from ever existing unencrypted.
77
+ *
78
+ * @param userId - The local user's ID, normally `call.currentUserId`.
79
+ * @param options - the create options.
80
+ * @throws {Error} If E2EE is unavailable. It never degrades to plaintext.
81
+ */
82
+ static create = async (userId, options) => {
83
+ if (!_reactNativeWebrtc.RTCEncryptionManager) {
84
+ throw new Error('E2EE requires a version of @stream-io/react-native-webrtc that supports RTCEncryptionManager');
85
+ }
86
+ if (!_reactNativeWebrtc.RTCEncryptionManager.isSupported()) {
87
+ throw new Error('E2EE is not supported on this device');
88
+ }
89
+ const algorithm = options?.algorithm ?? 'AES-128-GCM';
90
+ const native = _reactNativeWebrtc.RTCEncryptionManager.create(userId, {
91
+ algorithm: (0, _eventMapping.algorithmToNative)(algorithm)
92
+ });
93
+ return new EncryptionManager(native, algorithm);
94
+ };
95
+
96
+ /**
97
+ * Subscribe to an E2EE event.
98
+ *
99
+ * @returns a function that unsubscribes the listener.
100
+ */
101
+ on = (event, fn) => this.events.on(event, fn);
102
+
103
+ /** Unsubscribe a listener registered with {@link on}. */
104
+ off = (event, fn) => this.events.off(event, fn);
105
+
106
+ /** Drop every listener, or every listener of one event. */
107
+ removeAllListeners = event => this.events.removeAllListeners(event);
108
+
109
+ /**
110
+ * Set a per-user AES-GCM encryption key in the native key store.
111
+ *
112
+ * Use it when each participant has their own key from a central authority.
113
+ * The receiver picks the right one by the `keyIndex` in the frame trailer.
114
+ *
115
+ * @param userId - The key owner.
116
+ * @param keyIndex - Increases with each rotation.
117
+ * @param rawKey - 16 bytes for AES-128-GCM, 32 for AES-256-GCM.
118
+ */
119
+ setKey = (userId, keyIndex, rawKey) => {
120
+ this.assertUsable();
121
+ this.validateKeyIndex(keyIndex);
122
+ this.validateKeyLength(rawKey);
123
+ this.native.setKey(userId, keyIndex, this.copyKey(rawKey));
124
+ };
125
+
126
+ /**
127
+ * Fallback key for any user without a per-user key. The simplest E2EE mode:
128
+ * one key for everyone, usually passphrase-derived, no distribution needed.
129
+ * Setting an epoch makes it active for encryption while older epochs remain
130
+ * available to decrypt in-flight frames until {@link removeSharedKey}.
131
+ *
132
+ * @param keyIndex - An integer 0-255, since one trailer byte carries it.
133
+ * @param rawKey - 16 bytes for AES-128-GCM, 32 for AES-256-GCM.
134
+ */
135
+ setSharedKey = (keyIndex, rawKey) => {
136
+ this.assertUsable();
137
+ this.validateKeyIndex(keyIndex);
138
+ this.validateKeyLength(rawKey);
139
+ this.native.setSharedKey(keyIndex, this.copyKey(rawKey));
140
+ };
141
+
142
+ /**
143
+ * Retire one of a user's key epochs, leaving their other epochs usable.
144
+ *
145
+ * @param userId - The key owner.
146
+ * @param keyIndex - The exact epoch to remove. Absent epochs are a no-op.
147
+ */
148
+ removeKey = (userId, keyIndex) => {
149
+ this.assertUsable();
150
+ this.validateKeyIndex(keyIndex);
151
+ this.native.removeKey(userId, keyIndex);
152
+ };
153
+
154
+ /**
155
+ * Drop every key a user holds from the local key store, so later frames of
156
+ * theirs no longer decrypt.
157
+ *
158
+ * This is local cleanup, not remote revocation: it cannot stop that
159
+ * participant from decrypting anything, and a shared key still decrypts them.
160
+ * Revoking access means withholding future keys, which the application owns.
161
+ *
162
+ * To retire one rotated epoch instead, use {@link removeKey}.
163
+ */
164
+ removeAllKeys = userId => {
165
+ this.assertUsable();
166
+ this.native.removeAllKeys(userId);
167
+ };
168
+
169
+ /**
170
+ * Remove one shared-key epoch from the native receive key ring.
171
+ *
172
+ * If this is the active epoch, shared-key encryption stops until
173
+ * {@link setSharedKey} succeeds again. An older epoch is not reactivated.
174
+ *
175
+ * @param keyIndex - The exact shared-key epoch to remove.
176
+ */
177
+ removeSharedKey = keyIndex => {
178
+ this.assertUsable();
179
+ this.validateKeyIndex(keyIndex);
180
+ this.native.removeSharedKey(keyIndex);
181
+ };
182
+
183
+ /**
184
+ * Called by the Publisher when it adds a transceiver.
185
+ *
186
+ * Synchronous all the way to the native `SetFrameTransformer` call: were it
187
+ * async, the sender would exist before its transform did, which is a
188
+ * plaintext window. A failure throws instead of publishing cleartext.
189
+ *
190
+ * @param sender - The sender to encrypt.
191
+ * @param codec - Codec name, e.g. 'vp8', selecting the clear-byte rules.
192
+ * @param trackType - `TrackType` enum name, e.g. 'SCREEN_SHARE_AUDIO'.
193
+ * @internal
194
+ */
195
+ encrypt = (sender, codec, trackType) => {
196
+ this.assertUsable();
197
+ this.native.encrypt(sender, codec, (0, _eventMapping.trackTypeToNative)(trackType));
198
+ };
199
+
200
+ /**
201
+ * Called by the Subscriber when a remote track arrives.
202
+ *
203
+ * @param receiver - The receiver to decrypt.
204
+ * @param userId - The remote user, for key lookup.
205
+ * @param trackType - `TrackType` enum name, e.g. 'SCREEN_SHARE_AUDIO'.
206
+ * @internal
207
+ */
208
+ decrypt = (receiver, userId, trackType) => {
209
+ this.assertUsable();
210
+ this.native.decrypt(receiver, userId, (0, _eventMapping.trackTypeToNative)(trackType));
211
+ };
212
+
213
+ /**
214
+ * Toggle periodic performance reporting.
215
+ *
216
+ * While on, `e2ee.perf_report` is emitted once per second with per-track FPS
217
+ * and crypto timings. Useful for debugging throughput.
218
+ */
219
+ enablePerformanceReporting = enabled => {
220
+ this.assertUsable();
221
+ // Observational, so it is the one native call that need not block. Kept
222
+ // void-returning to match the web manager.
223
+ this.native.enablePerformanceReporting(enabled).catch(err => this.logger.warn('Failed to toggle performance reporting', err));
224
+ };
225
+
226
+ /**
227
+ * Request a snapshot of the installed keys. It arrives later as the
228
+ * `e2ee.key_state` event, listing fingerprints only, never key material.
229
+ */
230
+ requestKeyState = () => {
231
+ this.assertUsable();
232
+ this.native.requestKeyState().catch(err => this.logger.warn('Failed to request key state', err));
233
+ };
234
+
235
+ /**
236
+ * Release the native manager and all resources.
237
+ *
238
+ * **The application owns this object's lifetime — the SDK never disposes it.**
239
+ * Nothing releases the native manager when a peer connection closes, and there
240
+ * is no detach API, so an undisposed manager keeps its transforms and its key
241
+ * material alive for the lifetime of the process. Dispose it together with the
242
+ * call instance whose flow has ended; a later flow gets a fresh call and a
243
+ * fresh manager (see `Call.setE2EEManager`).
244
+ *
245
+ * In-flight frames are dropped rather than drained.
246
+ *
247
+ * The manager is unusable afterwards and every key or attach method throws.
248
+ * Call {@link create} for a new one. Safe to call more than once.
249
+ */
250
+ dispose = () => {
251
+ if (this.disposed) return;
252
+ this.disposed = true;
253
+ for (const [type, handler] of this.bridged) {
254
+ this.native.off(type, handler);
255
+ }
256
+ this.bridged.length = 0;
257
+ try {
258
+ this.native.dispose();
259
+ } catch (err) {
260
+ // Local cleanup still has to finish, or listeners outlive the manager.
261
+ this.logger.warn('Failed to dispose the native encryption manager', err);
262
+ }
263
+ this.events.removeAllListeners();
264
+ };
265
+
266
+ /**
267
+ * {@link dispose} releases the native manager, so an attached transform would
268
+ * point at nothing: frames would stall with no error and no event. Throwing
269
+ * is also fail-closed, since a caller that swallows it still publishes
270
+ * nothing rather than cleartext.
271
+ */
272
+ assertUsable = () => {
273
+ if (this.disposed) throw new Error(`EncryptionManager is disposed`);
274
+ };
275
+
276
+ /**
277
+ * The caller keeps ownership of its buffer and may re-import the same bytes,
278
+ * so hand native a copy rather than a view onto memory that can change.
279
+ */
280
+ copyKey = rawKey => {
281
+ const copy = new Uint8Array(rawKey.byteLength);
282
+ copy.set(new Uint8Array(rawKey));
283
+ return copy;
284
+ };
285
+ validateKeyLength = rawKey => {
286
+ const is256 = this.algorithm === 'AES-256-GCM';
287
+ const expected = is256 ? 32 : 16;
288
+ if (rawKey.byteLength !== expected) {
289
+ throw new Error(`Key must be exactly ${expected} bytes (${is256 ? 'AES-256' : 'AES-128'})`);
290
+ }
291
+ };
292
+
293
+ /**
294
+ * One trailer byte carries the keyIndex. A larger value would truncate to
295
+ * `keyIndex & 0xFF`, so the receiver would look up the wrong key and fail
296
+ * every decrypt. Reject it rather than ship a silently broken key epoch.
297
+ */
298
+ validateKeyIndex = keyIndex => {
299
+ if (!Number.isInteger(keyIndex) || keyIndex < 0 || keyIndex > 255) {
300
+ throw new Error(`keyIndex must be an integer between 0 and 255, got ${keyIndex}`);
301
+ }
302
+ };
303
+ }
304
+ exports.EncryptionManager = EncryptionManager;
305
+ //# sourceMappingURL=EncryptionManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeWebrtc","require","_videoClient","_eventMapping","EncryptionManager","bridged","disposed","constructor","native","algorithm","logger","videoLoggerSystem","getLogger","events","TypedEventEmitter","type","E2EE_EVENT_TYPES","on","handleNativeEvent","push","data","event","mapNativeEvent","emit","payload","isSupported","RTCEncryptionManager","create","userId","options","Error","algorithmToNative","fn","off","removeAllListeners","setKey","keyIndex","rawKey","assertUsable","validateKeyIndex","validateKeyLength","copyKey","setSharedKey","removeKey","removeAllKeys","removeSharedKey","encrypt","sender","codec","trackType","trackTypeToNative","decrypt","receiver","enablePerformanceReporting","enabled","catch","err","warn","requestKeyState","dispose","handler","length","copy","Uint8Array","byteLength","set","is256","expected","Number","isInteger","exports"],"sourceRoot":"../../../../src","sources":["modules/encryption/EncryptionManager.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,aAAA,GAAAF,OAAA;AAOA;AAC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AAA","ignoreList":[]}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.trackTypeToNative = exports.trackTypeFromNative = exports.mapNativeEvent = exports.algorithmToNative = exports.E2EE_EVENT_TYPES = void 0;
7
+ var _reactNativeWebrtc = require("@stream-io/react-native-webrtc");
8
+ /**
9
+ * The core RTC layer labels tracks with the `TrackType` enum *name*
10
+ * (`SfuModels.TrackType[trackType]`), while the native manager takes a numeric
11
+ * enum. Screen-share audio is deliberately its own value: native keeps replay
12
+ * state per (userId, trackType), so folding it into `AUDIO` mis-groups it.
13
+ *
14
+ * These read the native enums inside the function body on purpose. This module
15
+ * is reachable from the SDK's public entry point, so an app whose
16
+ * `@stream-io/react-native-webrtc` predates E2EE would crash on import if the
17
+ * enums were dereferenced at module scope - even if it never touches E2EE.
18
+ */
19
+ const trackTypeToNative = trackType => {
20
+ switch (trackType) {
21
+ case 'AUDIO':
22
+ return _reactNativeWebrtc.RTCEncryptionTrackType.AUDIO;
23
+ case 'VIDEO':
24
+ return _reactNativeWebrtc.RTCEncryptionTrackType.VIDEO;
25
+ case 'SCREEN_SHARE':
26
+ return _reactNativeWebrtc.RTCEncryptionTrackType.SCREEN_SHARE;
27
+ case 'SCREEN_SHARE_AUDIO':
28
+ return _reactNativeWebrtc.RTCEncryptionTrackType.SCREEN_SHARE_AUDIO;
29
+ default:
30
+ // Native infers audio vs video from the sender rather than pinning a
31
+ // wrong value.
32
+ return undefined;
33
+ }
34
+ };
35
+
36
+ /** Map a native track type back to the name the web events carry. */
37
+ exports.trackTypeToNative = trackTypeToNative;
38
+ const trackTypeFromNative = trackType => {
39
+ switch (trackType) {
40
+ case _reactNativeWebrtc.RTCEncryptionTrackType.AUDIO:
41
+ return 'AUDIO';
42
+ case _reactNativeWebrtc.RTCEncryptionTrackType.VIDEO:
43
+ return 'VIDEO';
44
+ case _reactNativeWebrtc.RTCEncryptionTrackType.SCREEN_SHARE:
45
+ return 'SCREEN_SHARE';
46
+ case _reactNativeWebrtc.RTCEncryptionTrackType.SCREEN_SHARE_AUDIO:
47
+ return 'SCREEN_SHARE_AUDIO';
48
+ default:
49
+ return undefined;
50
+ }
51
+ };
52
+
53
+ /** Map the public algorithm name to the native enum. */
54
+ exports.trackTypeFromNative = trackTypeFromNative;
55
+ const algorithmToNative = algorithm => algorithm === 'AES-256-GCM' ? _reactNativeWebrtc.RTCEncryptionAlgorithm.AES_256_GCM : _reactNativeWebrtc.RTCEncryptionAlgorithm.AES_128_GCM;
56
+ exports.algorithmToNative = algorithmToNative;
57
+ const toTrackPerf = row => ({
58
+ userId: row.userId,
59
+ trackType: trackTypeFromNative(row.trackType) ?? '',
60
+ fps: row.fps,
61
+ maxCryptoMs: row.maxCryptoMs
62
+ });
63
+
64
+ /**
65
+ * Translate a native event into the payload the web manager emits, so a host
66
+ * can write one set of handlers for both platforms.
67
+ *
68
+ * Two things have to be reshaped rather than passed through: native track types
69
+ * are numeric, and native flattens `managerId`/`type`/`userId` alongside the
70
+ * payload of every event, including the two (`perf_report`, `key_state`) that
71
+ * are not about a single user. Fields the web types require but native leaves
72
+ * optional get an explicit default, so a handler never reads `undefined` where
73
+ * its type promises a value.
74
+ *
75
+ * @returns the mapped event, or `undefined` for an unrecognized event name.
76
+ */
77
+ const mapNativeEvent = event => {
78
+ const {
79
+ type,
80
+ userId,
81
+ trackType,
82
+ keyIndex,
83
+ version,
84
+ reason
85
+ } = event;
86
+ const mapped = payload => ({
87
+ type,
88
+ payload
89
+ });
90
+ switch (type) {
91
+ case 'e2ee.decryption_failed':
92
+ case 'e2ee.decryption_resumed':
93
+ case 'e2ee.unencrypted_frame':
94
+ return mapped({
95
+ userId,
96
+ trackType: trackTypeFromNative(trackType)
97
+ });
98
+ case 'e2ee.missing_key':
99
+ return mapped({
100
+ userId,
101
+ keyIndex,
102
+ trackType: trackTypeFromNative(trackType)
103
+ });
104
+ case 'e2ee.decryption_stalled':
105
+ return mapped({
106
+ userId,
107
+ keyIndex: keyIndex ?? 0,
108
+ trackType: trackTypeFromNative(trackType)
109
+ });
110
+ case 'e2ee.encryption_failed':
111
+ return mapped({
112
+ userId,
113
+ trackType: trackTypeFromNative(trackType),
114
+ reason: reason ?? ''
115
+ });
116
+ case 'e2ee.unsupported_version':
117
+ return mapped({
118
+ userId,
119
+ trackType: trackTypeFromNative(trackType),
120
+ version: version ?? 0
121
+ });
122
+ case 'e2ee.perf_report':
123
+ return mapped({
124
+ encode: (event.encode ?? []).map(row => ({
125
+ ...toTrackPerf(row),
126
+ codec: row.codec ?? ''
127
+ })),
128
+ decode: (event.decode ?? []).map(toTrackPerf)
129
+ });
130
+ case 'e2ee.key_state':
131
+ return mapped(event.keyState ?? {
132
+ perUserKeys: [],
133
+ sharedKeys: []
134
+ });
135
+ default:
136
+ return undefined;
137
+ }
138
+ };
139
+
140
+ /** Every event the native manager emits, i.e. what the bridge subscribes to. */
141
+ exports.mapNativeEvent = mapNativeEvent;
142
+ const E2EE_EVENT_TYPES = exports.E2EE_EVENT_TYPES = ['e2ee.decryption_failed', 'e2ee.decryption_resumed', 'e2ee.decryption_stalled', 'e2ee.encryption_failed', 'e2ee.missing_key', 'e2ee.unencrypted_frame', 'e2ee.unsupported_version', 'e2ee.perf_report', 'e2ee.key_state'];
143
+ //# sourceMappingURL=eventMapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeWebrtc","require","trackTypeToNative","trackType","RTCEncryptionTrackType","AUDIO","VIDEO","SCREEN_SHARE","SCREEN_SHARE_AUDIO","undefined","exports","trackTypeFromNative","algorithmToNative","algorithm","RTCEncryptionAlgorithm","AES_256_GCM","AES_128_GCM","toTrackPerf","row","userId","fps","maxCryptoMs","mapNativeEvent","event","type","keyIndex","version","reason","mapped","payload","encode","map","codec","decode","keyState","perUserKeys","sharedKeys","E2EE_EVENT_TYPES"],"sourceRoot":"../../../../src","sources":["modules/encryption/eventMapping.ts"],"mappings":";;;;;;AAAA,IAAA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ACC,GAAG,CAAC;UACnBc,KAAK,EAAEd,GAAG,CAACc,KAAK,IAAI;QACtB,CAAC,CAAC,CAAC;QACHC,MAAM,EAAE,CAACV,KAAK,CAACU,MAAM,IAAI,EAAE,EAAEF,GAAG,CAACd,WAAW;MAC9C,CAAC,CAAC;IACJ,KAAK,gBAAgB;MACnB,OAAOW,MAAM,CAACL,KAAK,CAACW,QAAQ,IAAI;QAAEC,WAAW,EAAE,EAAE;QAAEC,UAAU,EAAE;MAAG,CAAC,CAAC;IACtE;MACE,OAAO3B,SAAS;EACpB;AACF,CAAC;;AAED;AAAAC,OAAA,CAAAY,cAAA,GAAAA,cAAA;AACO,MAAMe,gBAAgB,GAAA3B,OAAA,CAAA2B,gBAAA,GAAG,CAC9B,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,CACR","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "EncryptionManager", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _EncryptionManager.EncryptionManager;
10
+ }
11
+ });
12
+ var _EncryptionManager = require("./EncryptionManager");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_EncryptionManager","require"],"sourceRoot":"../../../../src","sources":["modules/encryption/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=parity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/encryption/parity.ts"],"mappings":"","ignoreList":[]}
@@ -41,8 +41,12 @@ const NoiseCancellationProvider = props => {
41
41
  const [isEnabled, setIsEnabled] = (0, _react.useState)(false);
42
42
  (0, _react.useEffect)(() => {
43
43
  const noiseCancellationNativeLib = (0, _lib.getNoiseCancellationLibThrowIfNotInstalled)();
44
- noiseCancellationNativeLib.deviceSupportsAdvancedAudioProcessing().then(result => setDeviceSupportsAdvancedAudioProcessing(result));
45
- noiseCancellationNativeLib.isEnabled().then(e => setIsEnabled(e));
44
+ try {
45
+ setDeviceSupportsAdvancedAudioProcessing(noiseCancellationNativeLib.deviceSupportsAdvancedAudioProcessing());
46
+ setIsEnabled(noiseCancellationNativeLib.isEnabled());
47
+ } catch (err) {
48
+ console.error('Failed to read noise cancellation state', err);
49
+ }
46
50
  }, []);
47
51
  const isSupported = hasCapability && noiseCancellationAllowed;
48
52
  (0, _react.useEffect)(() => {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_videoClient","_videoReactBindings","_lib","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NoiseCancellationContext","createContext","useNoiseCancellation","context","useContext","Error","exports","NoiseCancellationProvider","props","useCall","deviceSupportsAdvancedAudioProcessing","setDeviceSupportsAdvancedAudioProcessing","useState","useCallSettings","useHasPermissions","useCallStateHooks","settings","noiseCancellationAllowed","audio","noise_cancellation","mode","NoiseCancellationSettingsModeEnum","DISABLED","hasCapability","OwnCapability","ENABLE_NOISE_CANCELLATION","isEnabled","setIsEnabled","useEffect","noiseCancellationNativeLib","getNoiseCancellationLibThrowIfNotInstalled","then","result","isSupported","ncInstance","NoiseCancellationWrapper","getInstance","unsubscribe","on","v","microphone","enableNoiseCancellation","catch","err","videoLoggerSystem","getLogger","error","disableNoiseCancellation","jsx","Provider","value","setEnabled","enabledOrSetter","enable","console","disable","children"],"sourceRoot":"../../../../src","sources":["providers/NoiseCancellation/NoiseCancellationProvider.tsx"],"mappings":";;;;;;AAAA,IAAAA,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;UAC3D,CAAC,CAAC;QACJ,CAAC,MAAM;UACLT,UAAU,CAACqB,OAAO,CAAC,CAAC,CAACb,KAAK,CAAEC,GAAG,IAAK;YAClCW,OAAO,CAACR,KAAK,CAAC,sCAAsC,EAAEH,GAAG,CAAC;UAC5D,CAAC,CAAC;QACJ;MACF;IACF,CAAE;IAAAa,QAAA,EAEDhD,KAAK,CAACgD;EAAQ,CACkB,CAAC;AAExC,CAAC;AAAClD,OAAA,CAAAC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_videoClient","_videoReactBindings","_lib","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NoiseCancellationContext","createContext","useNoiseCancellation","context","useContext","Error","exports","NoiseCancellationProvider","props","useCall","deviceSupportsAdvancedAudioProcessing","setDeviceSupportsAdvancedAudioProcessing","useState","useCallSettings","useHasPermissions","useCallStateHooks","settings","noiseCancellationAllowed","audio","noise_cancellation","mode","NoiseCancellationSettingsModeEnum","DISABLED","hasCapability","OwnCapability","ENABLE_NOISE_CANCELLATION","isEnabled","setIsEnabled","useEffect","noiseCancellationNativeLib","getNoiseCancellationLibThrowIfNotInstalled","err","console","error","isSupported","ncInstance","NoiseCancellationWrapper","getInstance","unsubscribe","on","v","microphone","enableNoiseCancellation","catch","videoLoggerSystem","getLogger","disableNoiseCancellation","jsx","Provider","value","setEnabled","enabledOrSetter","enable","disable","children"],"sourceRoot":"../../../../src","sources":["providers/NoiseCancellation/NoiseCancellationProvider.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAGe,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAA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AAC,CAAC;QACJ;MACF;IACF,CAAE;IAAAuB,QAAA,EAED9C,KAAK,CAAC8C;EAAQ,CACkB,CAAC;AAExC,CAAC;AAAChD,OAAA,CAAAC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -8,7 +8,7 @@ var _videoReactBindings = require("@stream-io/video-react-bindings");
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _netinfo = _interopRequireDefault(require("@react-native-community/netinfo"));
10
10
  var _hooks = require("../hooks");
11
- var _translations = require("../translations");
11
+ var _i18n = require("../i18n");
12
12
  var _ThemeContext = require("../contexts/ThemeContext");
13
13
  var _ScreenshotIosContext = require("../contexts/internal/ScreenshotIosContext");
14
14
  var _BusyTonePlayer = _interopRequireDefault(require("./BusyTonePlayer"));
@@ -16,6 +16,17 @@ var _jsxRuntime = require("react/jsx-runtime");
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
18
  /**
19
+ * StreamVideo is the root provider of the SDK: it provides the client to the component tree and
20
+ * mounts the SDK's translation context.
21
+ *
22
+ * The i18n runtime lives here rather than in `@stream-io/video-react-bindings` because the
23
+ * translation key catalog is generated from *this* package's `t()` call sites.
24
+ *
25
+ * There used to be a `translationsOverrides = translations` default parameter here, which was a
26
+ * bug: an integrator passing their own dictionaries *replaced* the SDK's bundled strings instead
27
+ * of merging with them, leaving every untranslated key rendering as a raw dotted path.
28
+ * `useStreami18n` layers integrator dictionaries over the SDK's own defaults, so a partial
29
+ * dictionary is now safe.
19
30
  *
20
31
  * @param props
21
32
  * @returns
@@ -26,11 +37,16 @@ const StreamVideo = props => {
26
37
  const {
27
38
  client,
28
39
  children,
29
- translationsOverrides = _translations.translations,
30
40
  i18nInstance,
31
41
  language,
42
+ translations,
32
43
  style
33
44
  } = props;
45
+ const translationContext = (0, _i18n.useStreami18n)({
46
+ i18nInstance,
47
+ language,
48
+ translations
49
+ });
34
50
 
35
51
  /**
36
52
  * Effect to inform the coordinator about the online status of the app
@@ -53,17 +69,17 @@ const StreamVideo = props => {
53
69
  });
54
70
  });
55
71
  }, [client]);
56
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_videoReactBindings.StreamVideoProvider, {
72
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_videoReactBindings.StreamVideoProvider, {
57
73
  client: client,
58
- language: language,
59
- translationsOverrides: translationsOverrides,
60
- i18nInstance: i18nInstance,
61
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PushRegister, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BusyTonePlayer.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeContext.StreamTheme, {
62
- style: style,
63
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenshotIosContext.ScreenshotIosContextProvider, {
64
- children: children
65
- })
66
- })]
74
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_i18n.TranslationProvider, {
75
+ value: translationContext,
76
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PushRegister, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BusyTonePlayer.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeContext.StreamTheme, {
77
+ style: style,
78
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenshotIosContext.ScreenshotIosContextProvider, {
79
+ children: children
80
+ })
81
+ })]
82
+ })
67
83
  });
68
84
  };
69
85
 
@@ -1 +1 @@
1
- {"version":3,"names":["_videoReactBindings","require","_react","_interopRequireWildcard","_netinfo","_interopRequireDefault","_hooks","_translations","_ThemeContext","_ScreenshotIosContext","_BusyTonePlayer","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StreamVideo","props","client","children","translationsOverrides","translations","i18nInstance","language","style","useEffect","prevIsOnline","NetInfo","addEventListener","state","isConnected","isInternetReachable","isOnline","type","streamClient","updateNetworkConnectionStatus","jsxs","StreamVideoProvider","jsx","PushRegister","StreamTheme","ScreenshotIosContextProvider","exports","usePushRegisterEffect"],"sourceRoot":"../../../src","sources":["providers/StreamVideo.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AAEA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAL,sBAAA,CAAAJ,OAAA;AAA8C,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAI,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,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C5Cd,MAAM,CAACgB,YAAY,CAACC,6BAA6B,CAAC;QAAEF;MAAK,CAAC,CAAC;IAC7D,CAAC,CAAC;EACJ,CAAC,EAAE,CAACf,MAAM,CAAC,CAAC;EAEZ,oBACE,IAAAtB,WAAA,CAAAwC,IAAA,EAACnD,mBAAA,CAAAoD,mBAAmB;IAClBnB,MAAM,EAAEA,MAAO;IACfK,QAAQ,EAAEA,QAAS;IACnBH,qBAAqB,EAAEA,qBAAsB;IAC7CE,YAAY,EAAEA,YAAa;IAAAH,QAAA,gBAE3B,IAAAvB,WAAA,CAAA0C,GAAA,EAACC,YAAY,IAAE,CAAC,eAChB,IAAA3C,WAAA,CAAA0C,GAAA,EAAC3C,eAAA,CAAAI,OAAc,IAAE,CAAC,eAClB,IAAAH,WAAA,CAAA0C,GAAA,EAAC7C,aAAA,CAAA+C,WAAW;MAAChB,KAAK,EAAEA,KAAM;MAAAL,QAAA,eACxB,IAAAvB,WAAA,CAAA0C,GAAA,EAAC5C,qBAAA,CAAA+C,4BAA4B;QAAAtB,QAAA,EAAEA;MAAQ,CAA+B;IAAC,CAC5D,CAAC;EAAA,CACK,CAAC;AAE1B,CAAC;;AAED;AACA;AACA;AACA;AAHAuB,OAAA,CAAA1B,WAAA,GAAAA,WAAA;AAIA,MAAMuB,YAAY,GAAGA,CAAA,KAAM;EACzB,IAAAI,4BAAqB,EAAC,CAAC;EACvB,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_videoReactBindings","require","_react","_interopRequireWildcard","_netinfo","_interopRequireDefault","_hooks","_i18n","_ThemeContext","_ScreenshotIosContext","_BusyTonePlayer","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StreamVideo","props","client","children","i18nInstance","language","translations","style","translationContext","useStreami18n","useEffect","prevIsOnline","NetInfo","addEventListener","state","isConnected","isInternetReachable","isOnline","type","streamClient","updateNetworkConnectionStatus","jsx","StreamVideoProvider","jsxs","TranslationProvider","value","PushRegister","StreamTheme","ScreenshotIosContextProvider","exports","usePushRegisterEffect"],"sourceRoot":"../../../src","sources":["providers/StreamVideo.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAP,OAAA;AAEA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAL,sBAAA,CAAAJ,OAAA;AAA8C,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAI,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAAAN,CAAA,IAAAH,CAAA,gBAAAG,CAAA,OAAAW,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAG,CAAA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