Bug 1343465 - part1 : check audio track to decide the audible state when the media element was muted. r=baku

If the media starts after muting the tab, IsOwnerAudible() would always return
"eNotAudible". It causes that the "play tab" icon can't be displayed because we
only show the "play tab" icon for the "eMaybeAudible" or "eAudible".

We should check whether owner owns the audio track to decide the return value.

MozReview-Commit-ID: DGwkArx0a4R

--HG--
extra : rebase_source : 920968acc744593f4ef383be4068352233c74101
This commit is contained in:
Alastor Wu 2017-03-04 16:51:12 +08:00
Родитель 5912cbf416
Коммит f973d1e5cf
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -998,7 +998,9 @@ private:
{
// Muted or the volume should not be ~0
if (mOwner->mMuted || (std::fabs(mOwner->Volume()) <= 1e-7)) {
return AudioChannelService::AudibleState::eNotAudible;
return mOwner->HasAudio() ?
AudioChannelService::AudibleState::eMaybeAudible :
AudioChannelService::AudibleState::eNotAudible;
}
// No audio track.