@fishjam-cloud/react-native-client 0.23.0 → 0.25.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +44 -92
- package/plugin/broadcastExtensionFiles/Atomic.swift +37 -0
- package/plugin/broadcastExtensionFiles/DarwinNotificationCenter.swift +29 -0
- package/plugin/broadcastExtensionFiles/Info.plist +2 -2
- 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 -3
- package/plugin/build/withFishjam.d.ts +31 -2
- package/plugin/build/withFishjam.js +32 -6
- package/plugin/build/withFishjamAndroid.d.ts +2 -2
- package/plugin/build/withFishjamAndroid.js +60 -13
- package/plugin/build/withFishjamIos.d.ts +3 -8
- package/plugin/build/withFishjamIos.js +54 -69
- package/plugin/src/types.ts +19 -0
- package/plugin/src/withFishjam.ts +42 -0
- package/plugin/src/withFishjamAndroid.ts +112 -0
- package/plugin/src/withFishjamIos.ts +336 -0
- package/plugin/tsconfig.json +9 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- 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 -53
- 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 -20
- package/build/hooks/useAppScreenShare.d.ts.map +0 -1
- package/build/hooks/useAppScreenShare.js +0 -54
- 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 -95
- 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 -37
- package/build/hooks/useScreenShare.d.ts.map +0 -1
- package/build/hooks/useScreenShare.js +0 -52
- 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/useLivestreamStreamer.d.ts +0 -65
- package/build/livestream/hooks/useLivestreamStreamer.d.ts.map +0 -1
- package/build/livestream/hooks/useLivestreamStreamer.js +0 -72
- 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 -11
- package/build/livestream/index.d.ts.map +0 -1
- package/build/livestream/index.js +0 -6
- 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
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
package io.fishjam.reactnative
|
|
2
|
-
|
|
3
|
-
import android.Manifest
|
|
4
|
-
import expo.modules.interfaces.permissions.Permissions
|
|
5
|
-
import expo.modules.kotlin.Promise
|
|
6
|
-
import expo.modules.kotlin.exception.Exceptions
|
|
7
|
-
import expo.modules.kotlin.functions.Coroutine
|
|
8
|
-
import expo.modules.kotlin.modules.Module
|
|
9
|
-
import expo.modules.kotlin.modules.ModuleDefinition
|
|
10
|
-
import expo.modules.kotlin.records.Field
|
|
11
|
-
import expo.modules.kotlin.records.Record
|
|
12
|
-
import kotlinx.coroutines.CoroutineScope
|
|
13
|
-
import kotlinx.coroutines.Dispatchers
|
|
14
|
-
import kotlinx.coroutines.launch
|
|
15
|
-
import kotlinx.coroutines.sync.Mutex
|
|
16
|
-
import kotlinx.coroutines.sync.withLock
|
|
17
|
-
import kotlinx.coroutines.withContext
|
|
18
|
-
|
|
19
|
-
class SimulcastConfig : Record {
|
|
20
|
-
@Field
|
|
21
|
-
val enabled: Boolean = false
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
class CameraConfig : Record {
|
|
25
|
-
@Field
|
|
26
|
-
val quality: String = "VGA169"
|
|
27
|
-
|
|
28
|
-
@Field
|
|
29
|
-
val flipDimensions: Boolean = false
|
|
30
|
-
|
|
31
|
-
@Field
|
|
32
|
-
val videoTrackMetadata: Map<String, Any> = emptyMap()
|
|
33
|
-
|
|
34
|
-
@Field
|
|
35
|
-
val simulcastConfig: SimulcastConfig = SimulcastConfig()
|
|
36
|
-
|
|
37
|
-
@Field
|
|
38
|
-
val cameraEnabled: Boolean = true
|
|
39
|
-
|
|
40
|
-
@Field
|
|
41
|
-
val cameraId: String? = null
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
class ScreenShareOptions : Record {
|
|
45
|
-
@Field
|
|
46
|
-
val quality: String = "HD15"
|
|
47
|
-
|
|
48
|
-
@Field
|
|
49
|
-
val screenShareMetadata: Map<String, Any> = emptyMap()
|
|
50
|
-
|
|
51
|
-
@Field
|
|
52
|
-
val simulcastConfig: SimulcastConfig = SimulcastConfig()
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
class ReconnectConfig : Record {
|
|
56
|
-
@Field
|
|
57
|
-
val maxAttempts: Int = 5
|
|
58
|
-
|
|
59
|
-
@Field
|
|
60
|
-
val initialDelayMs: Long = 1000
|
|
61
|
-
|
|
62
|
-
@Field
|
|
63
|
-
val delayMs: Long = 1000
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
class ConnectConfig : Record {
|
|
67
|
-
@Field
|
|
68
|
-
val reconnectConfig: ReconnectConfig = ReconnectConfig()
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
class ForegroundServiceConfig : Record {
|
|
72
|
-
@Field
|
|
73
|
-
val channelId: String? = null
|
|
74
|
-
|
|
75
|
-
@Field
|
|
76
|
-
val channelName: String? = null
|
|
77
|
-
|
|
78
|
-
@Field
|
|
79
|
-
val notificationContent: String? = null
|
|
80
|
-
|
|
81
|
-
@Field
|
|
82
|
-
val notificationTitle: String? = null
|
|
83
|
-
|
|
84
|
-
@Field
|
|
85
|
-
val enableCamera: Boolean? = null
|
|
86
|
-
|
|
87
|
-
@Field
|
|
88
|
-
val enableMicrophone: Boolean? = null
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
class RNFishjamClientModule : Module() {
|
|
92
|
-
override fun definition() =
|
|
93
|
-
ModuleDefinition {
|
|
94
|
-
val mutex = Mutex()
|
|
95
|
-
|
|
96
|
-
val rnFishjamClient =
|
|
97
|
-
RNFishjamClient { name, data ->
|
|
98
|
-
sendEvent(name, data)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
Name("RNFishjamClient")
|
|
102
|
-
|
|
103
|
-
Events(EmitableEvent.allEvents)
|
|
104
|
-
|
|
105
|
-
OnCreate {
|
|
106
|
-
rnFishjamClient.onModuleCreate(appContext)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
OnDestroy {
|
|
110
|
-
rnFishjamClient.onModuleDestroy()
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
OnActivityDestroys {
|
|
114
|
-
rnFishjamClient.leaveRoom()
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
OnActivityResult { _, result ->
|
|
118
|
-
rnFishjamClient.onActivityResult(result.requestCode, result.resultCode, result.data)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
Property("isCameraOn") {
|
|
122
|
-
return@Property rnFishjamClient.isCameraOn
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
Property("isMicrophoneOn") {
|
|
126
|
-
return@Property rnFishjamClient.isMicrophoneOn
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
Property("cameras") {
|
|
130
|
-
return@Property rnFishjamClient.getCaptureDevices()
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
Property("currentCamera") {
|
|
134
|
-
return@Property rnFishjamClient.getCurrentCaptureDevice()
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
Property("isScreenShareOn") {
|
|
138
|
-
return@Property rnFishjamClient.isScreenShareOn
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
Property("peerStatus") {
|
|
142
|
-
return@Property rnFishjamClient.peerStatus.status
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
Property("reconnectionStatus") {
|
|
146
|
-
return@Property rnFishjamClient.reconnectionStatus.status
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
Property("isCameraInitialized") {
|
|
150
|
-
return@Property rnFishjamClient.isCameraInitialized
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
Function("getPeers") {
|
|
154
|
-
return@Function rnFishjamClient.getPeers()
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
AsyncFunction(
|
|
158
|
-
"joinRoom"
|
|
159
|
-
) { url: String, peerToken: String, peerMetadata: Map<String, Any>, config: ConnectConfig, promise: Promise ->
|
|
160
|
-
CoroutineScope(Dispatchers.Main).launch {
|
|
161
|
-
rnFishjamClient.joinRoom(url, peerToken, peerMetadata, config, promise)
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
AsyncFunction("leaveRoom") Coroutine { ->
|
|
166
|
-
withContext(Dispatchers.Main) {
|
|
167
|
-
rnFishjamClient.leaveRoom()
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
AsyncFunction("startCamera") Coroutine { config: CameraConfig ->
|
|
172
|
-
mutex.withLock {
|
|
173
|
-
return@Coroutine withContext(Dispatchers.Main) {
|
|
174
|
-
return@withContext rnFishjamClient.startCamera(config)
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
AsyncFunction("toggleMicrophone") Coroutine { ->
|
|
180
|
-
withContext(Dispatchers.Main) {
|
|
181
|
-
rnFishjamClient.toggleMicrophone()
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
AsyncFunction("startMicrophone") Coroutine { ->
|
|
186
|
-
withContext(Dispatchers.Main) {
|
|
187
|
-
rnFishjamClient.startMicrophone()
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
AsyncFunction("stopMicrophone") Coroutine { ->
|
|
192
|
-
withContext(Dispatchers.Main) {
|
|
193
|
-
rnFishjamClient.stopMicrophone()
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
AsyncFunction("toggleCamera") Coroutine { ->
|
|
198
|
-
withContext(Dispatchers.Main) {
|
|
199
|
-
rnFishjamClient.toggleCamera()
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
AsyncFunction("flipCamera") Coroutine { ->
|
|
204
|
-
mutex.withLock {
|
|
205
|
-
withContext(Dispatchers.Main) {
|
|
206
|
-
rnFishjamClient.flipCamera()
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
AsyncFunction("switchCamera") Coroutine { cameraId: String ->
|
|
212
|
-
mutex.withLock {
|
|
213
|
-
withContext(Dispatchers.Main) {
|
|
214
|
-
rnFishjamClient.switchCamera(cameraId)
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
AsyncFunction("handleScreenSharePermission") { promise: Promise ->
|
|
220
|
-
CoroutineScope(Dispatchers.Main).launch {
|
|
221
|
-
rnFishjamClient.handleScreenSharePermission(promise)
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
AsyncFunction("toggleScreenShare") Coroutine { screenShareOptions: ScreenShareOptions ->
|
|
226
|
-
withContext(Dispatchers.Main) {
|
|
227
|
-
rnFishjamClient.toggleScreenShare(screenShareOptions)
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
AsyncFunction("updatePeerMetadata") Coroutine { metadata: Map<String, Any> ->
|
|
232
|
-
withContext(Dispatchers.Main) {
|
|
233
|
-
rnFishjamClient.updatePeerMetadata(metadata)
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
AsyncFunction("updateVideoTrackMetadata") Coroutine { metadata: Map<String, Any> ->
|
|
238
|
-
withContext(Dispatchers.Main) {
|
|
239
|
-
rnFishjamClient.updateLocalVideoTrackMetadata(metadata)
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
AsyncFunction("updateScreenShareTrackMetadata") Coroutine { metadata: Map<String, Any> ->
|
|
244
|
-
withContext(Dispatchers.Main) {
|
|
245
|
-
rnFishjamClient.updateLocalScreenShareTrackMetadata(metadata)
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
AsyncFunction("setOutputAudioDevice") { audioDevice: String ->
|
|
250
|
-
rnFishjamClient.setOutputAudioDevice(audioDevice)
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
AsyncFunction("startAudioSwitcher") {
|
|
254
|
-
rnFishjamClient.startAudioSwitcher()
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
AsyncFunction("stopAudioSwitcher") {
|
|
258
|
-
rnFishjamClient.stopAudioSwitcher()
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
AsyncFunction("toggleScreenShareTrackEncoding") Coroutine { encoding: String ->
|
|
262
|
-
withContext(Dispatchers.Main) {
|
|
263
|
-
rnFishjamClient.toggleScreenShareTrackEncoding(encoding)
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
AsyncFunction("setScreenShareTrackBandwidth") Coroutine { bandwidth: Int ->
|
|
268
|
-
withContext(Dispatchers.Main) {
|
|
269
|
-
rnFishjamClient.setScreenShareTrackBandwidth(bandwidth)
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
AsyncFunction("setScreenShareTrackEncodingBandwidth") Coroutine { encoding: String, bandwidth: Int ->
|
|
274
|
-
withContext(Dispatchers.Main) {
|
|
275
|
-
rnFishjamClient.setScreenShareTrackEncodingBandwidth(encoding, bandwidth)
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
AsyncFunction("setTargetTrackEncoding") Coroutine { trackId: String, encoding: String ->
|
|
280
|
-
withContext(Dispatchers.Main) {
|
|
281
|
-
rnFishjamClient.setTargetTrackEncoding(trackId, encoding)
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
AsyncFunction("toggleVideoTrackEncoding") Coroutine { encoding: String ->
|
|
286
|
-
withContext(Dispatchers.Main) {
|
|
287
|
-
rnFishjamClient.toggleVideoTrackEncoding(encoding)
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
AsyncFunction("setVideoTrackEncodingBandwidth") Coroutine { encoding: String, bandwidth: Int ->
|
|
292
|
-
withContext(Dispatchers.Main) {
|
|
293
|
-
rnFishjamClient.setVideoTrackEncodingBandwidth(encoding, bandwidth)
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
AsyncFunction("setVideoTrackBandwidth") Coroutine { bandwidth: Int ->
|
|
298
|
-
withContext(Dispatchers.Main) {
|
|
299
|
-
rnFishjamClient.setVideoTrackBandwidth(bandwidth)
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
AsyncFunction("changeWebRTCLoggingSeverity") Coroutine { severity: String ->
|
|
304
|
-
withContext(Dispatchers.Main) {
|
|
305
|
-
rnFishjamClient.changeWebRTCLoggingSeverity(severity)
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
AsyncFunction("getStatistics") Coroutine { ->
|
|
310
|
-
return@Coroutine rnFishjamClient.getStatistics()
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
AsyncFunction("startForegroundService") Coroutine { config: ForegroundServiceConfig ->
|
|
314
|
-
rnFishjamClient.startForegroundService(config)
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
Function("stopForegroundService") {
|
|
318
|
-
rnFishjamClient.stopForegroundService()
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
AsyncFunction("requestCameraPermissionsAsync") { promise: Promise ->
|
|
322
|
-
Permissions.askForPermissionsWithPermissionsManager(
|
|
323
|
-
permissionsManager,
|
|
324
|
-
promise,
|
|
325
|
-
Manifest.permission.CAMERA
|
|
326
|
-
)
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
AsyncFunction("requestMicrophonePermissionsAsync") { promise: Promise ->
|
|
330
|
-
Permissions.askForPermissionsWithPermissionsManager(
|
|
331
|
-
permissionsManager,
|
|
332
|
-
promise,
|
|
333
|
-
Manifest.permission.RECORD_AUDIO
|
|
334
|
-
)
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
AsyncFunction("getCameraPermissionsAsync") { promise: Promise ->
|
|
338
|
-
Permissions.getPermissionsWithPermissionsManager(
|
|
339
|
-
permissionsManager,
|
|
340
|
-
promise,
|
|
341
|
-
Manifest.permission.CAMERA
|
|
342
|
-
)
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
AsyncFunction("getMicrophonePermissionsAsync") { promise: Promise ->
|
|
346
|
-
Permissions.getPermissionsWithPermissionsManager(
|
|
347
|
-
permissionsManager,
|
|
348
|
-
promise,
|
|
349
|
-
Manifest.permission.RECORD_AUDIO
|
|
350
|
-
)
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
private val permissionsManager: Permissions
|
|
357
|
-
get() = appContext.permissions ?: throw Exceptions.PermissionsModuleNotFound()
|
|
358
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
package io.fishjam.reactnative
|
|
2
|
-
|
|
3
|
-
import com.fishjamcloud.client.models.TrackEncoding
|
|
4
|
-
|
|
5
|
-
internal fun String.toTrackEncoding(): TrackEncoding =
|
|
6
|
-
when (this) {
|
|
7
|
-
"l" -> TrackEncoding.L
|
|
8
|
-
"m" -> TrackEncoding.M
|
|
9
|
-
"h" -> TrackEncoding.H
|
|
10
|
-
else -> throw IllegalArgumentException("Invalid encoding specified: $this")
|
|
11
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
package io.fishjam.reactnative
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
import android.util.Log
|
|
5
|
-
import com.fishjamcloud.client.media.LocalVideoTrack
|
|
6
|
-
import com.fishjamcloud.client.models.Dimensions
|
|
7
|
-
import expo.modules.kotlin.AppContext
|
|
8
|
-
import io.fishjam.reactnative.managers.LocalCameraTrackChangedListener
|
|
9
|
-
|
|
10
|
-
class VideoPreviewView(
|
|
11
|
-
context: Context,
|
|
12
|
-
appContext: AppContext
|
|
13
|
-
) : VideoRendererView(context, appContext),
|
|
14
|
-
LocalCameraTrackChangedListener {
|
|
15
|
-
private fun trySetLocalCameraTrack() {
|
|
16
|
-
(
|
|
17
|
-
RNFishjamClient.fishjamClient.getLocalEndpoint().tracks.values.firstOrNull { track ->
|
|
18
|
-
track is LocalVideoTrack
|
|
19
|
-
} as? LocalVideoTrack?
|
|
20
|
-
)?.let {
|
|
21
|
-
init(it.id())
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
override fun onDetachedFromWindow() {
|
|
26
|
-
RNFishjamClient.localCameraTracksChangedListenersManager.remove(this)
|
|
27
|
-
super.onDetachedFromWindow()
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
override fun onAttachedToWindow() {
|
|
31
|
-
RNFishjamClient.localCameraTracksChangedListenersManager.add(this)
|
|
32
|
-
activeVideoTrack?.removeRenderer(videoView)
|
|
33
|
-
super.onAttachedToWindow()
|
|
34
|
-
trySetLocalCameraTrack()
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
override fun onLocalCameraTrackChanged() {
|
|
38
|
-
if (activeVideoTrack == null) trySetLocalCameraTrack()
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
package io.fishjam.reactnative
|
|
2
|
-
|
|
3
|
-
import expo.modules.kotlin.modules.Module
|
|
4
|
-
import expo.modules.kotlin.modules.ModuleDefinition
|
|
5
|
-
|
|
6
|
-
class VideoPreviewViewModule : Module() {
|
|
7
|
-
override fun definition() =
|
|
8
|
-
ModuleDefinition {
|
|
9
|
-
Name("VideoPreviewViewModule")
|
|
10
|
-
|
|
11
|
-
View(VideoPreviewView::class) {
|
|
12
|
-
OnViewDestroys { view: VideoPreviewView ->
|
|
13
|
-
view.dispose()
|
|
14
|
-
RNFishjamClient.localTracksSwitchListenerManager.remove(view)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
Prop("videoLayout") { view: VideoPreviewView, videoLayout: String ->
|
|
18
|
-
view.setVideoLayout(videoLayout)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
package io.fishjam.reactnative
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
import com.fishjamcloud.client.media.VideoTrack
|
|
5
|
-
import com.fishjamcloud.client.media.VideoTrackListener
|
|
6
|
-
import com.fishjamcloud.client.models.Dimensions
|
|
7
|
-
import expo.modules.kotlin.AppContext
|
|
8
|
-
import io.fishjam.reactnative.managers.TrackUpdateListener
|
|
9
|
-
import kotlinx.coroutines.CoroutineScope
|
|
10
|
-
import kotlinx.coroutines.Dispatchers
|
|
11
|
-
import kotlinx.coroutines.launch
|
|
12
|
-
|
|
13
|
-
open class VideoRendererView(
|
|
14
|
-
context: Context,
|
|
15
|
-
appContext: AppContext
|
|
16
|
-
) : VideoView(context, appContext),
|
|
17
|
-
TrackUpdateListener,
|
|
18
|
-
VideoTrackListener {
|
|
19
|
-
protected var activeVideoTrack: VideoTrack? = null
|
|
20
|
-
private var trackId: String? = null
|
|
21
|
-
|
|
22
|
-
init {
|
|
23
|
-
RNFishjamClient.trackUpdateListenersManager.add(this)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
private fun setupTrack(videoTrack: VideoTrack) {
|
|
27
|
-
if (activeVideoTrack == videoTrack) return
|
|
28
|
-
|
|
29
|
-
activeVideoTrack?.removeRenderer(videoView)
|
|
30
|
-
activeVideoTrack = videoTrack
|
|
31
|
-
|
|
32
|
-
videoTrack.setDimensionsListener(this)
|
|
33
|
-
videoTrack.addRenderer(videoView)
|
|
34
|
-
|
|
35
|
-
super.setupTrack()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
private fun update() {
|
|
39
|
-
CoroutineScope(Dispatchers.Main).launch {
|
|
40
|
-
val peers = RNFishjamClient.getAllPeers()
|
|
41
|
-
val endpoint = peers.firstOrNull { it.tracks[trackId] != null } ?: return@launch
|
|
42
|
-
val videoTrack = endpoint.tracks[trackId] as? VideoTrack ?: return@launch
|
|
43
|
-
setupTrack(videoTrack)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
fun init(trackId: String) {
|
|
48
|
-
this.trackId = trackId
|
|
49
|
-
update()
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
override fun dispose() {
|
|
53
|
-
activeVideoTrack?.removeRenderer(videoView)
|
|
54
|
-
RNFishjamClient.trackUpdateListenersManager.remove(this)
|
|
55
|
-
super.dispose()
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
override fun onTracksUpdate() {
|
|
59
|
-
update()
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
override fun getVideoTrack(): VideoTrack? = activeVideoTrack
|
|
63
|
-
|
|
64
|
-
override fun onDimensionsChanged(dimensions: Dimensions) {
|
|
65
|
-
if (trackId == null) return
|
|
66
|
-
|
|
67
|
-
RNFishjamClient.sendEvent(
|
|
68
|
-
EmitableEvent.trackAspectRatioUpdated(
|
|
69
|
-
trackId!!,
|
|
70
|
-
dimensions.aspectRatio
|
|
71
|
-
)
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
fun getTrackId(): String? = trackId
|
|
76
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
package io.fishjam.reactnative
|
|
2
|
-
|
|
3
|
-
import expo.modules.kotlin.modules.Module
|
|
4
|
-
import expo.modules.kotlin.modules.ModuleDefinition
|
|
5
|
-
|
|
6
|
-
class VideoRendererViewModule : Module() {
|
|
7
|
-
override fun definition() =
|
|
8
|
-
ModuleDefinition {
|
|
9
|
-
Name("VideoRendererViewModule")
|
|
10
|
-
|
|
11
|
-
Events("TrackAspectRatioUpdated")
|
|
12
|
-
|
|
13
|
-
View(VideoRendererView::class) {
|
|
14
|
-
OnViewDestroys { view: VideoRendererView ->
|
|
15
|
-
view.dispose()
|
|
16
|
-
RNFishjamClient.trackUpdateListenersManager.remove(view)
|
|
17
|
-
RNFishjamClient.localTracksSwitchListenerManager.remove(view)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
Prop("trackId") { view, trackId: String ->
|
|
21
|
-
view.init(trackId)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Prop("videoLayout") { view, videoLayout: String ->
|
|
25
|
-
view.setVideoLayout(videoLayout)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
Prop("skipRenderOutsideVisibleArea") { view, skipRenderOutsideVisibleArea: Boolean ->
|
|
29
|
-
view.checkVisibilityDelayMillis = if (skipRenderOutsideVisibleArea) 1000 else null
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|