Bug 1192818 - part4 : only mute media element if there is alive track. r=jwwang
If we don't have any alive track in MediaTrackList, we don't need to mute MediaElement. MozReview-Commit-ID: 9vY692O7N0e
This commit is contained in:
@@ -2039,6 +2039,8 @@ void HTMLMediaElement::NotifyMediaTrackDisabled(MediaTrack* aTrack)
|
||||
(!aTrack->AsVideoTrack() || !aTrack->AsVideoTrack()->Selected()));
|
||||
|
||||
if (aTrack->AsAudioTrack()) {
|
||||
// If we don't have any alive track , we don't need to mute MediaElement.
|
||||
if (AudioTracks()->Length() > 0) {
|
||||
bool shouldMute = true;
|
||||
for (uint32_t i = 0; i < AudioTracks()->Length(); ++i) {
|
||||
if ((*AudioTracks())[i]->Enabled()) {
|
||||
@@ -2046,9 +2048,11 @@ void HTMLMediaElement::NotifyMediaTrackDisabled(MediaTrack* aTrack)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldMute) {
|
||||
SetMutedInternal(mMuted | MUTED_BY_AUDIO_TRACK);
|
||||
}
|
||||
}
|
||||
} else if (aTrack->AsVideoTrack()) {
|
||||
if (mSrcStream) {
|
||||
MOZ_ASSERT(mSelectedVideoStreamTrack);
|
||||
|
||||
Reference in New Issue
Block a user