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

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

Issue 599103003: Switch from WebMediaPlayer::maxTimeSeekable() to seekable() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile on android 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 | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('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 155eea86d912b4783858385ae90d1a8b95bb0d3f..32f81d15cd5a7221a8bb2de54c6e054d64d4fd4a 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -64,7 +64,6 @@ static const int kSDKVersionToSupportSecurityOriginCheck = 20;
using blink::WebMediaPlayer;
using blink::WebSize;
using blink::WebString;
-using blink::WebTimeRanges;
using blink::WebURL;
using gpu::gles2::GLES2Interface;
using media::MediaPlayerAndroid;
@@ -514,19 +513,25 @@ WebMediaPlayer::ReadyState WebMediaPlayerAndroid::readyState() const {
return ready_state_;
}
-WebTimeRanges WebMediaPlayerAndroid::buffered() const {
+blink::WebTimeRanges WebMediaPlayerAndroid::buffered() const {
if (media_source_delegate_)
return media_source_delegate_->Buffered();
return buffered_;
}
-double WebMediaPlayerAndroid::maxTimeSeekable() const {
- // If we haven't even gotten to ReadyStateHaveMetadata yet then just
- // return 0 so that the seekable range is empty.
+blink::WebTimeRanges WebMediaPlayerAndroid::seekable() const {
+ // If we haven't even gotten to ReadyStateHaveMetadata yet then there
+ // are no seekable ranges.
if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata)
- return 0.0;
+ return blink::WebTimeRanges();
- return duration();
+ // If we have a duration then use [0, duration] as the seekable range.
+ const double seekable_end = duration();
+ if (!seekable_end)
+ return blink::WebTimeRanges();
+
+ blink::WebTimeRange seekable_range(0.0, seekable_end);
+ return blink::WebTimeRanges(&seekable_range, 1);
}
bool WebMediaPlayerAndroid::didLoadingProgress() {
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698