Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(video_player): extract to separate file
Elian Doran88d84fae1e94
diff --git a/apps/client/src/widgets/type_widgets/File.tsx b/apps/client/src/widgets/type_widgets/File.tsxindex 0d5b038608..a13d765ed7 100644--- a/apps/client/src/widgets/type_widgets/File.tsx+++ b/apps/client/src/widgets/type_widgets/File.tsx@@ -6,6 +6,7 @@ import { getUrlForDownload } from "../../services/open";import Alert from "../react/Alert";import { useNoteBlob } from "../react/hooks";import PdfPreview from "./file/Pdf";+import VideoPreview from "./file/Video";import { TypeWidgetProps } from "./type_widget";const TEXT_MAX_NUM_CHARS = 5000;@@ -42,17 +43,6 @@ function TextPreview({ content }: { content: string }) {);}-function VideoPreview({ note }: { note: FNote }) {- return (- <video- class="video-preview"- src={getUrlForDownload(`api/notes/${note.noteId}/open-partial`)}- datatype={note?.mime}- controls- />- );-}-function AudioPreview({ note }: { note: FNote }) {return (<audiodiff --git a/apps/client/src/widgets/type_widgets/file/Video.css b/apps/client/src/widgets/type_widgets/file/Video.cssnew file mode 100644index 0000000000..b5c8b44097--- /dev/null+++ b/apps/client/src/widgets/type_widgets/file/Video.css@@ -0,0 +1,3 @@+.note-detail-file > .video-preview {++}diff --git a/apps/client/src/widgets/type_widgets/file/Video.tsx b/apps/client/src/widgets/type_widgets/file/Video.tsxnew file mode 100644index 0000000000..a61779f262--- /dev/null+++ b/apps/client/src/widgets/type_widgets/file/Video.tsx@@ -0,0 +1,15 @@+import "./Video.css";++import FNote from "../../../entities/fnote";+import { getUrlForDownload } from "../../../services/open";++export default function VideoPreview({ note }: { note: FNote }) {+ return (+ <video+ class="video-preview"+ src={getUrlForDownload(`api/notes/${note.noteId}/open-partial`)}+ datatype={note?.mime}+ controls+ />+ );+}