diff options
author | Hailey <me@haileyok.com> | 2024-08-15 16:29:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 16:29:16 -0700 |
commit | a5af24b53b6085cfb5547592c29155bc10e71f9e (patch) | |
tree | 6946c933322c1cdfc455e63c02ca74b18651117b /src/view/screens/Storybook/index.tsx | |
parent | b6e515c664d51ffe357c3562fd514301805ade8c (diff) | |
download | voidsky-a5af24b53b6085cfb5547592c29155bc10e71f9e.tar.zst |
Revert "[Video] Download videos" (#4945)
Diffstat (limited to 'src/view/screens/Storybook/index.tsx')
-rw-r--r-- | src/view/screens/Storybook/index.tsx | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/src/view/screens/Storybook/index.tsx b/src/view/screens/Storybook/index.tsx index c6da63314..71dbe8839 100644 --- a/src/view/screens/Storybook/index.tsx +++ b/src/view/screens/Storybook/index.tsx @@ -1,17 +1,12 @@ import React from 'react' import {ScrollView, View} from 'react-native' -import {deleteAsync} from 'expo-file-system' -import {saveToLibraryAsync} from 'expo-media-library' import {useSetThemePrefs} from '#/state/shell' -import {useVideoLibraryPermission} from 'lib/hooks/usePermissions' -import {isIOS, isWeb} from 'platform/detection' +import {isWeb} from 'platform/detection' import {CenteredView} from '#/view/com/util/Views' -import * as Toast from 'view/com/util/Toast' import {ListContained} from 'view/screens/Storybook/ListContained' import {atoms as a, ThemeProvider, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' -import {HLSDownloadView} from '../../../../modules/expo-bluesky-swiss-army' import {Breakpoints} from './Breakpoints' import {Buttons} from './Buttons' import {Dialogs} from './Dialogs' @@ -38,49 +33,10 @@ function StorybookInner() { const t = useTheme() const {setColorMode, setDarkTheme} = useSetThemePrefs() const [showContainedList, setShowContainedList] = React.useState(false) - const hlsDownloadRef = React.useRef<HLSDownloadView>(null) - - const {requestVideoAccessIfNeeded} = useVideoLibraryPermission() return ( <CenteredView style={[t.atoms.bg]}> <View style={[a.p_xl, a.gap_5xl, {paddingBottom: 100}]}> - <HLSDownloadView - ref={hlsDownloadRef} - downloaderUrl={ - isIOS - ? 'http://localhost:19006/video-download' - : 'http://10.0.2.2:19006/video-download' - } - onSuccess={async e => { - const uri = e.nativeEvent.uri - const permsRes = await requestVideoAccessIfNeeded() - if (!permsRes) return - - await saveToLibraryAsync(uri) - try { - deleteAsync(uri) - } catch (err) { - console.error('Failed to delete file', err) - } - Toast.show('Video saved to library') - }} - onStart={() => console.log('Download is starting')} - onError={e => console.log(e.nativeEvent.message)} - onProgress={e => console.log(e.nativeEvent.progress)} - /> - <Button - variant="solid" - color="primary" - size="small" - onPress={async () => { - hlsDownloadRef.current?.startDownloadAsync( - 'https://lumi.jazco.dev/watch/did:plc:q6gjnaw2blty4crticxkmujt/Qmc8w93UpTa2adJHg4ZhnDPrBs1EsbzrekzPcqF5SwusuZ/playlist.m3u8?download=true', - ) - }} - label="Video download test"> - <ButtonText>Video download test</ButtonText> - </Button> {!showContainedList ? ( <> <View style={[a.flex_row, a.align_start, a.gap_md]}> |