Add hiding controls to native webrtc player (oops)
This commit is contained in:
@@ -29,8 +29,6 @@ customElements.whenDefined('ha-hls-player').then(() => {
|
|||||||
@query('#video')
|
@query('#video')
|
||||||
protected _video: HTMLVideoElement;
|
protected _video: HTMLVideoElement;
|
||||||
|
|
||||||
protected _controlsVisibilityTimerID: number | null = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Play the video.
|
* Play the video.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ import { customElement } from 'lit/decorators.js';
|
|||||||
import { query } from 'lit/decorators/query.js';
|
import { query } from 'lit/decorators/query.js';
|
||||||
import { dispatchErrorMessageEvent } from '../components/message.js';
|
import { dispatchErrorMessageEvent } from '../components/message.js';
|
||||||
import { dispatchMediaLoadedEvent } from '../utils/media-info.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';
|
import liveHAComponentsStyle from '../scss/live-ha-components.scss';
|
||||||
|
|
||||||
customElements.whenDefined('ha-web-rtc-player').then(() => {
|
customElements.whenDefined('ha-web-rtc-player').then(() => {
|
||||||
@@ -86,6 +90,9 @@ customElements.whenDefined('ha-web-rtc-player').then(() => {
|
|||||||
.muted=${this.muted}
|
.muted=${this.muted}
|
||||||
?playsinline=${this.playsInline}
|
?playsinline=${this.playsInline}
|
||||||
?controls=${this.controls}
|
?controls=${this.controls}
|
||||||
|
@loadedmetadata=${() => {
|
||||||
|
hideMediaControlsTemporarily(this._video, MEDIA_LOAD_CONTROLS_HIDE_SECONDS);
|
||||||
|
}}
|
||||||
@loadeddata=${(e) => {
|
@loadeddata=${(e) => {
|
||||||
dispatchMediaLoadedEvent(this, e);
|
dispatchMediaLoadedEvent(this, e);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user