Chromium Code Reviews| 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..654bd5978ceb830defe973b3be33d652676ccf90 100644 |
| --- a/content/renderer/media/android/webmediaplayer_android.cc |
| +++ b/content/renderer/media/android/webmediaplayer_android.cc |
| @@ -520,13 +520,21 @@ WebTimeRanges WebMediaPlayerAndroid::buffered() const { |
| 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. |
| +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 WebTimeRanges(); |
| - return duration(); |
| + // If we have a duration then use [0, duration] as the seekable range. |
| + const double duration = this->duration(); |
|
DaleCurtis
2014/09/29 16:52:43
Avoid this-> with current_duration or something? I
philipj_slow
2014/09/29 19:51:46
I don't like this style either, I was just going w
philipj_slow
2014/09/30 08:09:28
seekable_end it is.
|
| + if (!duration) |
| + return WebTimeRanges(); |
| + |
| + WebTimeRanges ranges(static_cast<size_t>(1)); |
|
DaleCurtis
2014/09/29 16:52:43
Does 1 hit a compiler error somewhere? 1u should w
philipj_slow
2014/09/29 19:51:46
Yes, it's ambiguous because WebVector has so many
philipj_slow
2014/09/30 08:09:28
I went with the WebVector(const U* values, size_t
|
| + ranges[0].start = 0.0; |
| + ranges[0].end = duration; |
| + return ranges; |
| } |
| bool WebMediaPlayerAndroid::didLoadingProgress() { |