forgot to add this file
This commit is contained in:
parent
9d65a93c83
commit
43ff113fe9
21
src/Images/Video.coffee
Normal file
21
src/Images/Video.coffee
Normal file
@ -0,0 +1,21 @@
|
||||
Video =
|
||||
configure: (video, disableAutoplay) ->
|
||||
video.loop = true
|
||||
video.muted = !Conf['Allow Sound']
|
||||
video.controls = Conf['Show Controls']
|
||||
video.autoplay = false
|
||||
if Conf['Autoplay'] and not disableAutoplay
|
||||
Video.start video
|
||||
else
|
||||
video.pause()
|
||||
|
||||
start: (video) ->
|
||||
{controls} = video
|
||||
video.controls = false
|
||||
video.play()
|
||||
# Hacky workaround for Firefox forever-loading bug for very short videos
|
||||
if controls
|
||||
$.asap (-> (video.readyState >= 3 and video.currentTime <= Math.max 0.1, (video.duration - 0.5)) or !d.contains video), ->
|
||||
video.controls = true
|
||||
, 500
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user