@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.
- package/README.md +56 -15
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/overrides/RTCPeerConnection.d.ts +8 -0
- package/dist/overrides/RTCPeerConnection.d.ts.map +1 -0
- package/dist/overrides/RTCPeerConnection.js +16 -0
- package/dist/overrides/RTCView.d.ts +11 -0
- package/dist/overrides/RTCView.d.ts.map +1 -0
- package/dist/overrides/RTCView.js +21 -0
- package/dist/polyfills/local-storage.d.ts +10 -0
- package/dist/polyfills/local-storage.d.ts.map +1 -0
- package/dist/polyfills/local-storage.js +24 -0
- package/{build/hooks → dist}/useForegroundService.d.ts +10 -10
- package/dist/useForegroundService.d.ts.map +1 -0
- package/dist/useForegroundService.js +10 -0
- package/dist/webrtc-polyfill.d.ts +2 -0
- package/dist/webrtc-polyfill.d.ts.map +1 -0
- package/dist/webrtc-polyfill.js +14 -0
- package/package.json +45 -92
- package/plugin/broadcastExtensionFiles/Atomic.swift +37 -0
- package/plugin/broadcastExtensionFiles/DarwinNotificationCenter.swift +29 -0
- package/plugin/broadcastExtensionFiles/Info.plist +1 -1
- package/plugin/broadcastExtensionFiles/SampleHandler.swift +104 -0
- package/plugin/broadcastExtensionFiles/SampleUploader.swift +146 -0
- package/plugin/broadcastExtensionFiles/SocketConnection.swift +198 -0
- package/plugin/build/types.d.ts +5 -4
- package/plugin/build/withFishjam.d.ts +31 -2
- package/plugin/build/withFishjam.js +31 -5
- package/plugin/build/withFishjamAndroid.d.ts +2 -2
- package/plugin/build/withFishjamAndroid.js +48 -40
- package/plugin/build/withFishjamIos.d.ts +3 -8
- package/plugin/build/withFishjamIos.js +52 -72
- package/LICENSE.txt +0 -201
- package/android/build.gradle +0 -95
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/io/fishjam/reactnative/AudioDeviceKind.kt +0 -34
- package/android/src/main/java/io/fishjam/reactnative/AudioSwitchManager.kt +0 -61
- package/android/src/main/java/io/fishjam/reactnative/EmitableEvents.kt +0 -126
- package/android/src/main/java/io/fishjam/reactnative/Errors.kt +0 -31
- package/android/src/main/java/io/fishjam/reactnative/PipContainerView.kt +0 -282
- package/android/src/main/java/io/fishjam/reactnative/PipContainerViewModule.kt +0 -41
- package/android/src/main/java/io/fishjam/reactnative/PipTrackSelector.kt +0 -98
- package/android/src/main/java/io/fishjam/reactnative/PipViewFactory.kt +0 -186
- package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +0 -1001
- package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +0 -358
- package/android/src/main/java/io/fishjam/reactnative/Utils.kt +0 -11
- package/android/src/main/java/io/fishjam/reactnative/VideoPreviewView.kt +0 -40
- package/android/src/main/java/io/fishjam/reactnative/VideoPreviewViewModule.kt +0 -22
- package/android/src/main/java/io/fishjam/reactnative/VideoRendererView.kt +0 -76
- package/android/src/main/java/io/fishjam/reactnative/VideoRendererViewModule.kt +0 -33
- package/android/src/main/java/io/fishjam/reactnative/VideoView.kt +0 -257
- package/android/src/main/java/io/fishjam/reactnative/extensions/CaptureDevice.kt +0 -17
- package/android/src/main/java/io/fishjam/reactnative/foregroundService/FishjamForegroundService.kt +0 -101
- package/android/src/main/java/io/fishjam/reactnative/foregroundService/ForegroundServiceManager.kt +0 -118
- package/android/src/main/java/io/fishjam/reactnative/foregroundService/ForegroundServiceState.kt +0 -46
- package/android/src/main/java/io/fishjam/reactnative/helpers/PictureInPictureHelperFragment.kt +0 -20
- package/android/src/main/java/io/fishjam/reactnative/managers/ListenerManager.kt +0 -24
- package/android/src/main/java/io/fishjam/reactnative/managers/LocalCameraTracksChangedListenersManager.kt +0 -8
- package/android/src/main/java/io/fishjam/reactnative/managers/LocalTracksSwitchListenersManager.kt +0 -17
- package/android/src/main/java/io/fishjam/reactnative/managers/TracksUpdateListenersManager.kt +0 -7
- package/android/src/main/java/io/fishjam/reactnative/utils/PermissionUtils.kt +0 -45
- package/build/RNFishjamClientModule.d.ts +0 -106
- package/build/RNFishjamClientModule.d.ts.map +0 -1
- package/build/RNFishjamClientModule.js +0 -21
- package/build/RNFishjamClientModule.js.map +0 -1
- package/build/common/metadata.d.ts +0 -9
- package/build/common/metadata.d.ts.map +0 -1
- package/build/common/metadata.js +0 -11
- package/build/common/metadata.js.map +0 -1
- package/build/components/FishjamRoom/GridTrackItem.d.ts +0 -12
- package/build/components/FishjamRoom/GridTrackItem.d.ts.map +0 -1
- package/build/components/FishjamRoom/GridTrackItem.js +0 -56
- package/build/components/FishjamRoom/GridTrackItem.js.map +0 -1
- package/build/components/FishjamRoom/VideosGrid.d.ts +0 -3
- package/build/components/FishjamRoom/VideosGrid.d.ts.map +0 -1
- package/build/components/FishjamRoom/VideosGrid.js +0 -20
- package/build/components/FishjamRoom/VideosGrid.js.map +0 -1
- package/build/components/FishjamRoom/index.d.ts +0 -33
- package/build/components/FishjamRoom/index.d.ts.map +0 -1
- package/build/components/FishjamRoom/index.js +0 -52
- package/build/components/FishjamRoom/index.js.map +0 -1
- package/build/components/FishjamRoom/parsePeersToTracks.d.ts +0 -4
- package/build/components/FishjamRoom/parsePeersToTracks.d.ts.map +0 -1
- package/build/components/FishjamRoom/parsePeersToTracks.js +0 -37
- package/build/components/FishjamRoom/parsePeersToTracks.js.map +0 -1
- package/build/components/PipContainerView.d.ts +0 -48
- package/build/components/PipContainerView.d.ts.map +0 -1
- package/build/components/PipContainerView.js +0 -34
- package/build/components/PipContainerView.js.map +0 -1
- package/build/components/VideoPreviewView.d.ts +0 -28
- package/build/components/VideoPreviewView.d.ts.map +0 -1
- package/build/components/VideoPreviewView.js +0 -17
- package/build/components/VideoPreviewView.js.map +0 -1
- package/build/components/VideoRendererView.d.ts +0 -39
- package/build/components/VideoRendererView.d.ts.map +0 -1
- package/build/components/VideoRendererView.js +0 -25
- package/build/components/VideoRendererView.js.map +0 -1
- package/build/consts/index.d.ts +0 -5
- package/build/consts/index.d.ts.map +0 -1
- package/build/consts/index.js +0 -8
- package/build/consts/index.js.map +0 -1
- package/build/debug/common/webRTC.d.ts +0 -9
- package/build/debug/common/webRTC.d.ts.map +0 -1
- package/build/debug/common/webRTC.js +0 -11
- package/build/debug/common/webRTC.js.map +0 -1
- package/build/debug/index.d.ts +0 -4
- package/build/debug/index.d.ts.map +0 -1
- package/build/debug/index.js +0 -3
- package/build/debug/index.js.map +0 -1
- package/build/debug/stats/types.d.ts +0 -55
- package/build/debug/stats/types.d.ts.map +0 -1
- package/build/debug/stats/types.js +0 -2
- package/build/debug/stats/types.js.map +0 -1
- package/build/debug/stats/useRTCStatistics.d.ts +0 -9
- package/build/debug/stats/useRTCStatistics.d.ts.map +0 -1
- package/build/debug/stats/useRTCStatistics.js +0 -79
- package/build/debug/stats/useRTCStatistics.js.map +0 -1
- package/build/hooks/internal/useFishjamEvent.d.ts +0 -4
- package/build/hooks/internal/useFishjamEvent.d.ts.map +0 -1
- package/build/hooks/internal/useFishjamEvent.js +0 -38
- package/build/hooks/internal/useFishjamEvent.js.map +0 -1
- package/build/hooks/internal/useFishjamEventState.d.ts +0 -3
- package/build/hooks/internal/useFishjamEventState.d.ts.map +0 -1
- package/build/hooks/internal/useFishjamEventState.js +0 -18
- package/build/hooks/internal/useFishjamEventState.js.map +0 -1
- package/build/hooks/useAppScreenShare.d.ts +0 -18
- package/build/hooks/useAppScreenShare.d.ts.map +0 -1
- package/build/hooks/useAppScreenShare.js +0 -46
- package/build/hooks/useAppScreenShare.js.map +0 -1
- package/build/hooks/useAudioSettings.d.ts +0 -49
- package/build/hooks/useAudioSettings.d.ts.map +0 -1
- package/build/hooks/useAudioSettings.js +0 -70
- package/build/hooks/useAudioSettings.js.map +0 -1
- package/build/hooks/useBandwidthEstimation.d.ts +0 -14
- package/build/hooks/useBandwidthEstimation.d.ts.map +0 -1
- package/build/hooks/useBandwidthEstimation.js +0 -19
- package/build/hooks/useBandwidthEstimation.js.map +0 -1
- package/build/hooks/useCallKit.d.ts +0 -121
- package/build/hooks/useCallKit.d.ts.map +0 -1
- package/build/hooks/useCallKit.js +0 -142
- package/build/hooks/useCallKit.js.map +0 -1
- package/build/hooks/useCamera.d.ts +0 -113
- package/build/hooks/useCamera.d.ts.map +0 -1
- package/build/hooks/useCamera.js +0 -93
- package/build/hooks/useCamera.js.map +0 -1
- package/build/hooks/useConnection.d.ts +0 -73
- package/build/hooks/useConnection.d.ts.map +0 -1
- package/build/hooks/useConnection.js +0 -46
- package/build/hooks/useConnection.js.map +0 -1
- package/build/hooks/useForegroundService.d.ts.map +0 -1
- package/build/hooks/useForegroundService.js +0 -66
- package/build/hooks/useForegroundService.js.map +0 -1
- package/build/hooks/useMicrophone.d.ts +0 -16
- package/build/hooks/useMicrophone.d.ts.map +0 -1
- package/build/hooks/useMicrophone.js +0 -31
- package/build/hooks/useMicrophone.js.map +0 -1
- package/build/hooks/usePeerStatus.d.ts +0 -10
- package/build/hooks/usePeerStatus.d.ts.map +0 -1
- package/build/hooks/usePeerStatus.js +0 -13
- package/build/hooks/usePeerStatus.js.map +0 -1
- package/build/hooks/usePeers.d.ts +0 -98
- package/build/hooks/usePeers.d.ts.map +0 -1
- package/build/hooks/usePeers.js +0 -81
- package/build/hooks/usePeers.js.map +0 -1
- package/build/hooks/usePermissions.d.ts +0 -24
- package/build/hooks/usePermissions.d.ts.map +0 -1
- package/build/hooks/usePermissions.js +0 -61
- package/build/hooks/usePermissions.js.map +0 -1
- package/build/hooks/useReconnection.d.ts +0 -11
- package/build/hooks/useReconnection.d.ts.map +0 -1
- package/build/hooks/useReconnection.js +0 -14
- package/build/hooks/useReconnection.js.map +0 -1
- package/build/hooks/useSandbox.d.ts +0 -20
- package/build/hooks/useSandbox.d.ts.map +0 -1
- package/build/hooks/useSandbox.js +0 -54
- package/build/hooks/useSandbox.js.map +0 -1
- package/build/hooks/useScreenShare.d.ts +0 -36
- package/build/hooks/useScreenShare.d.ts.map +0 -1
- package/build/hooks/useScreenShare.js +0 -45
- package/build/hooks/useScreenShare.js.map +0 -1
- package/build/hooks/useUpdatePeerMetadata.d.ts +0 -15
- package/build/hooks/useUpdatePeerMetadata.d.ts.map +0 -1
- package/build/hooks/useUpdatePeerMetadata.js +0 -21
- package/build/hooks/useUpdatePeerMetadata.js.map +0 -1
- package/build/index.d.ts +0 -36
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -30
- package/build/index.js.map +0 -1
- package/build/livestream/components/LivestreamStreamer.d.ts +0 -24
- package/build/livestream/components/LivestreamStreamer.d.ts.map +0 -1
- package/build/livestream/components/LivestreamStreamer.js +0 -12
- package/build/livestream/components/LivestreamStreamer.js.map +0 -1
- package/build/livestream/components/LivestreamViewer.d.ts +0 -46
- package/build/livestream/components/LivestreamViewer.d.ts.map +0 -1
- package/build/livestream/components/LivestreamViewer.js +0 -10
- package/build/livestream/components/LivestreamViewer.js.map +0 -1
- package/build/livestream/hooks/useLivestreamScreenSharingStreamer.d.ts +0 -49
- package/build/livestream/hooks/useLivestreamScreenSharingStreamer.d.ts.map +0 -1
- package/build/livestream/hooks/useLivestreamScreenSharingStreamer.js +0 -58
- package/build/livestream/hooks/useLivestreamScreenSharingStreamer.js.map +0 -1
- package/build/livestream/hooks/useLivestreamStreamer.d.ts +0 -65
- package/build/livestream/hooks/useLivestreamStreamer.d.ts.map +0 -1
- package/build/livestream/hooks/useLivestreamStreamer.js +0 -71
- package/build/livestream/hooks/useLivestreamStreamer.js.map +0 -1
- package/build/livestream/hooks/useLivestreamViewer.d.ts +0 -36
- package/build/livestream/hooks/useLivestreamViewer.d.ts.map +0 -1
- package/build/livestream/hooks/useLivestreamViewer.js +0 -73
- package/build/livestream/hooks/useLivestreamViewer.js.map +0 -1
- package/build/livestream/index.d.ts +0 -12
- package/build/livestream/index.d.ts.map +0 -1
- package/build/livestream/index.js +0 -7
- package/build/livestream/index.js.map +0 -1
- package/build/protos/fishjam/peer_notifications.d.ts +0 -63
- package/build/protos/fishjam/peer_notifications.d.ts.map +0 -1
- package/build/protos/fishjam/peer_notifications.js +0 -235
- package/build/protos/fishjam/peer_notifications.js.map +0 -1
- package/build/types.d.ts +0 -34
- package/build/types.d.ts.map +0 -1
- package/build/types.js +0 -2
- package/build/types.js.map +0 -1
- package/build/utils/config.d.ts +0 -6
- package/build/utils/config.d.ts.map +0 -1
- package/build/utils/config.js +0 -10
- package/build/utils/config.js.map +0 -1
- package/build/utils/errorListener.d.ts +0 -2
- package/build/utils/errorListener.d.ts.map +0 -1
- package/build/utils/errorListener.js +0 -15
- package/build/utils/errorListener.js.map +0 -1
- package/build/utils/eventPayloadValidator.d.ts +0 -3
- package/build/utils/eventPayloadValidator.d.ts.map +0 -1
- package/build/utils/eventPayloadValidator.js +0 -86
- package/build/utils/eventPayloadValidator.js.map +0 -1
- package/build/utils/getFishjamUrl.d.ts +0 -2
- package/build/utils/getFishjamUrl.d.ts.map +0 -1
- package/build/utils/getFishjamUrl.js +0 -10
- package/build/utils/getFishjamUrl.js.map +0 -1
- package/debug/package.json +0 -4
- package/expo-module.config.json +0 -19
- package/ios/CameraPermissionsRequester.swift +0 -117
- package/ios/Events.swift +0 -152
- package/ios/PictureInPictureManager.swift +0 -215
- package/ios/PipContainerView.swift +0 -56
- package/ios/PipContainerViewModule.swift +0 -48
- package/ios/RNFishjamClient.podspec +0 -30
- package/ios/RNFishjamClient.swift +0 -995
- package/ios/RNFishjamClientModule.swift +0 -289
- package/ios/RNFishjamProxy.swift +0 -12
- package/ios/Utils/PermissionUtils.swift +0 -16
- package/ios/Utils.swift +0 -23
- package/ios/VideoPreviewView.swift +0 -54
- package/ios/VideoPreviewViewModule.swift +0 -21
- package/ios/VideoRendererView.swift +0 -98
- package/ios/VideoRendererViewModule.swift +0 -23
- package/ios/extensions/AVCaptureDevice.swift +0 -20
- package/ios/managers/LocalCameraTracksChangedListenersManager.swift +0 -23
- package/ios/managers/TracksUpdateListenersManager.swift +0 -21
- package/livestream/package.json +0 -4
- package/plugin/broadcastExtensionFiles/FishjamBroadcastSampleHandler.swift +0 -50
- /package/plugin/broadcastExtensionFiles/{FishjamScreenBroadcastExtension.entitlements → ScreenBroadcastExtension.entitlements} +0 -0
package/README.md
CHANGED
|
@@ -1,29 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
# @fishjam-cloud/react-native-client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React Native client library for Fishjam.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @fishjam-cloud/react-native-client
|
|
9
|
+
# or
|
|
10
|
+
yarn add @fishjam-cloud/react-native-client
|
|
11
|
+
```
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
## Local Development with WebRTC Fork
|
|
10
14
|
|
|
11
|
-
|
|
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
|
-
|
|
17
|
+
### Prerequisites
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
1. Clone the WebRTC fork:
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/fishjam-cloud/fishjam-react-native-webrtc.git
|
|
23
|
+
```
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
### Setting Up Local Development
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
1. **Update the dependency in `packages/mobile-client/package.json`:**
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
Change from:
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
```json
|
|
32
|
+
"@fishjam-cloud/react-native-webrtc": "^x.x.x"
|
|
33
|
+
```
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
To a local file path:
|
|
28
36
|
|
|
29
|
-
|
|
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!
|
package/dist/index.d.ts
ADDED
|
@@ -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
|
|
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 @@
|
|
|
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,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishjam-cloud/react-native-client",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"author": "Fishjam Team",
|
|
3
|
+
"version": "0.25.0-rc.2",
|
|
4
|
+
"description": "React Native client library for Fishjam",
|
|
6
5
|
"license": "Apache-2.0",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
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/build/**",
|
|
14
|
+
"plugin/broadcastExtensionFiles/**",
|
|
15
|
+
"app.plugin.js"
|
|
32
16
|
],
|
|
33
17
|
"repository": {
|
|
34
18
|
"type": "git",
|
|
35
|
-
"url": "git+https://github.com/fishjam-cloud/
|
|
36
|
-
"directory": "packages/
|
|
37
|
-
},
|
|
38
|
-
"bugs": {
|
|
39
|
-
"url": "https://github.com/fishjam-cloud/mobile-client-sdk/issues"
|
|
19
|
+
"url": "git+https://github.com/fishjam-cloud/web-client-sdk.git",
|
|
20
|
+
"directory": "packages/mobile-client"
|
|
40
21
|
},
|
|
41
|
-
"homepage": "https://fishjam
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
22
|
+
"homepage": "https://github.com/fishjam-cloud/web-client-sdk#readme",
|
|
23
|
+
"bugs": "https://github.com/fishjam-cloud/web-client-sdk/issues",
|
|
24
|
+
"keywords": [
|
|
25
|
+
"webrtc",
|
|
26
|
+
"fishjam"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./app.plugin": "./app.plugin.js",
|
|
34
|
+
"./app.plugin.js": "./app.plugin.js",
|
|
35
|
+
"./package.json": "./package.json"
|
|
47
36
|
},
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
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"
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc && EXPO_NONINTERACTIVE=1 expo-module build plugin",
|
|
39
|
+
"lint": "eslint . --ext .ts,.tsx --fix",
|
|
40
|
+
"prepare": "tsc && EXPO_NONINTERACTIVE=1 expo-module build plugin"
|
|
72
41
|
},
|
|
73
42
|
"peerDependencies": {
|
|
74
43
|
"expo": "*",
|
|
75
44
|
"react": "*",
|
|
76
45
|
"react-native": "*"
|
|
77
46
|
},
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
"<rootDir>/lib/"
|
|
83
|
-
],
|
|
84
|
-
"testEnvironment": "jsdom"
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@fishjam-cloud/react-client": "0.25.0-rc.2",
|
|
49
|
+
"@fishjam-cloud/react-native-webrtc": "git+https://github.com/fishjam-cloud/fishjam-react-native-webrtc.git#9753272f9e6c992d8a05263e668e2198ec858160",
|
|
50
|
+
"react-native-get-random-values": "^1.11.0"
|
|
85
51
|
},
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
}
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/promise-fs": "^2.1.2",
|
|
54
|
+
"eslint-config-expo": "~9.2.0",
|
|
55
|
+
"eslint-plugin-prettier": "^5.5.1",
|
|
56
|
+
"expo-module-scripts": "^5.0.7",
|
|
57
|
+
"promise-fs": "^2.1.1"
|
|
58
|
+
},
|
|
59
|
+
"packageManager": "yarn@4.12.0",
|
|
60
|
+
"stableVersion": "0.23.0"
|
|
108
61
|
}
|
|
@@ -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).
|
|
22
|
+
<string>$(PRODUCT_MODULE_NAME).SampleHandler</string>
|
|
23
23
|
<key>RPBroadcastProcessMode</key>
|
|
24
24
|
<string>RPBroadcastProcessModeSampleBuffer</string>
|
|
25
25
|
</dict>
|