Skip to content

Commit ae87f14

Browse files
authored
Update manifest to reflect changes to fishjam-react-native-webrtc (#547)
## Description Updated manifest to reflect changes made to fishjam-react-native-webrtc ## Motivation and Context I've made changes to fishjam-react-native-webrtc that makes mediaProjectionService in manifest obsolete ## Documentation impact - [ ] Documentation update required - [ ] Documentation updated [in another PR](_) - [X] No documentation update required ## Types of changes - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
1 parent 29d7e58 commit ae87f14

2 files changed

Lines changed: 6 additions & 21 deletions

File tree

examples/mobile-client/fishjam-chat/app/room/[roomName].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
useScreenShare,
99
} from '@fishjam-cloud/react-native-client';
1010
import { router, useLocalSearchParams } from 'expo-router';
11-
import React, { useCallback, useEffect } from 'react';
11+
import { useCallback, useEffect } from 'react';
1212
import { Platform, StyleSheet, View } from 'react-native';
1313
import { SafeAreaView } from 'react-native-safe-area-context';
1414

packages/mobile-client/plugin/src/withFishjamAndroid.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ const withFishjamForegroundService: ConfigPlugin<FishjamPluginOptions> = (config
2525
const mainApplication = getMainApplicationOrThrow(configuration.modResults);
2626
mainApplication.service = mainApplication.service || [];
2727

28+
const foregroundServiceType = props?.android?.enableScreensharing
29+
? 'camera|microphone|mediaProjection'
30+
: 'camera|microphone';
31+
2832
const webRTCForegroundService = {
2933
$: {
3034
'android:name': 'com.oney.WebRTCModule.foregroundService.WebRTCForegroundService',
31-
'android:foregroundServiceType': 'camera|microphone',
35+
'android:foregroundServiceType': foregroundServiceType,
3236
'android:stopWithTask': 'true',
3337
},
3438
};
@@ -43,25 +47,6 @@ const withFishjamForegroundService: ConfigPlugin<FishjamPluginOptions> = (config
4347
mainApplication.service.push(webRTCForegroundService);
4448
}
4549

46-
if (props?.android?.enableScreensharing) {
47-
const mediaProjectionService = {
48-
$: {
49-
'android:name': 'com.oney.WebRTCModule.MediaProjectionService',
50-
'android:foregroundServiceType': 'mediaProjection',
51-
'android:stopWithTask': 'true',
52-
},
53-
};
54-
55-
const existingMediaProjectionServiceIndex = mainApplication.service.findIndex(
56-
(service) => service.$['android:name'] === mediaProjectionService.$['android:name'],
57-
);
58-
59-
if (existingMediaProjectionServiceIndex !== -1) {
60-
mainApplication.service[existingMediaProjectionServiceIndex] = mediaProjectionService;
61-
} else {
62-
mainApplication.service.push(mediaProjectionService);
63-
}
64-
}
6550
return configuration;
6651
});
6752

0 commit comments

Comments
 (0)