-
eric.carlson@apple.com authored
Reviewed by David Kilzer. <rdar://problem/6902197> WebCore doesn't know about all of the MIME types supported by QTKit Add a static table to map from some common file extensions to their MIME types so it is possible to detect support even when the platform mapping is incomplete. Use the table to lookup types not found by UTI on the OSX, and when looking for a media engine with a generic or missing type. * platform/MIMETypeRegistry.cpp: (WebCore::initializeMediaTypeMaps): New, initialize the mediaMIMETypeForExtensionMap. (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): New. Look for the specified MIME type in the static mapping table if the platform specific getMIMETypeForExtension doesn't find a match. * platform/MIMETypeRegistry.h: Declare getMediaMIMETypeForExtension. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::load): When the type passed is empty, "application/octet-stream", or "text/plain", try to look it up based on the file extension with getMediaMIMETypeForExtension. * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::addFileTypesToCache): See if getMediaMIMETypeForExtension can map from file extension to MIME type if UTI fails. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fa182c8d