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
|
value
|
||||||
)
|
)
|
||||||
|
|
||||||
|
$.hasAudio = (video) ->
|
||||||
|
video.mozHasAudio or !!video.webkitAudioDecodedByteCount
|
||||||
|
|
||||||
$.item = (key, val) ->
|
$.item = (key, val) ->
|
||||||
item = {}
|
item = {}
|
||||||
item[key] = val
|
item[key] = val
|
||||||
|
|||||||
@ -76,6 +76,7 @@ ImageExpand =
|
|||||||
g.posts.forEach (post) ->
|
g.posts.forEach (post) ->
|
||||||
for post in [post, post.clones...] when post.file and post.file.isVideo and post.file.isExpanded
|
for post in [post, post.clones...] when post.file and post.file.isVideo and post.file.isExpanded
|
||||||
video = post.file.fullImage
|
video = post.file.fullImage
|
||||||
|
continue if $.hasAudio video
|
||||||
visible = Header.isNodeVisible video
|
visible = Header.isNodeVisible video
|
||||||
if visible and post.file.wasPlaying
|
if visible and post.file.wasPlaying
|
||||||
delete post.file.wasPlaying
|
delete post.file.wasPlaying
|
||||||
|
|||||||
@ -404,7 +404,7 @@ 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 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"
|
QR.error "#{file.name}: Audio not allowed"
|
||||||
pass = false
|
pass = false
|
||||||
cb pass, video
|
cb pass, video
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user