This repository was archived by the owner on Feb 10, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
FCE-2395: Implement screen sharing for live streams #524
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ae57c43
Implement screen sharing for live streams
anna1901 6609231
Fix linter issues
anna1901 857e3cc
Merge branch 'main' into FCE-2395/add-screensharing-to-livestreams
anna1901 d468f0c
Use the whip/whep config
anna1901 0aeafb3
Fix the webRTC network monitoring crash on android
anna1901 3ccf9d9
Lint
anna1901 0dbccb6
Fix lint issues and CR suggestions
anna1901 85e4e08
CR improvements
anna1901 112be4c
Update whip-whep version
anna1901 8635cac
Merge branch 'main' into FCE-2395/add-screensharing-to-livestreams
anna1901 522b125
Use correct expo/metro-config version
anna1901 d33ffe9
Catch initializeScreenshare errors correctly
anna1901 453a335
bump example packages
MiloszFilimowski a31f3ec
Fix android plugin
anna1901 d88d9be
Merge branch 'FCE-2395/add-screensharing-to-livestreams' of github.co…
anna1901 6aea42b
lint code
anna1901 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
internal/fishjam-chat/screens/LivestreamScreen/LivestreamScreenSharingScreen.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| import { useSandbox } from '@fishjam-cloud/react-native-client'; | ||
| import { | ||
| LivestreamStreamer, | ||
| useLivestreamScreenSharingStreamer, | ||
| VideoParameters, | ||
| } from '@fishjam-cloud/react-native-client/livestream'; | ||
| import type { NativeStackScreenProps } from '@react-navigation/native-stack'; | ||
| import React, { useCallback } from 'react'; | ||
| import { Button, SafeAreaView, StyleSheet, View } from 'react-native'; | ||
| import { AppRootStackParamList } from '../../navigators/AppNavigator'; | ||
| import { BrandColors } from '../../utils/Colors'; | ||
|
|
||
| type Props = NativeStackScreenProps< | ||
| AppRootStackParamList, | ||
| 'LivestreamScreenSharingScreen' | ||
| >; | ||
|
|
||
| export default function LivestreamScreenSharingScreen({ route }: Props) { | ||
| const { fishjamId, roomName } = route.params; | ||
|
|
||
| const { getSandboxLivestream } = useSandbox({ | ||
| fishjamId, | ||
| }); | ||
|
|
||
| const { connect, disconnect, isConnected, whipClientRef } = | ||
| useLivestreamScreenSharingStreamer({ | ||
| audioEnabled: true, | ||
| videoParameters: VideoParameters.presetHD169, | ||
| }); | ||
|
|
||
| const handleConnect = useCallback(async () => { | ||
| try { | ||
| const { streamerToken } = await getSandboxLivestream(roomName, false); | ||
| await connect(streamerToken); | ||
| } catch (err) { | ||
| console.log(err); | ||
| } | ||
| }, [connect, getSandboxLivestream, roomName]); | ||
|
|
||
| const handleDisconnect = useCallback(() => { | ||
| disconnect(); | ||
| }, [disconnect]); | ||
|
|
||
| return ( | ||
| <SafeAreaView style={styles.container}> | ||
| <View style={styles.box}> | ||
| <View style={styles.videoView}> | ||
| <LivestreamStreamer style={styles.whepView} ref={whipClientRef} /> | ||
| <Button | ||
| title={isConnected ? 'Disconnect' : 'Connect'} | ||
| onPress={isConnected ? handleDisconnect : handleConnect} | ||
| /> | ||
| </View> | ||
| </View> | ||
| </SafeAreaView> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| container: { | ||
| flex: 1, | ||
| backgroundColor: '#F1FAFE', | ||
| padding: 24, | ||
| }, | ||
| box: { | ||
| flex: 1, | ||
| justifyContent: 'center', | ||
| alignItems: 'center', | ||
| gap: 20, | ||
| }, | ||
| videoView: { | ||
| width: '100%', | ||
| height: '70%', | ||
| backgroundColor: '#E0E0E0', | ||
| borderRadius: 12, | ||
| overflow: 'hidden', | ||
| borderWidth: 1, | ||
| borderColor: BrandColors.darkBlue80, | ||
| }, | ||
| whepView: { | ||
| flex: 1, | ||
| backgroundColor: '#000', | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.