зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1329179 - only display 'play tab' icon for background tab. r=baku
When user open new tab and then go to the pasted URL (which has autoplaying media), the "play tab" icon would be displayed briefly, and then change to the "mute tab" icon. That is the media element starts before calling nsDocument::PageShow() which would resume all blocked media in the tab. Before that moment, even the tab is in the foreground, but we doesn't resume the media yet. Therefore, we need to check the document's visibility by ourself, and only show the "play tab" icon for the background blocked tab. MozReview-Commit-ID: Eg2SD5kpG0j --HG-- extra : rebase_source : ccf25537904a10e17de2e70650b62fac8f5a3434
This commit is contained in:
Родитель
dc7d9fc978
Коммит
504a266d7c
|
@ -1392,7 +1392,18 @@ AudioChannelService::AudioChannelWindow::MaybeNotifyMediaBlocked(AudioChannelAge
|
|||
}
|
||||
|
||||
MOZ_ASSERT(window->IsOuterWindow());
|
||||
if (window->GetMediaSuspend() != nsISuspendedTypes::SUSPENDED_BLOCK) {
|
||||
nsCOMPtr<nsPIDOMWindowInner> inner = window->GetCurrentInnerWindow();
|
||||
if (!inner) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = inner->GetExtantDoc();
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (window->GetMediaSuspend() != nsISuspendedTypes::SUSPENDED_BLOCK ||
|
||||
!doc->Hidden()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче