dermotduffy / frigate-hass-card

A Lovelace card for Frigate in Home Assistant
MIT License
477 stars 53 forks source link

Intersection option in go2rtc/webrtc camera is not respected #1376

Closed widewing closed 3 months ago

widewing commented 3 months ago

When I use webrtc camera card alone, the video stream will stop when the card is outside of screen. In Webrtc Camera card there is an option

intersection: 0.75  # auto stop stream when less than 75% of video element is in the screen, 50% by default

But when using this card with go2rtc live stream, it will always stream even out of screen. This is particularly annoying when have a lot camera and using mobile app or page.

dermotduffy commented 3 months ago

Can you include your config?

widewing commented 3 months ago

The setting is pretty simply frigate-card with live_provider=webrtc-card, and 10 cards in one page.

type: custom:frigate-card
cameras:
  - camera_entity: camera.front_door
    live_provider: webrtc-card
    webrtc_card:
      type: custom:webrtc-camera
      url: front_door
      server: http://localhost/go2rtc/
      muted: true
      digital_ptz:
        persist: false

I realize when the page load all the feeds will load, but when I scroll up/down the hided cards will pause and when they become visible they will reload. So the intersection option IS respected but the behavior of initial load is not expected

dermotduffy commented 3 months ago

I realize when the page load all the feeds will load, but when I scroll up/down the hided cards will pause and when they become visible they will reload. So the intersection option IS respected but the behavior of initial load is not expected

And it does work if you just use webrtc card directly?

widewing commented 3 months ago

Yes. Before the frigate cards I used the bare webrtc cards, and they worked as expected, only the visible cards are streaming video.

widewing commented 3 months ago

oh.. I reverted to webrtc cards and tested with webrtc cards only again, they DO have same behavior - on initial load all streams are loaded, only after scrolling the hidden / visible cards are paused / reloaded. But the webrtc cards only page loads much smoother than the frigate page on my phone so it made me ignored the issue.

Not sure why frigate page loads slow but that's unrelated to the topic of this issue, let me close this one.