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

Unified Diff: Source/core/html/shadow/MediaControls.cpp

Issue 214793005: Use HTMLMediaElement::togglePlayState() where appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: documentation 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
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.cpp ('k') | Source/core/rendering/RenderMediaControls.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/MediaControls.cpp
diff --git a/Source/core/html/shadow/MediaControls.cpp b/Source/core/html/shadow/MediaControls.cpp
index 17efb600f9bd20ab826198f3ad3c1282c1341d4f..62c39de593ed5a9fea483c3ba6959f86471e6899 100644
--- a/Source/core/html/shadow/MediaControls.cpp
+++ b/Source/core/html/shadow/MediaControls.cpp
@@ -273,9 +273,9 @@ void MediaControls::updatePlayState()
void MediaControls::beginScrubbing()
{
- if (!mediaControllerInterface().paused()) {
+ if (!mediaElement().togglePlayStateWillPlay()) {
m_isPausedForScrubbing = true;
- mediaControllerInterface().pause();
+ mediaElement().togglePlayState();
}
}
@@ -283,8 +283,8 @@ void MediaControls::endScrubbing()
{
if (m_isPausedForScrubbing) {
m_isPausedForScrubbing = false;
- if (mediaControllerInterface().paused())
- mediaControllerInterface().play();
+ if (mediaElement().togglePlayStateWillPlay())
+ mediaElement().togglePlayState();
}
}
@@ -360,7 +360,7 @@ void MediaControls::defaultEventHandler(Event* event)
if (event->type() == EventTypeNames::mouseover) {
if (!containsRelatedTarget(event)) {
m_isMouseOverControls = true;
- if (!mediaControllerInterface().canPlay()) {
+ if (!mediaElement().togglePlayStateWillPlay()) {
makeOpaque();
if (shouldHideFullscreenControls())
startHideFullscreenControlsTimer();
@@ -391,7 +391,7 @@ void MediaControls::defaultEventHandler(Event* event)
void MediaControls::hideFullscreenControlsTimerFired(Timer<MediaControls>*)
{
- if (mediaControllerInterface().paused())
+ if (mediaElement().togglePlayStateWillPlay())
return;
if (!m_isFullscreen)
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.cpp ('k') | Source/core/rendering/RenderMediaControls.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698