@fishjam-cloud/react-native-client 0.24.0 → 0.25.0-rc.1

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 (266) hide show
  1. package/README.md +56 -15
  2. package/dist/index.d.ts +13 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +19 -0
  5. package/dist/overrides/RTCPeerConnection.d.ts +8 -0
  6. package/dist/overrides/RTCPeerConnection.d.ts.map +1 -0
  7. package/dist/overrides/RTCPeerConnection.js +16 -0
  8. package/dist/overrides/RTCView.d.ts +11 -0
  9. package/dist/overrides/RTCView.d.ts.map +1 -0
  10. package/dist/overrides/RTCView.js +21 -0
  11. package/dist/polyfills/local-storage.d.ts +10 -0
  12. package/dist/polyfills/local-storage.d.ts.map +1 -0
  13. package/dist/polyfills/local-storage.js +24 -0
  14. package/{build/hooks → dist}/useForegroundService.d.ts +10 -10
  15. package/dist/useForegroundService.d.ts.map +1 -0
  16. package/dist/useForegroundService.js +10 -0
  17. package/dist/webrtc-polyfill.d.ts +2 -0
  18. package/dist/webrtc-polyfill.d.ts.map +1 -0
  19. package/dist/webrtc-polyfill.js +14 -0
  20. package/package.json +44 -92
  21. package/plugin/broadcastExtensionFiles/Atomic.swift +37 -0
  22. package/plugin/broadcastExtensionFiles/DarwinNotificationCenter.swift +29 -0
  23. package/plugin/broadcastExtensionFiles/Info.plist +1 -1
  24. package/plugin/broadcastExtensionFiles/SampleHandler.swift +104 -0
  25. package/plugin/broadcastExtensionFiles/SampleUploader.swift +146 -0
  26. package/plugin/broadcastExtensionFiles/SocketConnection.swift +198 -0
  27. package/plugin/build/types.d.ts +5 -4
  28. package/plugin/build/withFishjam.d.ts +31 -2
  29. package/plugin/build/withFishjam.js +31 -5
  30. package/plugin/build/withFishjamAndroid.d.ts +2 -2
  31. package/plugin/build/withFishjamAndroid.js +48 -40
  32. package/plugin/build/withFishjamIos.d.ts +3 -8
  33. package/plugin/build/withFishjamIos.js +52 -72
  34. package/plugin/src/types.ts +19 -0
  35. package/plugin/src/withFishjam.ts +42 -0
  36. package/plugin/src/withFishjamAndroid.ts +112 -0
  37. package/plugin/src/withFishjamIos.ts +336 -0
  38. package/plugin/tsconfig.json +9 -0
  39. package/plugin/tsconfig.tsbuildinfo +1 -0
  40. package/LICENSE.txt +0 -201
  41. package/android/build.gradle +0 -95
  42. package/android/src/main/AndroidManifest.xml +0 -2
  43. package/android/src/main/java/io/fishjam/reactnative/AudioDeviceKind.kt +0 -34
  44. package/android/src/main/java/io/fishjam/reactnative/AudioSwitchManager.kt +0 -61
  45. package/android/src/main/java/io/fishjam/reactnative/EmitableEvents.kt +0 -126
  46. package/android/src/main/java/io/fishjam/reactnative/Errors.kt +0 -31
  47. package/android/src/main/java/io/fishjam/reactnative/PipContainerView.kt +0 -282
  48. package/android/src/main/java/io/fishjam/reactnative/PipContainerViewModule.kt +0 -41
  49. package/android/src/main/java/io/fishjam/reactnative/PipTrackSelector.kt +0 -98
  50. package/android/src/main/java/io/fishjam/reactnative/PipViewFactory.kt +0 -186
  51. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +0 -1001
  52. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +0 -358
  53. package/android/src/main/java/io/fishjam/reactnative/Utils.kt +0 -11
  54. package/android/src/main/java/io/fishjam/reactnative/VideoPreviewView.kt +0 -40
  55. package/android/src/main/java/io/fishjam/reactnative/VideoPreviewViewModule.kt +0 -22
  56. package/android/src/main/java/io/fishjam/reactnative/VideoRendererView.kt +0 -76
  57. package/android/src/main/java/io/fishjam/reactnative/VideoRendererViewModule.kt +0 -33
  58. package/android/src/main/java/io/fishjam/reactnative/VideoView.kt +0 -257
  59. package/android/src/main/java/io/fishjam/reactnative/extensions/CaptureDevice.kt +0 -17
  60. package/android/src/main/java/io/fishjam/reactnative/foregroundService/FishjamForegroundService.kt +0 -101
  61. package/android/src/main/java/io/fishjam/reactnative/foregroundService/ForegroundServiceManager.kt +0 -118
  62. package/android/src/main/java/io/fishjam/reactnative/foregroundService/ForegroundServiceState.kt +0 -46
  63. package/android/src/main/java/io/fishjam/reactnative/helpers/PictureInPictureHelperFragment.kt +0 -20
  64. package/android/src/main/java/io/fishjam/reactnative/managers/ListenerManager.kt +0 -24
  65. package/android/src/main/java/io/fishjam/reactnative/managers/LocalCameraTracksChangedListenersManager.kt +0 -8
  66. package/android/src/main/java/io/fishjam/reactnative/managers/LocalTracksSwitchListenersManager.kt +0 -17
  67. package/android/src/main/java/io/fishjam/reactnative/managers/TracksUpdateListenersManager.kt +0 -7
  68. package/android/src/main/java/io/fishjam/reactnative/utils/PermissionUtils.kt +0 -45
  69. package/build/RNFishjamClientModule.d.ts +0 -106
  70. package/build/RNFishjamClientModule.d.ts.map +0 -1
  71. package/build/RNFishjamClientModule.js +0 -21
  72. package/build/RNFishjamClientModule.js.map +0 -1
  73. package/build/common/metadata.d.ts +0 -9
  74. package/build/common/metadata.d.ts.map +0 -1
  75. package/build/common/metadata.js +0 -11
  76. package/build/common/metadata.js.map +0 -1
  77. package/build/components/FishjamRoom/GridTrackItem.d.ts +0 -12
  78. package/build/components/FishjamRoom/GridTrackItem.d.ts.map +0 -1
  79. package/build/components/FishjamRoom/GridTrackItem.js +0 -56
  80. package/build/components/FishjamRoom/GridTrackItem.js.map +0 -1
  81. package/build/components/FishjamRoom/VideosGrid.d.ts +0 -3
  82. package/build/components/FishjamRoom/VideosGrid.d.ts.map +0 -1
  83. package/build/components/FishjamRoom/VideosGrid.js +0 -20
  84. package/build/components/FishjamRoom/VideosGrid.js.map +0 -1
  85. package/build/components/FishjamRoom/index.d.ts +0 -33
  86. package/build/components/FishjamRoom/index.d.ts.map +0 -1
  87. package/build/components/FishjamRoom/index.js +0 -52
  88. package/build/components/FishjamRoom/index.js.map +0 -1
  89. package/build/components/FishjamRoom/parsePeersToTracks.d.ts +0 -4
  90. package/build/components/FishjamRoom/parsePeersToTracks.d.ts.map +0 -1
  91. package/build/components/FishjamRoom/parsePeersToTracks.js +0 -37
  92. package/build/components/FishjamRoom/parsePeersToTracks.js.map +0 -1
  93. package/build/components/PipContainerView.d.ts +0 -48
  94. package/build/components/PipContainerView.d.ts.map +0 -1
  95. package/build/components/PipContainerView.js +0 -34
  96. package/build/components/PipContainerView.js.map +0 -1
  97. package/build/components/VideoPreviewView.d.ts +0 -28
  98. package/build/components/VideoPreviewView.d.ts.map +0 -1
  99. package/build/components/VideoPreviewView.js +0 -17
  100. package/build/components/VideoPreviewView.js.map +0 -1
  101. package/build/components/VideoRendererView.d.ts +0 -39
  102. package/build/components/VideoRendererView.d.ts.map +0 -1
  103. package/build/components/VideoRendererView.js +0 -25
  104. package/build/components/VideoRendererView.js.map +0 -1
  105. package/build/consts/index.d.ts +0 -5
  106. package/build/consts/index.d.ts.map +0 -1
  107. package/build/consts/index.js +0 -8
  108. package/build/consts/index.js.map +0 -1
  109. package/build/debug/common/webRTC.d.ts +0 -9
  110. package/build/debug/common/webRTC.d.ts.map +0 -1
  111. package/build/debug/common/webRTC.js +0 -11
  112. package/build/debug/common/webRTC.js.map +0 -1
  113. package/build/debug/index.d.ts +0 -4
  114. package/build/debug/index.d.ts.map +0 -1
  115. package/build/debug/index.js +0 -3
  116. package/build/debug/index.js.map +0 -1
  117. package/build/debug/stats/types.d.ts +0 -55
  118. package/build/debug/stats/types.d.ts.map +0 -1
  119. package/build/debug/stats/types.js +0 -2
  120. package/build/debug/stats/types.js.map +0 -1
  121. package/build/debug/stats/useRTCStatistics.d.ts +0 -9
  122. package/build/debug/stats/useRTCStatistics.d.ts.map +0 -1
  123. package/build/debug/stats/useRTCStatistics.js +0 -79
  124. package/build/debug/stats/useRTCStatistics.js.map +0 -1
  125. package/build/hooks/internal/useFishjamEvent.d.ts +0 -4
  126. package/build/hooks/internal/useFishjamEvent.d.ts.map +0 -1
  127. package/build/hooks/internal/useFishjamEvent.js +0 -38
  128. package/build/hooks/internal/useFishjamEvent.js.map +0 -1
  129. package/build/hooks/internal/useFishjamEventState.d.ts +0 -3
  130. package/build/hooks/internal/useFishjamEventState.d.ts.map +0 -1
  131. package/build/hooks/internal/useFishjamEventState.js +0 -18
  132. package/build/hooks/internal/useFishjamEventState.js.map +0 -1
  133. package/build/hooks/useAppScreenShare.d.ts +0 -18
  134. package/build/hooks/useAppScreenShare.d.ts.map +0 -1
  135. package/build/hooks/useAppScreenShare.js +0 -46
  136. package/build/hooks/useAppScreenShare.js.map +0 -1
  137. package/build/hooks/useAudioSettings.d.ts +0 -49
  138. package/build/hooks/useAudioSettings.d.ts.map +0 -1
  139. package/build/hooks/useAudioSettings.js +0 -70
  140. package/build/hooks/useAudioSettings.js.map +0 -1
  141. package/build/hooks/useBandwidthEstimation.d.ts +0 -14
  142. package/build/hooks/useBandwidthEstimation.d.ts.map +0 -1
  143. package/build/hooks/useBandwidthEstimation.js +0 -19
  144. package/build/hooks/useBandwidthEstimation.js.map +0 -1
  145. package/build/hooks/useCallKit.d.ts +0 -121
  146. package/build/hooks/useCallKit.d.ts.map +0 -1
  147. package/build/hooks/useCallKit.js +0 -142
  148. package/build/hooks/useCallKit.js.map +0 -1
  149. package/build/hooks/useCamera.d.ts +0 -113
  150. package/build/hooks/useCamera.d.ts.map +0 -1
  151. package/build/hooks/useCamera.js +0 -93
  152. package/build/hooks/useCamera.js.map +0 -1
  153. package/build/hooks/useConnection.d.ts +0 -73
  154. package/build/hooks/useConnection.d.ts.map +0 -1
  155. package/build/hooks/useConnection.js +0 -46
  156. package/build/hooks/useConnection.js.map +0 -1
  157. package/build/hooks/useForegroundService.d.ts.map +0 -1
  158. package/build/hooks/useForegroundService.js +0 -66
  159. package/build/hooks/useForegroundService.js.map +0 -1
  160. package/build/hooks/useMicrophone.d.ts +0 -16
  161. package/build/hooks/useMicrophone.d.ts.map +0 -1
  162. package/build/hooks/useMicrophone.js +0 -31
  163. package/build/hooks/useMicrophone.js.map +0 -1
  164. package/build/hooks/usePeerStatus.d.ts +0 -10
  165. package/build/hooks/usePeerStatus.d.ts.map +0 -1
  166. package/build/hooks/usePeerStatus.js +0 -13
  167. package/build/hooks/usePeerStatus.js.map +0 -1
  168. package/build/hooks/usePeers.d.ts +0 -98
  169. package/build/hooks/usePeers.d.ts.map +0 -1
  170. package/build/hooks/usePeers.js +0 -81
  171. package/build/hooks/usePeers.js.map +0 -1
  172. package/build/hooks/usePermissions.d.ts +0 -24
  173. package/build/hooks/usePermissions.d.ts.map +0 -1
  174. package/build/hooks/usePermissions.js +0 -61
  175. package/build/hooks/usePermissions.js.map +0 -1
  176. package/build/hooks/useReconnection.d.ts +0 -11
  177. package/build/hooks/useReconnection.d.ts.map +0 -1
  178. package/build/hooks/useReconnection.js +0 -14
  179. package/build/hooks/useReconnection.js.map +0 -1
  180. package/build/hooks/useSandbox.d.ts +0 -20
  181. package/build/hooks/useSandbox.d.ts.map +0 -1
  182. package/build/hooks/useSandbox.js +0 -54
  183. package/build/hooks/useSandbox.js.map +0 -1
  184. package/build/hooks/useScreenShare.d.ts +0 -36
  185. package/build/hooks/useScreenShare.d.ts.map +0 -1
  186. package/build/hooks/useScreenShare.js +0 -45
  187. package/build/hooks/useScreenShare.js.map +0 -1
  188. package/build/hooks/useUpdatePeerMetadata.d.ts +0 -15
  189. package/build/hooks/useUpdatePeerMetadata.d.ts.map +0 -1
  190. package/build/hooks/useUpdatePeerMetadata.js +0 -21
  191. package/build/hooks/useUpdatePeerMetadata.js.map +0 -1
  192. package/build/index.d.ts +0 -36
  193. package/build/index.d.ts.map +0 -1
  194. package/build/index.js +0 -30
  195. package/build/index.js.map +0 -1
  196. package/build/livestream/components/LivestreamStreamer.d.ts +0 -24
  197. package/build/livestream/components/LivestreamStreamer.d.ts.map +0 -1
  198. package/build/livestream/components/LivestreamStreamer.js +0 -12
  199. package/build/livestream/components/LivestreamStreamer.js.map +0 -1
  200. package/build/livestream/components/LivestreamViewer.d.ts +0 -46
  201. package/build/livestream/components/LivestreamViewer.d.ts.map +0 -1
  202. package/build/livestream/components/LivestreamViewer.js +0 -10
  203. package/build/livestream/components/LivestreamViewer.js.map +0 -1
  204. package/build/livestream/hooks/useLivestreamScreenSharingStreamer.d.ts +0 -49
  205. package/build/livestream/hooks/useLivestreamScreenSharingStreamer.d.ts.map +0 -1
  206. package/build/livestream/hooks/useLivestreamScreenSharingStreamer.js +0 -58
  207. package/build/livestream/hooks/useLivestreamScreenSharingStreamer.js.map +0 -1
  208. package/build/livestream/hooks/useLivestreamStreamer.d.ts +0 -65
  209. package/build/livestream/hooks/useLivestreamStreamer.d.ts.map +0 -1
  210. package/build/livestream/hooks/useLivestreamStreamer.js +0 -71
  211. package/build/livestream/hooks/useLivestreamStreamer.js.map +0 -1
  212. package/build/livestream/hooks/useLivestreamViewer.d.ts +0 -36
  213. package/build/livestream/hooks/useLivestreamViewer.d.ts.map +0 -1
  214. package/build/livestream/hooks/useLivestreamViewer.js +0 -73
  215. package/build/livestream/hooks/useLivestreamViewer.js.map +0 -1
  216. package/build/livestream/index.d.ts +0 -12
  217. package/build/livestream/index.d.ts.map +0 -1
  218. package/build/livestream/index.js +0 -7
  219. package/build/livestream/index.js.map +0 -1
  220. package/build/protos/fishjam/peer_notifications.d.ts +0 -63
  221. package/build/protos/fishjam/peer_notifications.d.ts.map +0 -1
  222. package/build/protos/fishjam/peer_notifications.js +0 -235
  223. package/build/protos/fishjam/peer_notifications.js.map +0 -1
  224. package/build/types.d.ts +0 -34
  225. package/build/types.d.ts.map +0 -1
  226. package/build/types.js +0 -2
  227. package/build/types.js.map +0 -1
  228. package/build/utils/config.d.ts +0 -6
  229. package/build/utils/config.d.ts.map +0 -1
  230. package/build/utils/config.js +0 -10
  231. package/build/utils/config.js.map +0 -1
  232. package/build/utils/errorListener.d.ts +0 -2
  233. package/build/utils/errorListener.d.ts.map +0 -1
  234. package/build/utils/errorListener.js +0 -15
  235. package/build/utils/errorListener.js.map +0 -1
  236. package/build/utils/eventPayloadValidator.d.ts +0 -3
  237. package/build/utils/eventPayloadValidator.d.ts.map +0 -1
  238. package/build/utils/eventPayloadValidator.js +0 -86
  239. package/build/utils/eventPayloadValidator.js.map +0 -1
  240. package/build/utils/getFishjamUrl.d.ts +0 -2
  241. package/build/utils/getFishjamUrl.d.ts.map +0 -1
  242. package/build/utils/getFishjamUrl.js +0 -10
  243. package/build/utils/getFishjamUrl.js.map +0 -1
  244. package/debug/package.json +0 -4
  245. package/expo-module.config.json +0 -19
  246. package/ios/CameraPermissionsRequester.swift +0 -117
  247. package/ios/Events.swift +0 -152
  248. package/ios/PictureInPictureManager.swift +0 -215
  249. package/ios/PipContainerView.swift +0 -56
  250. package/ios/PipContainerViewModule.swift +0 -48
  251. package/ios/RNFishjamClient.podspec +0 -30
  252. package/ios/RNFishjamClient.swift +0 -995
  253. package/ios/RNFishjamClientModule.swift +0 -289
  254. package/ios/RNFishjamProxy.swift +0 -12
  255. package/ios/Utils/PermissionUtils.swift +0 -16
  256. package/ios/Utils.swift +0 -23
  257. package/ios/VideoPreviewView.swift +0 -54
  258. package/ios/VideoPreviewViewModule.swift +0 -21
  259. package/ios/VideoRendererView.swift +0 -98
  260. package/ios/VideoRendererViewModule.swift +0 -23
  261. package/ios/extensions/AVCaptureDevice.swift +0 -20
  262. package/ios/managers/LocalCameraTracksChangedListenersManager.swift +0 -23
  263. package/ios/managers/TracksUpdateListenersManager.swift +0 -21
  264. package/livestream/package.json +0 -4
  265. package/plugin/broadcastExtensionFiles/FishjamBroadcastSampleHandler.swift +0 -50
  266. /package/plugin/broadcastExtensionFiles/{FishjamScreenBroadcastExtension.entitlements → ScreenBroadcastExtension.entitlements} +0 -0
