Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/herrmannplatz/poster-image
- Owner: herrmannplatz
- License: mit
- Created: 2017-01-06T22:07:02.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-22T19:31:26.000Z (about 6 years ago)
- Last Synced: 2024-04-25T07:42:17.222Z (7 months ago)
- Topics: canvas, html5-video, javascript
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)