From 3d57efba6cd582021e4ed63fb15f2ffb1ef33606 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 2 Apr 2025 14:41:58 -0400 Subject: [PATCH] Allow mkv video playback if supported and custom toast opacity increased --- domUtils.js | 4 ++-- fileManager.js | 2 +- styles.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/domUtils.js b/domUtils.js index 4925e3a..200b710 100644 --- a/domUtils.js +++ b/domUtils.js @@ -136,11 +136,11 @@ export function buildFileTableRow(file, folderPath) { const safeUploader = escapeHTML(file.uploader || "Unknown"); let previewButton = ""; - if (/\.(jpg|jpeg|png|gif|bmp|webp|svg|ico|tif|tiff|eps|heic|pdf|mp4|webm|mov|mp3|wav|m4a|ogg|flac|aac|wma|opus)$/i.test(file.name)) { + if (/\.(jpg|jpeg|png|gif|bmp|webp|svg|ico|tif|tiff|eps|heic|pdf|mp4|webm|mov|mp3|wav|m4a|ogg|flac|aac|wma|opus|mkv|ogv)$/i.test(file.name)) { let previewIcon = ""; if (/\.(jpg|jpeg|png|gif|bmp|webp|svg|ico|tif|tiff|eps|heic)$/i.test(file.name)) { previewIcon = `image`; - } else if (/\.(mp4|webm|mov)$/i.test(file.name)) { + } else if (/\.(mp4|mkv|webm|mov|ogv)$/i.test(file.name)) { previewIcon = `videocam`; } else if (/\.pdf$/i.test(file.name)) { previewIcon = `picture_as_pdf`; diff --git a/fileManager.js b/fileManager.js index 03f4e9c..385018e 100644 --- a/fileManager.js +++ b/fileManager.js @@ -263,7 +263,7 @@ function previewFile(fileUrl, fileName) { embed.style.height = "80vh"; embed.style.border = "none"; container.appendChild(embed); - } else if (/\.(mp4|webm|mov|ogg)$/i.test(fileName)) { + } else if (/\.(mp4|mkv|webm|mov|ogv)$/i.test(fileName)) { const video = document.createElement("video"); video.src = fileUrl; video.controls = true; diff --git a/styles.css b/styles.css index 6bab5c0..44eef89 100644 --- a/styles.css +++ b/styles.css @@ -1068,7 +1068,7 @@ body.dark-mode .custom-prev-next-btn:hover:not(:disabled) { } #customToast.show { - opacity: 0.7; + opacity: 0.9; } .button-wrap {