eliminate Video.configure

This commit is contained in:
ccd0 2014-07-26 11:57:56 -07:00
parent a995d5ecb1
commit 43b12523d4
3 changed files with 8 additions and 11 deletions

View File

@ -158,7 +158,10 @@ Gallery =
$.extend file.dataset, @dataset
nodes.current.pause?()
$.replace nodes.current, file
Video.configure file if elType is 'video'
if elType is 'video'
file.loop = true
file.controls = Conf['Show Controls']
Video.start file if Conf['Autoplay']
nodes.count.textContent = +@dataset.id + 1
nodes.current = file
nodes.frame.scrollTop = 0

View File

@ -153,7 +153,10 @@ ImageExpand =
post.file.isExpanded = true
if post.file.isVideo
ImageExpand.setupVideoControls post
Video.configure post.file.fullImage, disableAutoplay
video = post.file.fullImage
video.loop = true
video.controls = Conf['Show Controls']
Video.start video if Conf['Autoplay'] and not disableAutoplay
videoCB: do ->
# dragging to the left contracts the video

View File

@ -1,13 +1,4 @@
Video =
configure: (video, disableAutoplay) ->
video.loop = true
video.controls = Conf['Show Controls']
video.autoplay = false
if Conf['Autoplay'] and not disableAutoplay
Video.start video
else
video.pause()
start: (video) ->
return unless video.paused
{controls} = video