use events for video load detection
This commit is contained in:
parent
cf2f7d3a2f
commit
86d37f6aef
@ -153,6 +153,7 @@ ImageExpand =
|
|||||||
TrashQueue.remove el
|
TrashQueue.remove el
|
||||||
else
|
else
|
||||||
el.src = src or file.URL
|
el.src = src or file.URL
|
||||||
|
el.load() if isVideo
|
||||||
$.after thumb, el
|
$.after thumb, el
|
||||||
file.fullImage = el
|
file.fullImage = el
|
||||||
|
|
||||||
@ -169,8 +170,12 @@ ImageExpand =
|
|||||||
el.loop = true
|
el.loop = true
|
||||||
ImageExpand.setupVideoCB post
|
ImageExpand.setupVideoCB post
|
||||||
|
|
||||||
$.asap (-> if isVideo then el.readyState >= el.HAVE_CURRENT_DATA else el.naturalHeight), ->
|
if !isVideo
|
||||||
|
$.asap (-> el.naturalHeight), -> ImageExpand.completeExpand post
|
||||||
|
else if el.readyState >= el.HAVE_CURRENT_DATA
|
||||||
ImageExpand.completeExpand post
|
ImageExpand.completeExpand post
|
||||||
|
else
|
||||||
|
$.on el, 'loadeddata', -> ImageExpand.completeExpand post
|
||||||
|
|
||||||
completeExpand: (post) ->
|
completeExpand: (post) ->
|
||||||
{file} = post
|
{file} = post
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user