зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1172394 - Ignore video tracks in autoplay checks in MediaStreamAudioSourceNode. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D52048 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
8d201eb310
Коммит
56c675fa60
|
@ -373,6 +373,7 @@ already_AddRefed<DOMMediaStream> DOMMediaStream::Clone() {
|
|||
}
|
||||
|
||||
bool DOMMediaStream::Active() const { return mActive; }
|
||||
bool DOMMediaStream::Audible() const { return mAudible; }
|
||||
|
||||
MediaStreamTrack* DOMMediaStream::GetTrackById(const nsAString& aId) const {
|
||||
for (const auto& track : mTracks) {
|
||||
|
|
|
@ -144,6 +144,9 @@ class DOMMediaStream : public DOMEventTargetHelper,
|
|||
|
||||
// NON-WebIDL
|
||||
|
||||
// Returns true if this stream contains a live audio track.
|
||||
bool Audible() const;
|
||||
|
||||
/**
|
||||
* Returns true if this DOMMediaStream has aTrack in mTracks.
|
||||
*/
|
||||
|
|
|
@ -76,8 +76,8 @@ void MediaStreamAudioSourceNode::Init(DOMMediaStream* aMediaStream,
|
|||
mInputStream->AddConsumerToKeepAlive(ToSupports(this));
|
||||
|
||||
mInputStream->RegisterTrackListener(this);
|
||||
if (mInputStream->Active()) {
|
||||
NotifyActive();
|
||||
if (mInputStream->Audible()) {
|
||||
NotifyAudible();
|
||||
}
|
||||
AttachToRightTrack(mInputStream, aRv);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ void MediaStreamAudioSourceNode::NotifyTrackRemoved(
|
|||
}
|
||||
}
|
||||
|
||||
void MediaStreamAudioSourceNode::NotifyActive() {
|
||||
void MediaStreamAudioSourceNode::NotifyAudible() {
|
||||
MOZ_ASSERT(mInputStream);
|
||||
Context()->StartBlockedAudioContextIfAllowed();
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class MediaStreamAudioSourceNode
|
|||
// From DOMMediaStream::TrackListener.
|
||||
void NotifyTrackAdded(const RefPtr<MediaStreamTrack>& aTrack) override;
|
||||
void NotifyTrackRemoved(const RefPtr<MediaStreamTrack>& aTrack) override;
|
||||
void NotifyActive() override;
|
||||
void NotifyAudible() override;
|
||||
|
||||
// From PrincipalChangeObserver<MediaStreamTrack>.
|
||||
void PrincipalChanged(MediaStreamTrack* aMediaStreamTrack) override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче