Bug 1343465 - part1 : check audio track to decide the audible state when the media element was muted.
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
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -993,17 +993,19 @@ private:
mSuspended == nsISuspendedTypes::SUSPENDED_BLOCK);
}
AudibleState
IsOwnerAudible() const
{
// 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.
if (!mOwner->HasAudio()) {
return AudioChannelService::AudibleState::eNotAudible;
}
// Might be audible but not yet.