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

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

Issue 214793005: Use HTMLMediaElement::togglePlayState() where appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index f5fb8f9311ddbe67a339b11b7c983bc1d9e04ec9..f4f6f362c3a474fe84b73f85f4935d72818e29b3 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -2181,14 +2181,15 @@ void HTMLMediaElement::scheduleTimeupdateEvent(bool periodicEvent)
}
}
-bool HTMLMediaElement::canPlay() const
+bool HTMLMediaElement::togglePlayStateWillPlay() const
{
- return paused() || ended() || m_readyState < HAVE_METADATA;
+ if (m_mediaController)
+ return m_mediaController->paused() || m_mediaController->isRestrained();
+ return paused();
}
void HTMLMediaElement::togglePlayState()
{
- ASSERT(controls());
// The activation behavior of a media element that is exposing a user interface to the user
if (m_mediaController) {
if (m_mediaController->isRestrained())

Powered by Google App Engine
This is Rietveld 408576698