Bug 784932 - Allow HTMLMediaElement.buffered to be read when readyState > HAVE_NOTHING instead of > HAVE_METADATA. r=roc

This commit is contained in:
Chris Pearce 2012-08-27 20:30:29 +12:00
parent 0bb2ab1660
commit e0a0b091c1

View File

@ -3429,7 +3429,7 @@ nsHTMLMediaElement::CopyInnerTo(nsGenericElement* aDest)
nsresult nsHTMLMediaElement::GetBuffered(nsIDOMTimeRanges** aBuffered) nsresult nsHTMLMediaElement::GetBuffered(nsIDOMTimeRanges** aBuffered)
{ {
nsRefPtr<nsTimeRanges> ranges = new nsTimeRanges(); nsRefPtr<nsTimeRanges> ranges = new nsTimeRanges();
if (mReadyState >= nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA && mDecoder) { if (mReadyState > nsIDOMHTMLMediaElement::HAVE_NOTHING && mDecoder) {
// If GetBuffered fails we ignore the error result and just return the // If GetBuffered fails we ignore the error result and just return the
// time ranges we found up till the error. // time ranges we found up till the error.
mDecoder->GetBuffered(ranges); mDecoder->GetBuffered(ranges);