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

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

Issue 621573002: Expose a seekable range at 0 for streaming sources with duration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@io
Patch Set: 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') | media/blink/webmediaplayer_impl.cc » ('J')
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 32f81d15cd5a7221a8bb2de54c6e054d64d4fd4a..a914e7ffc6dc334e666e07a79ba08b8fb57247be 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"
@@ -525,11 +526,12 @@ blink::WebTimeRanges WebMediaPlayerAndroid::seekable() const {
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))
philipj_slow 2014/10/01 09:37:50 With this change I believe you can remove the read
DaleCurtis 2014/10/06 23:55:42 Done.
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);
}
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | media/blink/webmediaplayer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698