Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2047433003: Update autoplay settings when moving media elements between documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 7beecb9dd4be9a28665ac847fe9e6f45f67b085f..897f538769f9fd7766a109fddb8e0c879802bbc2 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -487,6 +487,13 @@ void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument)
{
DVLOG(MEDIA_LOG_LEVEL) << "didMoveToNewDocument(" << (void*)this << ")";
+ // If any experiment is enabled, then we want to enable a user gesture by
+ // default, otherwise the experiment does nothing.
+ if ((document().settings() && document().settings()->mediaPlaybackRequiresUserGesture())
+ || m_autoplayHelper->isExperimentEnabled()) {
mlamouri (slow - plz ping) 2016/06/07 15:40:28 I think you should do something like: ``` bool old
Zhiqiang Zhang (Slow) 2016/06/07 17:02:40 Done.
+ m_lockedPendingUserGesture = true;
+ }
+
if (m_shouldDelayLoadEvent) {
document().incrementLoadEventDelayCount();
// Note: Keeping the load event delay count increment on oldDocument that was added
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698