WebMs with sound sighted on /wsg/!

This commit is contained in:
ccd0 2015-01-30 21:56:42 -08:00
parent 525ad213dc
commit 43454eae88
5 changed files with 8 additions and 0 deletions

View File

@ -244,6 +244,10 @@ Config =
true
'Show controls on videos expanded inline.'
]
'Allow Sound': [
true
'Allow sound in videos.'
]
'Loop in New Tab': [
true
'Loop videos opened in their own tabs.'

View File

@ -147,6 +147,7 @@ Gallery =
$.replace nodes.current, file
if elType is 'video'
file.loop = true
file.muted = !Conf['Allow Sound']
file.play() if Conf['Autoplay']
ImageCommon.addControls file if Conf['Show Controls']
nodes.count.textContent = +thumb.dataset.id + 1

View File

@ -172,6 +172,7 @@ ImageExpand =
thumb.parentNode.removeAttribute 'target'
el.loop = true
el.muted = !Conf['Allow Sound']
if !isVideo
$.asap (-> el.naturalHeight), -> ImageExpand.completeExpand post

View File

@ -38,6 +38,7 @@ ImageHover =
if isVideo
el.loop = true
el.controls = false
el.muted = !Conf['Allow Sound']
el.play() if Conf['Autoplay']
[width, height] = file.dimensions.split('x').map (x) -> +x
{left, right} = @getBoundingClientRect()

View File

@ -46,6 +46,7 @@ ImageLoader =
video = $.el 'video',
preload: 'none'
loop: true
muted: true
poster: thumb.src
textContent: thumb.alt
className: thumb.className