|
|
|
@ -978,6 +978,11 @@ function startTorrentDownloadAndPreview(torrentId, previewContainer, isMedia) {
@@ -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 = $('<div class="image-preview" />'); |
|
|
|
|
previewContainer.append(imagePreview); |
|
|
|
|