Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/herrmannplatz/poster-image

Capture preview image from a video file
https://github.com/herrmannplatz/poster-image

canvas html5-video javascript

Last synced: 4 days ago
JSON representation

Capture preview image from a video file

Awesome Lists containing this project

README

        

# poster-image

Capture preview image from a video file. Useful when dealing with videos uploaded by the user.

## usage

HTML
```html

```

Javascript
```js
poster(file).then(function(blob) {
var image = new Image()
image.src = URL.createObjectURL(blob)
document.body.appendChild(image)
})
```

## browser support

Tested with latest Chrome, Firefox, Opera and Edge.

## api

### `poster(file)`

Create a video preview image from the given video file.

* `file` - video of type `File` or `Blob`.

* returns a Promise with the image data as `Blob`

## license

See [License](LICENSE)