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
This commit is contained in:
Alastor Wu
2017-03-04 16:51:12 +08:00
parent a61768e84c
commit 7ff7d706d0

View File

@@ -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.