Bug 1382574 - part3 : remove HTMLMediaElement::mHasUserInteraction. r=jwwang

We won't need to check the whether the media element is interacted with user for
autoplay anymore.

MozReview-Commit-ID: 2tll9LtGyVR
This commit is contained in:
Alastor Wu
2017-11-22 00:33:23 +08:00
parent b001a5a837
commit 7baabd66f1
2 changed files with 0 additions and 20 deletions

View File

@@ -1972,13 +1972,7 @@ void HTMLMediaElement::DoLoad()
return;
}
// Detect if user has interacted with element so that play will not be
// blocked when initiated by a script. This enables sites to capture user
// intent to play by calling load() in the click handler of a "catalog
// view" of a gallery of videos.
if (EventStateManager::IsHandlingUserInput()) {
mHasUserInteraction = true;
// Mark the channel as urgent-start when autopaly so that it will play the
// media from src after loading enough resource.
if (HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay)) {
@@ -2754,12 +2748,6 @@ HTMLMediaElement::Seek(double aTime,
return nullptr;
}
// Detect if user has interacted with element by seeking so that
// play will not be blocked when initiated by a script.
if (EventStateManager::IsHandlingUserInput()) {
mHasUserInteraction = true;
}
StopSuspendingAfterFirstFrame();
if (mSrcStream) {
@@ -4043,7 +4031,6 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
mIsEncrypted(false),
mWaitingForKey(NOT_WAITING_FOR_KEY),
mDisableVideo(false),
mHasUserInteraction(false),
mFirstFrameLoaded(false),
mDefaultPlaybackStartPosition(0.0),
mHasSuspendTaint(false),
@@ -4228,9 +4215,6 @@ HTMLMediaElement::PlayInternal(ErrorResult& aRv)
}
mPendingPlayPromises.AppendElement(promise);
// Play was not blocked so assume user interacted with the element.
mHasUserInteraction = true;
if (mPreloadAction == HTMLMediaElement::PRELOAD_NONE) {
// The media load algorithm will be initiated by a user interaction.
// We want to boost the channel priority for better responsiveness.