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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user