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 0c8910d9e738ec9fa50a26c75c2440c3955c53ff..af0c5d72cb749837860a7817202cc50e965cd935 100644 |
--- a/content/renderer/media/android/webmediaplayer_android.cc |
+++ b/content/renderer/media/android/webmediaplayer_android.cc |
@@ -11,6 +11,7 @@ |
#include "base/callback_helpers.h" |
#include "base/command_line.h" |
#include "base/files/file_path.h" |
+#include "base/float_util.h" |
#include "base/logging.h" |
#include "base/metrics/histogram.h" |
#include "base/single_thread_task_runner.h" |
@@ -520,16 +521,12 @@ blink::WebTimeRanges WebMediaPlayerAndroid::buffered() const { |
} |
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 blink::WebTimeRanges(); |
- |
- // If we have a duration then use [0, duration] as the seekable range. |
+ // Media without duration are considered streaming and should not be seekable. |
const double seekable_end = duration(); |
- if (!seekable_end) |
+ if (!base::IsFinite(seekable_end)) |
return blink::WebTimeRanges(); |
+ // If we have a finite duration then use [0, duration] as the seekable range. |
blink::WebTimeRange seekable_range(0.0, seekable_end); |
return blink::WebTimeRanges(&seekable_range, 1); |
} |