@@ -3,107 +3,9 @@ import { withFishjamAndroid } from './withFishjamAndroid';
33import { FishjamPluginOptions } from './types' ;
44import withFishjamIos from './withFishjamIos' ;
55
6- /**
7- * Main Fishjam Expo config plugin.
8- *
9- * This plugin configures both iOS and Android platforms for Fishjam video calls
10- * and optionally for livestreaming functionality.
11- *
12- * ## Basic Usage (Video Calls)
13- *
14- * ```json
15- * {
16- * "plugins": [
17- * [
18- * "@fishjam -cloud/react-native-client",
19- * {
20- * "android": {
21- * "enableForegroundService": true,
22- * "supportsPictureInPicture": true
23- * },
24- * "ios": {
25- * "enableScreensharing": true,
26- * "enableVoIPBackgroundMode": true,
27- * "supportsPictureInPicture": true
28- * }
29- * }
30- * ]
31- * ]
32- * }
33- * ```
34- *
35- * ## Livestreaming Support
36- *
37- * If you're using the livestream functionality (WHIP/WHEP), add the `livestream` configuration.
38- * This will automatically configure the underlying `react-native-whip-whep` package:
39- *
40- * ```json
41- * {
42- * "plugins": [
43- * [
44- * "@fishjam -cloud/react-native-client",
45- * {
46- * "android": {
47- * "enableForegroundService": true,
48- * "supportsPictureInPicture": true
49- * },
50- * "ios": {
51- * "enableScreensharing": true,
52- * "enableVoIPBackgroundMode": true,
53- * "supportsPictureInPicture": true
54- * },
55- * "livestream": {
56- * "android": {
57- * "enableScreensharing": true,
58- * "supportsPictureInPicture": true
59- * },
60- * "ios": {
61- * "enableScreensharing": true,
62- * "supportsPictureInPicture": true
63- * }
64- * }
65- * }
66- * ]
67- * ]
68- * }
69- * ```
70- *
71- * The `livestream` configuration adds:
72- * - **Android**: ScreenCaptureService for screen sharing in livestreams
73- * - **iOS**: Broadcast extension for screen sharing in livestreams
74- *
75- * @param config - Expo config object
76- * @param options - Plugin configuration options
77- * @returns Modified config object
78- */
796const withFishjam : ConfigPlugin < FishjamPluginOptions > = ( config , options ) => {
807 config = withFishjamAndroid ( config , options ) ;
818 config = withFishjamIos ( config , options ) ;
82-
83- if ( options ?. livestream ) {
84- try {
85- const withWhipWhep =
86- // eslint-disable-next-line @typescript-eslint/no-require-imports
87- require ( 'react-native-whip-whep/plugin/build/withWhipWhep' ) . default ;
88-
89- // Fishjam's iOS screensharing is enabled, disable whip-whep's screensharing
90- // This ensures only one broadcast extension is created (Fishjam's FishjamScreenBroadcastExtension)
91- // to avoid duplicate broadcast extension targets in the Xcode project
92- if ( options ?. ios ?. enableScreensharing ) {
93- options . livestream . ios = {
94- ...options . livestream . ios ,
95- enableScreensharing : false ,
96- } ;
97- }
98-
99- config = withWhipWhep ( config , options . livestream ) ;
100- } catch {
101- console . warn (
102- '[Fishjam] react-native-whip-whep plugin not found. Livestream configuration will be skipped.' ,
103- ) ;
104- }
105- }
106-
1079 return config ;
10810} ;
10911
0 commit comments