support audio check in Chromium
This commit is contained in:
parent
a8dd2ea56a
commit
bba7262184
@ -402,7 +402,7 @@ QR =
|
|||||||
img.src = URL.createObjectURL file
|
img.src = URL.createObjectURL file
|
||||||
else if /^video\//.test file.type
|
else if /^video\//.test file.type
|
||||||
video = $.el 'video'
|
video = $.el 'video'
|
||||||
$.on video, 'loadedmetadata', ->
|
$.on video, 'loadeddata', ->
|
||||||
return unless cb
|
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)
|
||||||
@ -420,11 +420,9 @@ QR =
|
|||||||
else if duration > QR.max_duration_video
|
else if duration > QR.max_duration_video
|
||||||
QR.error "#{file.name}: Video too long (video: #{duration}s, max: #{QR.max_duration_video}s)"
|
QR.error "#{file.name}: Video too long (video: #{duration}s, max: #{QR.max_duration_video}s)"
|
||||||
pass = false
|
pass = false
|
||||||
<% if (type === 'userscript') { %>
|
if video.mozHasAudio or video.webkitAudioDecodedByteCount
|
||||||
if video.mozHasAudio
|
|
||||||
QR.error "#{file.name}: Audio not allowed"
|
QR.error "#{file.name}: Audio not allowed"
|
||||||
pass = false
|
pass = false
|
||||||
<% } %>
|
|
||||||
cb pass, video
|
cb pass, video
|
||||||
cb = null
|
cb = null
|
||||||
$.on video, 'error', ->
|
$.on video, 'error', ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user