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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1824143004: Allow WebView to force MediaPlayer for unsupported containers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test. Created 4 years, 9 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 | « android_webview/test/shell/assets/video.3gp ('k') | media/base/media_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 1218cb618dfc6964dd450fd4c2f544e594c7c667..0d976608a6e68c0e6c543cc91ff1555f4d01ccd6 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -26,6 +26,7 @@
#include "base/process/process.h"
#include "base/stl_util.h"
#include "base/strings/string16.h"
+#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
@@ -768,6 +769,22 @@ bool UseWebMediaPlayerImpl(const GURL& url) {
return false;
}
+ // Android WebView may allow codecs and containers that Chrome does not.
ncarter (slow) 2016/03/28 22:30:03 A command line switch seems like an awkward way to
ncarter (slow) 2016/03/28 22:50:07 Also, I checked with Charlie, who thinks it's a go
ddorwin 2016/03/28 22:50:51 See, for example ShouldUseVideoOverlayForEmbeddedE
DaleCurtis 2016/03/29 00:28:19 Done. Thanks for the suggestion, it's much cleaner
+ const std::string media_player_extension_csv =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kUseMediaPlayerForExtensions);
+ if (!media_player_extension_csv.empty()) {
+ std::vector<std::string> media_player_extensions =
+ base::SplitString(media_player_extension_csv, ",",
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
+ for (const auto& extension : media_player_extensions) {
+ if (base::EndsWith(url.path(), extension,
+ base::CompareCase::INSENSITIVE_ASCII)) {
+ return false;
+ }
+ }
+ }
+
// Otherwise enable WMPI if indicated via experiment or command line.
return media::IsUnifiedMediaPipelineEnabled();
}
« no previous file with comments | « android_webview/test/shell/assets/video.3gp ('k') | media/base/media_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698