mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Fix media browser (#22875)
This commit is contained in:
parent
2c1931adb1
commit
3282785cf2
@ -20,6 +20,8 @@ class HaHLSPlayer extends LitElement {
|
|||||||
|
|
||||||
@property() public entityid?: string;
|
@property() public entityid?: string;
|
||||||
|
|
||||||
|
@property() public url?: string;
|
||||||
|
|
||||||
@property({ attribute: "poster-url" }) public posterUrl?: string;
|
@property({ attribute: "poster-url" }) public posterUrl?: string;
|
||||||
|
|
||||||
@property({ type: Boolean, attribute: "controls" })
|
@property({ type: Boolean, attribute: "controls" })
|
||||||
@ -94,14 +96,19 @@ class HaHLSPlayer extends LitElement {
|
|||||||
super.updated(changedProps);
|
super.updated(changedProps);
|
||||||
|
|
||||||
const entityChanged = changedProps.has("entityid");
|
const entityChanged = changedProps.has("entityid");
|
||||||
|
const urlChanged = changedProps.has("url");
|
||||||
|
|
||||||
if (!entityChanged) {
|
if (entityChanged) {
|
||||||
return;
|
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._cleanUp();
|
||||||
this._resetError();
|
this._resetError();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user