Bug 1744398 - Media element load algorithm must fire 'emptied' before 'timeupdate' r=alwu

Differential Revision: https://phabricator.services.mozilla.com/D142628
This commit is contained in:
ashley
2022-04-01 18:26:05 +00:00
parent 4861e95f8f
commit 2458bfed11

View File

@@ -2300,6 +2300,9 @@ void HTMLMediaElement::AbortExistingLoads() {
if (mNetworkState != NETWORK_EMPTY) {
NS_ASSERTION(!mDecoder && !mSrcStream,
"How did someone setup a new stream/decoder already?");
DispatchAsyncEvent(u"emptied"_ns);
// ChangeNetworkState() will call UpdateAudioChannelPlayingState()
// indirectly which depends on mPaused. So we need to update mPaused first.
if (!mPaused) {
@@ -2324,7 +2327,6 @@ void HTMLMediaElement::AbortExistingLoads() {
// change will be reflected in the controls.
FireTimeUpdate(TimeupdateType::eMandatory);
}
DispatchAsyncEvent(u"emptied"_ns);
UpdateAudioChannelPlayingState();
}