style
This commit is contained in:
@@ -1,11 +1,18 @@
|
|||||||
module.exports = captureVideoFrame
|
module.exports = captureVideoFrame
|
||||||
|
|
||||||
function captureVideoFrame (video, format) {
|
function captureVideoFrame (video, format) {
|
||||||
if (typeof video === 'string') video = document.querySelector(video)
|
if (typeof video === 'string') {
|
||||||
if (!video || video.nodeName !== 'VIDEO') {
|
video = document.querySelector(video)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (video == null || video.nodeName !== 'VIDEO') {
|
||||||
throw new Error('First argument must be a <video> element or selector')
|
throw new Error('First argument must be a <video> element or selector')
|
||||||
}
|
}
|
||||||
if (format == null) format = 'png'
|
|
||||||
|
if (format == null) {
|
||||||
|
format = 'png'
|
||||||
|
}
|
||||||
|
|
||||||
if (format !== 'png' && format !== 'jpg' && format !== 'webp') {
|
if (format !== 'png' && format !== 'jpg' && format !== 'webp') {
|
||||||
throw new Error('Second argument must be one of "png", "jpg", or "webp"')
|
throw new Error('Second argument must be one of "png", "jpg", or "webp"')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ function torrentPoster (torrent, cb) {
|
|||||||
.reduce(function (a, b) {
|
.reduce(function (a, b) {
|
||||||
return a.length > b.length ? a : b
|
return a.length > b.length ? a : b
|
||||||
})
|
})
|
||||||
|
|
||||||
var index = torrent.files.indexOf(file)
|
var index = torrent.files.indexOf(file)
|
||||||
|
|
||||||
var server = torrent.createServer(0)
|
var server = torrent.createServer(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user