https://github.com/mengdu/poster
浏览器端video视频截图,视频封面获取
https://github.com/mengdu/poster
poster screenshot video-screenshot
Last synced: 6 months ago
JSON representation
浏览器端video视频截图,视频封面获取
- Host: GitHub
- URL: https://github.com/mengdu/poster
- Owner: mengdu
- Created: 2016-06-28T04:13:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-13T10:16:53.000Z (almost 6 years ago)
- Last Synced: 2025-04-10T13:34:54.919Z (6 months ago)
- Topics: poster, screenshot, video-screenshot
- Language: JavaScript
- Homepage: https://mengdu.github.io/poster/
- Size: 3.06 MB
- Stars: 45
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
## Poster
这是一个前端 Video 视频播放截图工具。
通过 canvas 实现从video标签截取当前播放画面。
## use
```html
```
+ **window.$poster.videoScreenshot(video, time, size, cb(err, blob))** 视频截图,不支持跨域;time 为指定视频进度,默认为0
- video HTMLVideoElement 标签
- time 0|number|[number] 定截图视频播放位置,秒;0 表示截取当前
- size [w, h] 指定输出尺寸,默认输出原尺寸;可选
- cb 回调函数,返回 (err, {orgSize, size, at, blob})+ **window.$poster.getMetadata(url, cb(err, data))** 获取视频数据元
## 兼容性
你的浏览器需要支持`HTML5`