Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/components/ha-web-rtc-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>`;
}
Expand All @@ -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;
}
Expand Down