diff --git a/src/models/attachmentManager.ts b/src/models/attachmentManager.ts index ca427a0..dcd8658 100644 --- a/src/models/attachmentManager.ts +++ b/src/models/attachmentManager.ts @@ -150,6 +150,7 @@ export class AttachmentManager { canvas.width = 640; canvas.height = 480; let video: HTMLVideoElement = document.createElement("video"); + video.preload = "auto"; video.addEventListener("loadedmetadata", function () { if (video.videoWidth > THUMBNAIL_MAX_WIDTH || video.videoHeight > THUMBNAIL_MAX_HEIGHT) { var aspect = video.videoWidth / video.videoHeight; @@ -183,6 +184,7 @@ export class AttachmentManager { }); video.src = url; video.currentTime = 0.1; + video.load(); } catch (error) { console.error("Failed to get video thumbnail: " + error); resolve(undefined);