diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h index 58014713432c..1558cdc6e0be 100644 --- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -627,7 +627,6 @@ GK_ATOM(mouseout, "mouseout") GK_ATOM(mouseover, "mouseover") GK_ATOM(mousethrough, "mousethrough") GK_ATOM(mouseup, "mouseup") -GK_ATOM(mozaudiochannel, "mozaudiochannel") GK_ATOM(mozfullscreenchange, "mozfullscreenchange") GK_ATOM(mozfullscreenerror, "mozfullscreenerror") GK_ATOM(mozpointerlockchange, "mozpointerlockchange") @@ -1959,10 +1958,6 @@ GK_ATOM(onuserproximity, "onuserproximity") // light sensor support GK_ATOM(ondevicelight, "ondevicelight") -// Audio channel events -GK_ATOM(onmozinterruptbegin, "onmozinterruptbegin") -GK_ATOM(onmozinterruptend, "onmozinterruptend") - // MediaDevices device change event GK_ATOM(ondevicechange, "ondevicechange") diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index cd8e05bbdd76..1fa3f427b850 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -1444,23 +1444,6 @@ NS_IMPL_BOOL_ATTR(HTMLMediaElement, Loop, loop) NS_IMPL_BOOL_ATTR(HTMLMediaElement, DefaultMuted, muted) NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLMediaElement, Preload, preload, nullptr) -NS_IMETHODIMP -HTMLMediaElement::GetMozAudioChannelType(nsAString& aValue) -{ - nsString defaultValue; - AudioChannelService::GetDefaultAudioChannelString(defaultValue); - - NS_ConvertUTF16toUTF8 str(defaultValue); - GetEnumAttr(nsGkAtoms::mozaudiochannel, str.get(), aValue); - return NS_OK; -} - -NS_IMETHODIMP -HTMLMediaElement::SetMozAudioChannelType(const nsAString& aValue) -{ - return SetAttrHelper(nsGkAtoms::mozaudiochannel, aValue); -} - NS_IMETHODIMP_(bool) HTMLMediaElement::IsVideo() { @@ -4142,77 +4125,12 @@ bool HTMLMediaElement::ParseAttribute(int32_t aNamespaceID, if (aAttribute == nsGkAtoms::preload) { return aResult.ParseEnumValue(aValue, kPreloadTable, false); } - - // Remove the b2g-specific audio channel setting in bug1299390. - if (aAttribute == nsGkAtoms::mozaudiochannel) { - const nsAttrValue::EnumTable* table = - AudioChannelService::GetAudioChannelTable(); - MOZ_ASSERT(table); - - bool parsed = aResult.ParseEnumValue(aValue, table, false, &table[0]); - if (!parsed) { - return false; - } - - AudioChannel audioChannel = static_cast(aResult.GetEnumValue()); - - if (audioChannel == mAudioChannel || - !CheckAudioChannelPermissions(aValue)) { - return true; - } - - // We cannot change the AudioChannel of a decoder. - if (mDecoder) { - return true; - } - - mAudioChannel = audioChannel; - - if (mSrcStream) { - RefPtr stream = GetSrcMediaStream(); - if (stream) { - stream->SetAudioChannelType(mAudioChannel); - } - } - - return true; - } } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, aResult); } -bool HTMLMediaElement::CheckAudioChannelPermissions(const nsAString& aString) -{ - // Only normal channel doesn't need permission. - if (aString.EqualsASCII("normal")) { - return true; - } - - // Maybe this audio channel is equal to the default value from the pref. - nsString audioChannel; - AudioChannelService::GetDefaultAudioChannelString(audioChannel); - if (audioChannel.Equals(aString)) { - return true; - } - - nsCOMPtr permissionManager = - services::GetPermissionManager(); - if (!permissionManager) { - return false; - } - - uint32_t perm = nsIPermissionManager::UNKNOWN_ACTION; - permissionManager->TestExactPermissionFromPrincipal(NodePrincipal(), - nsCString(NS_LITERAL_CSTRING("audio-channel-") + NS_ConvertUTF16toUTF8(aString)).get(), &perm); - if (perm != nsIPermissionManager::ALLOW_ACTION) { - return false; - } - - return true; -} - void HTMLMediaElement::DoneCreatingElement() { if (HasAttr(kNameSpaceID_None, nsGkAtoms::muted)) { @@ -7063,15 +6981,6 @@ HTMLMediaElement::GetOrCreateTextTrackManager() return mTextTrackManager; } -void -HTMLMediaElement::SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv) -{ - nsString channel; - channel.AssignASCII(AudioChannelValues::strings[uint32_t(aValue)].value, - AudioChannelValues::strings[uint32_t(aValue)].length); - SetHTMLAttr(nsGkAtoms::mozaudiochannel, channel, aRv); -} - MediaDecoderOwner::NextFrameStatus HTMLMediaElement::NextFrameStatus() { diff --git a/dom/html/HTMLMediaElement.h b/dom/html/HTMLMediaElement.h index c5f9f382e9de..539b6ab311aa 100644 --- a/dom/html/HTMLMediaElement.h +++ b/dom/html/HTMLMediaElement.h @@ -693,13 +693,6 @@ public: double MozFragmentEnd(); - AudioChannel MozAudioChannelType() const - { - return mAudioChannel; - } - - void SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv); - AudioTrackList* AudioTracks(); VideoTrackList* VideoTracks(); @@ -751,9 +744,6 @@ public: // that will soon be gone. bool IsBeingDestroyed(); - IMPL_EVENT_HANDLER(mozinterruptbegin) - IMPL_EVENT_HANDLER(mozinterruptend) - // These are used for testing only float ComputedVolume() const; bool ComputedMuted() const; @@ -1250,9 +1240,6 @@ protected: void ReportTelemetry(); - // Check the permissions for audiochannel. - bool CheckAudioChannelPermissions(const nsAString& aType); - // Seeks to aTime seconds. aSeekType can be Exact to seek to exactly the // seek target, or PrevSyncPoint if a quicker but less precise seek is // desired, and we'll seek to the sync point (keyframe and/or start of the diff --git a/dom/html/test/file_mozaudiochannel.html b/dom/html/test/file_mozaudiochannel.html deleted file mode 100644 index 588ae338ba9b..000000000000 --- a/dom/html/test/file_mozaudiochannel.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - diff --git a/dom/html/test/mochitest.ini b/dom/html/test/mochitest.ini index b0870b14e2db..78cb54779b12 100644 --- a/dom/html/test/mochitest.ini +++ b/dom/html/test/mochitest.ini @@ -183,7 +183,6 @@ support-files = reflect.js file_ignoreuserfocus.html simpleFileOpener.js - file_mozaudiochannel.html file_bug1166138_1x.png file_bug1166138_2x.png file_bug1166138_def.png @@ -506,7 +505,6 @@ skip-if = toolkit == 'android' # bug 939642 [test_map_attributes_reflection.html] [test_meta_attributes_reflection.html] [test_mod_attributes_reflection.html] -[test_mozaudiochannel.html] [test_named_options.html] [test_nested_invalid_fieldsets.html] [test_object_attributes_reflection.html] diff --git a/dom/html/test/test_mozaudiochannel.html b/dom/html/test/test_mozaudiochannel.html deleted file mode 100644 index 722e181bf154..000000000000 --- a/dom/html/test/test_mozaudiochannel.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - Test for mozaudiochannel - - - - - - -
-
-
- - diff --git a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl index 7a03320794c9..0cadc614aeea 100644 --- a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl +++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl @@ -87,40 +87,6 @@ interface nsIDOMHTMLMediaElement : nsISupports // it is equal to the media duration. readonly attribute double mozFragmentEnd; - // Mozilla extension: an audio channel type for media elements. - // An exception is thrown if the app tries to change the audio channel type - // without the permission (manifest file for B2G apps). - // The supported values are: - // * normal (default value) - // Automatically paused if "notification" or higher priority channel - // is played - // Use case: normal applications - // * content - // Automatically paused if "notification" or higher priority channel - // is played. Also paused if another app starts using "content" - // channel. Using this channel never affects applications using - // the "normal" channel. - // Use case: video/audio players - // * notification - // Automatically paused if "alarm" or higher priority channel is played. - // Use case: New email, incoming SMS - // * alarm - // Automatically paused if "telephony" or higher priority channel is - // played. - // User case: Alarm clock, calendar alarms - // * telephony - // Automatically paused if "ringer" or higher priority - // channel is played. - // Use case: dialer, voip - // * ringer - // Automatically paused if "publicnotification" or higher priority - // channel is played. - // Use case: dialer, voip - // * publicnotification - // Always plays in speaker, even when headphones are plugged in. - // Use case: Camera shutter sound. - attribute DOMString mozAudioChannelType; - // In addition the media element has this new events: // * onmozinterruptbegin - called when the media element is interrupted // because of the audiochannel manager. diff --git a/dom/media/webaudio/AudioContext.cpp b/dom/media/webaudio/AudioContext.cpp index 01f886400ea7..31a825f257f1 100644 --- a/dom/media/webaudio/AudioContext.cpp +++ b/dom/media/webaudio/AudioContext.cpp @@ -1066,21 +1066,6 @@ AudioContext::Unmute() const } } -AudioChannel -AudioContext::MozAudioChannelType() const -{ - return mDestination->MozAudioChannelType(); -} - -AudioChannel -AudioContext::TestAudioChannelInAudioNodeStream() -{ - MediaStream* stream = mDestination->Stream(); - MOZ_ASSERT(stream); - - return stream->AudioChannelType(); -} - size_t AudioContext::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { diff --git a/dom/media/webaudio/AudioContext.h b/dom/media/webaudio/AudioContext.h index 7cfd71f2b371..64d2e3577905 100644 --- a/dom/media/webaudio/AudioContext.h +++ b/dom/media/webaudio/AudioContext.h @@ -312,10 +312,6 @@ public: JSObject* GetGlobalJSObject() const; - AudioChannel MozAudioChannelType() const; - - AudioChannel TestAudioChannelInAudioNodeStream(); - void RegisterNode(AudioNode* aNode); void UnregisterNode(AudioNode* aNode); @@ -323,9 +319,6 @@ public: BasicWaveFormCache* GetBasicWaveFormCache(); - IMPL_EVENT_HANDLER(mozinterruptbegin) - IMPL_EVENT_HANDLER(mozinterruptend) - bool CheckClosed(ErrorResult& aRv); void Dispatch(already_AddRefed&& aRunnable); diff --git a/dom/media/webaudio/AudioDestinationNode.cpp b/dom/media/webaudio/AudioDestinationNode.cpp index 98618506994a..abe357e3264e 100644 --- a/dom/media/webaudio/AudioDestinationNode.cpp +++ b/dom/media/webaudio/AudioDestinationNode.cpp @@ -545,9 +545,6 @@ AudioDestinationNode::WindowSuspendChanged(nsSuspendedTypes aSuspend) "this = %p, aSuspend = %s\n", this, SuspendTypeToStr(aSuspend))); mAudioChannelSuspended = suspended; - Context()->DispatchTrustedEvent(!suspended ? - NS_LITERAL_STRING("mozinterruptend") : - NS_LITERAL_STRING("mozinterruptbegin")); DisabledTrackMode disabledMode = suspended ? DisabledTrackMode::SILENCE_BLACK : DisabledTrackMode::ENABLED; diff --git a/dom/media/webaudio/test/mochitest.ini b/dom/media/webaudio/test/mochitest.ini index 4345d79cfead..56a07ed0801a 100644 --- a/dom/media/webaudio/test/mochitest.ini +++ b/dom/media/webaudio/test/mochitest.ini @@ -171,9 +171,6 @@ tags=capturestream tags=capturestream [test_mixingRules.html] skip-if = toolkit == 'android' # bug 1091965 -[test_mozaudiochannel.html] -# Android: bug 1061675; OSX 10.6: bug 1097721 -skip-if = (toolkit == 'android') || (os == 'mac' && os_version == '10.6') [test_nodeToParamConnection.html] [test_nodeCreationDocumentGone.html] [test_OfflineAudioContext.html] diff --git a/dom/media/webaudio/test/test_mozaudiochannel.html b/dom/media/webaudio/test/test_mozaudiochannel.html deleted file mode 100644 index 6ba14347bf70..000000000000 --- a/dom/media/webaudio/test/test_mozaudiochannel.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - Test for mozaudiochannel - - - - - -

