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

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

Issue 478403002: Fix HLS playback on Galaxy S4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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') | no next file » | 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 930ea6d6a92026e47f37e4265f49f647885ba1cd..3ffd8203c2cc71982b9819a3f895b432b9a66c3b 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -279,8 +279,11 @@ void WebMediaPlayerAndroid::DidLoadMediaInfo(
void WebMediaPlayerAndroid::play() {
DCHECK(main_thread_checker_.CalledOnValidThread());
+
+ // For HLS streams, some devices cannot detect the video size unless a surface
+ // texture is bind to it. See http://crbug.com/400145.
#if defined(VIDEO_HOLE)
- if (hasVideo() && needs_external_surface_ &&
+ if ((hasVideo() || IsHLSStream()) && needs_external_surface_ &&
!player_manager_->IsInFullscreen(frame_)) {
DCHECK(!needs_establish_peer_);
player_manager_->RequestExternalSurface(player_id_, last_computed_rect_);
@@ -290,7 +293,7 @@ void WebMediaPlayerAndroid::play() {
TryCreateStreamTextureProxyIfNeeded();
// There is no need to establish the surface texture peer for fullscreen
// video.
- if (hasVideo() && needs_establish_peer_ &&
+ if ((hasVideo() || IsHLSStream()) && needs_establish_peer_ &&
!player_manager_->IsInFullscreen(frame_)) {
EstablishSurfaceTexturePeer();
}
@@ -1727,4 +1730,11 @@ bool WebMediaPlayerAndroid::canEnterFullscreen() const {
return player_manager_->CanEnterFullscreen(frame_);
}
+bool WebMediaPlayerAndroid::IsHLSStream() const {
+ std::string mime;
+ if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime))
+ return false;
+ return !mime.compare("application/x-mpegurl");
miroslav 2015/01/13 18:47:17 How about vnd.apple.mpegURL?
+}
+
} // namespace content
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698