Capture preview image from a video file. Useful when dealing with videos uploaded by the user.
HTML
<script src="poster.js"></script>
Javascript
poster(file).then(function(blob) {
var image = new Image()
image.src = URL.createObjectURL(blob)
document.body.appendChild(image)
})
Tested with latest Chrome, Firefox, Opera and Edge.
Create a video preview image from the given video file.
-
file
- video of typeFile
orBlob
. -
returns a Promise with the image data as
Blob
See License