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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 if (type.isNull() || type.isEmpty()) 236 if (type.isNull() || type.isEmpty())
237 return false; 237 return false;
238 238
239 ContentType contentType(type); 239 ContentType contentType(type);
240 String codecs = contentType.parameter("codecs"); 240 String codecs = contentType.parameter("codecs");
241 241
242 // 2. If type does not contain a valid MIME type string, then return false. 242 // 2. If type does not contain a valid MIME type string, then return false.
243 if (contentType.type().isEmpty()) 243 if (contentType.type().isEmpty())
244 return false; 244 return false;
245 245
246 // Note: MediaSource.isTypeSupported() returning true implies that HTMLMedia Element.canPlayType() will return "maybe" or "probably"
247 // since it does not make sense for a MediaSource to support a type the HTML MediaElement knows it cannot play.
248 if (HTMLMediaElement::supportsType(contentType, String()) == WebMimeRegistry ::IsNotSupported)
249 return false;
250
246 // 3. If type contains a media type or media subtype that the MediaSource do es not support, then return false. 251 // 3. If type contains a media type or media subtype that the MediaSource do es not support, then return false.
247 // 4. If type contains at a codec that the MediaSource does not support, the n return false. 252 // 4. If type contains at a codec that the MediaSource does not support, the n return false.
248 // 5. If the MediaSource does not support the specified combination of media type, media subtype, and codecs then return false. 253 // 5. If the MediaSource does not support the specified combination of media type, media subtype, and codecs then return false.
249 // 6. Return true. 254 // 6. Return true.
250 return MIMETypeRegistry::isSupportedMediaSourceMIMEType(contentType.type(), codecs); 255 return MIMETypeRegistry::isSupportedMediaSourceMIMEType(contentType.type(), codecs);
251 } 256 }
252 257
253 const AtomicString& MediaSource::interfaceName() const 258 const AtomicString& MediaSource::interfaceName() const
254 { 259 {
255 return EventTargetNames::MediaSource; 260 return EventTargetNames::MediaSource;
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 564
560 m_asyncEventQueue->enqueueEvent(event.release()); 565 m_asyncEventQueue->enqueueEvent(event.release());
561 } 566 }
562 567
563 URLRegistry& MediaSource::registry() const 568 URLRegistry& MediaSource::registry() const
564 { 569 {
565 return MediaSourceRegistry::registry(); 570 return MediaSourceRegistry::registry();
566 } 571 }
567 572
568 } // namespace blink 573 } // namespace blink
OLDNEW
« 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