feat: show controls while loading

This commit is contained in:
Adrian Castro
2024-02-20 16:10:01 +01:00
parent 6dab85f945
commit 45b924911c
2 changed files with 12 additions and 4 deletions

View File

@@ -4,11 +4,11 @@ import { BottomControls } from "./BottomControls";
import { Header } from "./Header";
import { MiddleControls } from "./MiddleControls";
export const ControlsOverlay = () => {
export const ControlsOverlay = ({ isLoading }: { isLoading: boolean }) => {
return (
<View className="flex w-full flex-1 flex-col justify-between">
<Header />
<MiddleControls />
{!isLoading && <MiddleControls />}
<BottomControls />
</View>
);

View File

@@ -193,8 +193,16 @@ export const VideoPlayer = () => {
]}
onTouchStart={() => setIsIdle(!isIdle)}
/>
{isLoading && <ActivityIndicator size="large" color="#0000ff" />}
{!isLoading && <ControlsOverlay />}
<View className="flex-1 items-center justify-center">
{isLoading && (
<ActivityIndicator
size="large"
color="#0000ff"
className="absolute"
/>
)}
<ControlsOverlay isLoading={isLoading} />
</View>
{showVolumeOverlay && (
<View className="absolute bottom-12 self-center rounded-xl bg-black p-3 opacity-50">
<Text className="font-bold">Volume: {debouncedVolume}</Text>