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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 533543004: WebMediaPlayerImpl should notify ended event Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 35e898e9bac8dba0ea903ec4571ad4eec8ade2cc..86a9a6b39177e20101b8d88ec54de30f1fdd207e 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -752,14 +752,15 @@ void WebMediaPlayerAndroid::OnMediaMetadataChanged(
}
void WebMediaPlayerAndroid::OnPlaybackComplete() {
- // When playback is about to finish, android media player often stops
- // at a time which is smaller than the duration. This makes webkit never
- // know that the playback has finished. To solve this, we set the
- // current time to media duration when OnPlaybackComplete() get called.
interpolator_.SetBounds(duration_, duration_);
- client_->timeChanged();
+ // If the duration in the metadata is not correct, then actual duration should
+ // be updated in blink.
+ if (duration() != currentTime())
+ OnDurationChanged(base::FromSecondsD(currentTime()));
+
+ client_->mediaEnded();
- // if the loop attribute is set, timeChanged() will update the current time
+ // If the 'loop' attribute is set, mediaEnded() will update the current time
// to 0. It will perform a seek to 0. As the requests to the renderer
// process are sequential, the OnSeekComplete() will only occur
// once OnPlaybackComplete() is done. As the playback can only be executed
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698