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

Side by Side Diff: android_webview/renderer/aw_content_renderer_client.cc

Issue 1824143004: Allow WebView to force MediaPlayer for unsupported containers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't concat strings. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « android_webview/renderer/aw_content_renderer_client.h ('k') | android_webview/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/renderer/aw_content_renderer_client.h" 5 #include "android_webview/renderer/aw_content_renderer_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "android_webview/common/aw_resource.h" 9 #include "android_webview/common/aw_resource.h"
10 #include "android_webview/common/aw_switches.h" 10 #include "android_webview/common/aw_switches.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) { 222 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) {
223 return visited_link_slave_->IsVisited(link_hash); 223 return visited_link_slave_->IsVisited(link_hash);
224 } 224 }
225 225
226 void AwContentRendererClient::AddKeySystems( 226 void AwContentRendererClient::AddKeySystems(
227 std::vector<media::KeySystemInfo>* key_systems) { 227 std::vector<media::KeySystemInfo>* key_systems) {
228 AwAddKeySystems(key_systems); 228 AwAddKeySystems(key_systems);
229 } 229 }
230 230
231 bool AwContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) {
232 // Android WebView needs to support codecs that Chrome does not, for these
233 // cases we must force the usage of Android MediaPlayer instead of Chrome's
234 // internal player.
235 //
236 // Note: Despite these extensions being forwarded for playback to MediaPlayer,
237 // HTMLMediaElement.canPlayType() will return empty for these containers.
238 // TODO(boliu): If this is important, extend media::MimeUtil for WebView.
239 //
240 // Format list mirrors:
241 // http://developer.android.com/guide/appendix/media-formats.html
242 static const char* kMediaPlayerExtensions[] = {
243 ".3gp", ".ts", ".flac", ".mid", ".xmf",
244 ".mxmf", ".rtttl", ".rtx", ".ota", ".imy"};
245 for (const auto& extension : kMediaPlayerExtensions) {
246 if (base::EndsWith(url.path(), extension,
247 base::CompareCase::INSENSITIVE_ASCII)) {
248 return true;
249 }
250 }
251 return false;
252 }
253
231 bool AwContentRendererClient::ShouldOverridePageVisibilityState( 254 bool AwContentRendererClient::ShouldOverridePageVisibilityState(
232 const content::RenderFrame* render_frame, 255 const content::RenderFrame* render_frame,
233 blink::WebPageVisibilityState* override_state) { 256 blink::WebPageVisibilityState* override_state) {
234 if (disable_page_visibility_) { 257 if (disable_page_visibility_) {
235 *override_state = blink::WebPageVisibilityStateVisible; 258 *override_state = blink::WebPageVisibilityStateVisible;
236 return true; 259 return true;
237 } 260 }
238 261
239 return false; 262 return false;
240 } 263 }
241 264
242 } // namespace android_webview 265 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/renderer/aw_content_renderer_client.h ('k') | android_webview/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698