diff --git a/content/html/content/src/nsHTMLMediaElement.cpp b/content/html/content/src/nsHTMLMediaElement.cpp index 3cc663cccde9..b11af6f7541a 100644 --- a/content/html/content/src/nsHTMLMediaElement.cpp +++ b/content/html/content/src/nsHTMLMediaElement.cpp @@ -2187,6 +2187,11 @@ nsHTMLMediaElement::CanPlayType(const nsAString& aType, nsAString& aResult) aResult.AssignLiteral("maybe"); break; } + + LOG(PR_LOG_DEBUG, ("%p CanPlayType(%s) = \"%s\"", this, + NS_ConvertUTF16toUTF8(aType).get(), + NS_ConvertUTF16toUTF8(aResult).get())); + return NS_OK; } diff --git a/content/media/test/can_play_type_mpeg.js b/content/media/test/can_play_type_mpeg.js index 54140844a278..5598044351d5 100644 --- a/content/media/test/can_play_type_mpeg.js +++ b/content/media/test/can_play_type_mpeg.js @@ -7,6 +7,14 @@ function check_mp4(v, enabled) { check("video/mp4", "maybe"); check("audio/mp4", "maybe"); check("audio/mpeg", "maybe"); + check("audio/mp3", "maybe"); + check("audio/x-m4a", "maybe"); + + // Not the MIME type that other browsers respond to, so we won't either. + check("audio/m4a", ""); + // Only Safari responds affirmatively to "audio/aac", + // so we'll let x-m4a cover aac support. + check("audio/aac", ""); check("video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"", "probably"); check("video/mp4; codecs=\"avc1.42001E, mp4a.40.2\"", "probably"); @@ -22,6 +30,14 @@ function check_mp4(v, enabled) { check("video/mp4; codecs=\"avc1.64001E\"", "probably"); check("video/mp4; codecs=\"avc1.64001F\"", "probably"); + check("audio/mpeg; codecs=\"mp3\"", "probably"); + check("audio/mpeg; codecs=mp3", "probably"); + + check("audio/mp3; codecs=\"mp3\"", "probably"); + check("audio/mp3; codecs=mp3", "probably"); + check("audio/mp4; codecs=\"mp4a.40.2\"", "probably"); check("audio/mp4; codecs=mp4a.40.2", "probably"); + check("audio/x-m4a; codecs=\"mp4a.40.2\"", "probably"); + check("audio/x-m4a; codecs=mp4a.40.2", "probably"); } diff --git a/content/media/wmf/WMFDecoder.cpp b/content/media/wmf/WMFDecoder.cpp index 72767b48970e..72a6544acb62 100644 --- a/content/media/wmf/WMFDecoder.cpp +++ b/content/media/wmf/WMFDecoder.cpp @@ -26,19 +26,17 @@ WMFDecoder::GetSupportedCodecs(const nsACString& aType, NS_FAILED(LoadDLLs())) return false; - // MP3 is specified to have no codecs in its "type" param: - // http://wiki.whatwg.org/wiki/Video_type_parameters#MPEG - // So specify an empty codecs list, so that if script specifies - // a "type" param with codecs, it will be reported as not supported - // as per the spec. + // Assume that if LoadDLLs() didn't fail, we can playback the types that + // we know should be supported on Windows 7+ using WMF. static char const *const mp3AudioCodecs[] = { + "mp3", nullptr }; - if (aType.EqualsASCII("audio/mpeg")) { + if (aType.EqualsASCII("audio/mpeg") || + aType.EqualsASCII("audio/mp3")) { if (aCodecList) { *aCodecList = mp3AudioCodecs; } - // Assume that if LoadDLLs() didn't fail, we can decode MP3. return true; } @@ -47,7 +45,8 @@ WMFDecoder::GetSupportedCodecs(const nsACString& aType, "mp4a.40.2", // AAC-LC nullptr }; - if (aType.EqualsASCII("audio/mp4")) { + if (aType.EqualsASCII("audio/mp4") || + aType.EqualsASCII("audio/x-m4a")) { if (aCodecList) { *aCodecList = aacAudioCodecs; }