| 1 | import { View } from "react-native"; |
| 2 | |
| 3 | import { MediaVideoPlayer } from "../../components/MediaVideoPlayer"; |
| 4 | import type { MediaVideoPreviewSource } from "../../lib/videoPreviewSource"; |
| 5 | |
| 6 | /** Uses the signed progressive URL directly; choosing a file never preloads its video bytes as text. */ |
| 7 | export function WorkspaceFileVideoPreview(props: { |
| 8 | readonly name: string; |
| 9 | readonly thumbnailKey: string; |
| 10 | readonly uri: string | null; |
| 11 | readonly source: MediaVideoPreviewSource | null; |
| 12 | readonly resolvePlaybackUri: () => Promise<string | null>; |
| 13 | }) { |
| 14 | const uri = props.uri; |
| 15 | |
| 16 | return ( |
| 17 | <View className="flex-1 items-center justify-center bg-sheet p-4"> |
| 18 | <MediaVideoPlayer |
| 19 | uri={uri} |
| 20 | resolvePlaybackUri={props.resolvePlaybackUri} |
| 21 | name={props.name} |
| 22 | thumbnailKey={props.thumbnailKey} |
| 23 | actionsSource={props.source?.actionsSource} |
| 24 | /> |
| 25 | </View> |
| 26 | ); |
| 27 | } |