Placeholder while loading mediatag and broken images for 404

This commit is contained in:
yflory 2019-10-15 18:03:07 +02:00
parent 8db0fcf8bd
commit d5a3581469

View file

@ -435,9 +435,14 @@
return mediaObject;
}
mediaObject.tag.innerHTML = '<img style="width: 100px; height: 100px;">';
// Download the encrypted blob
download(src, function (err, u8Encrypted) {
if (err) {
if (err === "XHR_ERROR 404") {
mediaObject.tag.innerHTML = '<img style="width: 100px; height: 100px;" src="/images/broken.png">';
}
return void emit('error', err);
}
// Decrypt the blob