Test HAVE_METADATA in ImageExpand

HAVE_CURRENT_DATA can revert to HAVE_METADATA, in which case
loadeddata will not be fired when video reaches HAVE_CURRENT_DATA
again.
This commit is contained in:
ccd0 2014-08-06 21:14:04 -07:00
parent 6abf7d48b3
commit 924fab8400

View File

@ -174,10 +174,10 @@ ImageExpand =
if !isVideo
$.asap (-> el.naturalHeight), -> ImageExpand.completeExpand post
else if el.readyState >= el.HAVE_CURRENT_DATA
else if el.readyState >= el.HAVE_METADATA
ImageExpand.completeExpand post
else
$.on el, 'loadeddata', -> ImageExpand.completeExpand post
$.on el, 'loadedmetadata', -> ImageExpand.completeExpand post
completeExpand: (post) ->
{file} = post