@fishjam-cloud/react-native-client 0.24.0 → 0.25.0-rc.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 (260) 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 +45 -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/LICENSE.txt +0 -201
  35. package/android/build.gradle +0 -95
  36. package/android/src/main/AndroidManifest.xml +0 -2
  37. package/android/src/main/java/io/fishjam/reactnative/AudioDeviceKind.kt +0 -34
  38. package/android/src/main/java/io/fishjam/reactnative/AudioSwitchManager.kt +0 -61
  39. package/android/src/main/java/io/fishjam/reactnative/EmitableEvents.kt +0 -126
  40. package/android/src/main/java/io/fishjam/reactnative/Errors.kt +0 -31
  41. package/android/src/main/java/io/fishjam/reactnative/PipContainerView.kt +0 -282
  42. package/android/src/main/java/io/fishjam/reactnative/PipContainerViewModule.kt +0 -41
  43. package/android/src/main/java/io/fishjam/reactnative/PipTrackSelector.kt +0 -98
  44. package/android/src/main/java/io/fishjam/reactnative/PipViewFactory.kt +0 -186
  45. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +0 -1001
  46. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +0 -358
  47. package/android/src/main/java/io/fishjam/reactnative/Utils.kt +0 -11
  48. package/android/src/main/java/io/fishjam/reactnative/VideoPreviewView.kt +0 -40
  49. package/android/src/main/java/io/fishjam/reactnative/VideoPreviewViewModule.kt +0 -22
  50. package/android/src/main/java/io/fishjam/reactnative/VideoRendererView.kt +0 -76
  51. package/android/src/main/java/io/fishjam/reactnative/VideoRendererViewModule.kt +0 -33
  52. package/android/src/main/java/io/fishjam/reactnative/VideoView.kt +0 -257
  53. package/android/src/main/java/io/fishjam/reactnative/extensions/CaptureDevice.kt +0 -17
  54. package/android/src/main/java/io/fishjam/reactnative/foregroundService/FishjamForegroundService.kt +0 -101
  55. package/android/src/main/java/io/fishjam/reactnative/foregroundService/ForegroundServiceManager.kt +0 -118
  56. package/android/src/main/java/io/fishjam/reactnative/foregroundService/ForegroundServiceState.kt +0 -46
  57. package/android/src/main/java/io/fishjam/reactnative/helpers/PictureInPictureHelperFragment.kt +0 -20
  58. package/android/src/main/java/io/fishjam/reactnative/managers/ListenerManager.kt +0 -24
  59. package/android/src/main/java/io/fishjam/reactnative/managers/LocalCameraTracksChangedListenersManager.kt +0 -8
  60. package/android/src/main/java/io/fishjam/reactnative/managers/LocalTracksSwitchListenersManager.kt +0 -17
  61. package/android/src/main/java/io/fishjam/reactnative/managers/TracksUpdateListenersManager.kt +0 -7
  62. package/android/src/main/java/io/fishjam/reactnative/utils/PermissionUtils.kt +0 -45
  63. package/build/RNFishjamClientModule.d.ts +0 -106
  64. package/build/RNFishjamClientModule.d.ts.map +0 -1
  65. package/build/RNFishjamClientModule.js +0 -21
  66. package/build/RNFishjamClientModule.js.map +0 -1
  67. package/build/common/metadata.d.ts +0 -9
  68. package/build/common/metadata.d.ts.map +0 -1
  69. package/build/common/metadata.js +0 -11
  70. package/build/common/metadata.js.map +0 -1
  71. package/build/components/FishjamRoom/GridTrackItem.d.ts +0 -12
  72. package/build/components/FishjamRoom/GridTrackItem.d.ts.map +0 -1
  73. package/build/components/FishjamRoom/GridTrackItem.js +0 -56
  74. package/build/components/FishjamRoom/GridTrackItem.js.map +0 -1
  75. package/build/components/FishjamRoom/VideosGrid.d.ts +0 -3
  76. package/build/components/FishjamRoom/VideosGrid.d.ts.map +0 -1
  77. package/build/components/FishjamRoom/VideosGrid.js +0 -20
  78. package/build/components/FishjamRoom/VideosGrid.js.map +0 -1
  79. package/build/components/FishjamRoom/index.d.ts +0 -33
  80. package/build/components/FishjamRoom/index.d.ts.map +0 -1
  81. package/build/components/FishjamRoom/index.js +0 -52
  82. package/build/components/FishjamRoom/index.js.map +0 -1
  83. package/build/components/FishjamRoom/parsePeersToTracks.d.ts +0 -4
  84. package/build/components/FishjamRoom/parsePeersToTracks.d.ts.map +0 -1
  85. package/build/components/FishjamRoom/parsePeersToTracks.js +0 -37
  86. package/build/components/FishjamRoom/parsePeersToTracks.js.map +0 -1
  87. package/build/components/PipContainerView.d.ts +0 -48
  88. package/build/components/PipContainerView.d.ts.map +0 -1
  89. package/build/components/PipContainerView.js +0 -34
  90. package/build/components/PipContainerView.js.map +0 -1
  91. package/build/components/VideoPreviewView.d.ts +0 -28
  92. package/build/components/VideoPreviewView.d.ts.map +0 -1
  93. package/build/components/VideoPreviewView.js +0 -17
  94. package/build/components/VideoPreviewView.js.map +0 -1
  95. package/build/components/VideoRendererView.d.ts +0 -39
  96. package/build/components/VideoRendererView.d.ts.map +0 -1
  97. package/build/components/VideoRendererView.js +0 -25
  98. package/build/components/VideoRendererView.js.map +0 -1
  99. package/build/consts/index.d.ts +0 -5
  100. package/build/consts/index.d.ts.map +0 -1
  101. package/build/consts/index.js +0 -8
  102. package/build/consts/index.js.map +0 -1
  103. package/build/debug/common/webRTC.d.ts +0 -9
  104. package/build/debug/common/webRTC.d.ts.map +0 -1
  105. package/build/debug/common/webRTC.js +0 -11
  106. package/build/debug/common/webRTC.js.map +0 -1
  107. package/build/debug/index.d.ts +0 -4
  108. package/build/debug/index.d.ts.map +0 -1
  109. package/build/debug/index.js +0 -3
  110. package/build/debug/index.js.map +0 -1
  111. package/build/debug/stats/types.d.ts +0 -55
  112. package/build/debug/stats/types.d.ts.map +0 -1
  113. package/build/debug/stats/types.js +0 -2
  114. package/build/debug/stats/types.js.map +0 -1
  115. package/build/debug/stats/useRTCStatistics.d.ts +0 -9
  116. package/build/debug/stats/useRTCStatistics.d.ts.map +0 -1
  117. package/build/debug/stats/useRTCStatistics.js +0 -79
  118. package/build/debug/stats/useRTCStatistics.js.map +0 -1
  119. package/build/hooks/internal/useFishjamEvent.d.ts +0 -4
  120. package/build/hooks/internal/useFishjamEvent.d.ts.map +0 -1
  121. package/build/hooks/internal/useFishjamEvent.js +0 -38
  122. package/build/hooks/internal/useFishjamEvent.js.map +0 -1
  123. package/build/hooks/internal/useFishjamEventState.d.ts +0 -3
  124. package/build/hooks/internal/useFishjamEventState.d.ts.map +0 -1
  125. package/build/hooks/internal/useFishjamEventState.js +0 -18
  126. package/build/hooks/internal/useFishjamEventState.js.map +0 -1
  127. package/build/hooks/useAppScreenShare.d.ts +0 -18
  128. package/build/hooks/useAppScreenShare.d.ts.map +0 -1
  129. package/build/hooks/useAppScreenShare.js +0 -46
  130. package/build/hooks/useAppScreenShare.js.map +0 -1
  131. package/build/hooks/useAudioSettings.d.ts +0 -49
  132. package/build/hooks/useAudioSettings.d.ts.map +0 -1
  133. package/build/hooks/useAudioSettings.js +0 -70
  134. package/build/hooks/useAudioSettings.js.map +0 -1
  135. package/build/hooks/useBandwidthEstimation.d.ts +0 -14
  136. package/build/hooks/useBandwidthEstimation.d.ts.map +0 -1
  137. package/build/hooks/useBandwidthEstimation.js +0 -19
  138. package/build/hooks/useBandwidthEstimation.js.map +0 -1
  139. package/build/hooks/useCallKit.d.ts +0 -121
  140. package/build/hooks/useCallKit.d.ts.map +0 -1
  141. package/build/hooks/useCallKit.js +0 -142
  142. package/build/hooks/useCallKit.js.map +0 -1
  143. package/build/hooks/useCamera.d.ts +0 -113
  144. package/build/hooks/useCamera.d.ts.map +0 -1
  145. package/build/hooks/useCamera.js +0 -93
  146. package/build/hooks/useCamera.js.map +0 -1
  147. package/build/hooks/useConnection.d.ts +0 -73
  148. package/build/hooks/useConnection.d.ts.map +0 -1
  149. package/build/hooks/useConnection.js +0 -46
  150. package/build/hooks/useConnection.js.map +0 -1
  151. package/build/hooks/useForegroundService.d.ts.map +0 -1
  152. package/build/hooks/useForegroundService.js +0 -66
  153. package/build/hooks/useForegroundService.js.map +0 -1
  154. package/build/hooks/useMicrophone.d.ts +0 -16
  155. package/build/hooks/useMicrophone.d.ts.map +0 -1
  156. package/build/hooks/useMicrophone.js +0 -31
  157. package/build/hooks/useMicrophone.js.map +0 -1
  158. package/build/hooks/usePeerStatus.d.ts +0 -10
  159. package/build/hooks/usePeerStatus.d.ts.map +0 -1
  160. package/build/hooks/usePeerStatus.js +0 -13
  161. package/build/hooks/usePeerStatus.js.map +0 -1
  162. package/build/hooks/usePeers.d.ts +0 -98
  163. package/build/hooks/usePeers.d.ts.map +0 -1
  164. package/build/hooks/usePeers.js +0 -81
  165. package/build/hooks/usePeers.js.map +0 -1
  166. package/build/hooks/usePermissions.d.ts +0 -24
  167. package/build/hooks/usePermissions.d.ts.map +0 -1
  168. package/build/hooks/usePermissions.js +0 -61
  169. package/build/hooks/usePermissions.js.map +0 -1
  170. package/build/hooks/useReconnection.d.ts +0 -11
  171. package/build/hooks/useReconnection.d.ts.map +0 -1
  172. package/build/hooks/useReconnection.js +0 -14
  173. package/build/hooks/useReconnection.js.map +0 -1
  174. package/build/hooks/useSandbox.d.ts +0 -20
  175. package/build/hooks/useSandbox.d.ts.map +0 -1
  176. package/build/hooks/useSandbox.js +0 -54
  177. package/build/hooks/useSandbox.js.map +0 -1
  178. package/build/hooks/useScreenShare.d.ts +0 -36
  179. package/build/hooks/useScreenShare.d.ts.map +0 -1
  180. package/build/hooks/useScreenShare.js +0 -45
  181. package/build/hooks/useScreenShare.js.map +0 -1
  182. package/build/hooks/useUpdatePeerMetadata.d.ts +0 -15
  183. package/build/hooks/useUpdatePeerMetadata.d.ts.map +0 -1
  184. package/build/hooks/useUpdatePeerMetadata.js +0 -21
  185. package/build/hooks/useUpdatePeerMetadata.js.map +0 -1
  186. package/build/index.d.ts +0 -36
  187. package/build/index.d.ts.map +0 -1
  188. package/build/index.js +0 -30
  189. package/build/index.js.map +0 -1
  190. package/build/livestream/components/LivestreamStreamer.d.ts +0 -24
  191. package/build/livestream/components/LivestreamStreamer.d.ts.map +0 -1
  192. package/build/livestream/components/LivestreamStreamer.js +0 -12
  193. package/build/livestream/components/LivestreamStreamer.js.map +0 -1
  194. package/build/livestream/components/LivestreamViewer.d.ts +0 -46
  195. package/build/livestream/components/LivestreamViewer.d.ts.map +0 -1
  196. package/build/livestream/components/LivestreamViewer.js +0 -10
  197. package/build/livestream/components/LivestreamViewer.js.map +0 -1
  198. package/build/livestream/hooks/useLivestreamScreenSharingStreamer.d.ts +0 -49
  199. package/build/livestream/hooks/useLivestreamScreenSharingStreamer.d.ts.map +0 -1
  200. package/build/livestream/hooks/useLivestreamScreenSharingStreamer.js +0 -58
  201. package/build/livestream/hooks/useLivestreamScreenSharingStreamer.js.map +0 -1
  202. package/build/livestream/hooks/useLivestreamStreamer.d.ts +0 -65
  203. package/build/livestream/hooks/useLivestreamStreamer.d.ts.map +0 -1
  204. package/build/livestream/hooks/useLivestreamStreamer.js +0 -71
  205. package/build/livestream/hooks/useLivestreamStreamer.js.map +0 -1
  206. package/build/livestream/hooks/useLivestreamViewer.d.ts +0 -36
  207. package/build/livestream/hooks/useLivestreamViewer.d.ts.map +0 -1
  208. package/build/livestream/hooks/useLivestreamViewer.js +0 -73
  209. package/build/livestream/hooks/useLivestreamViewer.js.map +0 -1
  210. package/build/livestream/index.d.ts +0 -12
  211. package/build/livestream/index.d.ts.map +0 -1
  212. package/build/livestream/index.js +0 -7
  213. package/build/livestream/index.js.map +0 -1
  214. package/build/protos/fishjam/peer_notifications.d.ts +0 -63
  215. package/build/protos/fishjam/peer_notifications.d.ts.map +0 -1
  216. package/build/protos/fishjam/peer_notifications.js +0 -235
  217. package/build/protos/fishjam/peer_notifications.js.map +0 -1
  218. package/build/types.d.ts +0 -34
  219. package/build/types.d.ts.map +0 -1
  220. package/build/types.js +0 -2
  221. package/build/types.js.map +0 -1
  222. package/build/utils/config.d.ts +0 -6
  223. package/build/utils/config.d.ts.map +0 -1
  224. package/build/utils/config.js +0 -10
  225. package/build/utils/config.js.map +0 -1
  226. package/build/utils/errorListener.d.ts +0 -2
  227. package/build/utils/errorListener.d.ts.map +0 -1
  228. package/build/utils/errorListener.js +0 -15
  229. package/build/utils/errorListener.js.map +0 -1
  230. package/build/utils/eventPayloadValidator.d.ts +0 -3
  231. package/build/utils/eventPayloadValidator.d.ts.map +0 -1
  232. package/build/utils/eventPayloadValidator.js +0 -86
  233. package/build/utils/eventPayloadValidator.js.map +0 -1
  234. package/build/utils/getFishjamUrl.d.ts +0 -2
  235. package/build/utils/getFishjamUrl.d.ts.map +0 -1
  236. package/build/utils/getFishjamUrl.js +0 -10
  237. package/build/utils/getFishjamUrl.js.map +0 -1
  238. package/debug/package.json +0 -4
  239. package/expo-module.config.json +0 -19
  240. package/ios/CameraPermissionsRequester.swift +0 -117
  241. package/ios/Events.swift +0 -152
  242. package/ios/PictureInPictureManager.swift +0 -215
  243. package/ios/PipContainerView.swift +0 -56
  244. package/ios/PipContainerViewModule.swift +0 -48
  245. package/ios/RNFishjamClient.podspec +0 -30
  246. package/ios/RNFishjamClient.swift +0 -995
  247. package/ios/RNFishjamClientModule.swift +0 -289
  248. package/ios/RNFishjamProxy.swift +0 -12
  249. package/ios/Utils/PermissionUtils.swift +0 -16
  250. package/ios/Utils.swift +0 -23
  251. package/ios/VideoPreviewView.swift +0 -54
  252. package/ios/VideoPreviewViewModule.swift +0 -21
  253. package/ios/VideoRendererView.swift +0 -98
  254. package/ios/VideoRendererViewModule.swift +0 -23
  255. package/ios/extensions/AVCaptureDevice.swift +0 -20
  256. package/ios/managers/LocalCameraTracksChangedListenersManager.swift +0 -23
  257. package/ios/managers/TracksUpdateListenersManager.swift +0 -21
  258. package/livestream/package.json +0 -4
  259. package/plugin/broadcastExtensionFiles/FishjamBroadcastSampleHandler.swift +0 -50
  260. /package/plugin/broadcastExtensionFiles/{FishjamScreenBroadcastExtension.entitlements → ScreenBroadcastExtension.entitlements} +0 -0
