Add hiding controls to native webrtc player (oops)

This commit is contained in:
Dermot Duffy
2022-10-11 22:00:22 -07:00
parent 38c6ce33c0
commit cebdf9a789
2 changed files with 7 additions and 2 deletions
-2
View File
@@ -29,8 +29,6 @@ customElements.whenDefined('ha-hls-player').then(() => {
@query('#video')
protected _video: HTMLVideoElement;
protected _controlsVisibilityTimerID: number | null = null;
/**
* Play the video.
*/
+7
View File
@@ -14,6 +14,10 @@ import { customElement } from 'lit/decorators.js';
import { query } from 'lit/decorators/query.js';
import { dispatchErrorMessageEvent } from '../components/message.js';
import { dispatchMediaLoadedEvent } from '../utils/media-info.js';
import {
hideMediaControlsTemporarily,
MEDIA_LOAD_CONTROLS_HIDE_SECONDS,
} from '../utils/media.js';
import liveHAComponentsStyle from '../scss/live-ha-components.scss';
customElements.whenDefined('ha-web-rtc-player').then(() => {
@@ -86,6 +90,9 @@ customElements.whenDefined('ha-web-rtc-player').then(() => {
.muted=${this.muted}
?playsinline=${this.playsInline}
?controls=${this.controls}
@loadedmetadata=${() => {
hideMediaControlsTemporarily(this._video, MEDIA_LOAD_CONTROLS_HIDE_SECONDS);
}}
@loadeddata=${(e) => {
dispatchMediaLoadedEvent(this, e);
}}