pg
/
sbot
1
0
Fork 0

fix: webcam no longer throws if no frames are recorded

Dieser Commit ist enthalten in:
Paul Frazee 2015-09-29 12:50:01 -05:00
Ursprung b5c5600b93
Commit aa864e01d0
1 geänderte Dateien mit 13 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -241,17 +241,23 @@ module.exports = function (rootMsg, branchMsg, opts) {
// stop capture
clearInterval(recordInterval)
// show output stream
invideo.classList.add('hide')
outvideo.classList.remove('hide')
// remove 'recording' border
invideo.classList.remove('recording')
// produce output
blob = encoder.compile()
console.log('Webm video encoded:', blob.size, 'bytes')
outvideo.src = URL.createObjectURL(blob, 'video/webm')
if (encoder.frames && encoder.frames.length) {
blob = encoder.compile()
console.log('Webm video encoded:', blob.size, 'bytes')
outvideo.src = URL.createObjectURL(blob, 'video/webm')
// show output stream
invideo.classList.add('hide')
outvideo.classList.remove('hide')
} else {
// show input stream
invideo.classList.remove('hide')
outvideo.classList.add('hide')
}
enable()
}