From 6093ef131a742281c5c209991a0f128584ed3d96 Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Mon, 22 May 2023 20:07:45 +0200 Subject: [PATCH] Added videos in Markdawn --- src/components/Markdown/Markdawn.tsx | 12 ++++++++++++ src/components/Player.tsx | 14 +++++++++++--- src/pages/dev/editor.tsx | 21 +++++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/components/Markdown/Markdawn.tsx b/src/components/Markdown/Markdawn.tsx index db81f3f..43dba8e 100644 --- a/src/components/Markdown/Markdawn.tsx +++ b/src/components/Markdown/Markdawn.tsx @@ -17,6 +17,8 @@ import { atoms } from "contexts/atoms"; import { useAtomGetter } from "helpers/atoms"; import { Link } from "components/Inputs/Link"; import { useFormat } from "hooks/useFormat"; +import { VideoPlayer } from "components/Player"; +import { getVideoFile } from "helpers/videos"; /* * ╭─────────────╮ @@ -144,6 +146,16 @@ export const Markdawn = ({ className, text: rawText }: MarkdawnProps): JSX.Eleme }, }, + Video: { + component: (comProps) => ( + + ), + }, + InsetBox: { component: (compProps) => {compProps.children}, }, diff --git a/src/components/Player.tsx b/src/components/Player.tsx index 6fc6a7e..31828c2 100644 --- a/src/components/Player.tsx +++ b/src/components/Player.tsx @@ -251,14 +251,18 @@ const PlayerControls = ({ />
{isDefinedAndNotEmpty(title) && ( -

{title}

+

{title}

)}
-

+

{prettyDuration(currentTime)}

{!isContentPanelAtLeastXl && type === "video" &&

/

} -

+

{prettyDuration(duration)}

diff --git a/src/pages/dev/editor.tsx b/src/pages/dev/editor.tsx index 9b423e2..ea8298b 100644 --- a/src/pages/dev/editor.tsx +++ b/src/pages/dev/editor.tsx @@ -444,6 +444,27 @@ const Editor = (props: Props): JSX.Element => {
+ + }> +