frontend icon indicating copy to clipboard operation
frontend copied to clipboard

First Camera stream in the dashboard not starting automarically

Open edomasca opened this issue 1 year ago • 12 comments

Checklist

  • [X] I have updated to the latest available Home Assistant version.
  • [X] I have cleared the cache of my browser.
  • [X] I have tried a different browser to see if it is related to my browser.
  • [ ] I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

When loading a specific dashboard in Lovelace with multiple cameras to stream, the first one do not starts automatically while the others do. Changing the order of the devices causes always the first one to fail doing autoplay. (E.g. it is not an issue related to an entity but only to the first entity in the dashboard whatever it is). The dashboard has only cameras to steam from UNIFI protect. If I switch to another dashboard and then I go back to the one with the cameras, then all streams start normally. the issue happens then only when loading the page directly to the specific dashboard It happens to all browsers and app too.

Describe the behavior you expected

All cameras should start streaming when opening the specific dashboard (Autoplay)

Steps to reproduce the issue

  1. Create a dashboard with more than one camera to stream (live)
  2. Load that specific page directly without switching between dashboards

What version of Home Assistant Core has the issue?

Core 2024.2.1

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

No response

Which operating system are you using to run this browser?

No response

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

edomasca avatar Feb 14 '24 12:02 edomasca

I'm experiencing the same thing. I have a picture-glance card with camera_view: live and the stream never starts (though it appears to fall back to camera thumbnails as I have those defined for RTSP and Frigate cameras I've tested)

Additional findings: I receive a JS error in the Chrome DevTools console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'KeySystemFormats')
    at 96996 (96996.w7vKRby48d0.js:1:283711)
    at Function.c (bootstrap:19:32)
    at async a.value (ha-hls-player.ts:112:11)

And sure enough this part of the frontend bundle doesn't seem to play well. The offending bundle file "96996.w7vKRby48d0.js" is attempting the following near its end:

var oi = $.KeySystemFormats
  , li = $.KeySystems
  , di = $.SubtitleStreamController
  , hi = $.TimelineController

But above that, $ is initialized to undefined:

var $ = void 0
  , G = s($);

It is not reassigned between the two code blocks.

I'm fairly certain this code comes from https://github.com/video-dev/hls.js, but due to being minified and lacking sourcemaps I'm unable to locate exactly where in hls.js these offending lines map to.

ETA: Still present on Home Assistant v2024.2.2, frontend v20240207.1

acshef avatar Feb 14 '24 23:02 acshef

yeah I am experiencing the same problem

sdotter avatar Feb 17 '24 00:02 sdotter

Came here for this issue.

nomonkeynodeal avatar Feb 21 '24 00:02 nomonkeynodeal

Experiencing the same issue after updating to 2024.2.x

b0mbays avatar Feb 26 '24 15:02 b0mbays

Same problem for me since version 2024.2.x

sebastian-bugajny avatar Feb 26 '24 15:02 sebastian-bugajny

I'm experiencing the same thing. I have a picture-glance card with camera_view: live and the stream never starts (though it appears to fall back to camera thumbnails as I have those defined for RTSP and Frigate cameras I've tested)

Additional findings: I receive a JS error in the Chrome DevTools console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'KeySystemFormats')
    at 96996 (96996.w7vKRby48d0.js:1:283711)
    at Function.c (bootstrap:19:32)
    at async a.value (ha-hls-player.ts:112:11)

And sure enough this part of the frontend bundle doesn't seem to play well. The offending bundle file "96996.w7vKRby48d0.js" is attempting the following near its end:

var oi = $.KeySystemFormats
  , li = $.KeySystems
  , di = $.SubtitleStreamController
  , hi = $.TimelineController

But above that, $ is initialized to undefined:

var $ = void 0
  , G = s($);

It is not reassigned between the two code blocks.

I'm fairly certain this code comes from https://github.com/video-dev/hls.js, but due to being minified and lacking sourcemaps I'm unable to locate exactly where in hls.js these offending lines map to.

