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

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

Issue 2440563004: Switch to using an explicit ended signal instead of time comparison. (Closed)
Patch Set: Fix ended event in ARI. Created 4 years, 2 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: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 617bad3cd641e9a7bf1e4b5b9079f621ea4ba1c1..4ee85e57deba6dc29abc9ccd4c621223a50bd43c 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -2979,7 +2979,7 @@ void HTMLMediaElement::sourceWasRemoved(HTMLSourceElement* source) {
}
}
-void HTMLMediaElement::timeChanged() {
+void HTMLMediaElement::timeChanged(bool ended) {
BLINK_MEDIA_LOG << "timeChanged(" << (void*)this << ")";
cueTimeline().updateActiveCues(currentTime());
@@ -2997,14 +2997,7 @@ void HTMLMediaElement::timeChanged() {
// already posted one at the current movie time.
scheduleTimeupdateEvent(false);
- double now = currentTime();
- double dur = duration();
-
- // When the current playback position reaches the end of the media resource
- // when the direction of playback is forwards, then the user agent must follow
- // these steps:
- if (!std::isnan(dur) && dur && now >= dur &&
- getDirectionOfPlayback() == Forward) {
+ if (ended) {
// If the media element has a loop attribute specified
if (loop()) {
// then seek to the earliest possible position of the media resource and
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | third_party/WebKit/public/platform/WebMediaPlayerClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698