Bug 566779 - Don't move media to readyState HAVE_ENOUGH_DATA when resource loaded, if metadata not loaded yet r=roc

This commit is contained in:
Chris Pearce 2011-05-09 09:10:44 +12:00
parent 61d1102801
commit e0a6c862fb

View File

@ -1974,7 +1974,9 @@ void nsHTMLMediaElement::ResourceLoaded()
mBegun = PR_FALSE;
mNetworkState = nsIDOMHTMLMediaElement::NETWORK_IDLE;
AddRemoveSelfReference();
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA);
if (mReadyState >= nsIDOMHTMLMediaElement::HAVE_METADATA) {
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA);
}
// Ensure a progress event is dispatched at the end of download.
DispatchAsyncEvent(NS_LITERAL_STRING("progress"));
// The download has stopped.