From 136e05795443e72dabcee047acaef892f7b9b80e Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Thu, 4 Apr 2024 14:38:18 +0100 Subject: [PATCH] feat: support embed of generic links --- .../Lesson/Materials/Video/EmbedLink.svelte | 80 +++++++++++++++++++ .../Lesson/Materials/Video/Index.svelte | 3 + .../Lesson/Materials/Video/constants.js | 9 ++- .../components/ComponentVideo.svelte | 11 +++ .../components/Lesson/Materials/index.svelte | 24 ++++-- .../lessons/[...lessonParams]/+page.svelte | 11 ++- 6 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 apps/dashboard/src/lib/components/Course/components/Lesson/Materials/Video/EmbedLink.svelte diff --git a/apps/dashboard/src/lib/components/Course/components/Lesson/Materials/Video/EmbedLink.svelte b/apps/dashboard/src/lib/components/Course/components/Lesson/Materials/Video/EmbedLink.svelte new file mode 100644 index 00000000..b9d5ecbb --- /dev/null +++ b/apps/dashboard/src/lib/components/Course/components/Lesson/Materials/Video/EmbedLink.svelte @@ -0,0 +1,80 @@ + + +
+ ($isLessonDirty = true)} + placeholder="https://www.videoplayer.com/" + errorMessage={error} + /> + +
+

+ Videos added: + {$lesson?.materials?.videos.filter((v) => v.type === 'generic').length || 0} + +

+
+ {#each $lesson?.materials?.videos as video, index} + {#if video.type === 'generic'} +
+ + {video.link} + + + removeVideo(index)}> + + +
+ {/if} + {/each} +
diff --git a/apps/dashboard/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte b/apps/dashboard/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte index c1c718c2..ffbf5477 100644 --- a/apps/dashboard/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte +++ b/apps/dashboard/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte @@ -1,6 +1,7 @@