@fishjam-cloud/react-native-client 0.18.1 → 0.19.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.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +25 -15
  3. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +52 -0
  4. package/build/RNFishjamClientModule.d.ts +6 -1
  5. package/build/RNFishjamClientModule.d.ts.map +1 -1
  6. package/build/RNFishjamClientModule.js.map +1 -1
  7. package/build/components/FishjamRoom/index.d.ts +6 -0
  8. package/build/components/FishjamRoom/index.d.ts.map +1 -1
  9. package/build/components/FishjamRoom/index.js +6 -0
  10. package/build/components/FishjamRoom/index.js.map +1 -1
  11. package/build/components/LivestreamView.d.ts +33 -1
  12. package/build/components/LivestreamView.d.ts.map +1 -1
  13. package/build/components/LivestreamView.js +1 -1
  14. package/build/components/LivestreamView.js.map +1 -1
  15. package/build/components/VideoPreviewView.d.ts +1 -1
  16. package/build/components/VideoPreviewView.js +1 -0
  17. package/build/components/VideoPreviewView.js.map +1 -1
  18. package/build/components/VideoRendererView.d.ts +2 -2
  19. package/build/components/VideoRendererView.js +3 -2
  20. package/build/components/VideoRendererView.js.map +1 -1
  21. package/build/consts/index.d.ts +3 -0
  22. package/build/consts/index.d.ts.map +1 -0
  23. package/build/consts/index.js +4 -0
  24. package/build/consts/index.js.map +1 -0
  25. package/build/debug/stats/useRTCStatistics.js.map +1 -1
  26. package/build/hooks/useCamera.d.ts +5 -5
  27. package/build/hooks/useCamera.js.map +1 -1
  28. package/build/hooks/useConnection.d.ts +18 -7
  29. package/build/hooks/useConnection.d.ts.map +1 -1
  30. package/build/hooks/useConnection.js +10 -2
  31. package/build/hooks/useConnection.js.map +1 -1
  32. package/build/hooks/useMicrophone.d.ts +6 -2
  33. package/build/hooks/useMicrophone.d.ts.map +1 -1
  34. package/build/hooks/useMicrophone.js +12 -2
  35. package/build/hooks/useMicrophone.js.map +1 -1
  36. package/build/hooks/usePeers.js.map +1 -1
  37. package/build/hooks/usePermissions.d.ts +24 -0
  38. package/build/hooks/usePermissions.d.ts.map +1 -0
  39. package/build/hooks/usePermissions.js +61 -0
  40. package/build/hooks/usePermissions.js.map +1 -0
  41. package/build/hooks/useSandbox.d.ts +13 -0
  42. package/build/hooks/useSandbox.d.ts.map +1 -0
  43. package/build/hooks/useSandbox.js +42 -0
  44. package/build/hooks/useSandbox.js.map +1 -0
  45. package/build/hooks/useScreenShare.d.ts +1 -1
  46. package/build/hooks/useScreenShare.js.map +1 -1
  47. package/build/index.d.ts +5 -2
  48. package/build/index.d.ts.map +1 -1
  49. package/build/index.js +3 -0
  50. package/build/index.js.map +1 -1
  51. package/build/types.d.ts +1 -0
  52. package/build/types.d.ts.map +1 -1
  53. package/build/types.js.map +1 -1
  54. package/ios/CameraPermissionsRequester.swift +117 -0
  55. package/ios/RNFishjamClient.swift +31 -20
  56. package/ios/RNFishjamClientModule.swift +176 -119
  57. package/package.json +16 -11
  58. package/plugin/build/types.d.ts +5 -0
  59. package/plugin/build/withFishjamAndroid.js +16 -4
  60. package/plugin/build/withFishjamIos.d.ts +1 -1
  61. package/plugin/build/withFishjamIos.js +106 -48
@@ -328,40 +328,51 @@ class RNFishjamClient: FishjamClientListener {
328
328
  }
329
329
 
