From 94af047527c7f646332d472bf64dfc75f6935c4f Mon Sep 17 00:00:00 2001 From: Andy Burke Date: Wed, 8 Oct 2025 18:42:38 -0700 Subject: [PATCH] feature: some more media embeds --- public/index.html | 2 ++ public/js/embeds/mkv.js | 13 +++++++++++++ public/js/embeds/mov.js | 13 +++++++++++++ public/js/htmlify.js | 2 ++ 4 files changed, 30 insertions(+) create mode 100644 public/js/embeds/mkv.js create mode 100644 public/js/embeds/mov.js diff --git a/public/index.html b/public/index.html index a55c9f2..a5b5ed7 100644 --- a/public/index.html +++ b/public/index.html @@ -18,6 +18,8 @@ + + diff --git a/public/js/embeds/mkv.js b/public/js/embeds/mkv.js new file mode 100644 index 0000000..7a18d05 --- /dev/null +++ b/public/js/embeds/mkv.js @@ -0,0 +1,13 @@ +function embed_mkv(link_info) { + if (typeof link_info.extension !== "string") { + return; + } + + const is_mkv = link_info.extension?.toLowerCase().indexOf("mkv") === 1; + + if (!is_mkv) { + return; + } + + return `
`; +} diff --git a/public/js/embeds/mov.js b/public/js/embeds/mov.js new file mode 100644 index 0000000..59e1dc7 --- /dev/null +++ b/public/js/embeds/mov.js @@ -0,0 +1,13 @@ +function embed_mov(link_info) { + if (typeof link_info.extension !== "string") { + return; + } + + const is_mov = get_mime_types(link_info.extension).includes("video/quicktime"); + + if (!is_mov) { + return; + } + + return `
`; +} diff --git a/public/js/htmlify.js b/public/js/htmlify.js index c42b713..231846e 100644 --- a/public/js/htmlify.js +++ b/public/js/htmlify.js @@ -8,6 +8,8 @@ const EMBEDS = [ embed_vimeo, embed_audio, embed_gif, + embed_mkv, + embed_mov, embed_mp4, embed_image, embed_link,