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

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

Issue 130813006: Remove the user gesture restriction for HTMLMediaElement::pause() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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') | no next file » | 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 26b56712e76816125abb730049760ef845cab203..27582a4472f0a3fb9c1148a5b579b22293ac332f 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -317,7 +317,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
if (document.settings()) {
if (document.settings()->mediaPlaybackRequiresUserGesture()) {
- addBehaviorRestriction(RequireUserGestureForRateChangeRestriction);
+ addBehaviorRestriction(RequireUserGestureForPlayRestriction);
addBehaviorRestriction(RequireUserGestureForLoadRestriction);
}
if (document.settings()->mediaFullscreenRequiresUserGesture()) {
@@ -875,7 +875,7 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType, c
if (url.protocolIs(mediaSourceBlobProtocol)) {
if (isMediaStreamURL(url.string())) {
loadType = blink::WebMediaPlayer::LoadTypeMediaStream;
- removeBehaviorRestriction(RequireUserGestureForRateChangeRestriction);
+ removeBehaviorRestriction(RequireUserGestureForPlayRestriction);
} else {
m_mediaSource = HTMLMediaSource::lookup(url.string());
@@ -1630,7 +1630,7 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
if (isPotentiallyPlaying && oldState <= HAVE_CURRENT_DATA)
scheduleEvent(EventTypeNames::playing);
- if (m_autoplaying && m_paused && autoplay() && !document().isSandboxed(SandboxAutomaticFeatures) && !userGestureRequiredForRateChange()) {
+ if (m_autoplaying && m_paused && autoplay() && !document().isSandboxed(SandboxAutomaticFeatures) && !userGestureRequiredForPlay()) {
m_paused = false;
invalidateCachedTime();
scheduleEvent(EventTypeNames::play);
@@ -2148,7 +2148,7 @@ void HTMLMediaElement::play()
{
WTF_LOG(Media, "HTMLMediaElement::play()");
- if (userGestureRequiredForRateChange() && !UserGestureIndicator::processingUserGesture())
+ if (userGestureRequiredForPlay() && !UserGestureIndicator::processingUserGesture())
return;
if (UserGestureIndicator::processingUserGesture())
removeBehaviorsRestrictionsAfterFirstUserGesture();
@@ -2190,18 +2190,6 @@ void HTMLMediaElement::pause()
{
WTF_LOG(Media, "HTMLMediaElement::pause()");
- if (userGestureRequiredForRateChange() && !UserGestureIndicator::processingUserGesture())
- return;
-
- pauseInternal();
-}
-
-
-void HTMLMediaElement::pauseInternal()
-{
- WTF_LOG(Media, "HTMLMediaElement::pauseInternal");
-
- // 4.8.10.9. Playing the media resource
philipj_slow 2014/02/10 12:57:40 I removed this comment because it's out-of-date an
if (!m_player || m_networkState == NETWORK_EMPTY)
scheduleDelayedAction(LoadMediaResource);
@@ -2443,7 +2431,7 @@ void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*)
m_fragmentEndTime = MediaPlayer::invalidTime();
if (!m_mediaController && !m_paused) {
// changes paused to true and fires a simple event named pause at the media element.
- pauseInternal();
+ pause();
}
}
@@ -3129,7 +3117,7 @@ void HTMLMediaElement::mediaPlayerPlaybackStateChanged()
return;
if (m_player->paused())
- pauseInternal();
+ pause();
else
playInternal();
}
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698