RESOLVED FIXED Bug 86308
<video> won't load when URL ends with .php
https://bugs.webkit.org/show_bug.cgi?id=86308
Summary <video> won't load when URL ends with .php
Eric Carlson
Reported 2012-05-12 17:33:16 PDT
A media file that does not provide MIME a type in the markup, eg. does not use <source type=...>, will not load if the url has a non-media file extension for which MIMETypeRegistry::getMediaMIMETypeForExtension() returns a type. This is caused by the changes in http://trac.webkit.org/changeset/102800 in many cases because we now correctly extract the file extension from query urls.
Attachments
Proposed patch (6.98 KB, patch)
2012-05-12 18:06 PDT, Eric Carlson
webkit-ews: commit-queue-
Updated patch - this time with not as many uninitialized variables. (7.09 KB, patch)
2012-05-12 23:04 PDT, Eric Carlson
darin: review+
Eric Carlson
Comment 1 2012-05-12 17:33:50 PDT
Radar WebKit Bug Importer
Comment 2 2012-05-12 17:34:08 PDT
Eric Carlson
Comment 3 2012-05-12 18:06:00 PDT
Created attachment 141590 [details] Proposed patch
Early Warning System Bot
Comment 4 2012-05-12 18:10:45 PDT
Comment on attachment 141590 [details] Proposed patch Attachment 141590 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/12679123
Early Warning System Bot
Comment 5 2012-05-12 18:10:58 PDT
Comment on attachment 141590 [details] Proposed patch Attachment 141590 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/12678503
Build Bot
Comment 6 2012-05-12 18:27:26 PDT
Comment on attachment 141590 [details] Proposed patch Attachment 141590 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/12666923
Eric Carlson
Comment 7 2012-05-12 23:04:39 PDT
Created attachment 141600 [details] Updated patch - this time with not as many uninitialized variables.
Darin Adler
Comment 8 2012-05-13 16:19:26 PDT
Comment on attachment 141600 [details] Updated patch - this time with not as many uninitialized variables. View in context: https://bugs.webkit.org/attachment.cgi?id=141600&action=review > Source/WebCore/platform/graphics/MediaPlayer.cpp:328 > + , m_typeInferredFromExtension(false) This variable name sounds like it would be a type, not a boolean. m_typeWasInferredFromExtension should like a boolean. Or for additional clarity, m_contentMIMETypeWasInferredFromExtension. > Source/WebCore/platform/graphics/MediaPlayer.cpp:354 > + m_typeInferredFromExtension = false; Seems strange that for m_url, m_contentMIMEType, and m_contentTypeCodecs we use local variables and set the data member only at the end, but for m_typeInferredFromExtension we set the data member directly. The code would be easier to read if all worked the same way. > Source/WebCore/platform/graphics/MediaPlayer.cpp:369 > String mediaType = MIMETypeRegistry::getMediaMIMETypeForExtension(extension); > - if (!mediaType.isEmpty()) > + if (!mediaType.isEmpty()) { > type = mediaType; > + m_typeInferredFromExtension = true; > + } Seems like for clarity mediaType could be named inferredType.
Eric Carlson
Comment 9 2012-05-14 10:25:07 PDT
(In reply to comment #8) > (From update of attachment 141600 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=141600&action=review > > > Source/WebCore/platform/graphics/MediaPlayer.cpp:328 > > + , m_typeInferredFromExtension(false) > > This variable name sounds like it would be a type, not a boolean. m_typeWasInferredFromExtension should like a boolean. Or for additional clarity, m_contentMIMETypeWasInferredFromExtension. > Done. > > Source/WebCore/platform/graphics/MediaPlayer.cpp:354 > > + m_typeInferredFromExtension = false; > > Seems strange that for m_url, m_contentMIMEType, and m_contentTypeCodecs we use local variables and set the data member only at the end, but for m_typeInferredFromExtension we set the data member directly. The code would be easier to read if all worked the same way. > Done. > > Source/WebCore/platform/graphics/MediaPlayer.cpp:369 > > String mediaType = MIMETypeRegistry::getMediaMIMETypeForExtension(extension); > > - if (!mediaType.isEmpty()) > > + if (!mediaType.isEmpty()) { > > type = mediaType; > > + m_typeInferredFromExtension = true; > > + } > > Seems like for clarity mediaType could be named inferredType. Excellent point, but I forgot to fix this before checking it in. I will clean this up the next time I modify this file.
Eric Carlson
Comment 10 2012-05-14 10:25:20 PDT
Note You need to log in before you can comment on or make changes to this bug.