Fix mjpeg player (#6896)

This commit is contained in:
Bram Kragten 2020-09-09 22:09:56 +02:00 committed by GitHub
parent d99d092784
commit 1130007d14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -35,7 +35,7 @@ class HaCameraStream extends LitElement {
@internalProperty() private _url?: string;
protected render(): TemplateResult {
if (!this.stateObj || (!this._forceMJPEG && !this._url)) {
if (!this.stateObj) {
return html``;
}
@ -52,16 +52,18 @@ class HaCameraStream extends LitElement {
)} camera.`}
/>
`
: html`
: this._url
? html`
<ha-hls-player
autoplay
muted
playsinline
?controls=${this.showControls}
.hass=${this.hass}
.url=${this._url!}
.url=${this._url}
></ha-hls-player>
`}
`
: ""}
`;
}

View File

@ -4,9 +4,9 @@ import {
css,
CSSResult,
html,
internalProperty,
LitElement,
property,
internalProperty,
PropertyValues,
TemplateResult,
} from "lit-element";
@ -47,7 +47,7 @@ class MoreInfoCamera extends LitElement {
return html`
<ha-camera-stream
.hass=${this.hass}
.stateObj="${this.stateObj}"
.stateObj=${this.stateObj}
showcontrols
></ha-camera-stream>
${this._cameraPrefs