--
This commit is contained in:
parent
9ffde777af
commit
338a5ba681
@ -1,3 +1,5 @@
|
||||
1.0.10 _ 2025-10-05 _ utm
|
||||
1.0.9 _ 2025-10-05 _ utm
|
||||
1.0.8 _ 2025-10-05 _ замена инпут на текстареа
|
||||
1.0.7 _ 2025-10-05 _ замена инпут на текстареа
|
||||
1.0.6 _ 2025-09-19 _ логика включения таймера
|
||||
|
||||
@ -82,9 +82,8 @@ export default function StartPageSettings() {
|
||||
if (!quiz) return;
|
||||
|
||||
console.log("[StartPage] Video upload start", { videoUrl });
|
||||
setBackgroundUploading(true);
|
||||
|
||||
if (videoUrl.startsWith("blob:")) {
|
||||
setBackgroundUploading(true);
|
||||
const videoBlob = await (await fetch(videoUrl)).blob();
|
||||
console.log("[StartPage] Uploading blob to backend", { size: videoBlob.size, type: videoBlob.type });
|
||||
uploadQuizImage(quiz.id, videoBlob, (quiz, url) => {
|
||||
@ -92,6 +91,8 @@ export default function StartPageSettings() {
|
||||
console.log("[StartPage] Backend returned video URL", { url });
|
||||
});
|
||||
} else {
|
||||
// для ссылок скелетон не нужен
|
||||
setBackgroundUploading(false);
|
||||
updateQuiz(quiz.id, (quiz) => {
|
||||
quiz.config.startpage.background.video = videoUrl;
|
||||
});
|
||||
@ -481,6 +482,7 @@ export default function StartPageSettings() {
|
||||
console.log('[StartPage] VideoElement reported loaded');
|
||||
setBackgroundUploading(false);
|
||||
}}
|
||||
showSkeleton={backgroundUploding}
|
||||
onDeleteClick={() => {
|
||||
updateQuiz(quiz.id, (quiz) => {
|
||||
quiz.config.startpage.background.video = null;
|
||||
|
||||
@ -12,6 +12,7 @@ type VideoElementProps = {
|
||||
onDeleteClick: () => void;
|
||||
deleteIconSx?: SxProps<Theme>;
|
||||
onLoaded?: () => void;
|
||||
showSkeleton?: boolean;
|
||||
};
|
||||
|
||||
export const VideoElement: FC<VideoElementProps> = ({
|
||||
@ -21,6 +22,7 @@ export const VideoElement: FC<VideoElementProps> = ({
|
||||
onDeleteClick,
|
||||
deleteIconSx,
|
||||
onLoaded,
|
||||
showSkeleton = true,
|
||||
}) => {
|
||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||
const [isLoaded, setIsLoaded] = useState(false);
|
||||
@ -69,7 +71,7 @@ export const VideoElement: FC<VideoElementProps> = ({
|
||||
return (
|
||||
<Box ref={containerRef} sx={{ position: "relative", width: `${width}px`, minHeight: "168px" }}>
|
||||
<QuizVideo videoUrl={videoSrc} />
|
||||
{!isLoaded && (
|
||||
{!isLoaded && showSkeleton && (
|
||||
<Skeleton
|
||||
sx={{ position: "absolute", inset: 0, width: "100%", height: "100%", borderRadius: "8px", zIndex: 1000, backgroundColor: 'rgba(255,255,255,0.8)' }}
|
||||
variant="rounded"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user