Bug 1588138 - reset blessed state when media aborting current load. r=bryce

This patch is used to change the blessed state for media element under `click-to-play` blocking autoplay policy, which only allows play invocation called from user input handler, eg. `onclick`.

When media aborts current load, we should regard it as a new media. One example is on Youtube they always reuse same media element but replace its url for different video. Therefore, we should reset media's blessed state so that the media with new url can be blocked again.

Differential Revision: https://phabricator.services.mozilla.com/D57192
This commit is contained in:
Alastor Wu
2019-12-18 04:11:12 +00:00
parent fd6b1faa37
commit df0ca96677
2 changed files with 3 additions and 1 deletions

View File

@@ -2178,6 +2178,7 @@ void HTMLMediaElement::AbortExistingLoads() {
mPendingEncryptedInitData.Reset();
mWaitingForKey = NOT_WAITING_FOR_KEY;
mSourcePointer = nullptr;
mIsBlessed = false;
mTags = nullptr;
mAudioTrackSilenceStartedTime = 0.0;