package/README.md CHANGED
@@ -1,29 +1,70 @@
1
- <img src="../../.github/images/fishjam-card.png" width="100%" />
1
+ # @fishjam-cloud/react-native-client
2
2
 
3
- # Fishjam React Native client
3
+ React Native client library for Fishjam.
4
4
 
5
- `@fishjam-cloud/react-native-client` is an easiest way to add video streaming to your React Native app.
5
+ ## Installation
6
6
 
7
- # Installation
7
+ ```bash
8
+ npm install @fishjam-cloud/react-native-client
9
+ # or
10
+ yarn add @fishjam-cloud/react-native-client
11
+ ```
8
12
 
9
- Check out the [installation](https://docs.fishjam.io/react-native/installation) section of our docs for the detailed installation instructions.
13
+ ## Local Development with WebRTC Fork
10
14
 
11
- # Documentation
15
+ This package depends on `@fishjam-cloud/react-native-webrtc`, which is a fork of `react-native-webrtc`. When developing features that require changes to the native WebRTC code, you can set up a local development environment for faster iteration.
12
16
 
13
- Check out our [documentation](https://docs.fishjam.io/) on how Fishjam work and how to integrate our service with your app.
17
+ ### Prerequisites
14
18
 
15
- There is also [API documentation](https://docs.fishjam.io/category/api) available.
19
+ 1. Clone the WebRTC fork:
16
20
 
17
- # Examples
21
+ ```bash
22
+ git clone https://github.com/fishjam-cloud/fishjam-react-native-webrtc.git
23
+ ```
18
24
 
19
- There is simple example app, that allows you to test our service. To run it locally, follow [instructions](https://github.com/fishjam-cloud/mobile-client-sdk/tree/main/examples/minimal-react-native).
25
+ ### Setting Up Local Development
20
26
 
21
- ## License
27
+ 1. **Update the dependency in `packages/mobile-client/package.json`:**
22
28
 
23
- Licensed under the [Apache License, Version 2.0](./LICENSE.txt)
29
+ Change from:
24
30
 
25
- ## Fishjam is created by Software Mansion
31
+ ```json
32
+ "@fishjam-cloud/react-native-webrtc": "^x.x.x"
33
+ ```
26
34
 
27
- Since 2012 [Software Mansion](https://swmansion.com) is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – [Hire us](https://swmansion.com/contact/projects?utm_source=fishjam&utm_medium=mobile-readme).
35
+ To a local file path:
28
36
 
29
- [![Software Mansion](https://logo.swmansion.com/logo?color=white&variant=desktop&width=200&tag=react-client)](https://swmansion.com/contact/projects?utm_source=fishjam&utm_medium=mobile-readme)
37
+ ```json
38
+ "@fishjam-cloud/react-native-webrtc": "file:<PATH_TO_CLONED_REPO>/react-native-webrtc"
39
+ ```
40
+
41
+ > **Note:** Adjust the path based on where you cloned the fork. If using a git submodule, add it at `packages/react-native-webrtc`.
42
+
43
+ 2. **Run yarn install** from the repository root:
44
+
45
+ ```bash
46
+ yarn install
47
+ ```
48
+
49
+ 3. **Run expo prebuild** in the example app:
50
+
51
+ ```bash
52
+ cd examples/mobile-client/fishjam-chat
53
+ npx expo prebuild
54
+ ```
55
+
56
+ The local development plugin (`examples/mobile-client/common/plugins`) will automatically detect the `file:` dependency and configure:
57
+
58
+ - **iOS Podfile:** Adds `pod 'FishjamReactNativeWebrtc', :path => '...'`
59
+ - **Android settings.gradle:** Includes local project reference
60
+
61
+ ### Development Workflow
62
+
63
+ Once set up, you get a fast development cycle:
64
+
65
+ | Change Type | What to Do |
66
+ | ------------------------------------- | ----------------------------------------------------- |
67
+ | **JS/TS changes** in the fork | Save → Metro hot reloads automatically |
68
+ | **Native code changes** (iOS/Android) | Save → Rebuild the app (`yarn ios` or `yarn android`) |
69
+
70
+ **No need to run `pod install` or `yarn install`** after native code changes—just rebuild!
@@ -0,0 +1,13 @@
1
+ import './webrtc-polyfill';
2
+ import React from 'react';
3
+ import { type FishjamProviderProps as ReactClientFishjamProviderProps, useMicrophone as useMicrophoneReactClient } from '@fishjam-cloud/react-client';
4
+ export { RTCView, RTCPIPView, type RTCVideoViewProps, type RTCPIPViewProps } from './overrides/RTCView';
5
+ export { ScreenCapturePickerView, startPIP, stopPIP, useCallKit, useCallKitEvent, useCallKitService, } from '@fishjam-cloud/react-native-webrtc';
6
+ export type { CallKitAction, CallKitConfig, MediaStream } from '@fishjam-cloud/react-native-webrtc';
7
+ export { useForegroundService, type ForegroundServiceConfig } from './useForegroundService';
8
+ export { useCamera, useInitializeDevices, InitializeDevicesSettings, useConnection, useCustomSource, useLivestreamStreamer, useLivestreamViewer, usePeers, useSandbox, useScreenShare, useUpdatePeerMetadata, useVAD, Variant, } from '@fishjam-cloud/react-client';
9
+ export declare const useMicrophone: () => Omit<ReturnType<typeof useMicrophoneReactClient>, "toggleMicrophoneMute">;
10
+ export type { UseInitializeDevicesParams, JoinRoomConfig, ConnectStreamerConfig, StreamerInputs, UseLivestreamStreamerResult, ConnectViewerConfig, UseLivestreamViewerResult, PeerWithTracks, RoomType, UseSandboxProps, BandwidthLimits, Brand, CustomSource, DeviceError, DeviceItem, InitializeDevicesResult, InitializeDevicesStatus, MiddlewareResult, PeerId, PeerStatus, PersistLastDeviceHandlers, SimulcastBandwidthLimits, StreamConfig, Track, TrackId, TrackMiddleware, TracksMiddleware, TracksMiddlewareResult, AuthErrorReason, JoinErrorReason, Metadata, ReconnectConfig, ReconnectionStatus, SimulcastBandwidthLimit, SimulcastConfig, TrackBandwidthLimit, } from '@fishjam-cloud/react-client';
11
+ export type FishjamProviderProps = Omit<ReactClientFishjamProviderProps, 'persistLastDevice'>;
12
+ export declare function FishjamProvider(props: FishjamProviderProps): React.FunctionComponentElement<ReactClientFishjamProviderProps>;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,oBAAoB,IAAI,+BAA+B,EAC5D,aAAa,IAAI,wBAAwB,EAC1C,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EACL,uBAAuB,EACvB,QAAQ,EACR,OAAO,EACP,UAAU,EACV,eAAe,EACf,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAE5C,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEpG,OAAO,EAAE,oBAAoB,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAE5F,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,yBAAyB,EACzB,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,MAAM,EACN,OAAO,GACR,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,aAAa,EAA+B,MAAM,IAAI,CAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,EAAE,sBAAsB,CAAE,CAAA;AAE1I,YAAY,EACV,0BAA0B,EAC1B,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,2BAA2B,EAC3B,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,QAAQ,EACR,eAAe,EACf,eAAe,EACf,KAAK,EACL,YAAY,EACZ,WAAW,EACX,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,yBAAyB,EACzB,wBAAwB,EACxB,YAAY,EACZ,KAAK,EACL,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,+BAA+B,EAAE,mBAAmB,CAAC,CAAC;AAC9F,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,mEAK1D"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ /* eslint-disable simple-import-sort/imports */
2
+ /* eslint-disable import/no-duplicates */
3
+ /* eslint-disable simple-import-sort/exports */
4
+ /* eslint-disable import/first */
5
+ // TODO: FCE-2464 Investigate order
6
+ import './webrtc-polyfill';
7
+ import React from 'react';
8
+ import { FishjamProvider as ReactClientFishjamProvider, useMicrophone as useMicrophoneReactClient } from '@fishjam-cloud/react-client';
9
+ export { RTCView, RTCPIPView } from './overrides/RTCView';
10
+ export { ScreenCapturePickerView, startPIP, stopPIP, useCallKit, useCallKitEvent, useCallKitService, } from '@fishjam-cloud/react-native-webrtc';
11
+ export { useForegroundService } from './useForegroundService';
12
+ export { useCamera, useInitializeDevices, useConnection, useCustomSource, useLivestreamStreamer, useLivestreamViewer, usePeers, useSandbox, useScreenShare, useUpdatePeerMetadata, useVAD, Variant, } from '@fishjam-cloud/react-client';
13
+ export const useMicrophone = useMicrophoneReactClient;
14
+ export function FishjamProvider(props) {
15
+ return React.createElement(ReactClientFishjamProvider, {
16
+ ...props,
17
+ persistLastDevice: false,
18
+ });
19
+ }
@@ -0,0 +1,8 @@
1
+ import { RTCPeerConnection as OriginalRTCPeerConnection } from '@fishjam-cloud/react-native-webrtc';
2
+ export declare class RTCPeerConnection extends OriginalRTCPeerConnection {
3
+ private _configuration;
4
+ constructor(configuration?: RTCConfiguration);
5
+ setConfiguration(configuration: RTCConfiguration): void;
6
+ getConfiguration(): RTCConfiguration;
7
+ }
8
+ //# sourceMappingURL=RTCPeerConnection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTCPeerConnection.d.ts","sourceRoot":"","sources":["../../src/overrides/RTCPeerConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAEpG,qBAAa,iBAAkB,SAAQ,yBAAyB;IAE9D,OAAO,CAAC,cAAc,CAAmB;gBAE7B,aAAa,CAAC,EAAE,gBAAgB;IAK5C,gBAAgB,CAAC,aAAa,EAAE,gBAAgB,GAAG,IAAI;IAKvD,gBAAgB,IAAI,gBAAgB;CAGrC"}
@@ -0,0 +1,16 @@
1
+ import { RTCPeerConnection as OriginalRTCPeerConnection } from '@fishjam-cloud/react-native-webrtc';
2
+ export class RTCPeerConnection extends OriginalRTCPeerConnection {
3
+ // TODO: FCE-2464 Replace with native side fetch
4
+ _configuration;
5
+ constructor(configuration) {
6
+ super(configuration);
7
+ this._configuration = configuration ?? {};
8
+ }
9
+ setConfiguration(configuration) {
10
+ super.setConfiguration(configuration);
11
+ this._configuration = configuration;
12
+ }
13
+ getConfiguration() {
14
+ return this._configuration;
15
+ }
16
+ }
@@ -0,0 +1,11 @@
1
+ import { RTCPIPView as OriginalRTCPIPView, RTCView as OriginalRTCView } from '@fishjam-cloud/react-native-webrtc';
2
+ import type React from 'react';
3
+ export type RTCVideoViewProps = Omit<React.ComponentPropsWithRef<typeof OriginalRTCView>, 'streamURL'> & {
4
+ mediaStream: MediaStream;
5
+ };
6
+ export type RTCPIPViewProps = Omit<React.ComponentPropsWithRef<typeof OriginalRTCPIPView>, 'streamURL'> & {
7
+ mediaStream: MediaStream;
8
+ };
9
+ export declare const RTCView: ({ ref, ...props }: RTCVideoViewProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const RTCPIPView: ({ ref, ...props }: RTCPIPViewProps) => import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=RTCView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTCView.d.ts","sourceRoot":"","sources":["../../src/overrides/RTCView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAClH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,eAAe,CAAC,EAAE,WAAW,CAAC,GAAG;IACvG,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,kBAAkB,CAAC,EAAE,WAAW,CAAC,GAAG;IACxG,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAeF,eAAO,MAAM,OAAO,GAAI,mBAAmB,iBAAiB,4CAG3D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,mBAAmB,eAAe,4CAG5D,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { RTCPIPView as OriginalRTCPIPView, RTCView as OriginalRTCView } from '@fishjam-cloud/react-native-webrtc';
3
+ import { useMemo } from 'react';
4
+ const convertMediaStreamToURL = (mediaStream) => {
5
+ const rnMediaStream = mediaStream;
6
+ if (rnMediaStream && typeof rnMediaStream.toURL === 'function') {
7
+ return rnMediaStream.toURL();
8
+ }
9
+ else {
10
+ console.error('mediaStream.toURL is not a function. Make sure to use the MediaStream type from @fishjam-cloud/react-native-webrtc', rnMediaStream);
11
+ return undefined;
12
+ }
13
+ };
14
+ export const RTCView = ({ ref, ...props }) => {
15
+ const streamURL = useMemo(() => convertMediaStreamToURL(props.mediaStream), [props.mediaStream]);
16
+ return _jsx(OriginalRTCView, { ...props, ref: ref, streamURL: streamURL });
17
+ };
18
+ export const RTCPIPView = ({ ref, ...props }) => {
19
+ const streamURL = useMemo(() => convertMediaStreamToURL(props.mediaStream), [props.mediaStream]);
20
+ return _jsx(OriginalRTCPIPView, { ...props, ref: ref, streamURL: streamURL });
21
+ };
@@ -0,0 +1,10 @@
1
+ export declare class LocalStoragePolyfill {
2
+ private storage;
3
+ getItem(key: string): string | null;
4
+ setItem(key: string, value: string): void;
5
+ removeItem(key: string): void;
6
+ clear(): void;
7
+ get length(): number;
8
+ key(index: number): string | null;
9
+ }
10
+ //# sourceMappingURL=local-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../src/polyfills/local-storage.ts"],"names":[],"mappings":"AAEA,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,OAAO,CAAkC;IAEjD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAInC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,KAAK,IAAI,IAAI;IAIb,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAIlC"}
@@ -0,0 +1,24 @@
1
+ // LocalStorage polyfill for mobile.
2
+ // Device persistence is not supported on mobile, so an in-memory implementation is used instead of actual persistent storage.
3
+ export class LocalStoragePolyfill {
4
+ storage = new Map();
5
+ getItem(key) {
6
+ return this.storage.get(key) ?? null;
7
+ }
8
+ setItem(key, value) {
9
+ this.storage.set(key, String(value));
10
+ }
11
+ removeItem(key) {
12
+ this.storage.delete(key);
13
+ }
14
+ clear() {
15
+ this.storage.clear();
16
+ }
17
+ get length() {
18
+ return this.storage.size;
19
+ }
20
+ key(index) {
21
+ const keys = Array.from(this.storage.keys());
22
+ return keys[index] ?? null;
23
+ }
24
+ }
@@ -1,4 +1,6 @@
1
1
  /**
2
+ * Configuration options for foreground service permissions.
3
+ *
2
4
  * A type representing the configuration for foreground service permissions.
3
5
  */
4
6
  export type ForegroundServiceConfig = {
@@ -10,6 +12,10 @@ export type ForegroundServiceConfig = {
10
12
  * Indicates whether the microphone is enabled for the foreground service.
11
13
  */
12
14
  enableMicrophone?: boolean;
15
+ /**
16
+ * Indicates whether screen sharing is enabled for the foreground service.
17
+ */
18
+ enableScreenSharing?: boolean;
13
19
  /**
14
20
  * The id of the channel. Must be unique per package.
15
21
  */
@@ -28,18 +34,12 @@ export type ForegroundServiceConfig = {
28
34
  notificationContent?: string;
29
35
  };
30
36
  /**
37
+ * Hook for managing a foreground service on Android.
38
+ *
31
39
  * A hook for managing a foreground service on Android. Does nothing on other platforms.
32
40
  * You can use this hook to keep your app running in the background. You're also required to run a foreground service when screen sharing.
33
41
  *
34
- * @param {Object} config - Configuration options for the foreground service.
35
- * @param {boolean} config.enableCamera - Flag to enable or disable camera usage in the foreground service. Only enable after the user has granted the necessary permissions.
36
- * @param {boolean} config.enableMicrophone - Flag to enable or disable microphone usage in the foreground service. Only enable after the user has granted the necessary permissions.
37
- * @param {Object} config.channelId - The id of the channel. Must be unique per package.
38
- * @param {Object} config.channelName - The user visible name of the channel.
39
- * @param {Object} config.notificationTitle - The title (first row) of the notification, in a standard notification.
40
- * @param {Object} config.notificationContent - The text (second row) of the notification, in a standard notification.
41
- * @group Hooks
42
- * @category Connection
42
+ * @param config - Configuration options for the foreground service.
43
43
  */
44
- export declare const useForegroundService: ({ enableCamera, enableMicrophone, channelId, channelName, notificationContent, notificationTitle, }: ForegroundServiceConfig) => void;
44
+ export declare const useForegroundService: ({ enableCamera, enableMicrophone, enableScreenSharing, channelId, channelName, notificationContent, notificationTitle, }: import("@fishjam-cloud/react-native-webrtc").ForegroundServiceConfig) => void;
45
45
  //# sourceMappingURL=useForegroundService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useForegroundService.d.ts","sourceRoot":"","sources":["../src/useForegroundService.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,0MAA+B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { useForegroundService as externalUseForegroundService } from '@fishjam-cloud/react-native-webrtc';
2
+ /**
3
+ * Hook for managing a foreground service on Android.
4
+ *
5
+ * A hook for managing a foreground service on Android. Does nothing on other platforms.
6
+ * You can use this hook to keep your app running in the background. You're also required to run a foreground service when screen sharing.
7
+ *
8
+ * @param config - Configuration options for the foreground service.
9
+ */
10
+ export const useForegroundService = externalUseForegroundService;
@@ -0,0 +1,2 @@
1
+ import 'react-native-get-random-values';
2
+ //# sourceMappingURL=webrtc-polyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webrtc-polyfill.d.ts","sourceRoot":"","sources":["../src/webrtc-polyfill.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import 'react-native-get-random-values';
2
+ // @ts-ignore - event-target-shim types not properly exported via package.json exports
3
+ import { EventTarget } from 'event-target-shim';
4
+ import { registerGlobals } from '@fishjam-cloud/react-native-webrtc';
5
+ import { RTCPeerConnection } from './overrides/RTCPeerConnection';
6
+ import { LocalStoragePolyfill } from './polyfills/local-storage';
7
+ const registerGlobalsPolyfill = () => {
8
+ global.EventTarget = EventTarget;
9
+ global.localStorage = new LocalStoragePolyfill();
10
+ registerGlobals();
11
+ // Custom overrides
12
+ globalThis.RTCPeerConnection = RTCPeerConnection;
13
+ };
14
+ registerGlobalsPolyfill();
package/package.json CHANGED
@@ -1,108 +1,60 @@
1
1
  {
2
2
  "name": "@fishjam-cloud/react-native-client",
3
- "version": "0.24.0",
4
- "description": "A React Native client for Fishjam",
5
- "author": "Fishjam Team",
3
+ "version": "0.25.0-rc.1",
4
+ "description": "React Native client library for Fishjam",
6
5
  "license": "Apache-2.0",
7
- "main": "build/index.js",
8
- "types": "build/index.d.ts",
9
- "scripts": {
10
- "build": "EXPO_NONINTERACTIVE=1 sh -c 'expo-module build && expo-module build plugin'",
11
- "clean": "expo-module clean",
12
- "lint": "eslint . --ext .ts,.tsx",
13
- "lint:fix": "yarn lint --fix",
14
- "test": "expo-module test",
15
- "prepare": "expo-module prepare",
16
- "prepublishOnly": "expo-module prepublishOnly",
17
- "expo-module": "expo-module",
18
- "release": "release-it",
19
- "docs": "sed 's/\\.github\\/images/media/g' README.md > README_docs.md && typedoc src/index.tsx --media ./.github/images --readme README_docs.md && rm README_docs.md",
20
- "typecheck": "yarn tsc --noEmit && cd example && yarn tsc --noEmit"
21
- },
22
- "keywords": [
23
- "react-native",
24
- "expo",
25
- "Fishjam",
26
- "FishjamCloud",
27
- "MembraneWebRTC",
28
- "webRTC",
29
- "streaming",
30
- "video",
31
- "audio"
6
+ "author": "Fishjam Team",
7
+ "main": "./dist/index.js",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "react-native": "src/index.ts",
11
+ "files": [
12
+ "dist/**",
13
+ "plugin/**",
14
+ "app.plugin.js"
32
15
  ],
33
16
  "repository": {
34
17
  "type": "git",
35
- "url": "git+https://github.com/fishjam-cloud/mobile-client-sdk.git",
36
- "directory": "packages/react-native-client"
18
+ "url": "git+https://github.com/fishjam-cloud/web-client-sdk.git",
19
+ "directory": "packages/mobile-client"
37
20
  },
38
- "bugs": {
39
- "url": "https://github.com/fishjam-cloud/mobile-client-sdk/issues"
40
- },
41
- "homepage": "https://fishjam.io",
42
- "dependencies": {
43
- "promise-fs": "^2.1.1",
44
- "protobufjs": "^7.4.0",
45
- "react-native-whip-whep": "0.7.1",
46
- "zod": "^3.25.71"
21
+ "homepage": "https://github.com/fishjam-cloud/web-client-sdk#readme",
22
+ "bugs": "https://github.com/fishjam-cloud/web-client-sdk/issues",
23
+ "keywords": [
24
+ "webrtc",
25
+ "fishjam"
26
+ ],
27
+ "exports": {
28
+ ".": {
29
+ "import": "./dist/index.js",
30
+ "types": "./dist/index.d.ts"
31
+ },
32
+ "./app.plugin": "./app.plugin.js",
33
+ "./app.plugin.js": "./app.plugin.js",
34
+ "./package.json": "./package.json"
47
35
  },
48
- "devDependencies": {
49
- "@testing-library/dom": "^10.4.0",
50
- "@testing-library/react": "^16.3.0",
51
- "@types/lodash": "^4.17.20",
52
- "@types/promise-fs": "^2.1.2",
53
- "@types/react": "~19.0.10",
54
- "@types/react-dom": "^19",
55
- "eslint": "^9.29.0",
56
- "eslint-config-expo": "~9.2.0",
57
- "eslint-config-prettier": "^10.1.5",
58
- "eslint-plugin-prettier": "^5.5.1",
59
- "expo-module-scripts": "^4.1.9",
60
- "husky": "^9.1.7",
61
- "jest": "^29.6.1",
62
- "jest-environment-jsdom": "^29.6.1",
63
- "jest-expo": "~53.0.9",
64
- "jest-websocket-mock": "^2.4.0",
65
- "pod-install": "^0.3.9",
66
- "prettier": "^3.6.2",
67
- "react-dom": "19.0.0",
68
- "ts-proto": "^2.7.5",
69
- "typedoc": "^0.28.7",
70
- "typedoc-plugin-mark-react-functional-components": "^0.2.2",
71
- "typescript": "~5.8.3"
36
+ "scripts": {
37
+ "build": "tsc && EXPO_NONINTERACTIVE=1 expo-module build plugin",
38
+ "lint": "eslint . --ext .ts,.tsx --fix",
39
+ "prepare": "tsc && EXPO_NONINTERACTIVE=1 expo-module build plugin"
72
40
  },
73
41
  "peerDependencies": {
74
42
  "expo": "*",
75
43
  "react": "*",
76
44
  "react-native": "*"
77
45
  },
78
- "jest": {
79
- "preset": "jest-expo",
80
- "modulePathIgnorePatterns": [
81
- "<rootDir>/example/node_modules",
82
- "<rootDir>/lib/"
83
- ],
84
- "testEnvironment": "jsdom"
46
+ "dependencies": {
47
+ "@fishjam-cloud/react-client": "0.25.0-rc.1",
48
+ "@fishjam-cloud/react-native-webrtc": "git+https://github.com/fishjam-cloud/fishjam-react-native-webrtc.git#9753272f9e6c992d8a05263e668e2198ec858160",
49
+ "react-native-get-random-values": "^1.11.0"
85
50
  },
86
- "files": [
87
- "build/**",
88
- "debug",
89
- "livestream",
90
- "android/build.gradle",
91
- "android/src/**",
92
- "ios/**/*.swift",
93
- "ios/RNFishjamClient.podspec",
94
- "plugin/build/**",
95
- "plugin/broadcastExtensionFiles/**",
96
- "app.plugin.js",
97
- "expo-module.config.json",
98
- "README.md",
99
- "!**/node_modules"
100
- ],
101
- "expo": {
102
- "doctor": {
103
- "reactNativeDirectoryCheck": {
104
- "listUnknownPackages": false
105
- }
106
- }
107
- }
51
+ "devDependencies": {
52
+ "@types/promise-fs": "^2.1.2",
53
+ "eslint-config-expo": "~9.2.0",
54
+ "eslint-plugin-prettier": "^5.5.1",
55
+ "expo-module-scripts": "^5.0.7",
56
+ "promise-fs": "^2.1.1"
57
+ },
58
+ "packageManager": "yarn@4.12.0",
59
+ "stableVersion": "0.23.0"
108
60
  }
@@ -0,0 +1,37 @@
1
+ //
2
+ // Atomic.swift
3
+ // Broadcast Extension
4
+ //
5
+ // Created by Maksym Shcheglov.
6
+ // https://www.onswiftwings.com/posts/atomic-property-wrapper/
7
+ //
8
+
9
+ import Foundation
10
+
11
+ @propertyWrapper
12
+ struct Atomic<Value> {
13
+
14
+ private var value: Value
15
+ private let lock = NSLock()
16
+
17
+ init(wrappedValue value: Value) {
18
+ self.value = value
19
+ }
20
+
21
+ var wrappedValue: Value {
22
+ get { load() }
23
+ set { store(newValue: newValue) }
24
+ }
25
+
26
+ func load() -> Value {
27
+ lock.lock()
28
+ defer { lock.unlock() }
29
+ return value
30
+ }
31
+
32
+ mutating func store(newValue: Value) {
33
+ lock.lock()
34
+ defer { lock.unlock() }
35
+ value = newValue
36
+ }
37
+ }
@@ -0,0 +1,29 @@
1
+ //
2
+ // DarwinNotificationCenter.swift
3
+ // Broadcast Extension
4
+ //
5
+ // Created by Alex-Dan Bumbu on 23/03/2021.
6
+ // Copyright © 2021 8x8, Inc. All rights reserved.
7
+ //
8
+
9
+ import Foundation
10
+
11
+ enum DarwinNotification: String {
12
+ case broadcastStarted = "iOS_BroadcastStarted"
13
+ case broadcastStopped = "iOS_BroadcastStopped"
14
+ }
15
+
16
+ class DarwinNotificationCenter {
17
+
18
+ static let shared = DarwinNotificationCenter()
19
+
20
+ private let notificationCenter: CFNotificationCenter
21
+
22
+ init() {
23
+ notificationCenter = CFNotificationCenterGetDarwinNotifyCenter()
24
+ }
25
+
26
+ func postNotification(_ name: DarwinNotification) {
27
+ CFNotificationCenterPostNotification(notificationCenter, CFNotificationName(rawValue: name.rawValue as CFString), nil, nil, true)
28
+ }
29
+ }
@@ -19,7 +19,7 @@
19
19
  <key>NSExtensionPointIdentifier</key>
20
20
  <string>com.apple.broadcast-services-upload</string>
21
21
  <key>NSExtensionPrincipalClass</key>
22
- <string>$(PRODUCT_MODULE_NAME).FishjamBroadcastSampleHandler</string>
22
+ <string>$(PRODUCT_MODULE_NAME).SampleHandler</string>
23
23
  <key>RPBroadcastProcessMode</key>
24
24
  <string>RPBroadcastProcessModeSampleBuffer</string>
25
25
  </dict>