Bug 1303970: P2. Fix "If the media data fetching process is aborted by the user steps". r=jwwang

MozReview-Commit-ID: 6n91VY00gAo
This commit is contained in:
Jean-Yves Avenard
2016-09-20 19:52:06 +10:00
parent 976b820536
commit 1466fb42de

View File

@@ -4477,7 +4477,15 @@ void HTMLMediaElement::Error(uint16_t aErrorCode,
mError = new MediaError(this, aErrorCode, aErrorDetails);
DispatchAsyncEvent(NS_LITERAL_STRING("error"));
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_IDLE);
if (mReadyState == HAVE_NOTHING && aErrorCode == MEDIA_ERR_ABORTED) {
// https://html.spec.whatwg.org/multipage/embedded-content.html#media-data-processing-steps-list
// "If the media data fetching process is aborted by the user"
DispatchAsyncEvent(NS_LITERAL_STRING("abort"));
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY);
DispatchAsyncEvent(NS_LITERAL_STRING("emptied"));
} else {
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_IDLE);
}
ChangeDelayLoadStatus(false);
UpdateAudioChannelPlayingState();
}