π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Add video file preview
Dedmen Miller396064df4f0f
diff --git a/frontend/app/helpers/resources.ts b/frontend/app/helpers/resources.tsindex b2855578..ac5b97db 100644--- a/frontend/app/helpers/resources.ts+++ b/frontend/app/helpers/resources.ts@@ -16,6 +16,10 @@ const readableFileSize = (bytes: number): string => {/** Check if a filetype MIME string represents an image */const isImageFile = (filetype: string): boolean => filetype.startsWith('image/');+/** Check if a filetype MIME string represents a video */+const isImageFile = (filetype: string): boolean => filetype.startsWith('video/');++/** Check if a filetype MIME string represents a PDF */const isPdfFile = (filetype: string): boolean => filetype.startsWith('application/pdf');diff --git a/frontend/app/pages/dashboard/cdn/[id]/preview.vue b/frontend/app/pages/dashboard/cdn/[id]/preview.vueindex 4927bcff..b2ea9843 100644--- a/frontend/app/pages/dashboard/cdn/[id]/preview.vue+++ b/frontend/app/pages/dashboard/cdn/[id]/preview.vue@@ -12,6 +12,7 @@<div class="preview"><img v-if="isImageFile(mimeType)" :src="resourceURL(resource)" alt="Preview" /><LazyPDFViewer v-else-if="isPdfFile(mimeType)" :src="resourceURL(resource)" :zoom="zoom" />+ <video v-else-if="isVideoFile(mimeType)" :src="resourceURL(resource)" controls /><div v-else class="no-preview"><p>Preview not available for this file type.</p><p>