@@ -1,39 +0,0 @@
1
- import * as React from 'react';
2
- import { ViewStyle, StyleProp } from 'react-native';
3
- import { VideoLayout } from '../types';
4
- import type { TrackId } from '../hooks/usePeers';
5
- export type VideoRendererProps = {
6
- /**
7
- * id of the video track which you want to render.
8
- */
9
- trackId: TrackId;
10
- /**
11
- * Video layout inside of the component
12
- * @default `FILL`
13
- */
14
- videoLayout?: VideoLayout;
15
- /**
16
- * Whether the video should be rendered if it's off screen or hidden.
17
- */
18
- skipRenderOutsideVisibleArea?: boolean;
19
- style?: StyleProp<ViewStyle>;
20
- };
21
- /**
22
- * Render video track received from {@link usePeers} hook
23
- *
24
- * Example usage:
25
- * ```js
26
- * <VideoRendererView
27
- * trackId={peer.cameraTrack?.id}
28
- * videoLayout="FIT"
29
- * style={styles.videoContent}
30
- * />
31
- * ```
32
- *
33
- * @category Components
34
- *
35
- * @param {Object} props
36
- * @param props.trackId
37
- */
38
- export declare const VideoRendererView: React.ForwardRefExoticComponent<VideoRendererProps & React.RefAttributes<React.ComponentType<VideoRendererProps>>>;
39
- //# sourceMappingURL=VideoRendererView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoRendererView.d.ts","sourceRoot":"","sources":["../../src/components/VideoRendererView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;OAEG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAKF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,oHAM5B,CAAC"}
@@ -1,25 +0,0 @@
1
- import { requireNativeViewManager } from 'expo-modules-core';
2
- import * as React from 'react';
3
- const NativeView = requireNativeViewManager('VideoRendererViewModule');
4
- /**
5
- * Render video track received from {@link usePeers} hook
6
- *
7
- * Example usage:
8
- * ```js
9
- * <VideoRendererView
10
- * trackId={peer.cameraTrack?.id}
11
- * videoLayout="FIT"
12
- * style={styles.videoContent}
13
- * />
14
- * ```
15
- *
16
- * @category Components
17
- *
18
- * @param {Object} props
19
- * @param props.trackId
20
- */
21
- export const VideoRendererView = React.forwardRef((props, ref) => (
22
- // @ts-expect-error ref prop needs to be updated
23
- <NativeView {...props} ref={ref}/>));
24
- VideoRendererView.displayName = 'VideoRendererView';
25
- //# sourceMappingURL=VideoRendererView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoRendererView.js","sourceRoot":"","sources":["../../src/components/VideoRendererView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B,MAAM,UAAU,GACd,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAG/C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;AAChB,gDAAgD;AAChD,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CACpC,CAAC,CAAC;AAEH,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport { ViewStyle, StyleProp } from 'react-native';\n\nimport { VideoLayout } from '../types';\nimport type { TrackId } from '../hooks/usePeers';\n\nexport type VideoRendererProps = {\n /**\n * id of the video track which you want to render.\n */\n trackId: TrackId;\n /**\n * Video layout inside of the component\n * @default `FILL`\n */\n videoLayout?: VideoLayout;\n /**\n * Whether the video should be rendered if it's off screen or hidden.\n */\n skipRenderOutsideVisibleArea?: boolean;\n style?: StyleProp<ViewStyle>;\n};\n\nconst NativeView: React.ComponentType<VideoRendererProps> =\n requireNativeViewManager('VideoRendererViewModule');\n\n/**\n * Render video track received from {@link usePeers} hook\n *\n * Example usage:\n * ```js\n * <VideoRendererView\n * trackId={peer.cameraTrack?.id}\n * videoLayout=\"FIT\"\n * style={styles.videoContent}\n * />\n * ```\n *\n * @category Components\n *\n * @param {Object} props\n * @param props.trackId\n */\nexport const VideoRendererView = React.forwardRef<\n React.ComponentType<VideoRendererProps>,\n VideoRendererProps\n>((props, ref) => (\n // @ts-expect-error ref prop needs to be updated\n <NativeView {...props} ref={ref} />\n));\n\nVideoRendererView.displayName = 'VideoRendererView';\n"]}
@@ -1,5 +0,0 @@
1
- export declare const FISHJAM_HTTP_CONNECT_URL = "https://fishjam.io/api/v1/connect";
2
- export declare const FISHJAM_WS_CONNECT_URL = "wss://fishjam.io/api/v1/connect";
3
- export declare const FISHJAM_WHIP_URL = "https://fishjam.io/api/v1/live/api/whip";
4
- export declare const FISHJAM_WHEP_URL = "https://fishjam.io/api/v1/live/api/whep";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/consts/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,sCAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,oCAAkC,CAAC;AAItE,eAAO,MAAM,gBAAgB,4CAAiC,CAAC;AAC/D,eAAO,MAAM,gBAAgB,4CAAiC,CAAC"}
@@ -1,8 +0,0 @@
1
- const FISHJAM_URL_BASE = 'fishjam.io/api/v1';
2
- const FISHJAM_CONNECT_PATH = `${FISHJAM_URL_BASE}/connect`;
3
- export const FISHJAM_HTTP_CONNECT_URL = `https://${FISHJAM_CONNECT_PATH}`;
4
- export const FISHJAM_WS_CONNECT_URL = `wss://${FISHJAM_CONNECT_PATH}`;
5
- const FISHJAM_LIVE_URL = `https://${FISHJAM_URL_BASE}/live`;
6
- export const FISHJAM_WHIP_URL = `${FISHJAM_LIVE_URL}/api/whip`;
7
- export const FISHJAM_WHEP_URL = `${FISHJAM_LIVE_URL}/api/whep`;
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/consts/index.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,oBAAoB,GAAG,GAAG,gBAAgB,UAAU,CAAC;AAE3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,oBAAoB,EAAE,CAAC;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,oBAAoB,EAAE,CAAC;AAEtE,MAAM,gBAAgB,GAAG,WAAW,gBAAgB,OAAO,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,gBAAgB,WAAW,CAAC;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,gBAAgB,WAAW,CAAC","sourcesContent":["const FISHJAM_URL_BASE = 'fishjam.io/api/v1';\nconst FISHJAM_CONNECT_PATH = `${FISHJAM_URL_BASE}/connect`;\n\nexport const FISHJAM_HTTP_CONNECT_URL = `https://${FISHJAM_CONNECT_PATH}`;\nexport const FISHJAM_WS_CONNECT_URL = `wss://${FISHJAM_CONNECT_PATH}`;\n\nconst FISHJAM_LIVE_URL = `https://${FISHJAM_URL_BASE}/live`;\n\nexport const FISHJAM_WHIP_URL = `${FISHJAM_LIVE_URL}/api/whip`;\nexport const FISHJAM_WHEP_URL = `${FISHJAM_LIVE_URL}/api/whep`;\n"]}
@@ -1,9 +0,0 @@
1
- export type LoggingSeverity = 'verbose' | 'info' | 'warning' | 'error' | 'none';
2
- /**
3
- * Function that changes level of debugging logs in WebRTC.
4
- * @param severity to use when displaying logs
5
- * @returns a promise that is resolved when debug severity is changed
6
- * @category Debugging
7
- */
8
- export declare function changeWebRTCLoggingSeverity(severity: LoggingSeverity): Promise<void>;
9
- //# sourceMappingURL=webRTC.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webRTC.d.ts","sourceRoot":"","sources":["../../../src/debug/common/webRTC.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -1,11 +0,0 @@
1
- import RNFishjamClientModule from '../../RNFishjamClientModule';
2
- /**
3
- * Function that changes level of debugging logs in WebRTC.
4
- * @param severity to use when displaying logs
5
- * @returns a promise that is resolved when debug severity is changed
6
- * @category Debugging
7
- */
8
- export function changeWebRTCLoggingSeverity(severity) {
9
- return RNFishjamClientModule.changeWebRTCLoggingSeverity(severity);
10
- }
11
- //# sourceMappingURL=webRTC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webRTC.js","sourceRoot":"","sources":["../../../src/debug/common/webRTC.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,6BAA6B,CAAC;AAIhE;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAyB;IAEzB,OAAO,qBAAqB,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import RNFishjamClientModule from '../../RNFishjamClientModule';\n\nexport type LoggingSeverity = 'verbose' | 'info' | 'warning' | 'error' | 'none';\n\n/**\n * Function that changes level of debugging logs in WebRTC.\n * @param severity to use when displaying logs\n * @returns a promise that is resolved when debug severity is changed\n * @category Debugging\n */\nexport function changeWebRTCLoggingSeverity(\n severity: LoggingSeverity,\n): Promise<void> {\n return RNFishjamClientModule.changeWebRTCLoggingSeverity(severity);\n}\n"]}
@@ -1,4 +0,0 @@
1
- export { useRTCStatistics } from './stats/useRTCStatistics';
2
- export type { LoggingSeverity } from './common/webRTC';
3
- export { changeWebRTCLoggingSeverity } from './common/webRTC';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,3 +0,0 @@
1
- export { useRTCStatistics } from './stats/useRTCStatistics';
2
- export { changeWebRTCLoggingSeverity } from './common/webRTC';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { useRTCStatistics } from './stats/useRTCStatistics';\n\nexport type { LoggingSeverity } from './common/webRTC';\nexport { changeWebRTCLoggingSeverity } from './common/webRTC';\n"]}
@@ -1,55 +0,0 @@
1
- /**
2
- * A record of the total time, in seconds,
3
- * that this stream has spent in each quality limitation state.
4
- * none: The resolution and/or framerate is not limited.
5
- * bandwidth: The resolution and/or framerate is primarily limited due to
6
- * congestion cues during bandwidth estimation.
7
- * Typical, congestion control algorithms use inter-arrival time,
8
- * round-trip time, packet or other congestion cues to perform bandwidth estimation.
9
- * cpu: The resolution and/or framerate is primarily limited due to CPU load.
10
- * other: The resolution and/or framerate is primarily limited
11
- * for a reason other than the above.
12
- */
13
- export type QualityLimitationDurations = {
14
- bandwidth: number;
15
- cpu: number;
16
- none: number;
17
- other: number;
18
- };
19
- export type RTCOutboundStats = {
20
- 'kind': string;
21
- 'rid': string;
22
- 'bytesSent': number;
23
- 'targetBitrate': number;
24
- 'packetsSent': number;
25
- 'framesEncoded': number;
26
- 'framesPerSecond': number;
27
- 'frameWidth': number;
28
- 'frameHeight': number;
29
- 'qualityLimitationDurations': QualityLimitationDurations;
30
- 'bytesSent/s': number;
31
- 'packetsSent/s': number;
32
- 'framesEncoded/s': number;
33
- };
34
- export type RTCInboundStats = {
35
- 'kind': number;
36
- 'jitter': number;
37
- 'packetsLost': number;
38
- 'packetsReceived': number;
39
- 'bytesReceived': number;
40
- 'framesReceived': number;
41
- 'frameWidth': number;
42
- 'frameHeight': number;
43
- 'framesPerSecond': number;
44
- 'framesDropped': number;
45
- 'packetsLost/s': number;
46
- 'packetsReceived/s': number;
47
- 'bytesReceived/s': number;
48
- 'framesReceived/s': number;
49
- 'framesDropped/s': number;
50
- };
51
- export type RTCTrackStats = RTCOutboundStats | RTCInboundStats;
52
- export type RTCStats = {
53
- [key: string]: RTCTrackStats;
54
- };
55
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/debug/stats/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B,EAAE,0BAA0B,CAAC;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAE/D,MAAM,MAAM,QAAQ,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/debug/stats/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A record of the total time, in seconds,\n * that this stream has spent in each quality limitation state.\n * none: The resolution and/or framerate is not limited.\n * bandwidth: The resolution and/or framerate is primarily limited due to\n * congestion cues during bandwidth estimation.\n * Typical, congestion control algorithms use inter-arrival time,\n * round-trip time, packet or other congestion cues to perform bandwidth estimation.\n * cpu: The resolution and/or framerate is primarily limited due to CPU load.\n * other: The resolution and/or framerate is primarily limited\n * for a reason other than the above.\n */\nexport type QualityLimitationDurations = {\n bandwidth: number;\n cpu: number;\n none: number;\n other: number;\n};\n\nexport type RTCOutboundStats = {\n 'kind': string;\n 'rid': string;\n 'bytesSent': number;\n 'targetBitrate': number;\n 'packetsSent': number;\n 'framesEncoded': number;\n 'framesPerSecond': number;\n 'frameWidth': number;\n 'frameHeight': number;\n 'qualityLimitationDurations': QualityLimitationDurations;\n 'bytesSent/s': number;\n 'packetsSent/s': number;\n 'framesEncoded/s': number;\n};\n\nexport type RTCInboundStats = {\n 'kind': number;\n 'jitter': number;\n 'packetsLost': number;\n 'packetsReceived': number;\n 'bytesReceived': number;\n 'framesReceived': number;\n 'frameWidth': number;\n 'frameHeight': number;\n 'framesPerSecond': number;\n 'framesDropped': number;\n 'packetsLost/s': number;\n 'packetsReceived/s': number;\n 'bytesReceived/s': number;\n 'framesReceived/s': number;\n 'framesDropped/s': number;\n};\n\nexport type RTCTrackStats = RTCOutboundStats | RTCInboundStats;\n\nexport type RTCStats = { [key: string]: RTCTrackStats };\n"]}
@@ -1,9 +0,0 @@
1
- import type { RTCStats } from './types';
2
- /**
3
- * This hook provides access to current rtc statistics data.
4
- * @category Debugging
5
- */
6
- export declare function useRTCStatistics(refreshInterval: number): {
7
- statistics: RTCStats[];
8
- };
9
- //# sourceMappingURL=useRTCStatistics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRTCStatistics.d.ts","sourceRoot":"","sources":["../../../src/debug/stats/useRTCStatistics.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAqC,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG3E;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM;;EAqFvD"}
@@ -1,79 +0,0 @@
1
- import { takeRight } from 'lodash';
2
- import { useCallback, useEffect, useState } from 'react';
3
- import RNFishjamClientModule from '../../RNFishjamClientModule';
4
- /**
5
- * This hook provides access to current rtc statistics data.
6
- * @category Debugging
7
- */
8
- export function useRTCStatistics(refreshInterval) {
9
- const MAX_SIZE = 120;
10
- const [statistics, setStatistics] = useState([]);
11
- // Calculates diff between pervious and current stats,
12
- // providing end users with a per second metric.
13
- const processIncomingStats = useCallback((stats, stat) => {
14
- Object.keys(stat).forEach((obj) => {
15
- if (obj.includes('Inbound')) {
16
- const rtcStats = stat[obj];
17
- if (stats.length > 0 &&
18
- Object.keys(stats[stats.length - 1]).includes(obj)) {
19
- const prevRtcStats = stats[stats.length - 1][obj];
20
- rtcStats['packetsLost/s'] =
21
- rtcStats['packetsLost'] - prevRtcStats['packetsLost'];
22
- rtcStats['packetsReceived/s'] =
23
- rtcStats['packetsReceived'] - prevRtcStats['packetsReceived'];
24
- rtcStats['bytesReceived/s'] =
25
- rtcStats['bytesReceived'] - prevRtcStats['bytesReceived'];
26
- rtcStats['framesReceived/s'] =
27
- rtcStats['framesReceived'] - prevRtcStats['framesReceived'];
28
- rtcStats['framesDropped/s'] =
29
- rtcStats['framesDropped'] - prevRtcStats['framesDropped'];
30
- }
31
- else {
32
- rtcStats['packetsLost/s'] = 0;
33
- rtcStats['packetsReceived/s'] = 0;
34
- rtcStats['bytesReceived/s'] = 0;
35
- rtcStats['framesReceived/s'] = 0;
36
- rtcStats['framesDropped/s'] = 0;
37
- }
38
- return stat;
39
- }
40
- // Outbound
41
- const rtcStats = stat[obj];
42
- if (stats.length > 0 &&
43
- Object.keys(stats[stats.length - 1]).includes(obj)) {
44
- const prevRtcStats = stats[stats.length - 1][obj];
45
- rtcStats['bytesSent/s'] =
46
- rtcStats['bytesSent'] - prevRtcStats['bytesSent'];
47
- rtcStats['packetsSent/s'] =
48
- rtcStats['packetsSent'] - prevRtcStats['packetsSent'];
49
- rtcStats['framesEncoded/s'] =
50
- rtcStats['framesEncoded'] - prevRtcStats['framesEncoded'];
51
- }
52
- else {
53
- rtcStats['bytesSent/s'] = 0;
54
- rtcStats['packetsSent/s'] = 0;
55
- rtcStats['framesEncoded/s'] = 0;
56
- }
57
- return stat;
58
- });
59
- return stat;
60
- }, []);
61
- // Gets stats from the native libraries.
62
- const getStatistics = useCallback(async () => {
63
- const stats = await RNFishjamClientModule.getStatistics();
64
- setStatistics((prev) => {
65
- const newStats = [...prev, processIncomingStats(prev, stats)];
66
- takeRight(newStats, MAX_SIZE);
67
- return newStats;
68
- });
69
- }, [processIncomingStats]);
70
- useEffect(() => {
71
- const intervalId = setInterval(getStatistics, refreshInterval);
72
- return () => {
73
- clearInterval(intervalId);
74
- setStatistics([]);
75
- };
76
- }, [getStatistics, refreshInterval]);
77
- return { statistics };
78
- }
79
- //# sourceMappingURL=useRTCStatistics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRTCStatistics.js","sourceRoot":"","sources":["../../../src/debug/stats/useRTCStatistics.ts"],"names":[],"mappings":"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","sourcesContent":["import { takeRight } from 'lodash';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport type { RTCInboundStats, RTCOutboundStats, RTCStats } from './types';\nimport RNFishjamClientModule from '../../RNFishjamClientModule';\n\n/**\n * This hook provides access to current rtc statistics data.\n * @category Debugging\n */\nexport function useRTCStatistics(refreshInterval: number) {\n const MAX_SIZE = 120;\n const [statistics, setStatistics] = useState<RTCStats[]>([]);\n\n // Calculates diff between pervious and current stats,\n // providing end users with a per second metric.\n const processIncomingStats = useCallback(\n (stats: readonly RTCStats[], stat: Readonly<RTCStats>) => {\n Object.keys(stat).forEach((obj) => {\n if (obj.includes('Inbound')) {\n const rtcStats = stat[obj] as RTCInboundStats;\n\n if (\n stats.length > 0 &&\n Object.keys(stats[stats.length - 1]).includes(obj)\n ) {\n const prevRtcStats = stats[stats.length - 1][\n obj\n ] as RTCInboundStats;\n\n rtcStats['packetsLost/s'] =\n rtcStats['packetsLost'] - prevRtcStats['packetsLost'];\n rtcStats['packetsReceived/s'] =\n rtcStats['packetsReceived'] - prevRtcStats['packetsReceived'];\n rtcStats['bytesReceived/s'] =\n rtcStats['bytesReceived'] - prevRtcStats['bytesReceived'];\n rtcStats['framesReceived/s'] =\n rtcStats['framesReceived'] - prevRtcStats['framesReceived'];\n rtcStats['framesDropped/s'] =\n rtcStats['framesDropped'] - prevRtcStats['framesDropped'];\n } else {\n rtcStats['packetsLost/s'] = 0;\n rtcStats['packetsReceived/s'] = 0;\n rtcStats['bytesReceived/s'] = 0;\n rtcStats['framesReceived/s'] = 0;\n rtcStats['framesDropped/s'] = 0;\n }\n return stat;\n }\n // Outbound\n const rtcStats = stat[obj] as RTCOutboundStats;\n\n if (\n stats.length > 0 &&\n Object.keys(stats[stats.length - 1]).includes(obj)\n ) {\n const prevRtcStats = stats[stats.length - 1][obj] as RTCOutboundStats;\n\n rtcStats['bytesSent/s'] =\n rtcStats['bytesSent'] - prevRtcStats['bytesSent'];\n rtcStats['packetsSent/s'] =\n rtcStats['packetsSent'] - prevRtcStats['packetsSent'];\n rtcStats['framesEncoded/s'] =\n rtcStats['framesEncoded'] - prevRtcStats['framesEncoded'];\n } else {\n rtcStats['bytesSent/s'] = 0;\n rtcStats['packetsSent/s'] = 0;\n rtcStats['framesEncoded/s'] = 0;\n }\n return stat;\n });\n return stat;\n },\n [],\n );\n\n // Gets stats from the native libraries.\n const getStatistics = useCallback(async () => {\n const stats = await RNFishjamClientModule.getStatistics();\n setStatistics((prev) => {\n const newStats = [...prev, processIncomingStats(prev, stats)];\n takeRight(newStats, MAX_SIZE);\n return newStats;\n });\n }, [processIncomingStats]);\n\n useEffect(() => {\n const intervalId = setInterval(getStatistics, refreshInterval);\n return () => {\n clearInterval(intervalId);\n setStatistics([]);\n };\n }, [getStatistics, refreshInterval]);\n\n return { statistics };\n}\n"]}
@@ -1,4 +0,0 @@
1
- import { ReceivableEvents, ReceivableEventPayloads } from '../../RNFishjamClientModule';
2
- export declare function useFishjamEvent<T extends keyof typeof ReceivableEvents>(eventName: T, callback: (event: ReceivableEventPayloads[T]) => void): void;
3
- export declare function validateAndLogEventPayload<T extends keyof typeof ReceivableEvents>(eventName: T, payload: ReceivableEventPayloads[T]): void;
4
- //# sourceMappingURL=useFishjamEvent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFishjamEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/internal/useFishjamEvent.ts"],"names":[],"mappings":"AAEA,OAAqB,EACnB,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAIrC,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,OAAO,gBAAgB,EACrE,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,IAAI,QActD;AAED,wBAAgB,0BAA0B,CACxC,CAAC,SAAS,MAAM,OAAO,gBAAgB,EACvC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,IAAI,CAwBzD"}
@@ -1,38 +0,0 @@
1
- import { ZodError } from 'zod';
2
- import { useEffect } from 'react';
3
- import nativeModule from '../../RNFishjamClientModule';
4
- import { validateNativeEventPayload } from '../../utils/eventPayloadValidator';
5
- import { getDebugConfig } from '../../utils/config';
6
- export function useFishjamEvent(eventName, callback) {
7
- useEffect(() => {
8
- const eventListener = nativeModule.addListener(eventName, (event) => {
9
- const payload = event[eventName];
10
- if (__DEV__) {
11
- validateAndLogEventPayload(eventName, payload);
12
- }
13
- callback(payload);
14
- });
15
- return () => eventListener.remove();
16
- }, [callback, eventName]);
17
- }
18
- export function validateAndLogEventPayload(eventName, payload) {
19
- // Double check just to make sure
20
- if (!__DEV__)
21
- return;
22
- if (!getDebugConfig().validateEventPayloads)
23
- return;
24
- try {
25
- validateNativeEventPayload(eventName, payload);
26
- }
27
- catch (error) {
28
- if (error instanceof ZodError) {
29
- console.error(`Invalid payload received for event ${eventName}:\n`, error.errors
30
- .map((err) => `- ${err.path.join('.')}: ${err.message}`)
31
- .join('\n'), `\n Received:\n${JSON.stringify(payload, null, 2)}\n\n`);
32
- }
33
- else {
34
- console.error(`Unexpected error validating payload for event ${eventName}:`, error);
35
- }
36
- }
37
- }
38
- //# sourceMappingURL=useFishjamEvent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFishjamEvent.js","sourceRoot":"","sources":["../../../src/hooks/internal/useFishjamEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,YAGN,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,UAAU,eAAe,CAC7B,SAAY,EACZ,QAAqD;IAErD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;YAClE,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;YAEjC,IAAI,OAAO,EAAE,CAAC;gBACZ,0BAA0B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC;YAED,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;IACtC,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,0BAA0B,CAExC,SAAY,EAAE,OAAmC;IACjD,iCAAiC;IACjC,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,IAAI,CAAC,cAAc,EAAE,CAAC,qBAAqB;QAAE,OAAO;IAEpD,IAAI,CAAC;QACH,0BAA0B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,KAAK,CACX,sCAAsC,SAAS,KAAK,EACpD,KAAK,CAAC,MAAM;iBACT,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;iBACvD,IAAI,CAAC,IAAI,CAAC,EACb,iBAAiB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CACxD,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CACX,iDAAiD,SAAS,GAAG,EAC7D,KAAK,CACN,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { ZodError } from 'zod';\nimport { useEffect } from 'react';\nimport nativeModule, {\n ReceivableEvents,\n ReceivableEventPayloads,\n} from '../../RNFishjamClientModule';\nimport { validateNativeEventPayload } from '../../utils/eventPayloadValidator';\nimport { getDebugConfig } from '../../utils/config';\n\nexport function useFishjamEvent<T extends keyof typeof ReceivableEvents>(\n eventName: T,\n callback: (event: ReceivableEventPayloads[T]) => void,\n) {\n useEffect(() => {\n const eventListener = nativeModule.addListener(eventName, (event) => {\n const payload = event[eventName];\n\n if (__DEV__) {\n validateAndLogEventPayload(eventName, payload);\n }\n\n callback(payload);\n });\n return () => eventListener.remove();\n }, [callback, eventName]);\n}\n\nexport function validateAndLogEventPayload<\n T extends keyof typeof ReceivableEvents,\n>(eventName: T, payload: ReceivableEventPayloads[T]): void {\n // Double check just to make sure\n if (!__DEV__) return;\n\n if (!getDebugConfig().validateEventPayloads) return;\n\n try {\n validateNativeEventPayload(eventName, payload);\n } catch (error) {\n if (error instanceof ZodError) {\n console.error(\n `Invalid payload received for event ${eventName}:\\n`,\n error.errors\n .map((err) => `- ${err.path.join('.')}: ${err.message}`)\n .join('\\n'),\n `\\n Received:\\n${JSON.stringify(payload, null, 2)}\\n\\n`,\n );\n } else {\n console.error(\n `Unexpected error validating payload for event ${eventName}:`,\n error,\n );\n }\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { ReceivableEventPayloads, ReceivableEvents } from '../../RNFishjamClientModule';
2
- export declare function useFishjamEventState<EventName extends keyof typeof ReceivableEvents, StateType = ReceivableEventPayloads[EventName]>(eventName: EventName, defaultValue: ReceivableEventPayloads[EventName], transform?: (eventValue: ReceivableEventPayloads[EventName]) => StateType): StateType;
3
- //# sourceMappingURL=useFishjamEventState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFishjamEventState.d.ts","sourceRoot":"","sources":["../../../src/hooks/internal/useFishjamEventState.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,oBAAoB,CAClC,SAAS,SAAS,MAAM,OAAO,gBAAgB,EAC/C,SAAS,GAAG,uBAAuB,CAAC,SAAS,CAAC,EAE9C,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,uBAAuB,CAAC,SAAS,CAAC,EAChD,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,uBAAuB,CAAC,SAAS,CAAC,KAAK,SAAS,aAsB1E"}
@@ -1,18 +0,0 @@
1
- import { useCallback, useState } from 'react';
2
- import { useFishjamEvent } from './useFishjamEvent';
3
- export function useFishjamEventState(eventName, defaultValue, transform) {
4
- const [value, setValue] = useState(transform
5
- ? transform(defaultValue)
6
- : defaultValue);
7
- const onEvent = useCallback((newValue) => {
8
- if (transform) {
9
- setValue(transform(newValue));
10
- }
11
- else {
12
- setValue(newValue);
13
- }
14
- }, [transform]);
15
- useFishjamEvent(eventName, onEvent);
16
- return value;
17
- }
18
- //# sourceMappingURL=useFishjamEventState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFishjamEventState.js","sourceRoot":"","sources":["../../../src/hooks/internal/useFishjamEventState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,MAAM,UAAU,oBAAoB,CAIlC,SAAoB,EACpB,YAAgD,EAChD,SAAyE;IAEzE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAChC,SAAS;QACP,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;QACzB,CAAC,CAAE,YAAqC,CAC3C,CAAC;IAEF,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,QAA4C,EAAE,EAAE;QAC/C,IAAI,SAAS,EAAE,CAAC;YACd,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,QAAgC,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,eAAe,CAAY,SAAS,EAAE,OAAO,CAAC,CAAC;IAE/C,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { useCallback, useState } from 'react';\nimport { useFishjamEvent } from './useFishjamEvent';\nimport {\n ReceivableEventPayloads,\n ReceivableEvents,\n} from '../../RNFishjamClientModule';\n\nexport function useFishjamEventState<\n EventName extends keyof typeof ReceivableEvents,\n StateType = ReceivableEventPayloads[EventName],\n>(\n eventName: EventName,\n defaultValue: ReceivableEventPayloads[EventName],\n transform?: (eventValue: ReceivableEventPayloads[EventName]) => StateType,\n) {\n const [value, setValue] = useState<StateType>(\n transform\n ? transform(defaultValue)\n : (defaultValue as unknown as StateType),\n );\n\n const onEvent = useCallback(\n (newValue: ReceivableEventPayloads[EventName]) => {\n if (transform) {\n setValue(transform(newValue));\n } else {\n setValue(newValue as unknown as StateType);\n }\n },\n [transform],\n );\n\n useFishjamEvent<EventName>(eventName, onEvent);\n\n return value;\n}\n"]}
@@ -1,18 +0,0 @@
1
- import { ScreenShareOptions } from './useScreenShare';
2
- export type AppScreenShareData = {
3
- isAppScreenShareOn: boolean;
4
- toggleAppScreenShare: (screenShareOptions?: Partial<ScreenShareOptions>) => Promise<void>;
5
- };
6
- declare function useDefaultAppScreenShareAndroid(): AppScreenShareData;
7
- /**
8
- * This hook can toggle client app screen sharing on/off and provides current screen share state.
9
- *
10
- * It works only on iOS.
11
- *
12
- * @returns An object with functions to manage app screen share on iOS and null on android.
13
- * @category Connection
14
- * @group Hooks
15
- */
16
- export declare const useAppScreenShare: typeof useDefaultAppScreenShareAndroid;
17
- export {};
18
- //# sourceMappingURL=useAppScreenShare.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAppScreenShare.d.ts","sourceRoot":"","sources":["../../src/hooks/useAppScreenShare.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAItD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,CACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAC7C,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC;AAiCF,iBAAS,+BAA+B,IAAI,kBAAkB,CAK7D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,wCAG5B,CAAC"}
@@ -1,46 +0,0 @@
1
- import { useCallback } from 'react';
2
- import RNFishjamClientModule, { ReceivableEvents, } from '../RNFishjamClientModule';
3
- import { Platform } from 'react-native';
4
- import { useFishjamEventState } from './internal/useFishjamEventState';
5
- function useIosAppScreenShare() {
6
- const isAppScreenShareOn = useFishjamEventState(ReceivableEvents.IsAppScreenShareOn, RNFishjamClientModule.isAppScreenShareOn);
7
- const toggleAppScreenShare = useCallback(async (screenShareOptions = {}) => {
8
- const options = {
9
- ...screenShareOptions,
10
- screenShareMetadata: {
11
- displayName: 'presenting',
12
- type: 'screenShareVideo',
13
- active: !isAppScreenShareOn,
14
- },
15
- };
16
- await RNFishjamClientModule.toggleAppScreenShare(options);
17
- }, [isAppScreenShareOn]);
18
- return {
19
- isAppScreenShareOn,
20
- /**
21
- * Toggles the screen share on/off.
22
- * Emits warning on ios when user is screensharing full screen.
23
- */
24
- toggleAppScreenShare,
25
- };
26
- }
27
- function useDefaultAppScreenShareAndroid() {
28
- return {
29
- isAppScreenShareOn: false,
30
- toggleAppScreenShare: async () => { },
31
- };
32
- }
33
- /**
34
- * This hook can toggle client app screen sharing on/off and provides current screen share state.
35
- *
36
- * It works only on iOS.
37
- *
38
- * @returns An object with functions to manage app screen share on iOS and null on android.
39
- * @category Connection
40
- * @group Hooks
41
- */
42
- export const useAppScreenShare = Platform.select({
43
- ios: useIosAppScreenShare,
44
- default: useDefaultAppScreenShareAndroid,
45
- });
46
- //# sourceMappingURL=useAppScreenShare.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAppScreenShare.js","sourceRoot":"","sources":["../../src/hooks/useAppScreenShare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AASvE,SAAS,oBAAoB;IAC3B,MAAM,kBAAkB,GAAG,oBAAoB,CAC7C,gBAAgB,CAAC,kBAAkB,EACnC,qBAAqB,CAAC,kBAAkB,CACzC,CAAC;IAEF,MAAM,oBAAoB,GAAG,WAAW,CACtC,KAAK,EAAE,qBAAkD,EAAE,EAAE,EAAE;QAC7D,MAAM,OAAO,GAAG;YACd,GAAG,kBAAkB;YACrB,mBAAmB,EAAE;gBACnB,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,kBAA2B;gBACjC,MAAM,EAAE,CAAC,kBAAkB;aAC5B;SACF,CAAC;QACF,MAAM,qBAAqB,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC,EACD,CAAC,kBAAkB,CAAC,CACrB,CAAC;IAEF,OAAO;QACL,kBAAkB;QAClB;;;WAGG;QACH,oBAAoB;KACrB,CAAC;AACJ,CAAC;AAED,SAAS,+BAA+B;IACtC,OAAO;QACL,kBAAkB,EAAE,KAAK;QACzB,oBAAoB,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;KACrC,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC/C,GAAG,EAAE,oBAAoB;IACzB,OAAO,EAAE,+BAA+B;CACzC,CAAC,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { ScreenShareOptions } from './useScreenShare';\nimport { Platform } from 'react-native';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\nexport type AppScreenShareData = {\n isAppScreenShareOn: boolean;\n toggleAppScreenShare: (\n screenShareOptions?: Partial<ScreenShareOptions>,\n ) => Promise<void>;\n};\n\nfunction useIosAppScreenShare(): AppScreenShareData {\n const isAppScreenShareOn = useFishjamEventState(\n ReceivableEvents.IsAppScreenShareOn,\n RNFishjamClientModule.isAppScreenShareOn,\n );\n\n const toggleAppScreenShare = useCallback(\n async (screenShareOptions: Partial<ScreenShareOptions> = {}) => {\n const options = {\n ...screenShareOptions,\n screenShareMetadata: {\n displayName: 'presenting',\n type: 'screenShareVideo' as const,\n active: !isAppScreenShareOn,\n },\n };\n await RNFishjamClientModule.toggleAppScreenShare(options);\n },\n [isAppScreenShareOn],\n );\n\n return {\n isAppScreenShareOn,\n /**\n * Toggles the screen share on/off.\n * Emits warning on ios when user is screensharing full screen.\n */\n toggleAppScreenShare,\n };\n}\n\nfunction useDefaultAppScreenShareAndroid(): AppScreenShareData {\n return {\n isAppScreenShareOn: false,\n toggleAppScreenShare: async () => {},\n };\n}\n\n/**\n * This hook can toggle client app screen sharing on/off and provides current screen share state.\n *\n * It works only on iOS.\n *\n * @returns An object with functions to manage app screen share on iOS and null on android.\n * @category Connection\n * @group Hooks\n */\nexport const useAppScreenShare = Platform.select({\n ios: useIosAppScreenShare,\n default: useDefaultAppScreenShareAndroid,\n});\n"]}
@@ -1,49 +0,0 @@
1
- export type AudioOutputDeviceType = 'bluetooth' | 'headset' | 'speaker' | 'earpiece';
2
- export type AudioSessionMode = 'voiceChat' | 'videoChat';
3
- export type AudioOutputDevice = {
4
- type: AudioOutputDeviceType;
5
- name: string;
6
- };
7
- export type OnAudioDeviceEvent = {
8
- /**
9
- * Currently selected output audio device.
10
- * On iOS this property can briefly become null, even if it was previously initialized, when AVAudioSession's .currentRoute is empty.
11
- */
12
- selectedDevice: AudioOutputDevice | null;
13
- /**
14
- * [Android only] available audio output devices to be set
15
- */
16
- availableDevices: AudioOutputDevice[];
17
- };
18
- /**
19
- * This hook manages audio settings.
20
- * @category Devices
21
- * @group Hooks
22
- */
23
- export declare function useAudioSettings(): {
24
- /**
25
- * currently selected output audio device
26
- */
27
- selectedAudioOutputDevice: AudioOutputDevice | null;
28
- /**
29
- * [Android only] available audio output devices to be set
30
- */
31
- availableDevices: AudioOutputDevice[];
32
- /**
33
- * [Android only] selects output audio device.
34
- * For detecting and selecting bluettoth devices make sure you have the BLUETOOTH_CONNECT permission.
35
- */
36
- selectOutputAudioDevice: (device: AudioOutputDeviceType) => Promise<void>;
37
- /**
38
- * [iOS only] selects audio session mode. For more information refer to Apple's documentation:
39
- * https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/
40
- *
41
- */
42
- selectAudioSessionMode: (audioSessionMode: AudioSessionMode) => Promise<void>;
43
- /**
44
- * [iOS only] Shows a picker modal that allows user to select output audio device. For more
45
- * information refer to Apple's documentation: https://developer.apple.com/documentation/avkit/avroutepickerview
46
- */
47
- showAudioRoutePicker: () => Promise<void>;
48
- };
49
- //# sourceMappingURL=useAudioSettings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAudioSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useAudioSettings.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,SAAS,GACT,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACzC;;OAEG;IACH,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;CACvC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB;IAkD5B;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;sCA5CY,qBAAqB;IA8CpC;;;;OAIG;+CArCsB,gBAAgB;IAuCzC;;;OAGG;;EAGN"}