mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-26 06:17:20 +00:00
Fix WebRTC player stream playback when disconnected/connected (#11764)
This commit is contained in:
parent
27750b8b5d
commit
eb1f94c370
@ -43,7 +43,7 @@ class HaWebRtcPlayer extends LitElement {
|
||||
|
||||
private _remoteStream?: MediaStream;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
protected override render(): TemplateResult {
|
||||
if (this._error) {
|
||||
return html`<ha-alert alert-type="error">${this._error}</ha-alert>`;
|
||||
}
|
||||
@ -58,12 +58,19 @@ class HaWebRtcPlayer extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
public disconnectedCallback() {
|
||||
public override connectedCallback() {
|
||||
super.connectedCallback();
|
||||
if (this.hasUpdated) {
|
||||
this._startWebRtc();
|
||||
}
|
||||
}
|
||||
|
||||
public override disconnectedCallback() {
|
||||
super.disconnectedCallback();
|
||||
this._cleanUp();
|
||||
}
|
||||
|
||||
protected updated(changedProperties: PropertyValues<this>) {
|
||||
protected override updated(changedProperties: PropertyValues<this>) {
|
||||
if (!changedProperties.has("entityid")) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user