Index: media/blink/webmediaplayer_impl.cc |
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc |
index c79ee7a93bb96921407ab543f142d1138eb36843..b28482b5eeac95b06da9386d30e307ad372d46c4 100644 |
--- a/media/blink/webmediaplayer_impl.cc |
+++ b/media/blink/webmediaplayer_impl.cc |
@@ -484,18 +484,27 @@ blink::WebTimeRanges WebMediaPlayerImpl::buffered() const { |
return ConvertToWebTimeRanges(buffered_time_ranges); |
} |
-double WebMediaPlayerImpl::maxTimeSeekable() const { |
+blink::WebTimeRanges WebMediaPlayerImpl::seekable() const { |
DCHECK(main_task_runner_->BelongsToCurrentThread()); |
- // If we haven't even gotten to ReadyStateHaveMetadata yet then just |
- // return 0 so that the seekable range is empty. |
+ // 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(); |
// We don't support seeking in streaming media. |
if (data_source_ && data_source_->IsStreaming()) |
- return 0.0; |
- return duration(); |
+ return blink::WebTimeRanges(); |
+ |
+ // If we have a duration then use [0, duration] as the seekable range. |
+ const double duration = this->duration(); |
+ if (!duration) |
+ return blink::WebTimeRanges(); |
+ |
+ blink::WebTimeRanges ranges(static_cast<size_t>(1)); |
+ ranges[0].start = 0.0; |
+ ranges[0].end = duration; |
+ return ranges; |
} |
bool WebMediaPlayerImpl::didLoadingProgress() { |