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