1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Fix media browser (#22875)

This commit is contained in:
Ivan Kara
2024-11-19 18:24:36 +07:00
committed by GitHub
parent 2c1931adb1
commit 3282785cf2

View File

@@ -20,6 +20,8 @@ class HaHLSPlayer extends LitElement {
@property() public entityid?: string;
@property() public url?: string;
@property({ attribute: "poster-url" }) public posterUrl?: string;
@property({ type: Boolean, attribute: "controls" })
@@ -94,14 +96,19 @@ class HaHLSPlayer extends LitElement {
super.updated(changedProps);
const entityChanged = changedProps.has("entityid");
const urlChanged = changedProps.has("url");
if (!entityChanged) {
return;
if (entityChanged) {
this._getStreamUrlFromEntityId();
} else if (urlChanged && this.url) {
this._cleanUp();
this._resetError();
this._url = this.url;
this._startHls();
}
this._getStreamUrl();
}
private async _getStreamUrl(): Promise<void> {
private async _getStreamUrlFromEntityId(): Promise<void> {
this._cleanUp();
this._resetError();