Open History to see the last commit
1import { View } from "react-native";
2
3import { EmptyState } from "../../components/EmptyState";
4import { MediaVideoPlayer } from "../../components/MediaVideoPlayer";
5import type { MediaVideoPreviewSource } from "../../lib/videoPreviewSource";
6
7/** Uses the signed progressive URL directly; choosing a file never preloads its video bytes as text. */
8export function WorkspaceFileVideoPreview(props: {
9 readonly name: string;
10 readonly thumbnailKey: string;
11 readonly uri: string | null;
12 readonly source: MediaVideoPreviewSource | null;
13 readonly resolvePlaybackUri: () => Promise<string | null>;
14 readonly unavailable: boolean;
15}) {
16 const uri = props.uri;
17
18 if (props.unavailable) {
19 return (
20 <View className="flex-1 items-center justify-center bg-sheet px-6">
21 <EmptyState
22 title="Video unavailable"
23 detail="This file may be missing, unsupported, or unavailable on this environment."
24 />
25 </View>
26 );
27 }
28
29 return (
30 <View className="flex-1 items-center justify-center bg-sheet p-4">
31 <MediaVideoPlayer
32 uri={uri}
33 resolvePlaybackUri={props.resolvePlaybackUri}
34 name={props.name}
35 thumbnailKey={props.thumbnailKey}
36 actionsSource={props.source?.actionsSource}
37 />
38 </View>
39 );
40}