mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 18:26:15 +00:00
Bug 1391666 - P2. Reset mWaitingForKey when we have data and autoplay attribute is set r=cpearce
By default, a media element that has never played is in paused mode. As such, we need to reset mWaitingForKey to NOT_WAITING_FOR_KEY otherwise, readyState will never become HAVE_ENOUGH_DATA. MozReview-Commit-ID: EIi3Crt4zHl --HG-- extra : rebase_source : e9f9ad4136020db7db081b5c125f664e1c7bda20
This commit is contained in:
parent
aefd5c8c8a
commit
34fd923c04
@ -5919,11 +5919,15 @@ void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
|
||||
mReadyState >= nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA) {
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("canplay"));
|
||||
if (!mPaused) {
|
||||
mWaitingForKey = NOT_WAITING_FOR_KEY;
|
||||
NotifyAboutPlaying();
|
||||
}
|
||||
}
|
||||
|
||||
if (mReadyState >= nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA &&
|
||||
(!mPaused || mAutoplaying)) {
|
||||
mWaitingForKey = NOT_WAITING_FOR_KEY;
|
||||
}
|
||||
|
||||
CheckAutoplayDataReady();
|
||||
|
||||
if (oldState < nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA &&
|
||||
|
Loading…
Reference in New Issue
Block a user