diff --git a/js/interface_common.js b/js/interface_common.js index d6dfe32..1039600 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -978,6 +978,11 @@ function startTorrentDownloadAndPreview(torrentId, previewContainer, isMedia) { } function webtorrentFilePreview(file, previewContainer, isMedia) { + if (!isMedia) { + // try guessing by filename extension + isMedia = /^[^?]+\.(?:jpe?g|gif|png|mp4|webm|mp3|ogg|wav|)$/i.test(file.name) + } + if (isMedia) { var imagePreview = $('
'); previewContainer.append(imagePreview);