handle uppercase extensions
This commit is contained in:
parent
fb62fbccf7
commit
dfc51bd5d0
@ -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 videoExtensions =['mpg', 'mp2', 'mpeg', 'mpe', 'mpv', 'mp4'];
|
||||||
const audioExtensions =['mp3', 'ogg', 'wav', 'flac'];
|
const audioExtensions =['mp3', 'ogg', 'wav', 'flac'];
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ let currentFile = "";
|
|||||||
let currentFileIdx = null;
|
let currentFileIdx = null;
|
||||||
|
|
||||||
function createMediaFileElement(file, autoplay=false) {
|
function createMediaFileElement(file, autoplay=false) {
|
||||||
const fileExt = file.split('.').pop();
|
const fileExt = file.split('.').pop().toLowerCase();
|
||||||
if (imageExtensions.includes(fileExt)) { // if image
|
if (imageExtensions.includes(fileExt)) { // if image
|
||||||
let img = document.createElement("img");
|
let img = document.createElement("img");
|
||||||
img.setAttribute('src', stagingPath + file)
|
img.setAttribute('src', stagingPath + file)
|
||||||
|
Loading…
Reference in New Issue
Block a user