ETA: Still present on Home Assistant v2024.2.2, frontend v20240207.1

It's likely one of the dependency bumps for hls broke this and they need to revert until it's fixed upstream? I'm surprised more users aren't reporting this.

Daniel-dev22 avatar Feb 28 '24 11:02 Daniel-dev22

There have been multiple bumps of hls.js in 2024.3, can anyone check if this issue is still there in the beta of 2024.3?

bramkragten avatar Feb 28 '24 21:02 bramkragten

Just checked... Seems still to be an issue that it is not loading first cam.

But wondering... I didn't get notified that there's new frontend and that I should reload home assistant... Is it maybe that I need to force? Or is that same as ctrl+f5? Force refresh in chrome etc...

sdotter avatar Feb 28 '24 21:02 sdotter

Reproduced the issue in dev 👍

bramkragten avatar Feb 28 '24 21:02 bramkragten

Think you already know... but just in case:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'KeySystemFormats') at 96996 (96996.w7vKRby48d0.js:1:283711) at Function.c (bootstrap:19:32) at async a.value(ha-hls-player.ts:112:11) `

sdotter avatar Feb 28 '24 22:02 sdotter

Yeah, we use the light dist of hls, and they replace some packages with undefined... and then they import stuff from it 🙃

bramkragten avatar Feb 28 '24 22:02 bramkragten

Same issue here! I'm back to 2024.1.6 and everythig works fine.

postaccountgh avatar Feb 29 '24 06:02 postaccountgh

Yeah, we use the light dist of hls, and they replace some packages with undefined... and then they import stuff from it 🙃

Any idea if this can be fixed for 2024.3.x? If we have to wait for upstream?

Daniel-dev22 avatar Feb 29 '24 23:02 Daniel-dev22

I've noticed that every time I'm opening more-info dialog of any camera, live via never starts and image is just frozen. If I open this or any other camera again, streaming starts just fine. If I refresh the page it happens again. The error I'm seeing in dev tools:

image

Belive it is related.

alphasixtyfive avatar Mar 01 '24 20:03 alphasixtyfive

Same issue 2024.2.5 See: https://github.com/dermotduffy/frigate-hass-card/issues/1368

woempiej avatar Mar 01 '24 22:03 woempiej

Yeah, we use the light dist of hls, and they replace some packages with undefined... and then they import stuff from it 🙃

Is it possible it will be fixed in 2024.3.x as it seems as if a lot more users are experiencing this issue?

Daniel-dev22 avatar Mar 04 '24 20:03 Daniel-dev22

I'm experiencing the same since 2024.2 and above.

DaWheelz avatar Mar 06 '24 15:03 DaWheelz

It looks like there was a patch pushed to the frontend which could fix this in 2024.4.0?

Daniel-dev22 avatar Mar 06 '24 15:03 Daniel-dev22

Hi all,

The issue is fixed in HA 2024.3.0

woempiej avatar Mar 07 '24 08:03 woempiej

Version 2024.3.0 haven't resolved that issue for me.

sebastian-bugajny avatar Mar 07 '24 09:03 sebastian-bugajny

Version 2024.3.0 haven't resolved that issue for me.

Did you clear cache?

Daniel-dev22 avatar Mar 07 '24 10:03 Daniel-dev22

2024.3.0 is working for me 👍

b0mbays avatar Mar 07 '24 10:03 b0mbays

Ditto, 2024.3.0 also seems to work here (first playback of recordings from Frigate now works again).

kenni avatar Mar 07 '24 10:03 kenni

Ok for me now in 2024.3.0

crhass avatar Mar 09 '24 08:03 crhass

Yep confirm in 2024.3 it's working again.. all streams are loading and playing

sdotter avatar Mar 09 '24 09:03 sdotter

Adding my vote that upgrading from

Core 2024.2.5
Frontend 20240207.1

to

Core 2024.3.0
Frontend 20240306.0

Resolved this issue for me on both Firefox and Android.

XBigTK13X avatar Mar 14 '24 15:03 XBigTK13X