Bug 1351087 - part1 : don't register agent for audio without audio track. r=baku

Since we don't want to show media control for media without audio track (eg. GIFV),
it's no need to register audio agent for them.

MozReview-Commit-ID: 22YrMkpNrcP

--HG--
extra : rebase_source : 78a6c41b6018f91ed9370fb2f15c650fe76ba3a1
This commit is contained in:
Alastor Wu 2017-05-09 14:10:43 +08:00
Родитель ac96f877a5
Коммит a6e6b04a38
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1052,6 +1052,11 @@ private:
return false;
}
// No audio track
if (!mOwner->HasAudio()) {
return false;
}
// A loop always is playing
if (mOwner->HasAttr(kNameSpaceID_None, nsGkAtoms::loop)) {
return true;
@ -7080,6 +7085,7 @@ HTMLMediaElement::SetMediaInfo(const MediaInfo& aInfo)
const bool oldHasAudio = mMediaInfo.HasAudio();
mMediaInfo = aInfo;
if (aInfo.HasAudio() != oldHasAudio) {
UpdateAudioChannelPlayingState();
NotifyAudioPlaybackChanged(
AudioChannelService::AudibleChangedReasons::eDataAudibleChanged);
}