Skip to content

Conversation

@koostamas
Copy link
Contributor

Proposed change

This PR fixes the following issue: #26582, caused by #26235.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

No config changes is needed, just open a video stream in Chrome, move it to a PiP window and change tabs inside the browser.

Additional information

I tried several approaches since the current implementation is not very precise. The document.pictureInPictureElement returns the root home-assistant element because of the shadow DOM, so we can't test that the PiP window is containing the exact video element we are in. This should still be fine since afaik there is no way to have multiple video streams running at the same time, and even if there were, we know that at least one of them is in PiP, so we don't need to clean up the streams.
I tried to listen for the enterpictureinpicture event like suggested in the linked issue, but that is not fired in Chrome for any element (video or document), so that approach does not work.

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RTSP camera stream stops every time I switch off the HA browser tab Camera stream is blank when viewed in PIP mode

1 participant