| 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..1732ef0d392d596be7f2cd39f1a4c23920f710b7 100644
|
| --- a/content/renderer/media/android/webmediaplayer_android.cc
|
| +++ b/content/renderer/media/android/webmediaplayer_android.cc
|
| @@ -166,6 +166,26 @@ 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);
|
| +}
|
| +
|
| WebMediaPlayerAndroid::WebMediaPlayerAndroid(
|
| blink::WebFrame* frame,
|
| blink::WebMediaPlayerClient* client,
|
| @@ -1928,26 +1948,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);
|
|
|