client/upload: preview video time that will be used for final thumbnail
This commit is contained in:
parent
4220ae708d
commit
436a693be1
1 changed files with 8 additions and 0 deletions
|
@ -401,6 +401,14 @@ class PostUploadView extends events.EventTarget {
|
||||||
.addEventListener("click", (e) =>
|
.addEventListener("click", (e) =>
|
||||||
this._evtMoveClick(e, uploadable, 1)
|
this._evtMoveClick(e, uploadable, 1)
|
||||||
);
|
);
|
||||||
|
if (uploadable.type == "video") {
|
||||||
|
const video = rowNode.querySelector("video");
|
||||||
|
if (video) {
|
||||||
|
video.addEventListener("loadedmetadata", (e) => {
|
||||||
|
if (!isNaN(video.duration)) video.currentTime = Math.floor(video.duration * 0.3)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateThumbnailNode(uploadable) {
|
_updateThumbnailNode(uploadable) {
|
||||||
|
|
Reference in a new issue