Live video on the AT Protocol

app: add <title> to streams

+15 -3
+11
js/app/hooks/useTitle.tsx
··· 1 + import { useNavigation } from "@react-navigation/native"; 2 + import { useEffect } from "react"; 3 + 4 + export default function useTitle(user: string) { 5 + const navigation = useNavigation(); 6 + useEffect(() => { 7 + navigation.setOptions({ 8 + title: `@${user} on Streamplace`, 9 + }); 10 + }, [user, navigation]); 11 + }
+2 -3
js/app/src/screens/mobile-stream.tsx
··· 1 - import { useNavigation } from "@react-navigation/native"; 2 1 import { theme } from "@streamplace/components"; 3 2 import { Player } from "components/mobile/player"; 4 3 import { PlayerProps } from "components/player/props"; 5 4 import { FullscreenProvider } from "contexts/FullscreenContext"; 5 + import useTitle from "hooks/useTitle"; 6 6 import { isWeb } from "tamagui"; 7 7 import { queryToProps } from "./util"; 8 8 9 9 export default function MobileStream({ route }) { 10 10 const { user, protocol, url } = route.params; 11 - const navigation = useNavigation(); 12 11 let extraProps: Partial<PlayerProps> = {}; 13 12 if (isWeb) { 14 13 extraProps = queryToProps(new URLSearchParams(window.location.search)); ··· 18 17 src = url; 19 18 } 20 19 21 - console.log(src); 20 + useTitle(user); 22 21 23 22 return ( 24 23 <theme.ThemeProvider>
+2
js/app/src/screens/stream.tsx
··· 1 1 import Livestream from "components/livestream/livestream"; 2 2 import { PlayerProps } from "components/player/props"; 3 3 import { FullscreenProvider } from "contexts/FullscreenContext"; 4 + import useTitle from "hooks/useTitle"; 4 5 import { isWeb } from "tamagui"; 5 6 import { queryToProps } from "./util"; 6 7 ··· 14 15 if (user === "stream") { 15 16 src = url; 16 17 } 18 + useTitle(user); 17 19 return ( 18 20 <FullscreenProvider> 19 21 <Livestream src={src} {...extraProps} />