зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset c17987dfa969 (bug 1129882)
This commit is contained in:
Родитель
7cdb62ba5f
Коммит
1225980bea
|
@ -2055,8 +2055,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
|||
mPlayingThroughTheAudioChannel(false),
|
||||
mDisableVideo(false),
|
||||
mPlayBlockedBecauseHidden(false),
|
||||
mElementInTreeState(ELEMENT_NOT_INTREE),
|
||||
mHaveDispatchedInterruptBeginEvent(false)
|
||||
mElementInTreeState(ELEMENT_NOT_INTREE)
|
||||
{
|
||||
if (!gMediaElementLog) {
|
||||
gMediaElementLog = PR_NewLogModule("nsMediaElement");
|
||||
|
@ -4452,12 +4451,10 @@ nsresult HTMLMediaElement::UpdateChannelMuteState(float aVolume, bool aMuted)
|
|||
SetMutedInternal(mMuted | MUTED_BY_AUDIO_CHANNEL);
|
||||
if (UseAudioChannelAPI()) {
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("mozinterruptbegin"));
|
||||
mHaveDispatchedInterruptBeginEvent = true;
|
||||
}
|
||||
} else if (!aMuted && ComputedMuted()) {
|
||||
SetMutedInternal(mMuted & ~MUTED_BY_AUDIO_CHANNEL);
|
||||
if (UseAudioChannelAPI() && mHaveDispatchedInterruptBeginEvent) {
|
||||
mHaveDispatchedInterruptBeginEvent = false;
|
||||
if (UseAudioChannelAPI()) {
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("mozinterruptend"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1414,8 +1414,6 @@ protected:
|
|||
|
||||
ElementInTreeState mElementInTreeState;
|
||||
|
||||
bool mHaveDispatchedInterruptBeginEvent;
|
||||
|
||||
public:
|
||||
// Helper class to measure times for MSE telemetry stats
|
||||
class TimeDurationAccumulator {
|
||||
|
|
|
@ -326,7 +326,6 @@ AudioDestinationNode::AudioDestinationNode(AudioContext* aContext,
|
|||
, mExtraCurrentTime(0)
|
||||
, mExtraCurrentTimeSinceLastStartedBlocking(0)
|
||||
, mExtraCurrentTimeUpdatedSinceLastStableState(false)
|
||||
, mHaveDispatchedInterruptBeginEvent(false)
|
||||
{
|
||||
bool startWithAudioDriver = true;
|
||||
MediaStreamGraph* graph = aIsOffline ?
|
||||
|
@ -495,12 +494,10 @@ AudioDestinationNode::WindowVolumeChanged(float aVolume, bool aMuted)
|
|||
if (aMuted != mAudioChannelAgentPlaying) {
|
||||
mAudioChannelAgentPlaying = aMuted;
|
||||
|
||||
if (UseAudioChannelAPI() &&
|
||||
(mHaveDispatchedInterruptBeginEvent || aMuted)) {
|
||||
if (UseAudioChannelAPI()) {
|
||||
Context()->DispatchTrustedEvent(
|
||||
!aMuted ? NS_LITERAL_STRING("mozinterruptend")
|
||||
: NS_LITERAL_STRING("mozinterruptbegin"));
|
||||
mHaveDispatchedInterruptBeginEvent = aMuted;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ private:
|
|||
double mExtraCurrentTime;
|
||||
double mExtraCurrentTimeSinceLastStartedBlocking;
|
||||
bool mExtraCurrentTimeUpdatedSinceLastStableState;
|
||||
bool mHaveDispatchedInterruptBeginEvent;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "AudioChannelService.h"
|
||||
#include "AudioChannelAgent.h"
|
||||
#include "CallsList.h"
|
||||
#include "TelephonyCall.h"
|
||||
#include "TelephonyCallGroup.h"
|
||||
|
@ -65,8 +65,7 @@ public:
|
|||
|
||||
Telephony::Telephony(nsPIDOMWindow* aOwner)
|
||||
: DOMEventTargetHelper(aOwner),
|
||||
mIsAudioStartPlaying(false),
|
||||
mHaveDispatchedInterruptBeginEvent(false)
|
||||
mIsAudioStartPlaying(false)
|
||||
{
|
||||
MOZ_ASSERT(aOwner);
|
||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aOwner);
|
||||
|
@ -77,7 +76,6 @@ Telephony::Telephony(nsPIDOMWindow* aOwner)
|
|||
MOZ_ASSERT(!rv.Failed());
|
||||
|
||||
mReadyPromise = promise;
|
||||
mMuted = AudioChannelService::IsAudioChannelMutedByDefault();
|
||||
}
|
||||
|
||||
Telephony::~Telephony()
|
||||
|
@ -682,21 +680,6 @@ Telephony::WindowVolumeChanged(float aVolume, bool aMuted)
|
|||
return rv.StealNSResult();
|
||||
}
|
||||
|
||||
// These events will be triggered when the telephony is interrupted by other
|
||||
// audio channel.
|
||||
if (mMuted != aMuted) {
|
||||
mMuted = aMuted;
|
||||
// We should not dispatch "mozinterruptend" when the system app initializes
|
||||
// the telephony audio from muted to unmuted at the first time. The event
|
||||
// "mozinterruptend" must be dispatched after the "mozinterruptbegin".
|
||||
if (!mHaveDispatchedInterruptBeginEvent && mMuted) {
|
||||
DispatchTrustedEvent(NS_LITERAL_STRING("mozinterruptbegin"));
|
||||
mHaveDispatchedInterruptBeginEvent = mMuted;
|
||||
} else if (mHaveDispatchedInterruptBeginEvent && !mMuted) {
|
||||
DispatchTrustedEvent(NS_LITERAL_STRING("mozinterruptend"));
|
||||
mHaveDispatchedInterruptBeginEvent = mMuted;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,8 +59,6 @@ class Telephony final : public DOMEventTargetHelper,
|
|||
nsRefPtr<Promise> mReadyPromise;
|
||||
|
||||
bool mIsAudioStartPlaying;
|
||||
bool mHaveDispatchedInterruptBeginEvent;
|
||||
bool mMuted;
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
|
Загрузка…
Ссылка в новой задаче