From af824b47cbcd18457b0d5538b64b542bb977fba2 Mon Sep 17 00:00:00 2001 From: Eli Streams Date: Sat, 4 Jan 2025 22:49:10 +0000 Subject: [PATCH] app: add stream key generation See merge request aquareum-tv/aquareum!82 Changelog: feature --- js/app/components/aqlink.tsx | 7 +- js/app/components/golive.tsx | 135 ----------------------- js/app/components/login/login.tsx | 1 - js/app/components/player/use-webrtc.tsx | 34 +++++- js/app/components/player/video.tsx | 12 +- js/app/features/base/baseSlice.tsx | 56 ++++++++++ js/app/features/bluesky/blueskySlice.tsx | 108 ++++++++++++++++++ js/app/package.json | 2 + js/app/src/router.tsx | 41 +++++-- js/app/src/screens/golive.tsx | 10 -- js/app/src/screens/live.tsx | 33 ++++-- js/app/src/screens/stream-key.tsx | 120 ++++++++++++++++++++ js/app/store/store.tsx | 2 + pkg/api/api.go | 5 + pkg/api/playback.go | 58 +++++++++- pkg/atproto/atproto.go | 56 +++++++--- pkg/atproto/atproto_test.go | 9 +- pkg/cmd/aquareum.go | 8 +- pkg/config/config.go | 2 +- pkg/crypto/aqpub/aqpub.go | 9 ++ pkg/media/media.go | 17 ++- pkg/media/media_signer.go | 13 +-- pkg/media/media_test.go | 7 +- pkg/model/model.go | 2 +- pkg/model/repo.go | 16 +-- pkg/model/segment.go | 2 +- yarn.lock | 36 ++++++ 27 files changed, 573 insertions(+), 228 deletions(-) delete mode 100644 js/app/components/golive.tsx create mode 100644 js/app/features/base/baseSlice.tsx delete mode 100644 js/app/src/screens/golive.tsx create mode 100644 js/app/src/screens/stream-key.tsx diff --git a/js/app/components/aqlink.tsx b/js/app/components/aqlink.tsx index 4e47edebc..b6a50c834 100644 --- a/js/app/components/aqlink.tsx +++ b/js/app/components/aqlink.tsx @@ -16,10 +16,13 @@ export default function AQLink({ }) { const { isWeb } = usePlatform(); const navigation = useNavigation>(); + const baseStyle: StyleProp = { + display: "flex", + }; if (isWeb) { return ( - + {children} ); @@ -27,7 +30,7 @@ export default function AQLink({ return ( navigation.navigate(to.screen, to.params)} > {children} diff --git a/js/app/components/golive.tsx b/js/app/components/golive.tsx deleted file mode 100644 index 45c3ed4c3..000000000 --- a/js/app/components/golive.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import { useEffect, useState } from "react"; -import { Button, Label, Paragraph, TextArea, View } from "tamagui"; -import Loading from "./loading/loading"; -import { useToastController } from "@tamagui/toast"; -import useAquareumNode from "hooks/useAquareumNode"; -import { golivePost, selectUserProfile } from "features/bluesky/blueskySlice"; -import { useAppDispatch, useAppSelector } from "store/hooks"; -import AQLink from "./aqlink"; -import { getIdentity, selectAquareum } from "features/aquareum/aquareumSlice"; - -const Left = ({ children }: { children: React.ReactNode }) => { - return ( - - {children} - - ); -}; - -const Right = ({ children }: { children: React.ReactNode }) => { - return ( - - {children} - - ); -}; -type Settings = { - id: string; - streamer: string; - title: string; -}; - -export default function GoLive() { - const toast = useToastController(); - const { url } = useAquareumNode(); - const profile = useAppSelector(selectUserProfile); - const dispatch = useAppDispatch(); - const aquareum = useAppSelector(selectAquareum); - useEffect(() => { - if (!aquareum.identity) { - dispatch(getIdentity()); - } - }, [aquareum.identity]); - const [title, setTitle] = useState(""); - const [loading, setLoading] = useState(false); - const disabled = !profile || loading || title === ""; - if (!aquareum.identity) { - return ( - - - - ); - } - const identity = aquareum.identity; - return ( - - - - -