-
-
-
- - diff --git a/dom/webidl/AudioContext.webidl b/dom/webidl/AudioContext.webidl index cf4bd2acf000..72e3aabb87da 100644 --- a/dom/webidl/AudioContext.webidl +++ b/dom/webidl/AudioContext.webidl @@ -33,23 +33,4 @@ interface AudioContext : BaseAudioContext { [NewObject, Throws] MediaStreamAudioDestinationNode createMediaStreamDestination(); -}; - -// Mozilla extensions -partial interface AudioContext { - // Read AudioChannel.webidl for more information about this attribute. - [Pref="media.useAudioChannelAPI"] - readonly attribute AudioChannel mozAudioChannelType; - - // These 2 events are dispatched when the AudioContext object is muted by - // the AudioChannelService. It's call 'interrupt' because when this event is - // dispatched on a HTMLMediaElement, the audio stream is paused. - [Pref="media.useAudioChannelAPI"] - attribute EventHandler onmozinterruptbegin; - - [Pref="media.useAudioChannelAPI"] - attribute EventHandler onmozinterruptend; - - // This method is for test only. - [ChromeOnly] AudioChannel testAudioChannelInAudioNodeStream(); -}; +}; \ No newline at end of file diff --git a/dom/webidl/HTMLMediaElement.webidl b/dom/webidl/HTMLMediaElement.webidl index 056a8bb1608e..4de2d228953b 100644 --- a/dom/webidl/HTMLMediaElement.webidl +++ b/dom/webidl/HTMLMediaElement.webidl @@ -138,21 +138,6 @@ partial interface HTMLMediaElement { // the media element has a fragment URI for the currentSrc, otherwise // it is equal to the media duration. readonly attribute double mozFragmentEnd; - - // Mozilla extension: an audio channel type for media elements. - // Read AudioChannel.webidl for more information about this attribute. - [SetterThrows, Pref="media.useAudioChannelAPI"] - attribute AudioChannel mozAudioChannelType; - - // In addition the media element has this new events: - // * onmozinterruptbegin - called when the media element is interrupted - // because of the audiochannel manager. - // * onmozinterruptend - called when the interruption is concluded - [Pref="media.useAudioChannelAPI"] - attribute EventHandler onmozinterruptbegin; - - [Pref="media.useAudioChannelAPI"] - attribute EventHandler onmozinterruptend; }; // Encrypted Media Extensions