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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user