handle uppercase extensions

This commit is contained in:
matth@ultra 2024-09-02 14:32:06 +02:00
parent fb62fbccf7
commit dfc51bd5d0

View File

@ -1,4 +1,4 @@
const imageExtensions = ['gif','jpg','jpeg','png', 'webp', 'svg', 'pdf'];
const imageExtensions = ['gif','jpg','jpeg','png', 'webp', 'svg', 'ico', 'bmp'];
const videoExtensions =['mpg', 'mp2', 'mpeg', 'mpe', 'mpv', 'mp4'];
const audioExtensions =['mp3', 'ogg', 'wav', 'flac'];
@ -113,7 +113,7 @@ let currentFile = "";
let currentFileIdx = null;
function createMediaFileElement(file, autoplay=false) {
const fileExt = file.split('.').pop();
const fileExt = file.split('.').pop().toLowerCase();
if (imageExtensions.includes(fileExt)) { // if image
let img = document.createElement("img");
img.setAttribute('src', stagingPath + file)