Don't pause WebMs with audio when off screen.
This commit is contained in:
parent
8df52a0b24
commit
a85d5b2335
@ -296,6 +296,9 @@ $.minmax = (value, min, max) ->
|
||||
value
|
||||
)
|
||||
|
||||
$.hasAudio = (video) ->
|
||||
video.mozHasAudio or !!video.webkitAudioDecodedByteCount
|
||||
|
||||
$.item = (key, val) ->
|
||||
item = {}
|
||||
item[key] = val
|
||||
|
||||
@ -76,6 +76,7 @@ ImageExpand =
|
||||
g.posts.forEach (post) ->
|
||||
for post in [post, post.clones...] when post.file and post.file.isVideo and post.file.isExpanded
|
||||
video = post.file.fullImage
|
||||
continue if $.hasAudio video
|
||||
visible = Header.isNodeVisible video
|
||||
if visible and post.file.wasPlaying
|
||||
delete post.file.wasPlaying
|
||||
|
||||
@ -404,7 +404,7 @@ QR =
|
||||
else if duration > QR.max_duration_video
|
||||
QR.error "#{file.name}: Video too long (video: #{duration}s, max: #{QR.max_duration_video}s)"
|
||||
pass = false
|
||||
if g.BOARD.ID not in ['gif', 'wsg'] and (video.mozHasAudio or video.webkitAudioDecodedByteCount)
|
||||
if g.BOARD.ID not in ['gif', 'wsg'] and $.hasAudio video
|
||||
QR.error "#{file.name}: Audio not allowed"
|
||||
pass = false
|
||||
cb pass, video
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user