Use capture-frame package

See: https://github.com/feross/capture-frame
Capture video screenshot from a `<video>` tag (at the current time)

Changes from our version:

- Added tests in Chrome/Firefox browsers.
- Use built-in TypeError (which is meant for bad arguments) instead of
custom IllegalArgumentError.
This commit is contained in:
Feross Aboukhadijeh
2016-09-16 10:14:39 -07:00
parent fa67f9b82b
commit bcd6a38a05
4 changed files with 4 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
module.exports = torrentPoster
const captureVideoFrame = require('./capture-video-frame')
const captureFrame = require('capture-frame')
const path = require('path')
function torrentPoster (torrent, cb) {
@@ -61,7 +61,7 @@ function torrentPosterFromVideo (file, torrent, cb) {
function onSeeked () {
video.removeEventListener('seeked', onSeeked)
const buf = captureVideoFrame(video)
const buf = captureFrame(video)
// unload video element
video.pause()