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

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

Issue 1560953002: Implement fallback from WMPI to WMPA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/render_frame_impl.cc » ('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 4a1f4f74fde973229147c86413149cdc6101554c..ac32303f190ec440e130268f5720fe308450157b 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -166,6 +166,27 @@ class SyncTokenClientImpl : public media::VideoFrame::SyncTokenClient {
namespace content {
+// static
+bool WebMediaPlayerAndroid::IsHLSPath(const GURL& url) {
+ if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
+ return false;
+
+ std::string path = url.path();
+ return base::EndsWith(path, ".m3u8", base::CompareCase::INSENSITIVE_ASCII);
+}
+
+// static
+bool WebMediaPlayerAndroid::IsHLSURL(const GURL& url) {
+ if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
+ return false;
+
+ std::string spec = url.spec();
+ if (base::EndsWith(spec, ".m3u8", base::CompareCase::INSENSITIVE_ASCII))
+ return true;
+ return (spec.find("m3u8") != std::string::npos);
+}
+
+
watk 2016/01/06 20:06:47 extra newline or subtle style rule?
WebMediaPlayerAndroid::WebMediaPlayerAndroid(
blink::WebFrame* frame,
blink::WebMediaPlayerClient* client,
@@ -1928,26 +1949,6 @@ void WebMediaPlayerAndroid::enterFullscreen() {
suppress_deleting_texture_ = false;
}
-// Test whether the path of a URL ends with '.m3u8'.
-static bool IsHLSPath(const GURL& url) {
- if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
- return false;
-
- std::string path = url.path();
- return base::EndsWith(path, ".m3u8", base::CompareCase::INSENSITIVE_ASCII);
-}
-
-// Predict whether NuPlayer will use HTTPLiveSource.
-static bool IsHLSURL(const GURL& url) {
- if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
- return false;
-
- std::string spec = url.spec();
- if (base::EndsWith(spec, ".m3u8", base::CompareCase::INSENSITIVE_ASCII))
- return true;
- return (spec.find("m3u8") != std::string::npos);
-}
-
bool WebMediaPlayerAndroid::IsHLSStream() const {
const GURL& url = redirected_url_.is_empty() ? url_ : redirected_url_;
return IsHLSURL(url);
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698