video case needs an error handler
This commit is contained in:
parent
ec76588f86
commit
56bcb65206
@ -403,6 +403,7 @@ QR =
|
|||||||
else if /^video\//.test file.type
|
else if /^video\//.test file.type
|
||||||
video = $.el 'video'
|
video = $.el 'video'
|
||||||
$.on video, 'loadedmetadata', =>
|
$.on video, 'loadedmetadata', =>
|
||||||
|
return unless cb?
|
||||||
{videoHeight, videoWidth, duration} = video
|
{videoHeight, videoWidth, duration} = video
|
||||||
max_height = Math.min(QR.max_height, QR.max_height_video)
|
max_height = Math.min(QR.max_height, QR.max_height_video)
|
||||||
max_width = Math.min(QR.max_width, QR.max_width_video)
|
max_width = Math.min(QR.max_width, QR.max_width_video)
|
||||||
@ -420,6 +421,12 @@ QR =
|
|||||||
cb false
|
cb false
|
||||||
else
|
else
|
||||||
cb true
|
cb true
|
||||||
|
cb = null
|
||||||
|
$.on video, 'error', =>
|
||||||
|
return unless cb?
|
||||||
|
QR.error "#{file.name}: Video appears corrupt"
|
||||||
|
cb false
|
||||||
|
cb = null
|
||||||
video.src = URL.createObjectURL file
|
video.src = URL.createObjectURL file
|
||||||
else
|
else
|
||||||
cb true
|
cb true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user