mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
feat: show controls while loading
This commit is contained in:
@@ -4,11 +4,11 @@ import { BottomControls } from "./BottomControls";
|
|||||||
import { Header } from "./Header";
|
import { Header } from "./Header";
|
||||||
import { MiddleControls } from "./MiddleControls";
|
import { MiddleControls } from "./MiddleControls";
|
||||||
|
|
||||||
export const ControlsOverlay = () => {
|
export const ControlsOverlay = ({ isLoading }: { isLoading: boolean }) => {
|
||||||
return (
|
return (
|
||||||
<View className="flex w-full flex-1 flex-col justify-between">
|
<View className="flex w-full flex-1 flex-col justify-between">
|
||||||
<Header />
|
<Header />
|
||||||
<MiddleControls />
|
{!isLoading && <MiddleControls />}
|
||||||
<BottomControls />
|
<BottomControls />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
@@ -193,8 +193,16 @@ export const VideoPlayer = () => {
|
|||||||
]}
|
]}
|
||||||
onTouchStart={() => setIsIdle(!isIdle)}
|
onTouchStart={() => setIsIdle(!isIdle)}
|
||||||
/>
|
/>
|
||||||
{isLoading && <ActivityIndicator size="large" color="#0000ff" />}
|
<View className="flex-1 items-center justify-center">
|
||||||
{!isLoading && <ControlsOverlay />}
|
{isLoading && (
|
||||||
|
<ActivityIndicator
|
||||||
|
size="large"
|
||||||
|
color="#0000ff"
|
||||||
|
className="absolute"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<ControlsOverlay isLoading={isLoading} />
|
||||||
|
</View>
|
||||||
{showVolumeOverlay && (
|
{showVolumeOverlay && (
|
||||||
<View className="absolute bottom-12 self-center rounded-xl bg-black p-3 opacity-50">
|
<View className="absolute bottom-12 self-center rounded-xl bg-black p-3 opacity-50">
|
||||||
<Text className="font-bold">Volume: {debouncedVolume}</Text>
|
<Text className="font-bold">Volume: {debouncedVolume}</Text>
|
||||||
|
Reference in New Issue
Block a user