Bug 1064127 - Support audio/3gpp for non-web content. r=roc

This commit is contained in:
Makoto Kato 2014-09-16 17:07:15 +09:00
parent 4ba6913081
commit 958564b8ca
2 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,7 @@
#include "DecoderTraits.h"
#include "MediaDecoder.h"
#include "nsCharSeparatedTokenizer.h"
#include "nsMimeTypes.h"
#include "mozilla/Preferences.h"
#ifdef MOZ_ANDROID_OMX
@ -219,6 +220,7 @@ static const char* const gOmxTypes[] = {
"audio/mpeg",
"audio/mp4",
"audio/amr",
"audio/3gpp",
"video/mp4",
"video/3gpp",
"video/3gpp2",
@ -542,7 +544,7 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
if (IsOmxSupportedType(aType)) {
// AMR audio is enabled for MMS, but we are discouraging Web and App
// developers from using AMR, thus we only allow AMR to be played on WebApps.
if (aType.EqualsASCII("audio/amr")) {
if (aType.EqualsLiteral(AUDIO_AMR) || aType.EqualsLiteral(AUDIO_3GPP)) {
dom::HTMLMediaElement* element = aOwner->GetMediaElement();
if (!element) {
return nullptr;
@ -715,7 +717,8 @@ bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType)
#ifdef MOZ_OMX_DECODER
// We support amr inside WebApps on firefoxOS but not in general web content.
// Ensure we dont create a VideoDocument when accessing amr URLs directly.
(IsOmxSupportedType(aType) && !aType.EqualsASCII("audio/amr")) ||
(IsOmxSupportedType(aType) &&
(!aType.EqualsLiteral(AUDIO_AMR) && !aType.EqualsLiteral(AUDIO_3GPP))) ||
#endif
#ifdef MOZ_WEBM
IsWebMType(aType) ||

View File

@ -549,6 +549,7 @@ static nsExtraMimeTypeEntry extraMimeEntries [] =
{ AUDIO_OGG, "opus", "Opus Audio" },
#ifdef MOZ_WIDGET_GONK
{ AUDIO_AMR, "amr", "Adaptive Multi-Rate Audio" },
{ AUDIO_3GPP, "3gpp,3gp", "3GPP Audio" },
#endif
{ VIDEO_WEBM, "webm", "Web Media Video" },
{ AUDIO_WEBM, "webm", "Web Media Audio" },