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

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

Issue 169223003: Fire canplaythrough after play and playing when autoplaying (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: style 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 | « LayoutTests/media/video-capture-preview-expected.txt ('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 c1c66cca9ea6eec7f6c2b117973ca2c2a5a3c457..812c082e7bfd0e379662f98c467887d141ef52a5 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -1607,13 +1607,11 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
}
if (m_readyState == HAVE_ENOUGH_DATA && oldState < HAVE_ENOUGH_DATA && tracksAreReady) {
- if (oldState <= HAVE_CURRENT_DATA)
+ if (oldState <= HAVE_CURRENT_DATA) {
scheduleEvent(EventTypeNames::canplay);
-
- scheduleEvent(EventTypeNames::canplaythrough);
-
- if (isPotentiallyPlaying && oldState <= HAVE_CURRENT_DATA)
- scheduleEvent(EventTypeNames::playing);
+ if (isPotentiallyPlaying)
+ scheduleEvent(EventTypeNames::playing);
+ }
if (m_autoplaying && m_paused && autoplay() && !document().isSandboxed(SandboxAutomaticFeatures) && !userGestureRequiredForPlay()) {
m_paused = false;
@@ -1622,6 +1620,8 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
scheduleEvent(EventTypeNames::playing);
}
+ scheduleEvent(EventTypeNames::canplaythrough);
+
shouldUpdateDisplayState = true;
}
« no previous file with comments | « LayoutTests/media/video-capture-preview-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698