330
330
  func toggleMicrophone() async throws -> Bool {
331
- if let audioTrack = getLocalAudioTrack() {
332
- setMicrophoneTrackState(audioTrack, enabled: !isMicrophoneOn)
331
+ if isMicrophoneOn {
332
+ try stopMicrophone()
333
333
  } else {
334
- try await startMicrophone()
334
+ try await startMicrophone()
335
335
  }
336
336
 
337
- try updateLocalAudioTrackMetadata(metadata: getMicrophoneTrackMetadata())
338
-
339
337
  return isMicrophoneOn
340
338
  }
341
339
 
342
340
  func startMicrophone() async throws {
343
- guard await PermissionUtils.requestMicrophonePermission() else {
344
- emit(event: .warning(message: "Microphone permission not granted."))
345
- return
346
- }
347
- let microphoneTrack = RNFishjamClient.fishjamClient!.createAudioTrack(
348
- metadata: getMicrophoneTrackMetadata().toMetadata())
349
- setAudioSessionMode()
350
- setMicrophoneTrackState(microphoneTrack, enabled: true)
351
- emitEndpoints()
352
- }
353
-
354
- private func getMicrophoneTrackMetadata() -> [String: Any] {
341
+ // If microphone track already exist, just enable it
342
+ if let microphoneTrack = getLocalAudioTrack() {
343
+ try setMicrophoneTrackState(microphoneTrack, enabled: true)
344
+ } else {
345
+ guard await PermissionUtils.requestMicrophonePermission() else {
346
+ emit(event: .warning(message: "Microphone permission not granted."))
347
+ return
348
+ }
349
+ let microphoneTrack = RNFishjamClient.fishjamClient!.createAudioTrack(
350
+ metadata: getMicrophoneTrackMetadata(isEnabled: true).toMetadata())
351
+ setAudioSessionMode()
352
+ try setMicrophoneTrackState(microphoneTrack, enabled: true)
353
+ emitEndpoints()
354
+ }
355
+ }
356
+
357
+ func stopMicrophone() throws {
358
+ guard let microphoneTrack = getLocalAudioTrack() else {
359
+ return
360
+ }
361
+ try setMicrophoneTrackState(microphoneTrack, enabled: false)
362
+ }
363
+
364
+ private func getMicrophoneTrackMetadata(isEnabled: Bool) -> [String: Any] {
355
365
  return [
356
- "active": isMicrophoneOn,
357
- "paused": !isMicrophoneOn, //TODO: FCE-711
366
+ "active": isEnabled,
367
+ "paused": !isEnabled, //TODO: FCE-711
358
368
  "type": "microphone",
359
369
  ]
360
370
  }
361
371
 
362
- private func setMicrophoneTrackState(_ microphoneTrack: LocalAudioTrack, enabled: Bool) {
372
+ private func setMicrophoneTrackState(_ microphoneTrack: LocalAudioTrack, enabled: Bool) throws {
363
373
  microphoneTrack.enabled = enabled
364
374
  isMicrophoneOn = enabled
375
+ try updateLocalAudioTrackMetadata(metadata: getMicrophoneTrackMetadata(isEnabled: enabled))
365
376
  emit(event: .isMicrophoneOn(enabled: enabled))
366
377
  }
367
378
 
@@ -63,159 +63,216 @@ struct ConnectConfig: Record {
63
63
  typealias RNTrackBandwidthLimit = Either<Int, [String: Int]>
64
64
 
65
65
  public class RNFishjamClientModule: Module {
66
- public func definition() -> ModuleDefinition {
67
- let rnFishjamClient: RNFishjamClient = {
68
- let client = RNFishjamClient(sendEvent)
69
- client.create()
70
- return client
71
- }()
66
+ public func definition() -> ModuleDefinition {
67
+ let rnFishjamClient: RNFishjamClient = {
68
+ let client = RNFishjamClient(sendEvent)
69
+ client.create()
70
+ return client
71
+ }()
72
+
73
+ Name("RNFishjamClient")
74
+
75
+ Events(EmitableEvent.allEvents)
76
+
77
+ OnCreate {
78
+ let permissionsManager = self.appContext?.permissions
79
+ EXPermissionsMethodsDelegate.register(
80
+ [
81
+ CameraOnlyPermissionRequester(),
82
+ CameraMicrophonePermissionRequester()
83
+ ],
84
+ withPermissionsManager: permissionsManager
85
+ )
86
+ }
87
+
88
+ Property("peerStatus") {
89
+ return rnFishjamClient.peerStatus.rawValue
90
+ }
72
91
 
73
- Name("RNFishjamClient")
92
+ Property("reconnectionStatus") {
93
+ return rnFishjamClient.reconnectionStatus.rawValue
94
+ }
74
95
 
75
- Events(EmitableEvent.allEvents)
96
+ Property("isMicrophoneOn") {
97
+ return rnFishjamClient.isMicrophoneOn
98
+ }
76
99
 
77
- Property("peerStatus") {
78
- return rnFishjamClient.peerStatus.rawValue
79
- }
100
+ Property("isCameraOn") {
101
+ return rnFishjamClient.isCameraOn
102
+ }
80
103
 
81
- Property("reconnectionStatus") {
82
- return rnFishjamClient.reconnectionStatus.rawValue
83
- }
104
+ Property("cameras") {
105
+ return rnFishjamClient.getCaptureDevices()
106
+ }
84
107
 
85
- Property("isMicrophoneOn") {
86
- return rnFishjamClient.isMicrophoneOn
87
- }
108
+ Property("currentCamera") {
109
+ return rnFishjamClient.currentCamera
110
+ }
88
111
 
89
- Property("isCameraOn") {
90
- return rnFishjamClient.isCameraOn
91
- }
112
+ Property("isScreenShareOn") {
113
+ return rnFishjamClient.isScreenShareOn
114
+ }
92
115
 
93
- Property("cameras") {
94
- return rnFishjamClient.getCaptureDevices()
95
- }
116
+ Property("isAppScreenShareOn") {
117
+ return rnFishjamClient.isAppScreenShareOn
118
+ }
96
119
 
97
- Property("currentCamera") {
98
- return rnFishjamClient.currentCamera
99
- }
120
+ Property("isCameraInitialized") {
121
+ return rnFishjamClient.isCameraInitialized
122
+ }
100
123
 
101
- Property("isScreenShareOn") {
102
- return rnFishjamClient.isScreenShareOn
103
- }
124
+ Function("getPeers") {
125
+ return rnFishjamClient.getPeers()
126
+ }
104
127
 
105
- Property("isAppScreenShareOn") {
106
- return rnFishjamClient.isAppScreenShareOn
107
- }
128
+ AsyncFunction("joinRoom") {
129
+ (
130
+ url: String, peerToken: String, peerMetadata: [String: Any], config: ConnectConfig,
131
+ promise: Promise
132
+ ) in
133
+ rnFishjamClient.joinRoom(
134
+ url: url, peerToken: peerToken, peerMetadata: peerMetadata, config: config,
135
+ promise: promise)
136
+ }
108
137
 
109
- Property("isCameraInitialized") {
110
- return rnFishjamClient.isCameraInitialized
111
- }
138
+ AsyncFunction("leaveRoom") {
139
+ rnFishjamClient.leaveRoom()
140
+ }
112
141
 
113
- Function("getPeers") {
114
- return rnFishjamClient.getPeers()
115
- }
142
+ AsyncFunction("startCamera") { (config: CameraConfig) in
143
+ try await rnFishjamClient.startCamera(config: config)
144
+ }
116
145
 
117
- AsyncFunction("joinRoom") {
118
- (
119
- url: String, peerToken: String, peerMetadata: [String: Any], config: ConnectConfig,
120
- promise: Promise
121
- ) in
122
- rnFishjamClient.joinRoom(
123
- url: url, peerToken: peerToken, peerMetadata: peerMetadata, config: config,
124
- promise: promise)
125
- }
146
+ AsyncFunction("toggleMicrophone") {
147
+ try await rnFishjamClient.toggleMicrophone()
148
+ }
149
+
150
+ AsyncFunction("startMicrophone") {
151
+ try await rnFishjamClient.startMicrophone()
152
+ }
126
153
 
127
- AsyncFunction("leaveRoom") {
128
- rnFishjamClient.leaveRoom()
129
- }
154
+ AsyncFunction("stopMicrophone") {
155
+ try rnFishjamClient.stopMicrophone()
156
+ }
130
157
 
131
- AsyncFunction("startCamera") { (config: CameraConfig) in
132
- try await rnFishjamClient.startCamera(config: config)
133
- }
158
+ AsyncFunction("toggleCamera") {
159
+ try rnFishjamClient.toggleCamera()
160
+ }
134
161
 
135
- AsyncFunction("toggleMicrophone") {
136
- try await rnFishjamClient.toggleMicrophone()
137
- }
162
+ AsyncFunction("flipCamera") {
163
+ try rnFishjamClient.flipCamera()
164
+ }
138
165
 
139
- AsyncFunction("toggleCamera") {
140
- try rnFishjamClient.toggleCamera()
141
- }
166
+ AsyncFunction("switchCamera") { (cameraId: String) in
167
+ try rnFishjamClient.switchCamera(cameraId: cameraId)
168
+ }
142
169
 
143
- AsyncFunction("flipCamera") {
144
- try rnFishjamClient.flipCamera()
145
- }
170
+ AsyncFunction("toggleScreenShare") { (screenShareOptions: ScreenShareOptions) in
171
+ try rnFishjamClient.toggleScreenShare(screenShareOptions: screenShareOptions)
172
+ }
146
173
 
147
- AsyncFunction("switchCamera") { (cameraId: String) in
148
- try rnFishjamClient.switchCamera(cameraId: cameraId)
149
- }
174
+ AsyncFunction("toggleAppScreenShare") { (screenShareOptions: ScreenShareOptions) in
175
+ try rnFishjamClient.toggleAppScreenShare(screenShareOptions: screenShareOptions)
176
+ }
150
177
 
151
- AsyncFunction("toggleScreenShare") { (screenShareOptions: ScreenShareOptions) in
152
- try rnFishjamClient.toggleScreenShare(screenShareOptions: screenShareOptions)
153
- }
178
+ AsyncFunction("updatePeerMetadata") { (metadata: [String: Any]) in
179
+ try rnFishjamClient.updatePeerMetadata(metadata: metadata)
180
+ }
154
181
 
155
- AsyncFunction("toggleAppScreenShare") { (screenShareOptions: ScreenShareOptions) in
156
- try rnFishjamClient.toggleAppScreenShare(screenShareOptions: screenShareOptions)
157
- }
182
+ AsyncFunction("updateVideoTrackMetadata") { (metadata: [String: Any]) in
183
+ try rnFishjamClient.updateLocalVideoTrackMetadata(metadata: metadata)
184
+ }
158
185
 
159
- AsyncFunction("updatePeerMetadata") { (metadata: [String: Any]) in
160
- try rnFishjamClient.updatePeerMetadata(metadata: metadata)
161
- }
186
+ AsyncFunction("updateScreenShareTrackMetadata") { (metadata: [String: Any]) in
187
+ try rnFishjamClient.updateLocalScreenShareTrackMetadata(metadata: metadata)
188
+ }
162
189
 
163
- AsyncFunction("updateVideoTrackMetadata") { (metadata: [String: Any]) in
164
- try rnFishjamClient.updateLocalVideoTrackMetadata(metadata: metadata)
165
- }
190
+ AsyncFunction("toggleScreenShareTrackEncoding") { (encoding: String) in
191
+ try rnFishjamClient.toggleScreenShareTrackEncoding(encoding: encoding)
192
+ }
166
193
 
167
- AsyncFunction("updateScreenShareTrackMetadata") { (metadata: [String: Any]) in
168
- try rnFishjamClient.updateLocalScreenShareTrackMetadata(metadata: metadata)
169
- }
194
+ AsyncFunction("setScreenShareTrackBandwidth") { (bandwidth: Int) in
195
+ try rnFishjamClient.setScreenShareTrackBandwidth(bandwidth: bandwidth)
196
+ }
170
197
 
171
- AsyncFunction("toggleScreenShareTrackEncoding") { (encoding: String) in
172
- try rnFishjamClient.toggleScreenShareTrackEncoding(encoding: encoding)
173
- }
198
+ AsyncFunction("setScreenShareTrackEncodingBandwidth") { (encoding: String, bandwidth: Int) in
199
+ try rnFishjamClient.setScreenShareTrackEncodingBandwidth(
200
+ encoding: encoding, bandwidth: bandwidth)
201
+ }
174
202
 
175
- AsyncFunction("setScreenShareTrackBandwidth") { (bandwidth: Int) in
176
- try rnFishjamClient.setScreenShareTrackBandwidth(bandwidth: bandwidth)
177
- }
203
+ AsyncFunction("setTargetTrackEncoding") { (trackId: String, encoding: String) in
204
+ try rnFishjamClient.setTargetTrackEncoding(trackId: trackId, encoding: encoding)
205
+ }
178
206
 
179
- AsyncFunction("setScreenShareTrackEncodingBandwidth") { (encoding: String, bandwidth: Int) in
180
- try rnFishjamClient.setScreenShareTrackEncodingBandwidth(
181
- encoding: encoding, bandwidth: bandwidth)
182
- }
207
+ AsyncFunction("toggleVideoTrackEncoding") { (encoding: String) in
208
+ try rnFishjamClient.toggleVideoTrackEncoding(encoding: encoding)
209
+ }
183
210
 
184
- AsyncFunction("setTargetTrackEncoding") { (trackId: String, encoding: String) in
185
- try rnFishjamClient.setTargetTrackEncoding(trackId: trackId, encoding: encoding)
186
- }
211
+ AsyncFunction("setVideoTrackEncodingBandwidth") { (encoding: String, bandwidth: Int) in
212
+ try rnFishjamClient.setVideoTrackEncodingBandwidth(
213
+ encoding: encoding, bandwidth: bandwidth)
214
+ }
187
215
 
188
- AsyncFunction("toggleVideoTrackEncoding") { (encoding: String) in
189
- try rnFishjamClient.toggleVideoTrackEncoding(encoding: encoding)
190
- }
216
+ AsyncFunction("setVideoTrackBandwidth") { (bandwidth: Int) in
217
+ try rnFishjamClient.setVideoTrackBandwidth(bandwidth: bandwidth)
218
+ }
191
219
 
192
- AsyncFunction("setVideoTrackEncodingBandwidth") { (encoding: String, bandwidth: Int) in
193
- try rnFishjamClient.setVideoTrackEncodingBandwidth(
194
- encoding: encoding, bandwidth: bandwidth)
195
- }
220
+ AsyncFunction("changeWebRTCLoggingSeverity") { (severity: String) in
221
+ try rnFishjamClient.changeWebRTCLoggingSeverity(severity: severity)
222
+ }
196
223
 
197
- AsyncFunction("setVideoTrackBandwidth") { (bandwidth: Int) in
198
- try rnFishjamClient.setVideoTrackBandwidth(bandwidth: bandwidth)
199
- }
224
+ AsyncFunction("getStatistics") {
225
+ try await rnFishjamClient.getStatistics()
226
+ }
200
227
 
201
- AsyncFunction("changeWebRTCLoggingSeverity") { (severity: String) in
202
- try rnFishjamClient.changeWebRTCLoggingSeverity(severity: severity)
203
- }
228
+ AsyncFunction("selectAudioSessionMode") { (sessionMode: String) in
229
+ try rnFishjamClient.selectAudioSessionMode(sessionMode: sessionMode)
230
+ }
204
231
 
205
- AsyncFunction("getStatistics") {
206
- try await rnFishjamClient.getStatistics()
207
- }
232
+ AsyncFunction("showAudioRoutePicker") {
233
+ rnFishjamClient.showAudioRoutePicker()
234
+ }
208
235
 
209
- AsyncFunction("selectAudioSessionMode") { (sessionMode: String) in
210
- try rnFishjamClient.selectAudioSessionMode(sessionMode: sessionMode)
211
- }
236
+ AsyncFunction("startAudioSwitcher") {
237
+ rnFishjamClient.startAudioSwitcher()
238
+ }
212
239
 
213
- AsyncFunction("showAudioRoutePicker") {
214
- rnFishjamClient.showAudioRoutePicker()
215
- }
240
+ AsyncFunction("getCameraPermissionsAsync") { (promise: Promise) in
241
+ EXPermissionsMethodsDelegate.getPermissionWithPermissionsManager(
242
+ self.appContext?.permissions,
243
+ withRequester: CameraOnlyPermissionRequester.self,
244
+ resolve: promise.resolver,
245
+ reject: promise.legacyRejecter
246
+ )
247
+ }
216
248
 
217
- AsyncFunction("startAudioSwitcher") {
218
- rnFishjamClient.startAudioSwitcher()
219
- }
249
+ AsyncFunction("requestCameraPermissionsAsync") { (promise: Promise) in
250
+ EXPermissionsMethodsDelegate.askForPermission(
251
+ withPermissionsManager: self.appContext?.permissions,
252
+ withRequester: CameraOnlyPermissionRequester.self,
253
+ resolve: promise.resolver,
254
+ reject: promise.legacyRejecter
255
+ )
220
256
  }
221
- }
257
+
258
+ AsyncFunction("getMicrophonePermissionsAsync") { (promise: Promise) in
259
+ EXPermissionsMethodsDelegate.getPermissionWithPermissionsManager(
260
+ self.appContext?.permissions,
261
+ withRequester: CameraMicrophonePermissionRequester.self,
262
+ resolve: promise.resolver,
263
+ reject: promise.legacyRejecter
264
+ )
265
+ }
266
+
267
+ AsyncFunction("requestMicrophonePermissionsAsync") { (promise: Promise) in
268
+ EXPermissionsMethodsDelegate.askForPermission(
269
+ withPermissionsManager: self.appContext?.permissions,
270
+ withRequester: CameraMicrophonePermissionRequester.self,
271
+ resolve: promise.resolver,
272
+ reject: promise.legacyRejecter
273
+ )
274
+ }
275
+
276
+ }
277
+ }
278
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishjam-cloud/react-native-client",
3
- "version": "0.18.1",
3
+ "version": "0.19.1",
4
4
  "description": "A React Native client for Fishjam",
5
5
  "author": "Fishjam Team",
6
6
  "license": "Apache-2.0",
@@ -9,8 +9,8 @@
9
9
  "scripts": {
10
10
  "build": "EXPO_NONINTERACTIVE=1 sh -c 'expo-module build && expo-module build plugin'",
11
11
  "clean": "expo-module clean",
12
- "lint": "sh ./scripts/lint.sh",
13
- "lint:check": "sh ./scripts/lint_check.sh",
12
+ "lint": "eslint . --ext .ts,.tsx",
13
+ "lint:fix": "yarn lint --fix",
14
14
  "test": "expo-module test",
15
15
  "prepare": "expo-module prepare",
16
16
  "prepublishOnly": "expo-module prepublishOnly",
@@ -42,26 +42,31 @@
42
42
  "dependencies": {
43
43
  "promise-fs": "^2.1.1",
44
44
  "protobufjs": "^7.4.0",
45
- "react-native-whip-whep": "0.2.1",
46
- "zod": "^3.24.2"
45
+ "react-native-whip-whep": "0.2.3",
46
+ "zod": "^3.25.71"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@testing-library/dom": "^10.4.0",
50
50
  "@testing-library/react": "^16.3.0",
51
- "@types/lodash": "^4.17.16",
51
+ "@types/lodash": "^4.17.20",
52
52
  "@types/promise-fs": "^2.1.2",
53
53
  "@types/react": "~19.0.10",
54
54
  "@types/react-dom": "^19",
55
- "expo-module-scripts": "^4.1.7",
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",
56
60
  "husky": "^9.1.7",
57
61
  "jest": "^29.6.1",
58
62
  "jest-environment-jsdom": "^29.6.1",
59
- "jest-expo": "~53.0.5",
63
+ "jest-expo": "~53.0.9",
60
64
  "jest-websocket-mock": "^2.4.0",
61
- "pod-install": "^0.3.4",
65
+ "pod-install": "^0.3.9",
66
+ "prettier": "^3.6.2",
62
67
  "react-dom": "19.0.0",
63
- "ts-proto": "^2.7.0",
64
- "typedoc": "^0.28.1",
68
+ "ts-proto": "^2.7.5",
69
+ "typedoc": "^0.28.7",
65
70
  "typedoc-plugin-mark-react-functional-components": "^0.2.2",
66
71
  "typescript": "~5.8.3"
67
72
  },
@@ -1,9 +1,14 @@
1
1
  export type FishjamPluginOptions = {
2
2
  android?: {
3
3
  enableForegroundService?: boolean;
4
+ supportsPictureInPicture?: boolean;
4
5
  };
5
6
  ios?: {
6
7
  iphoneDeploymentTarget?: string;
7
8
  enableScreensharing?: boolean;
9
+ supportsPictureInPicture?: boolean;
10
+ appGroupContainerId?: string;
11
+ mainTargetName?: string;
12
+ broadcastExtensionTargetName?: string;
8
13
  };
9
14
  } | undefined;
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withFishjamAndroid = void 0;
4
4
  const config_plugins_1 = require("@expo/config-plugins");
5
5
  const Manifest_1 = require("@expo/config-plugins/build/android/Manifest");
6
- const withFishjamForegroundService = (config) => (0, config_plugins_1.withAndroidManifest)(config, async (configuration) => {
6
+ const withFishjamForegroundService = (config, props) => (0, config_plugins_1.withAndroidManifest)(config, async (configuration) => {
7
+ if (!props?.android?.enableForegroundService) {
8
+ return configuration;
9
+ }
7
10
  const mainApplication = (0, Manifest_1.getMainApplicationOrThrow)(configuration.modResults);
8
11
  mainApplication.service = mainApplication.service || [];
9
12
  const newService = {
@@ -22,10 +25,19 @@ const withFishjamForegroundService = (config) => (0, config_plugins_1.withAndroi
22
25
  }
23
26
  return configuration;
24
27
  });
25
- const withFishjamAndroid = (config, props) => {
26
- if (props?.android?.enableForegroundService) {
27
- config = withFishjamForegroundService(config);
28
+ const withFishjamPictureInPicture = (config, props) => (0, config_plugins_1.withAndroidManifest)(config, (configuration) => {
29
+ const activity = config_plugins_1.AndroidConfig.Manifest.getMainActivityOrThrow(configuration.modResults);
30
+ if (props?.android?.supportsPictureInPicture) {
31
+ activity.$['android:supportsPictureInPicture'] = 'true';
32
+ }
33
+ else {
34
+ delete activity.$['android:supportsPictureInPicture'];
28
35
  }
36
+ return configuration;
37
+ });
38
+ const withFishjamAndroid = (config, props) => {
39
+ config = withFishjamForegroundService(config, props);
40
+ config = withFishjamPictureInPicture(config, props);
29
41
  return config;
30
42
  };
31
43
  exports.withFishjamAndroid = withFishjamAndroid;
@@ -1,6 +1,6 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
2
  import { FishjamPluginOptions } from './types';
3
- export declare const SBE_PODFILE_SNIPPET = "\ntarget 'FishjamScreenBroadcastExtension' do\n pod 'FishjamCloudClient/Broadcast'\nend";
3
+ export declare function getSbePodfileSnippet(props: FishjamPluginOptions): string;
4
4
  /**
5
5
  * Applies screen sharing plugin if enabled. In order for screensharing to work, we need to copy extension files to your iOS project.
6
6
  * Allows for dynamically changing deploymentTarget.