Bug 758481 - When seeking in an unbuffered range after having ended a media, networkState is NETWORK_IDLE r=chris.double

--HG--
extra : rebase_source : e62887187ed20ad6e832bd0211c50392759bb321
This commit is contained in:
Chris Double 2012-05-31 14:30:23 +12:00
parent 55454a183d
commit 0e0ad7b069
3 changed files with 9 additions and 3 deletions

View File

@ -153,7 +153,11 @@ public:
// Called by the media stream, on the main thread, when the download
// has been resumed by the cache or because the element itself
// asked the decoder to resumed the download.
void DownloadResumed();
// If aForceNetworkLoading is True, ignore the fact that the download has
// previously finished. We are downloading the middle of the media after
// having downloaded the end, we need to notify the element a download in
// ongoing.
void DownloadResumed(bool aForceNetworkLoading = false);
// Called by the media decoder to indicate that the download has stalled
// (no data has arrived for a while).

View File

@ -2779,9 +2779,9 @@ void nsHTMLMediaElement::DownloadSuspended()
}
}
void nsHTMLMediaElement::DownloadResumed()
void nsHTMLMediaElement::DownloadResumed(bool aForceNetworkLoading)
{
if (mBegun) {
if (mBegun || aForceNetworkLoading) {
mNetworkState = nsIDOMHTMLMediaElement::NETWORK_LOADING;
AddRemoveSelfReference();
}

View File

@ -451,6 +451,8 @@ nsresult ChannelMediaResource::OpenChannel(nsIStreamListener** aStreamListener)
nsresult rv = mChannel->AsyncOpen(listener, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
// Tell the media element that we are fetching data from a channel.
element->DownloadResumed(true);
}
return NS_OK;