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

Unified Diff: Source/modules/mediasource/MediaSource.cpp

Issue 456313003: Check HTMLMediaElement::supportsType() in MediaSource.isTypeSupported() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediasource/MediaSource.cpp
diff --git a/Source/modules/mediasource/MediaSource.cpp b/Source/modules/mediasource/MediaSource.cpp
index 76149dfd479b9a12edfab2930f2f2bc10d616e89..613c82e169b82b31b4ce181174b398d4f97e5b06 100644
--- a/Source/modules/mediasource/MediaSource.cpp
+++ b/Source/modules/mediasource/MediaSource.cpp
@@ -243,6 +243,11 @@ bool MediaSource::isTypeSupported(const String& type)
if (contentType.type().isEmpty())
return false;
+ // Note: MediaSource.isTypeSupported() returning true implies that HTMLMediaElement.canPlayType() will return "maybe" or "probably"
+ // since it does not make sense for a MediaSource to support a type the HTMLMediaElement knows it cannot play.
+ if (HTMLMediaElement::supportsType(contentType, String()) == WebMimeRegistry::IsNotSupported)
+ return false;
+
// 3. If type contains a media type or media subtype that the MediaSource does not support, then return false.
// 4. If type contains at a codec that the MediaSource does not support, then return false.
// 5. If the MediaSource does not support the specified combination of media type, media subtype, and codecs then return false.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698