refactor: improve UI and fix videoplayer bugs

This commit is contained in:
--remove-section committed 2025-12-20 15:00:41 +05:30
1 parent 3000146e66
commit 6576bfe5f3
12 files changed
+523 -174

No files matched your search

@@ -0,0 +1,53 @@
import { Button, Typography } from "@mui/material";
import React from "react";
interface ErrorDisplayProps {
error: any;
onRetry?: () => void;
onExit?: () => void;
}
const ErrorDisplay = ({ error, onRetry, onExit }: ErrorDisplayProps) => {
if (!error) return null;
return (
<div
style={{
position: "absolute",
top: 0,
left: 0,
width: "100%",
height: "100%",
backgroundColor: "rgba(0, 0, 0, 0.8)",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
zIndex: 100,
color: "white",
gap: "1rem",
}}
>
<Typography variant="h5" color="error">
Playback Error
</Typography>
<Typography variant="body1">
{error.message || "An unknown error occurred during playback."}
</Typography>
<div style={{ display: "flex", gap: "1rem" }}>
{onRetry && (
<Button variant="contained" color="primary" onClick={onRetry}>
Retry
</Button>
)}
{onExit && (
<Button variant="outlined" color="secondary" onClick={onExit}>
Exit
</Button>
)}
</div>
</div>
);
};
export default ErrorDisplay;