@fishjam-cloud/react-native-client 0.23.0-RC.0 → 0.23.0
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/android/src/main/java/io/fishjam/reactnative/PipContainerView.kt +282 -0
- package/android/src/main/java/io/fishjam/reactnative/PipContainerViewModule.kt +41 -0
- package/android/src/main/java/io/fishjam/reactnative/PipTrackSelector.kt +98 -0
- package/android/src/main/java/io/fishjam/reactnative/PipViewFactory.kt +186 -0
- package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +9 -1
- package/android/src/main/java/io/fishjam/reactnative/VideoPreviewView.kt +2 -0
- package/android/src/main/java/io/fishjam/reactnative/VideoRendererView.kt +2 -0
- package/android/src/main/java/io/fishjam/reactnative/VideoView.kt +152 -11
- package/android/src/main/java/io/fishjam/reactnative/helpers/PictureInPictureHelperFragment.kt +20 -0
- package/android/src/main/java/io/fishjam/reactnative/managers/ListenerManager.kt +3 -1
- package/build/RNFishjamClientModule.d.ts +2 -0
- package/build/RNFishjamClientModule.d.ts.map +1 -1
- package/build/RNFishjamClientModule.js.map +1 -1
- package/build/components/PipContainerView.d.ts +48 -0
- package/build/components/PipContainerView.d.ts.map +1 -0
- package/build/components/PipContainerView.js +34 -0
- package/build/components/PipContainerView.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/livestream/components/LivestreamStreamer.d.ts +3 -30
- package/build/livestream/components/LivestreamStreamer.d.ts.map +1 -1
- package/build/livestream/components/LivestreamStreamer.js +3 -27
- package/build/livestream/components/LivestreamStreamer.js.map +1 -1
- package/build/livestream/components/LivestreamViewer.d.ts +2 -7
- package/build/livestream/components/LivestreamViewer.d.ts.map +1 -1
- package/build/livestream/components/LivestreamViewer.js +1 -1
- package/build/livestream/components/LivestreamViewer.js.map +1 -1
- package/build/livestream/hooks/useLivestreamStreamer.d.ts +40 -3
- package/build/livestream/hooks/useLivestreamStreamer.d.ts.map +1 -1
- package/build/livestream/hooks/useLivestreamStreamer.js +45 -3
- package/build/livestream/hooks/useLivestreamStreamer.js.map +1 -1
- package/build/livestream/hooks/useLivestreamViewer.d.ts +7 -0
- package/build/livestream/hooks/useLivestreamViewer.d.ts.map +1 -1
- package/build/livestream/hooks/useLivestreamViewer.js +39 -11
- package/build/livestream/hooks/useLivestreamViewer.js.map +1 -1
- package/build/livestream/index.d.ts +1 -1
- package/build/livestream/index.d.ts.map +1 -1
- package/build/livestream/index.js +1 -1
- package/build/livestream/index.js.map +1 -1
- package/expo-module.config.json +4 -2
- package/ios/PictureInPictureManager.swift +215 -0
- package/ios/PipContainerView.swift +56 -0
- package/ios/PipContainerViewModule.swift +48 -0
- package/ios/RNFishjamClient.swift +1 -0
- package/ios/RNFishjamClientModule.swift +4 -3
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package io.fishjam.reactnative
|
|
2
2
|
|
|
3
3
|
import android.animation.ValueAnimator
|
|
4
|
+
import android.annotation.SuppressLint
|
|
4
5
|
import android.content.Context
|
|
5
6
|
import android.content.res.Resources
|
|
6
7
|
import android.graphics.Color
|
|
@@ -9,8 +10,12 @@ import android.graphics.drawable.ColorDrawable
|
|
|
9
10
|
import android.os.Handler
|
|
10
11
|
import android.os.Looper
|
|
11
12
|
import android.view.animation.LinearInterpolator
|
|
13
|
+
import androidx.core.view.ViewCompat
|
|
12
14
|
import com.fishjamcloud.client.media.LocalVideoTrack
|
|
13
15
|
import com.fishjamcloud.client.media.VideoTrack
|
|
16
|
+
import com.fishjamcloud.client.models.Dimensions
|
|
17
|
+
import com.fishjamcloud.client.ui.VideoSurfaceViewRenderer
|
|
18
|
+
import com.fishjamcloud.client.ui.VideoSurfaceViewRendererListener
|
|
14
19
|
import expo.modules.kotlin.AppContext
|
|
15
20
|
import expo.modules.kotlin.views.ExpoView
|
|
16
21
|
import io.fishjam.reactnative.managers.LocalTrackSwitchListener
|
|
@@ -21,12 +26,23 @@ abstract class VideoView(
|
|
|
21
26
|
context: Context,
|
|
22
27
|
appContext: AppContext
|
|
23
28
|
) : ExpoView(context, appContext),
|
|
24
|
-
LocalTrackSwitchListener {
|
|
25
|
-
protected val videoView =
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
LocalTrackSwitchListener, VideoSurfaceViewRendererListener {
|
|
30
|
+
protected val videoView: VideoSurfaceViewRenderer = RNFishjamClient.fishjamClient.createVideoViewRenderer().also {
|
|
31
|
+
it.setEnableHardwareScaler(true)
|
|
32
|
+
addView(it)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private var frameHeight: Int = 0
|
|
36
|
+
private var frameWidth: Int = 0
|
|
37
|
+
|
|
38
|
+
private var scalingType = RendererCommon.ScalingType.SCALE_ASPECT_FIT
|
|
39
|
+
set(value) {
|
|
40
|
+
field = value
|
|
41
|
+
videoView.setScalingType(scalingType)
|
|
42
|
+
post(requestSurfaceViewRendererLayoutRunnable)
|
|
28
43
|
}
|
|
29
44
|
|
|
45
|
+
|
|
30
46
|
private val fadeAnimation: ValueAnimator =
|
|
31
47
|
ValueAnimator.ofArgb(Color.TRANSPARENT, Color.BLACK).apply {
|
|
32
48
|
duration = 200
|
|
@@ -73,23 +89,35 @@ abstract class VideoView(
|
|
|
73
89
|
return screen.intersect(globalVisibleRect)
|
|
74
90
|
}
|
|
75
91
|
|
|
76
|
-
init {
|
|
77
|
-
RNFishjamClient.localTracksSwitchListenerManager.add(this)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
92
|
fun setVideoLayout(videoLayout: String) {
|
|
81
|
-
|
|
93
|
+
scalingType =
|
|
82
94
|
when (videoLayout) {
|
|
83
95
|
"FILL" -> RendererCommon.ScalingType.SCALE_ASPECT_FILL
|
|
84
96
|
"FIT" -> RendererCommon.ScalingType.SCALE_ASPECT_FIT
|
|
85
97
|
else -> RendererCommon.ScalingType.SCALE_ASPECT_FILL
|
|
86
98
|
}
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
val dimensionsListener = object : VideoSurfaceViewRendererListener {
|
|
102
|
+
override fun onDimensionsChanged(dimensions: Dimensions) {
|
|
103
|
+
if (dimensions.height == frameHeight && dimensions.width == frameWidth) {
|
|
104
|
+
return
|
|
105
|
+
}
|
|
106
|
+
frameWidth = dimensions.width
|
|
107
|
+
frameHeight = dimensions.height
|
|
108
|
+
|
|
109
|
+
post(requestSurfaceViewRendererLayoutRunnable);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
init {
|
|
114
|
+
RNFishjamClient.localTracksSwitchListenerManager.add(this)
|
|
115
|
+
videoView.addDimensionsListener(dimensionsListener)
|
|
89
116
|
}
|
|
90
117
|
|
|
91
118
|
open fun dispose() {
|
|
92
119
|
checkVisibilityHandler.removeCallbacksAndMessages(null)
|
|
120
|
+
videoView.removeDimensionsListener(dimensionsListener)
|
|
93
121
|
videoView.release()
|
|
94
122
|
}
|
|
95
123
|
|
|
@@ -109,6 +137,119 @@ abstract class VideoView(
|
|
|
109
137
|
}
|
|
110
138
|
}
|
|
111
139
|
|
|
140
|
+
private val requestSurfaceViewRendererLayoutRunnable: Runnable = object : Runnable {
|
|
141
|
+
override fun run() {
|
|
142
|
+
requestSurfaceViewRendererLayout()
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Inspired by:
|
|
148
|
+
* https://github.com/react-native-webrtc/react-native-webrtc/blob/5ecc86111c2f8e0d152d719f8b7b357a601150b6/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java#L292
|
|
149
|
+
*/
|
|
150
|
+
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
|
|
151
|
+
super.onLayout(changed, l, t, r, b)
|
|
152
|
+
|
|
153
|
+
var left = l
|
|
154
|
+
var top = t
|
|
155
|
+
var right = r
|
|
156
|
+
var bottom = b
|
|
157
|
+
|
|
158
|
+
val height = b - t
|
|
159
|
+
val width = r - l
|
|
160
|
+
|
|
161
|
+
if (height == 0 || width == 0) {
|
|
162
|
+
left = 0
|
|
163
|
+
top = 0
|
|
164
|
+
right = 0
|
|
165
|
+
bottom = 0
|
|
166
|
+
} else {
|
|
167
|
+
when (scalingType) {
|
|
168
|
+
RendererCommon.ScalingType.SCALE_ASPECT_FILL -> {
|
|
169
|
+
// Fill this ViewGroup with videoView and the latter
|
|
170
|
+
// will take care of filling itself with the video similarly to
|
|
171
|
+
// the cover value the CSS property object-fit.
|
|
172
|
+
left = 0
|
|
173
|
+
top = 0
|
|
174
|
+
right = width
|
|
175
|
+
bottom = height
|
|
176
|
+
}
|
|
177
|
+
RendererCommon.ScalingType.SCALE_ASPECT_FIT -> {
|
|
178
|
+
// Lay videoView out inside this ViewGroup in accord
|
|
179
|
+
// with the contain value of the CSS property object-fit.
|
|
180
|
+
// VideoView will fill itself with the video similarly
|
|
181
|
+
// to the cover or contain value of the CSS property object-fit
|
|
182
|
+
// (which will not matter, eventually).
|
|
183
|
+
if (frameHeight == 0 || frameWidth == 0) {
|
|
184
|
+
// If frame dimensions are not yet available, fill the container
|
|
185
|
+
// to ensure the view is visible. It will re-layout once dimensions arrive.
|
|
186
|
+
left = 0
|
|
187
|
+
top = 0
|
|
188
|
+
right = width
|
|
189
|
+
bottom = height
|
|
190
|
+
} else {
|
|
191
|
+
val frameAspectRatio = frameWidth.toFloat() / frameHeight.toFloat()
|
|
192
|
+
val frameDisplaySize = RendererCommon.getDisplaySize(
|
|
193
|
+
scalingType,
|
|
194
|
+
frameAspectRatio,
|
|
195
|
+
width,
|
|
196
|
+
height
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
left = (width - frameDisplaySize.x) / 2
|
|
200
|
+
top = (height - frameDisplaySize.y) / 2
|
|
201
|
+
right = left + frameDisplaySize.x
|
|
202
|
+
bottom = top + frameDisplaySize.y
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else -> {
|
|
206
|
+
// Default to SCALE_ASPECT_FIT behavior
|
|
207
|
+
if (frameHeight == 0 || frameWidth == 0) {
|
|
208
|
+
// If frame dimensions are not yet available, fill the container
|
|
209
|
+
// to ensure the view is visible. It will re-layout once dimensions arrive.
|
|
210
|
+
left = 0
|
|
211
|
+
top = 0
|
|
212
|
+
right = width
|
|
213
|
+
bottom = height
|
|
214
|
+
} else {
|
|
215
|
+
val frameAspectRatio = frameWidth.toFloat() / frameHeight.toFloat()
|
|
216
|
+
val frameDisplaySize = RendererCommon.getDisplaySize(
|
|
217
|
+
scalingType,
|
|
218
|
+
frameAspectRatio,
|
|
219
|
+
width,
|
|
220
|
+
height
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
left = (width - frameDisplaySize.x) / 2
|
|
224
|
+
top = (height - frameDisplaySize.y) / 2
|
|
225
|
+
right = left + frameDisplaySize.x
|
|
226
|
+
bottom = top + frameDisplaySize.y
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
videoView.layout(left, top, right, bottom)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Inspired by:
|
|
237
|
+
* https://github.com/react-native-webrtc/react-native-webrtc/blob/5ecc86111c2f8e0d152d719f8b7b357a601150b6/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java#L386
|
|
238
|
+
*/
|
|
239
|
+
@SuppressLint("WrongCall")
|
|
240
|
+
public fun requestSurfaceViewRendererLayout() {
|
|
241
|
+
// Google/WebRTC just call requestLayout() on surfaceViewRenderer when
|
|
242
|
+
// they change the value of its mirror or surfaceType property.
|
|
243
|
+
videoView.requestLayout()
|
|
244
|
+
// The above is not enough though when the video frame's dimensions or
|
|
245
|
+
// rotation change. The following will suffice.
|
|
246
|
+
if (!ViewCompat.isInLayout(this)) {
|
|
247
|
+
onLayout( /* changed */
|
|
248
|
+
false, left, top, right, bottom
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
112
253
|
fun setupTrack() {
|
|
113
254
|
videoView.setMirror((getVideoTrack() as? LocalVideoTrack)?.isFrontCamera() ?: false)
|
|
114
255
|
checkVisibilityHandler.post(checkVisibility)
|
package/android/src/main/java/io/fishjam/reactnative/helpers/PictureInPictureHelperFragment.kt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
package io.fishjam.reactnative.helpers
|
|
2
|
+
|
|
3
|
+
import androidx.fragment.app.Fragment
|
|
4
|
+
import io.fishjam.reactnative.PipContainerView
|
|
5
|
+
import java.util.UUID
|
|
6
|
+
|
|
7
|
+
class PictureInPictureHelperFragment(private val containerView: PipContainerView) : Fragment() {
|
|
8
|
+
val id = "${PictureInPictureHelperFragment::class.java.simpleName}_${UUID.randomUUID()}"
|
|
9
|
+
|
|
10
|
+
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
|
|
11
|
+
super.onPictureInPictureModeChanged(isInPictureInPictureMode)
|
|
12
|
+
|
|
13
|
+
if (isInPictureInPictureMode) {
|
|
14
|
+
containerView.layoutForPiPEnter()
|
|
15
|
+
} else {
|
|
16
|
+
containerView.layoutForPiPExit()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
package io.fishjam.reactnative.managers
|
|
2
2
|
|
|
3
|
+
import java.util.concurrent.CopyOnWriteArrayList
|
|
4
|
+
|
|
3
5
|
abstract class ListenerManager<T> {
|
|
4
|
-
protected var listeners
|
|
6
|
+
protected var listeners = CopyOnWriteArrayList<T>()
|
|
5
7
|
private set
|
|
6
8
|
|
|
7
9
|
fun add(listener: T) {
|
|
@@ -57,6 +57,8 @@ type RNFishjamClient = {
|
|
|
57
57
|
requestMicrophonePermissionsAsync: () => Promise<PermissionResponse>;
|
|
58
58
|
startForegroundService: (config: ForegroundServiceConfig) => Promise<void>;
|
|
59
59
|
stopForegroundService: () => void;
|
|
60
|
+
startMicrophone: () => Promise<void>;
|
|
61
|
+
stopMicrophone: () => Promise<void>;
|
|
60
62
|
startCallKitSession: (displayName: string, isVideo: boolean) => Promise<void>;
|
|
61
63
|
endCallKitSession: () => Promise<void>;
|
|
62
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RNFishjamClientModule.d.ts","sourceRoot":"","sources":["../src/RNFishjamClientModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,mBAAmB,CAAC;AAE5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EACV,MAAM,EACN,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,QAAQ,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE3C,KAAK,eAAe,GAAG;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,S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AM,OAAO,gBAAgB,EAC7B,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAC3C,CACF;AANH,wBAMI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RNFishjamClientModule.js","sourceRoot":"","sources":["../src/RNFishjamClientModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"RNFishjamClientModule.js","sourceRoot":"","sources":["../src/RNFishjamClientModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAsG5E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,iBAAiB;IAClC,kBAAkB,EAAE,oBAAoB,EAAE,eAAe;IACzD,qBAAqB,EAAE,uBAAuB;IAC9C,WAAW,EAAE,aAAa;IAC1B,iBAAiB,EAAE,mBAAmB;IACtC,mBAAmB,EAAE,qBAAqB;IAC1C,+BAA+B,EAAE,iCAAiC;IAClE,mBAAmB,EAAE,qBAAqB;IAC1C,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,mBAAmB;IACtC,yBAAyB,EAAE,2BAA2B;IACtD,oBAAoB,EAAE,sBAAsB;IAC5C,uBAAuB,EAAE,yBAAyB;IAClD,sBAAsB,EAAE,wBAAwB;CACxC,CAAC;AAwBX,eAAe,mBAAmB,CAAC,iBAAiB,CAMjD,CAAC","sourcesContent":["import { PermissionResponse, requireNativeModule } from 'expo-modules-core';\n\nimport type { NativeModule } from 'expo-modules-core/types';\nimport type { RTCStats } from './debug/stats/types';\nimport type { OnAudioDeviceEvent } from './hooks/useAudioSettings';\nimport type {\n Camera,\n CameraConfigInternal,\n CurrentCameraChangedType,\n} from './hooks/useCamera';\nimport type {\n PeerStatus,\n ReconnectionStatus,\n ConnectionConfig,\n} from './hooks/useConnection';\nimport type { ForegroundServiceConfig } from './hooks/useForegroundService';\nimport type { Peer } from './hooks/usePeers';\nimport type { ScreenShareOptionsInternal } from './hooks/useScreenShare';\nimport type { GenericMetadata, SimulcastConfig } from './types';\nimport type { CallKitAction } from './hooks/useCallKit';\n\ntype Metadata = { [key: string]: unknown };\n\ntype RNFishjamClient = {\n isMicrophoneOn: boolean;\n isCameraOn: boolean;\n isScreenShareOn: boolean;\n isAppScreenShareOn: boolean; // only available on ios\n cameras: readonly Camera[];\n currentCamera: Camera | null;\n peerStatus: PeerStatus;\n reconnectionStatus: ReconnectionStatus;\n isCameraInitialized: boolean;\n hasActiveCallKitSession: boolean;\n\n getPeers: <\n PeerMetadataType extends Metadata,\n ServerMetadata extends Metadata = GenericMetadata,\n >() => Peer<PeerMetadataType, ServerMetadata>[];\n\n joinRoom: (\n url: string,\n peerToken: string,\n peerMetadata: Metadata,\n config: ConnectionConfig,\n ) => Promise<void>;\n leaveRoom: () => Promise<void>;\n startCamera: (config: CameraConfigInternal) => Promise<boolean>;\n toggleMicrophone: () => Promise<boolean>;\n toggleCamera: () => Promise<boolean>;\n flipCamera: () => Promise<void>;\n switchCamera: (cameraId: string) => Promise<void>;\n handleScreenSharePermission: () => Promise<'granted' | 'denied'>;\n toggleScreenShare: (\n screenShareOptions: Partial<ScreenShareOptionsInternal>,\n ) => Promise<void>;\n toggleAppScreenShare: (\n screenShareOptions: Partial<ScreenShareOptionsInternal>,\n ) => Promise<void>;\n updatePeerMetadata: <MetadataType extends Metadata>(\n metadata: MetadataType,\n ) => Promise<void>;\n updateVideoTrackMetadata: <MetadataType extends Metadata>(\n metadata: MetadataType,\n ) => Promise<void>;\n updateScreenShareTrackMetadata: <MetadataType extends Metadata>(\n metadata: MetadataType,\n ) => Promise<void>;\n setOutputAudioDevice: (audioDevice: string) => Promise<void>;\n startAudioSwitcher: () => Promise<void>;\n stopAudioSwitcher: () => Promise<void>;\n selectAudioSessionMode: (sessionMode: string) => Promise<void>;\n showAudioRoutePicker: () => Promise<void>;\n toggleScreenShareTrackEncoding: (\n encoding: string,\n ) => Promise<SimulcastConfig>;\n setScreenShareTrackBandwidth: (bandwidth: number) => Promise<void>;\n setScreenShareTrackEncodingBandwidth: (\n encoding: string,\n bandwidth: number,\n ) => Promise<void>;\n setTargetTrackEncoding: (trackId: string, encoding: string) => Promise<void>;\n toggleVideoTrackEncoding: (encoding: string) => Promise<SimulcastConfig>;\n setVideoTrackEncodingBandwidth: (\n encoding: string,\n bandwidth: number,\n ) => Promise<void>;\n setVideoTrackBandwidth: (bandwidth: number) => Promise<void>;\n changeWebRTCLoggingSeverity: (severity: string) => Promise<void>;\n getStatistics: () => Promise<RTCStats>;\n getCameraPermissionsAsync: () => Promise<PermissionResponse>;\n requestCameraPermissionsAsync: () => Promise<PermissionResponse>;\n getMicrophonePermissionsAsync: () => Promise<PermissionResponse>;\n requestMicrophonePermissionsAsync: () => Promise<PermissionResponse>;\n startForegroundService: (config: ForegroundServiceConfig) => Promise<void>;\n stopForegroundService: () => void;\n startMicrophone: () => Promise<void>;\n stopMicrophone: () => Promise<void>;\n startCallKitSession: (displayName: string, isVideo: boolean) => Promise<void>;\n endCallKitSession: () => Promise<void>;\n};\n\nexport const ReceivableEvents = {\n IsMicrophoneOn: 'IsMicrophoneOn',\n IsScreenShareOn: 'IsScreenShareOn',\n IsAppScreenShareOn: 'IsAppScreenShareOn', // only for iOS\n SimulcastConfigUpdate: 'SimulcastConfigUpdate',\n PeersUpdate: 'PeersUpdate',\n AudioDeviceUpdate: 'AudioDeviceUpdate',\n BandwidthEstimation: 'BandwidthEstimation',\n ReconnectionRetriesLimitReached: 'ReconnectionRetriesLimitReached',\n ReconnectionStarted: 'ReconnectionStarted',\n Reconnected: 'Reconnected',\n Warning: 'Warning',\n PeerStatusChanged: 'PeerStatusChanged',\n ReconnectionStatusChanged: 'ReconnectionStatusChanged',\n CurrentCameraChanged: 'CurrentCameraChanged',\n TrackAspectRatioUpdated: 'TrackAspectRatioUpdated',\n CallKitActionPerformed: 'CallKitActionPerformed',\n} as const;\n\nexport type ReceivableEventPayloads = {\n [ReceivableEvents.IsMicrophoneOn]: boolean;\n [ReceivableEvents.IsScreenShareOn]: boolean;\n [ReceivableEvents.IsAppScreenShareOn]: boolean;\n [ReceivableEvents.SimulcastConfigUpdate]: SimulcastConfig;\n [ReceivableEvents.PeersUpdate]: void;\n [ReceivableEvents.AudioDeviceUpdate]: OnAudioDeviceEvent;\n [ReceivableEvents.BandwidthEstimation]: number | null;\n [ReceivableEvents.ReconnectionRetriesLimitReached]: void;\n [ReceivableEvents.ReconnectionStarted]: void;\n [ReceivableEvents.Reconnected]: void;\n [ReceivableEvents.Warning]: string;\n [ReceivableEvents.PeerStatusChanged]: PeerStatus;\n [ReceivableEvents.ReconnectionStatusChanged]: ReconnectionStatus;\n [ReceivableEvents.CurrentCameraChanged]: CurrentCameraChangedType;\n [ReceivableEvents.TrackAspectRatioUpdated]: {\n trackId: string;\n aspectRatio: number | null;\n };\n [ReceivableEvents.CallKitActionPerformed]: CallKitAction;\n};\n\nexport default requireNativeModule('RNFishjamClient') as RNFishjamClient &\n NativeModule<\n Record<\n keyof typeof ReceivableEvents,\n (payload: ReceivableEventPayloads) => void\n >\n >;\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ViewProps } from 'react-native';
|
|
3
|
+
export type PictureInPictureConfig = {
|
|
4
|
+
startAutomatically?: boolean;
|
|
5
|
+
stopAutomatically?: boolean;
|
|
6
|
+
allowsCameraInBackground?: boolean;
|
|
7
|
+
primaryPlaceholderText?: string;
|
|
8
|
+
secondaryPlaceholderText?: string;
|
|
9
|
+
};
|
|
10
|
+
export interface PipContainerViewProps extends ViewProps {
|
|
11
|
+
startAutomatically?: boolean;
|
|
12
|
+
stopAutomatically?: boolean;
|
|
13
|
+
allowsCameraInBackground?: boolean;
|
|
14
|
+
primaryPlaceholderText?: string;
|
|
15
|
+
secondaryPlaceholderText?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PipContainerViewRef {
|
|
18
|
+
startPictureInPicture(): Promise<void>;
|
|
19
|
+
stopPictureInPicture(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A view component for Picture-in-Picture functionality with split-screen layout.
|
|
23
|
+
*
|
|
24
|
+
* Automatically displays:
|
|
25
|
+
* - Primary view (left): Local camera track or placeholder text
|
|
26
|
+
* - Secondary view (right): Remote track with active VAD (voice activity) or placeholder text
|
|
27
|
+
*
|
|
28
|
+
* Use a ref to call methods on this component:
|
|
29
|
+
* ```js
|
|
30
|
+
* const pipRef = useRef<PipContainerViewRef>(null);
|
|
31
|
+
*
|
|
32
|
+
* // Start PiP manually (if startAutomatically is false)
|
|
33
|
+
* await pipRef.current?.startPictureInPicture();
|
|
34
|
+
*
|
|
35
|
+
* // Stop PiP manually
|
|
36
|
+
* await pipRef.current?.stopPictureInPicture();
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @param startAutomatically - Whether to start PiP automatically when app goes to background (default: true)
|
|
40
|
+
* @param stopAutomatically - Whether to stop PiP automatically when app comes to foreground (default: true)
|
|
41
|
+
* @param allowsCameraInBackground - Whether to allow camera to continue running in PiP mode (default: false, iOS only)
|
|
42
|
+
* @param primaryPlaceholderText - Text to display when local camera is unavailable (default: "No camera")
|
|
43
|
+
* @param secondaryPlaceholderText - Text to display when no remote speaker is active (default: "No active speaker")
|
|
44
|
+
*
|
|
45
|
+
* @category Components
|
|
46
|
+
*/
|
|
47
|
+
export declare const PipContainerView: React.ForwardRefExoticComponent<PipContainerViewProps & React.RefAttributes<PipContainerViewRef>>;
|
|
48
|
+
//# sourceMappingURL=PipContainerView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipContainerView.d.ts","sourceRoot":"","sources":["../../src/components/PipContainerView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,sBAAsB,GAAG;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,mGAM3B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { requireNativeViewManager } from 'expo-modules-core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
const NativeView = requireNativeViewManager('PipContainerViewModule');
|
|
4
|
+
/**
|
|
5
|
+
* A view component for Picture-in-Picture functionality with split-screen layout.
|
|
6
|
+
*
|
|
7
|
+
* Automatically displays:
|
|
8
|
+
* - Primary view (left): Local camera track or placeholder text
|
|
9
|
+
* - Secondary view (right): Remote track with active VAD (voice activity) or placeholder text
|
|
10
|
+
*
|
|
11
|
+
* Use a ref to call methods on this component:
|
|
12
|
+
* ```js
|
|
13
|
+
* const pipRef = useRef<PipContainerViewRef>(null);
|
|
14
|
+
*
|
|
15
|
+
* // Start PiP manually (if startAutomatically is false)
|
|
16
|
+
* await pipRef.current?.startPictureInPicture();
|
|
17
|
+
*
|
|
18
|
+
* // Stop PiP manually
|
|
19
|
+
* await pipRef.current?.stopPictureInPicture();
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param startAutomatically - Whether to start PiP automatically when app goes to background (default: true)
|
|
23
|
+
* @param stopAutomatically - Whether to stop PiP automatically when app comes to foreground (default: true)
|
|
24
|
+
* @param allowsCameraInBackground - Whether to allow camera to continue running in PiP mode (default: false, iOS only)
|
|
25
|
+
* @param primaryPlaceholderText - Text to display when local camera is unavailable (default: "No camera")
|
|
26
|
+
* @param secondaryPlaceholderText - Text to display when no remote speaker is active (default: "No active speaker")
|
|
27
|
+
*
|
|
28
|
+
* @category Components
|
|
29
|
+
*/
|
|
30
|
+
export const PipContainerView = React.forwardRef((props, ref) => (
|
|
31
|
+
// @ts-expect-error - Expo modules API typing doesn't match React's ref typing
|
|
32
|
+
<NativeView {...props} ref={ref}/>));
|
|
33
|
+
PipContainerView.displayName = 'PipContainerView';
|
|
34
|
+
//# sourceMappingURL=PipContainerView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipContainerView.js","sourceRoot":"","sources":["../../src/components/PipContainerView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwB/B,MAAM,UAAU,GACd,wBAAwB,CAAwB,wBAAwB,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAG9C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;AAChB,8EAA8E;AAC9E,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CACpC,CAAC,CAAC;AAEH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport { ViewProps } from 'react-native';\n\nexport type PictureInPictureConfig = {\n startAutomatically?: boolean;\n stopAutomatically?: boolean;\n allowsCameraInBackground?: boolean;\n primaryPlaceholderText?: string;\n secondaryPlaceholderText?: string;\n};\n\nexport interface PipContainerViewProps extends ViewProps {\n startAutomatically?: boolean;\n stopAutomatically?: boolean;\n allowsCameraInBackground?: boolean;\n primaryPlaceholderText?: string;\n secondaryPlaceholderText?: string;\n}\n\nexport interface PipContainerViewRef {\n startPictureInPicture(): Promise<void>;\n stopPictureInPicture(): Promise<void>;\n}\n\nconst NativeView: React.ComponentType<PipContainerViewProps> =\n requireNativeViewManager<PipContainerViewProps>('PipContainerViewModule');\n\n/**\n * A view component for Picture-in-Picture functionality with split-screen layout.\n *\n * Automatically displays:\n * - Primary view (left): Local camera track or placeholder text\n * - Secondary view (right): Remote track with active VAD (voice activity) or placeholder text\n *\n * Use a ref to call methods on this component:\n * ```js\n * const pipRef = useRef<PipContainerViewRef>(null);\n *\n * // Start PiP manually (if startAutomatically is false)\n * await pipRef.current?.startPictureInPicture();\n *\n * // Stop PiP manually\n * await pipRef.current?.stopPictureInPicture();\n * ```\n *\n * @param startAutomatically - Whether to start PiP automatically when app goes to background (default: true)\n * @param stopAutomatically - Whether to stop PiP automatically when app comes to foreground (default: true)\n * @param allowsCameraInBackground - Whether to allow camera to continue running in PiP mode (default: false, iOS only)\n * @param primaryPlaceholderText - Text to display when local camera is unavailable (default: \"No camera\")\n * @param secondaryPlaceholderText - Text to display when no remote speaker is active (default: \"No active speaker\")\n *\n * @category Components\n */\nexport const PipContainerView = React.forwardRef<\n PipContainerViewRef,\n PipContainerViewProps\n>((props, ref) => (\n // @ts-expect-error - Expo modules API typing doesn't match React's ref typing\n <NativeView {...props} ref={ref} />\n));\n\nPipContainerView.displayName = 'PipContainerView';\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ export type { SimulcastConfig, VideoLayout, GenericMetadata, TrackMetadata, Bran
|
|
|
2
2
|
export { updatePeerMetadata } from './common/metadata';
|
|
3
3
|
export type { VideoPreviewViewProps } from './components/VideoPreviewView';
|
|
4
4
|
export type { VideoRendererProps } from './components/VideoRendererView';
|
|
5
|
+
export type { PipContainerViewRef, PipContainerViewProps, PictureInPictureConfig, } from './components/PipContainerView';
|
|
5
6
|
export { VideoPreviewView } from './components/VideoPreviewView';
|
|
6
7
|
export { VideoRendererView } from './components/VideoRendererView';
|
|
8
|
+
export { PipContainerView } from './components/PipContainerView';
|
|
7
9
|
export type { Peer, PeerId, Track, TrackId, TrackType, VadStatus, EncodingReason, TrackBase, AudioTrack, VideoTrack, UsePeersResult, PeerWithTracks, PeerTrackMetadata, DistinguishedTracks, } from './hooks/usePeers';
|
|
8
10
|
export type { AudioOutputDevice, AudioOutputDeviceType, AudioSessionMode, } from './hooks/useAudioSettings';
|
|
9
11
|
export type { CameraId, Camera, CameraConfig, VideoQuality, CameraFacingDirection, CameraConfigBase, } from './hooks/useCamera';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,YAAY,EACV,eAAe,EACf,WAAW,EACX,eAAe,EACf,aAAa,EACb,KAAK,EACL,QAAQ,GACT,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,YAAY,EACV,eAAe,EACf,WAAW,EACX,eAAe,EACf,aAAa,EACb,KAAK,EACL,QAAQ,GACT,MAAM,SAAS,CAAC;AAIj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;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAKvD,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { initializeWarningListener } from './utils/errorListener';
|
|
|
4
4
|
export { updatePeerMetadata } from './common/metadata';
|
|
5
5
|
export { VideoPreviewView } from './components/VideoPreviewView';
|
|
6
6
|
export { VideoRendererView } from './components/VideoRendererView';
|
|
7
|
+
export { PipContainerView } from './components/PipContainerView';
|
|
7
8
|
// #endregion
|
|
8
9
|
// #region hooks
|
|
9
10
|
export { useAudioSettings } from './hooks/useAudioSettings';
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAWlE,aAAa;AAEb,kBAAkB;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAWlE,aAAa;AAEb,kBAAkB;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAUvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAsDjE,aAAa;AAEb,gBAAgB;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,aAAa;AAEb,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,yBAAyB,EAAE,CAAC;AAE5B,mBAAmB;AACnB,OAAO,EAAE,uBAAuB,EAAe,MAAM,gBAAgB,CAAC","sourcesContent":["import { initializeWarningListener } from './utils/errorListener';\n\n// #region types\nexport type {\n SimulcastConfig,\n VideoLayout,\n GenericMetadata,\n TrackMetadata,\n Brand,\n RoomType,\n} from './types';\n// #endregion\n\n// #region methods\nexport { updatePeerMetadata } from './common/metadata';\n\n// #region components\nexport type { VideoPreviewViewProps } from './components/VideoPreviewView';\nexport type { VideoRendererProps } from './components/VideoRendererView';\nexport type {\n PipContainerViewRef,\n PipContainerViewProps,\n PictureInPictureConfig,\n} from './components/PipContainerView';\nexport { VideoPreviewView } from './components/VideoPreviewView';\nexport { VideoRendererView } from './components/VideoRendererView';\nexport { PipContainerView } from './components/PipContainerView';\n// #endregion\n\n// #region types for hooks\nexport type {\n Peer,\n PeerId,\n Track,\n TrackId,\n TrackType,\n VadStatus,\n EncodingReason,\n TrackBase,\n AudioTrack,\n VideoTrack,\n UsePeersResult,\n PeerWithTracks,\n PeerTrackMetadata,\n DistinguishedTracks,\n} from './hooks/usePeers';\n\nexport type {\n AudioOutputDevice,\n AudioOutputDeviceType,\n AudioSessionMode,\n} from './hooks/useAudioSettings';\n\nexport type {\n CameraId,\n Camera,\n CameraConfig,\n VideoQuality,\n CameraFacingDirection,\n CameraConfigBase,\n} from './hooks/useCamera';\n\nexport type {\n ScreenShareOptions,\n ScreenShareQuality,\n} from './hooks/useScreenShare';\nexport type { ForegroundServiceConfig } from './hooks/useForegroundService';\nexport type {\n JoinRoomConfig,\n ReconnectionStatus,\n PeerStatus,\n ConnectionConfig,\n} from './hooks/useConnection';\nexport type { AppScreenShareData } from './hooks/useAppScreenShare';\nexport type { UseSandboxProps } from './hooks/useSandbox';\nexport type {\n UseCallKitResult,\n CallKitConfig,\n CallKitAction,\n} from './hooks/useCallKit';\n// #endregion\n\n// #region hooks\nexport { useAudioSettings } from './hooks/useAudioSettings';\nexport { useBandwidthEstimation } from './hooks/useBandwidthEstimation';\nexport { useCamera } from './hooks/useCamera';\nexport { useMicrophone } from './hooks/useMicrophone';\nexport { useScreenShare } from './hooks/useScreenShare';\nexport { useAppScreenShare } from './hooks/useAppScreenShare';\nexport { useReconnection } from './hooks/useReconnection';\nexport { usePeerStatus } from './hooks/usePeerStatus';\nexport { usePeers } from './hooks/usePeers';\nexport { useForegroundService } from './hooks/useForegroundService';\nexport { useConnection } from './hooks/useConnection';\nexport { useUpdatePeerMetadata } from './hooks/useUpdatePeerMetadata';\nexport { useSandbox } from './hooks/useSandbox';\nexport {\n useCallKitService,\n useCallKit,\n useCallKitEvent,\n} from './hooks/useCallKit';\n// #endregion\n\nexport {\n useCameraPermissions,\n useMicrophonePermissions,\n} from './hooks/usePermissions';\n\nexport type { FishjamRoomProps } from './components/FishjamRoom';\nexport { FishjamRoom } from './components/FishjamRoom';\n\ninitializeWarningListener();\n\n// Debug/config API\nexport { setOverwriteDebugConfig, DebugConfig } from './utils/config';\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import { WhipClientViewRef } from 'react-native-whip-whep';
|
|
3
3
|
/**
|
|
4
4
|
* Props of the LivestreamView component
|
|
5
5
|
*/
|
|
@@ -8,37 +8,10 @@ export type LivestreamStreamerProps = {
|
|
|
8
8
|
* Styles of the LivestreamView component
|
|
9
9
|
*/
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
11
|
-
/**
|
|
12
|
-
* If video track should be enabled.
|
|
13
|
-
*/
|
|
14
|
-
videoEnabled: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* If audio track should be enabled.
|
|
17
|
-
*/
|
|
18
|
-
audioEnabled: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Camera to use for the livestream.
|
|
21
|
-
* Use {@link cameras} to get the list of supported cameras.
|
|
22
|
-
*/
|
|
23
|
-
camera?: Camera;
|
|
24
|
-
/**
|
|
25
|
-
* Set video parameters for the camera
|
|
26
|
-
*/
|
|
27
|
-
videoParameters?: VideoParameters;
|
|
28
|
-
/**
|
|
29
|
-
* Set the preferred video codecs for sending the video.
|
|
30
|
-
* Use {@link WhipClient.getSupportedVideoCodecs} to get the list of supported video codecs.
|
|
31
|
-
*/
|
|
32
|
-
preferredVideoCodecs?: SenderVideoCodecName[];
|
|
33
|
-
/**
|
|
34
|
-
* Set the preferred audio codecs for sending the audio.
|
|
35
|
-
* Use {@link WhipClient.getSupportedAudioCodecs} to get the list of supported audio codecs.
|
|
36
|
-
*/
|
|
37
|
-
preferredAudioCodecs?: SenderAudioCodecName[];
|
|
38
11
|
/**
|
|
39
12
|
* Reference to the WhipClient instance. Needs to be passed from the {@link useLivestreamStreamer} hook.
|
|
40
13
|
*/
|
|
41
|
-
|
|
14
|
+
ref: React.RefObject<WhipClientViewRef | null>;
|
|
42
15
|
};
|
|
43
16
|
/**
|
|
44
17
|
* Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.
|
|
@@ -47,5 +20,5 @@ export type LivestreamStreamerProps = {
|
|
|
47
20
|
* @param {object} props
|
|
48
21
|
* @param {object} props.style
|
|
49
22
|
*/
|
|
50
|
-
export declare const LivestreamStreamer: ({ style,
|
|
23
|
+
export declare const LivestreamStreamer: ({ style, ref }: LivestreamStreamerProps) => import("react").JSX.Element;
|
|
51
24
|
//# sourceMappingURL=LivestreamStreamer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LivestreamStreamer.d.ts","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamStreamer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"LivestreamStreamer.d.ts","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamStreamer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,uBAAuB,gCAEzE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cameras, WhipClient, WhipClientView, } from 'react-native-whip-whep';
|
|
1
|
+
import { WhipClientView } from 'react-native-whip-whep';
|
|
3
2
|
/**
|
|
4
3
|
* Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.
|
|
5
4
|
*
|
|
@@ -7,30 +6,7 @@ import { cameras, WhipClient, WhipClientView, } from 'react-native-whip-whep';
|
|
|
7
6
|
* @param {object} props
|
|
8
7
|
* @param {object} props.style
|
|
9
8
|
*/
|
|
10
|
-
export const LivestreamStreamer = ({ style,
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
whipClient.current = new WhipClient({
|
|
14
|
-
audioEnabled,
|
|
15
|
-
videoEnabled,
|
|
16
|
-
videoParameters,
|
|
17
|
-
videoDeviceId: camera?.id ?? cameras[0].id,
|
|
18
|
-
}, preferredVideoCodecs, preferredAudioCodecs);
|
|
19
|
-
whipClientRef.current = whipClient.current;
|
|
20
|
-
return () => {
|
|
21
|
-
whipClient.current?.disconnect();
|
|
22
|
-
whipClient.current?.cleanup();
|
|
23
|
-
whipClientRef.current = null;
|
|
24
|
-
};
|
|
25
|
-
}, [
|
|
26
|
-
camera,
|
|
27
|
-
videoParameters,
|
|
28
|
-
videoEnabled,
|
|
29
|
-
audioEnabled,
|
|
30
|
-
preferredVideoCodecs,
|
|
31
|
-
preferredAudioCodecs,
|
|
32
|
-
whipClientRef,
|
|
33
|
-
]);
|
|
34
|
-
return <WhipClientView style={style}/>;
|
|
9
|
+
export const LivestreamStreamer = ({ style, ref }) => {
|
|
10
|
+
return <WhipClientView style={style} ref={ref}/>;
|
|
35
11
|
};
|
|
36
12
|
//# sourceMappingURL=LivestreamStreamer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LivestreamStreamer.js","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamStreamer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LivestreamStreamer.js","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamStreamer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAqB,MAAM,wBAAwB,CAAC;AAiB3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,EAA2B,EAAE,EAAE;IAC5E,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAsB,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACrE,CAAC,CAAC","sourcesContent":["import { CSSProperties } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { WhipClientView, WhipClientViewRef } from 'react-native-whip-whep';\n\n/**\n * Props of the LivestreamView component\n */\nexport type LivestreamStreamerProps = {\n /**\n * Styles of the LivestreamView component\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * Reference to the WhipClient instance. Needs to be passed from the {@link useLivestreamStreamer} hook.\n */\n ref: React.RefObject<WhipClientViewRef | null>;\n};\n\n/**\n * Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.\n *\n * @category Components\n * @param {object} props\n * @param {object} props.style\n */\nexport const LivestreamStreamer = ({ style, ref }: LivestreamStreamerProps) => {\n return <WhipClientView style={style as CSSProperties} ref={ref} />;\n};\n"]}
|
|
@@ -10,11 +10,6 @@ export type LivestreamViewerProps = {
|
|
|
10
10
|
* Styles of the LivestreamView component
|
|
11
11
|
*/
|
|
12
12
|
style?: StyleProp<ViewStyle>;
|
|
13
|
-
/**
|
|
14
|
-
* Used to override the orientation of the video (from metadata).
|
|
15
|
-
* Defaults to "portrait".
|
|
16
|
-
*/
|
|
17
|
-
orientation?: 'landscape' | 'portrait';
|
|
18
13
|
/**
|
|
19
14
|
* A variable deciding whether the Picture-in-Picture is enabled.
|
|
20
15
|
* Defaults to true.
|
|
@@ -38,7 +33,7 @@ export type LivestreamViewerProps = {
|
|
|
38
33
|
width: number;
|
|
39
34
|
height: number;
|
|
40
35
|
};
|
|
41
|
-
ref
|
|
36
|
+
ref: Ref<LivestreamViewerRef>;
|
|
42
37
|
};
|
|
43
38
|
/**
|
|
44
39
|
* Renders a video player playing the livestream set up with {@link useLivestreamViewer} hook.
|
|
@@ -47,5 +42,5 @@ export type LivestreamViewerProps = {
|
|
|
47
42
|
* @param {object} props
|
|
48
43
|
* @param {object} props.style
|
|
49
44
|
*/
|
|
50
|
-
export declare const LivestreamViewer: ({ style,
|
|
45
|
+
export declare const LivestreamViewer: ({ style, pipEnabled, autoStartPip, autoStopPip, pipSize, ref, }: LivestreamViewerProps) => import("react").JSX.Element;
|
|
51
46
|
//# sourceMappingURL=LivestreamViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LivestreamViewer.d.ts","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"LivestreamViewer.d.ts","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,GAAG,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC;CAC/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,iEAO9B,qBAAqB,gCASvB,CAAC"}
|
|
@@ -6,5 +6,5 @@ import { WhepClientView } from 'react-native-whip-whep';
|
|
|
6
6
|
* @param {object} props
|
|
7
7
|
* @param {object} props.style
|
|
8
8
|
*/
|
|
9
|
-
export const LivestreamViewer = ({ style,
|
|
9
|
+
export const LivestreamViewer = ({ style, pipEnabled, autoStartPip, autoStopPip, pipSize, ref, }) => (<WhepClientView ref={ref} style={style} pipEnabled={pipEnabled} autoStartPip={autoStartPip} autoStopPip={autoStopPip} pipSize={pipSize}/>);
|
|
10
10
|
//# sourceMappingURL=LivestreamViewer.js.map
|