global sound option

This commit is contained in:
ccd0 2014-04-04 15:35:16 -07:00
parent 9ca9360ffd
commit 07d5b9eeb8
5 changed files with 14 additions and 8 deletions

View File

@ -182,7 +182,8 @@
'Fappe Tyme': [false, 'Hide posts without images. *hint* *hint*'],
'Werk Tyme': [false, 'Hide all post images.'],
'Autoplay': [true, 'Videos begin playing immediately when opened inline.'],
'Show Controls': [true, 'Show native seek and volume controls on videos. Contract videos when dragged to the left.']
'Show Controls': [true, 'Show native seek and volume controls on videos. Contract videos when dragged to the left.'],
'Allow Sound': [true, 'Allow sound in inline videos.']
},
'Menu': {
'Menu': [true, 'Add a drop-down menu to posts.'],
@ -7732,7 +7733,7 @@
file = post.file;
video = file.fullImage;
file.videoControls = [];
video.muted = true;
video.muted = !Conf['Allow Sound'];
if (video.controls) {
contract = $.el('a', {
textContent: 'contract',
@ -7907,7 +7908,7 @@
if (isVideo) {
el.loop = true;
el.controls = false;
el.muted = true;
el.muted = !Conf['Allow Sound'];
if (Conf['Autoplay']) {
el.play();
}

View File

@ -158,7 +158,8 @@
'Fappe Tyme': [false, 'Hide posts without images. *hint* *hint*'],
'Werk Tyme': [false, 'Hide all post images.'],
'Autoplay': [true, 'Videos begin playing immediately when opened inline.'],
'Show Controls': [true, 'Show native seek and volume controls on videos. Contract videos when dragged to the left.']
'Show Controls': [true, 'Show native seek and volume controls on videos. Contract videos when dragged to the left.'],
'Allow Sound': [true, 'Allow sound in inline videos.']
},
'Menu': {
'Menu': [true, 'Add a drop-down menu to posts.'],
@ -7751,7 +7752,7 @@
file = post.file;
video = file.fullImage;
file.videoControls = [];
video.muted = true;
video.muted = !Conf['Allow Sound'];
if (video.controls) {
contract = $.el('a', {
textContent: 'contract',
@ -7915,7 +7916,7 @@
if (isVideo) {
el.loop = true;
el.controls = false;
el.muted = true;
el.muted = !Conf['Allow Sound'];
if (Conf['Autoplay']) {
el.play();
}

View File

@ -191,6 +191,10 @@ Config =
true
'Show native seek and volume controls on videos. Contract videos when dragged to the left.'
]
'Allow Sound': [
true
'Allow sound in inline videos.'
]
'Menu':
'Menu': [

View File

@ -144,7 +144,7 @@ ImageExpand =
{file} = post
video = file.fullImage
file.videoControls = []
video.muted = true
video.muted = not Conf['Allow Sound']
if video.controls
# contract link in file info
contract = $.el 'a',

View File

@ -26,7 +26,7 @@ ImageHover =
if isVideo
el.loop = true
el.controls = false
el.muted = true
el.muted = not Conf['Allow Sound']
el.play() if Conf['Autoplay']
naturalHeight = if post.file.isVideo then 'videoHeight' else 'naturalHeight'
UI.hover