fix: uploaded video

This commit is contained in:
IlyaDoronin 2023-08-24 14:23:25 +03:00
parent 6ea8bdb1a9
commit cb8e057627
2 changed files with 5 additions and 12 deletions

@ -38,7 +38,6 @@ export default function HelpQuestions({ totalIndex }: HelpQuestionsProps) {
if (fileList?.length) { if (fileList?.length) {
const clonContent = listQuestions[totalIndex].content; const clonContent = listQuestions[totalIndex].content;
clonContent.hint.video = URL.createObjectURL(fileList[0]); clonContent.hint.video = URL.createObjectURL(fileList[0]);
clonContent.hint.videoUrl = "";
updateQuestionsList(totalIndex, { content: clonContent }); updateQuestionsList(totalIndex, { content: clonContent });
handleClose(); handleClose();
} }
@ -103,13 +102,9 @@ export default function HelpQuestions({ totalIndex }: HelpQuestionsProps) {
onClick={handleOpen} onClick={handleOpen}
sx={{ justifyContent: "flex-start" }} sx={{ justifyContent: "flex-start" }}
> >
{listQuestions[totalIndex].content.hint.videoUrl || {listQuestions[totalIndex].content.hint.video ? (
listQuestions[totalIndex].content.hint.video ? (
<video <video
src={ src={listQuestions[totalIndex].content.hint.video}
listQuestions[totalIndex].content.hint.videoUrl ||
listQuestions[totalIndex].content.hint.video
}
width="400" width="400"
controls controls
/> />
@ -181,11 +176,10 @@ export default function HelpQuestions({ totalIndex }: HelpQuestionsProps) {
</Typography> </Typography>
<CustomTextField <CustomTextField
placeholder={"http://example.com"} placeholder={"http://example.com"}
text={listQuestions[totalIndex].content.hint.videoUrl} text={listQuestions[totalIndex].content.hint.video}
onChange={({ target }) => { onChange={({ target }) => {
let clonContent = listQuestions[totalIndex].content; let clonContent = listQuestions[totalIndex].content;
clonContent.hint.videoUrl = target.value; clonContent.hint.video = target.value;
clonContent.hint.video = "";
updateQuestionsList(totalIndex, { content: clonContent }); updateQuestionsList(totalIndex, { content: clonContent });
}} }}
/> />

@ -10,7 +10,6 @@ export type Variants = {
type Hint = { type Hint = {
text: string; text: string;
video: string; video: string;
videoUrl: string;
}; };
export interface Question { export interface Question {
@ -95,12 +94,12 @@ export const createQuestion = (id: number) => {
hint: { hint: {
text: "", text: "",
video: "", video: "",
videoUrl: "",
}, },
large: false, large: false,
multi: false, multi: false,
own: false, own: false,
innerName: "", innerName: "",
// back: "",
}, },
version: 0, version: 0,
parent_ids: [0], parent_ids: [0],