mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Bug 589626 - Force canplaythrough to fire when the download has been suspended. r=roc a=blocking
This commit is contained in:
parent
8e86ed32b7
commit
6a2fdb1c3a
@ -2087,6 +2087,18 @@ void nsHTMLMediaElement::UpdateReadyStateForData(NextFrameStatus aNextFrame)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mDecoder->GetCurrentStream()->IsSuspendedByCache() &&
|
||||||
|
!mDecoder->IsEnded())
|
||||||
|
{
|
||||||
|
// The download has been suspended by the media cache, and we've not
|
||||||
|
// completed playback of the resource, so go into HAVE_ENOUGH_DATA state.
|
||||||
|
// This ensures we always fire canplaythrough and other play events,
|
||||||
|
// particularly when we suspend the download before the download rate
|
||||||
|
// has been reliably established.
|
||||||
|
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Now see if we should set HAVE_ENOUGH_DATA.
|
// Now see if we should set HAVE_ENOUGH_DATA.
|
||||||
// If it's something we don't know the size of, then we can't
|
// If it's something we don't know the size of, then we can't
|
||||||
// make a real estimate, so we go straight to HAVE_ENOUGH_DATA once
|
// make a real estimate, so we go straight to HAVE_ENOUGH_DATA once
|
||||||
|
@ -556,6 +556,7 @@ void nsBuiltinDecoder::NotifySuspendedStatusChanged()
|
|||||||
// now so we consume data and hopefully free up cache space
|
// now so we consume data and hopefully free up cache space
|
||||||
mElement->NotifyAutoplayDataReady();
|
mElement->NotifyAutoplayDataReady();
|
||||||
}
|
}
|
||||||
|
UpdateReadyStateForData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsBuiltinDecoder::NotifyBytesDownloaded()
|
void nsBuiltinDecoder::NotifyBytesDownloaded()
|
||||||
|
@ -17,7 +17,7 @@ var manager = new MediaTestManager;
|
|||||||
|
|
||||||
function startTest(test, token) {
|
function startTest(test, token) {
|
||||||
if (!tmpAudio.canPlayType(test.type))
|
if (!tmpAudio.canPlayType(test.type))
|
||||||
continue;
|
return;
|
||||||
manager.started(token);
|
manager.started(token);
|
||||||
var a1 = new Audio(test.name);
|
var a1 = new Audio(test.name);
|
||||||
is(a1.getAttribute("preload"), "auto", "Preload automatically set to auto");
|
is(a1.getAttribute("preload"), "auto", "Preload automatically set to auto");
|
||||||
|
@ -49,6 +49,7 @@ SimpleTest.waitForExplicitFinish();
|
|||||||
<video id='v'
|
<video id='v'
|
||||||
src='seek.ogv'
|
src='seek.ogv'
|
||||||
onloadedmetadata='return startTest();'
|
onloadedmetadata='return startTest();'
|
||||||
|
onerror='event.stopPropagation();'
|
||||||
onseeking='return startSeek();'
|
onseeking='return startSeek();'
|
||||||
ontimeupdate='return timeUpdated();'></video>
|
ontimeupdate='return timeUpdated();'></video>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user