PiP initial commit

This commit is contained in:
wuggy 2026-09-13 10:51:36 -07:00
commit 9a1d4edaa9
14 changed files with 377 additions and 1 deletions

View file

@ -1250,7 +1250,11 @@ MediaDecoder::SetElementVisibility(bool aIsVisible)
{
MOZ_ASSERT(NS_IsMainThread());
mElementVisible = aIsVisible;
mIsVisible = !mForcedHidden && mElementVisible;
// A floating player remains visible when its source tab is in the
// background or the original video is scrolled out of view.
HTMLMediaElement* element = mOwner ? mOwner->GetMediaElement() : nullptr;
mIsVisible = (element && element->MozPictureInPicture()) ||
(!mForcedHidden && mElementVisible);
}
void