Default size of hui-image to 16:9 during loading (#14245)

This commit is contained in:
Bram Kragten
2022-10-31 16:06:33 +01:00
committed by GitHub
parent 3356d559c9
commit 2e988bf5c3
4 changed files with 32 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ import {
} from "lit";
import { customElement, property, state, query } from "lit/decorators";
import { isComponentLoaded } from "../common/config/is_component_loaded";
import { fireEvent } from "../common/dom/fire_event";
import { handleWebRtcOffer, WebRtcAnswer } from "../data/camera";
import { fetchWebRtcSettings } from "../data/rtsp_to_webrtc";
import type { HomeAssistant } from "../types";
@@ -59,6 +60,7 @@ class HaWebRtcPlayer extends LitElement {
?playsinline=${this.playsInline}
?controls=${this.controls}
.poster=${this.posterUrl}
@loadeddata=${this._loadedData}
></video>
`;
}
@@ -188,6 +190,11 @@ class HaWebRtcPlayer extends LitElement {
}
}
private _loadedData() {
// @ts-ignore
fireEvent(this, "load");
}
static get styles(): CSSResultGroup {
return css`
:host,