Title: [175131] trunk
Revision
175131
Author
[email protected]
Date
2014-10-23 11:28:56 -0700 (Thu, 23 Oct 2014)

Log Message

[Mac] Safari cannot play 'audio/amr' content.
https://bugs.webkit.org/show_bug.cgi?id=137894

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-can-play-case-insensitive.html

Sites are returning 'video/amr' for AMR audio content, but the IANA spec says 'audio/AMR', which is also what
AVFoundation claims to support.  However, MIME types are supposed to be case-insensitive. When creating our
mime type cache, case-fold to lower all MIME types given to us by our media frameworks.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::mimeTypeCache):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::addFileTypesToCache):

LayoutTests:

* media/media-can-play-case-insensitive-expected.txt: Added.
* media/media-can-play-case-insensitive.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (175130 => 175131)


--- trunk/LayoutTests/ChangeLog	2014-10-23 18:01:53 UTC (rev 175130)
+++ trunk/LayoutTests/ChangeLog	2014-10-23 18:28:56 UTC (rev 175131)
@@ -1,3 +1,13 @@
+2014-10-23  Jer Noble  <[email protected]>
+
+        [Mac] Safari cannot play 'audio/amr' content.
+        https://bugs.webkit.org/show_bug.cgi?id=137894
+
+        Reviewed by Eric Carlson.
+
+        * media/media-can-play-case-insensitive-expected.txt: Added.
+        * media/media-can-play-case-insensitive.html: Added.
+
 2014-10-23  Yusuke Suzuki  <[email protected]>
 
         CSS JIT: Implement :matches

Added: trunk/LayoutTests/media/media-can-play-case-insensitive-expected.txt (0 => 175131)


--- trunk/LayoutTests/media/media-can-play-case-insensitive-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/media-can-play-case-insensitive-expected.txt	2014-10-23 18:28:56 UTC (rev 175131)
@@ -0,0 +1,11 @@
+
+Test HTMLMediaElement canPlayType() method.
+
+EXPECTED (video.canPlayType('video/mp4') === video.canPlayType('video/MP4') == 'true') OK
+EXPECTED (video.canPlayType('VIDEO/mp4') === video.canPlayType('video/mp4') == 'true') OK
+EXPECTED (video.canPlayType('video/ogg') === video.canPlayType('video/OGG') == 'true') OK
+EXPECTED (video.canPlayType('video/ogg') === video.canPlayType('VIDEO/ogg') == 'true') OK
+EXPECTED (video.canPlayType('video/webm') === video.canPlayType('video/WEBM') == 'true') OK
+EXPECTED (video.canPlayType('video/webm') === video.canPlayType('VIDEO/webm') == 'true') OK
+END OF TEST
+

Added: trunk/LayoutTests/media/media-can-play-case-insensitive.html (0 => 175131)


--- trunk/LayoutTests/media/media-can-play-case-insensitive.html	                        (rev 0)
+++ trunk/LayoutTests/media/media-can-play-case-insensitive.html	2014-10-23 18:28:56 UTC (rev 175131)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script src=""
+        <script>
+            function start() {
+                video = document.getElementsByTagName('video')[0];
+
+                testExpected("video.canPlayType('video/mp4') === video.canPlayType('video/MP4')", true);
+                testExpected("video.canPlayType('VIDEO/mp4') === video.canPlayType('video/mp4')", true);
+                testExpected("video.canPlayType('video/ogg') === video.canPlayType('video/OGG')", true);
+                testExpected("video.canPlayType('video/ogg') === video.canPlayType('VIDEO/ogg')", true);
+                testExpected("video.canPlayType('video/webm') === video.canPlayType('video/WEBM')", true);
+                testExpected("video.canPlayType('video/webm') === video.canPlayType('VIDEO/webm')", true);
+
+                endTest();
+            }
+        </script>
+    </head>
+    <body _onload_="start()">
+        <video controls></video>
+        <p>Test HTMLMediaElement <em>canPlayType()</em> method.</p>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (175130 => 175131)


--- trunk/Source/WebCore/ChangeLog	2014-10-23 18:01:53 UTC (rev 175130)
+++ trunk/Source/WebCore/ChangeLog	2014-10-23 18:28:56 UTC (rev 175131)
@@ -1,3 +1,21 @@
+2014-10-23  Jer Noble  <[email protected]>
+
+        [Mac] Safari cannot play 'audio/amr' content.
+        https://bugs.webkit.org/show_bug.cgi?id=137894
+
+        Reviewed by Eric Carlson.
+
+        Test: media/media-can-play-case-insensitive.html
+
+        Sites are returning 'video/amr' for AMR audio content, but the IANA spec says 'audio/AMR', which is also what
+        AVFoundation claims to support.  However, MIME types are supposed to be case-insensitive. When creating our
+        mime type cache, case-fold to lower all MIME types given to us by our media frameworks.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::mimeTypeCache):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::addFileTypesToCache):
+
 2014-10-23  Chris Dumez  <[email protected]>
 
         Move Length-type CSS properties from DeprecatedStyleBuilder to the new Style Builder

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (175130 => 175131)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-10-23 18:01:53 UTC (rev 175130)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-10-23 18:28:56 UTC (rev 175131)
@@ -1452,7 +1452,7 @@
 
     NSArray *types = [AVURLAsset audiovisualMIMETypes];
     for (NSString *mimeType in types)
-        cache.add(mimeType);
+        cache.add([mimeType lowercaseString]);
 
     return cache;
 } 

Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (175130 => 175131)


--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2014-10-23 18:01:53 UTC (rev 175130)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2014-10-23 18:28:56 UTC (rev 175131)
@@ -1240,7 +1240,7 @@
             Vector<String> typesForExtension = MIMETypeRegistry::getMediaMIMETypesForExtension(ext);
             unsigned count = typesForExtension.size();
             for (unsigned ndx = 0; ndx < count; ++ndx) {
-                String& type = typesForExtension[ndx];
+                String type = typesForExtension[ndx].lower();
 
                 if (shouldRejectMIMEType(type))
                     continue;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to