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

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

Issue 17391015: Add support for clicking to play/pause <video> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/page/Settings.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 530c97c2c91858b93f3b6e76648aaf43813b7a56..e0f53c735d7921f20f546b27f3f73c744dbaed7e 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -3491,6 +3491,19 @@ bool HTMLMediaElement::hasPendingActivity() const
return (hasAudio() && isPlaying()) || m_asyncEventQueue->hasPendingEvents();
}
+void HTMLMediaElement::defaultEventHandler(Event* event)
+{
+ if (isVideo() && event->type() == eventNames().clickEvent && document()->settings()
+ && document()->settings()->clickToPlayPauseVideo()) {
+ if (paused())
+ play();
+ else
+ pause();
+ return;
+ }
+ HTMLElement::defaultEventHandler(event);
+}
+
bool HTMLMediaElement::isFullscreen() const
{
return FullscreenController::isActiveFullScreenElement(this);
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/page/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698