file_input_view: Use makeVideoThumbnail on attach of video

This commit is contained in:
Scott Nonnenberg 2018-07-21 12:28:37 -07:00
parent 5933a34a18
commit 573a26021b
2 changed files with 18 additions and 9 deletions

View file

@ -161,8 +161,9 @@
// we use the variable on this here to ensure cleanup if we're interrupted
this.previewObjectUrl = URL.createObjectURL(file);
const type = 'image/png';
const thumbnail = await VisualAttachment.makeVideoScreenshot({
objectUrl: this.previewObjectUrl,
const thumbnail = await VisualAttachment.makeVideoThumbnail({
size: 100,
videoObjectUrl: this.previewObjectUrl,
contentType: type,
logger: window.log,
});
@ -171,7 +172,7 @@
const data = await VisualAttachment.blobToArrayBuffer(thumbnail);
this.previewObjectUrl = Signal.Util.arrayBufferToObjectURL({
data,
type: 'image/png',
type,
});
this.addThumb(this.previewObjectUrl, { addPlayIcon: true });
};