safer version of workaround

This commit is contained in:
ccd0 2014-07-27 16:57:52 -07:00
parent feb2f1efb6
commit b4b35c1ef3

View File

@ -49,6 +49,7 @@ ImageCommon =
handler = ->
$.off video, 'mouseover', handler
# Hacky workaround for Firefox forever-loading bug for very short videos
$.asap (-> (video.readyState >= 3 and video.currentTime <= Math.max 0.1, (video.duration - 0.5)) or !d.contains video), ->
t = new Date().getTime()
$.asap (-> chrome? or (video.readyState >= 3 and video.currentTime <= Math.max 0.1, (video.duration - 0.5)) or new Date().getTime() >= t + 1000), ->
video.controls = true
$.on video, 'mouseover', handler