Enable smooth panning between past/live.
This commit is contained in:
@@ -51,15 +51,15 @@ customElements.whenDefined('ha-camera-stream').then(() => {
|
||||
return this._player?.play();
|
||||
}
|
||||
|
||||
public pause(): void {
|
||||
public async pause(): Promise<void> {
|
||||
this._player?.pause();
|
||||
}
|
||||
|
||||
public mute(): void {
|
||||
public async mute(): Promise<void> {
|
||||
this._player?.mute();
|
||||
}
|
||||
|
||||
public unmute(): void {
|
||||
public async unmute(): Promise<void> {
|
||||
this._player?.unmute();
|
||||
}
|
||||
|
||||
@@ -67,10 +67,7 @@ customElements.whenDefined('ha-camera-stream').then(() => {
|
||||
return this._player?.isMuted() ?? true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek the video (unsupported).
|
||||
*/
|
||||
public seek(seconds: number): void {
|
||||
public async seek(seconds: number): Promise<void> {
|
||||
this._player?.seek(seconds);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ customElements.whenDefined('ha-hls-player').then(() => {
|
||||
return this._video?.play();
|
||||
}
|
||||
|
||||
public pause(): void {
|
||||
public async pause(): Promise<void> {
|
||||
this._video?.pause();
|
||||
}
|
||||
|
||||
public mute(): void {
|
||||
public async mute(): Promise<void> {
|
||||
// The muted property is only for the initial muted state. Must explicitly
|
||||
// set the muted on the video player to make the change dynamic.
|
||||
if (this._video) {
|
||||
@@ -49,7 +49,7 @@ customElements.whenDefined('ha-hls-player').then(() => {
|
||||
}
|
||||
}
|
||||
|
||||
public unmute(): void {
|
||||
public async unmute(): Promise<void> {
|
||||
// See note in mute().
|
||||
if (this._video) {
|
||||
this._video.muted = false;
|
||||
@@ -60,7 +60,7 @@ customElements.whenDefined('ha-hls-player').then(() => {
|
||||
return this._video?.muted ?? true;
|
||||
}
|
||||
|
||||
public seek(seconds: number): void {
|
||||
public async seek(seconds: number): Promise<void> {
|
||||
if (this._video) {
|
||||
hideMediaControlsTemporarily(this._video);
|
||||
this._video.currentTime = seconds;
|
||||
|
||||
@@ -9,16 +9,17 @@
|
||||
// available as compilation time.
|
||||
// ====================================================================
|
||||
|
||||
import { css, CSSResultGroup, html, unsafeCSS, TemplateResult } from 'lit';
|
||||
import { css, CSSResultGroup, html, TemplateResult, unsafeCSS } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { query } from 'lit/decorators/query.js';
|
||||
import { dispatchErrorMessageEvent } from '../components/message.js';
|
||||
import liveHAComponentsStyle from '../scss/live-ha-components.scss';
|
||||
import { FrigateCardMediaPlayer } from '../types.js';
|
||||
import { dispatchMediaLoadedEvent } from '../utils/media-info.js';
|
||||
import {
|
||||
hideMediaControlsTemporarily,
|
||||
MEDIA_LOAD_CONTROLS_HIDE_SECONDS,
|
||||
MEDIA_LOAD_CONTROLS_HIDE_SECONDS
|
||||
} from '../utils/media.js';
|
||||
import liveHAComponentsStyle from '../scss/live-ha-components.scss';
|
||||
|
||||
customElements.whenDefined('ha-web-rtc-player').then(() => {
|
||||
@customElement('frigate-card-ha-web-rtc-player')
|
||||
@@ -36,11 +37,11 @@ customElements.whenDefined('ha-web-rtc-player').then(() => {
|
||||
return this._video?.play();
|
||||
}
|
||||
|
||||
public pause(): void {
|
||||
public async pause(): Promise<void> {
|
||||
this._video?.pause();
|
||||
}
|
||||
|
||||
public mute(): void {
|
||||
public async mute(): Promise<void> {
|
||||
// The muted property is only for the initial muted state. Must explicitly
|
||||
// set the muted on the video player to make the change dynamic.
|
||||
if (this._video) {
|
||||
@@ -48,7 +49,7 @@ customElements.whenDefined('ha-web-rtc-player').then(() => {
|
||||
}
|
||||
}
|
||||
|
||||
public unmute(): void {
|
||||
public async unmute(): Promise<void> {
|
||||
// See note in mute().
|
||||
if (this._video) {
|
||||
this._video.muted = false;
|
||||
@@ -59,7 +60,7 @@ customElements.whenDefined('ha-web-rtc-player').then(() => {
|
||||
return this._video?.muted ?? true;
|
||||
}
|
||||
|
||||
public seek(seconds: number): void {
|
||||
public async seek(seconds: number): Promise<void> {
|
||||
if (this._video) {
|
||||
this._video.currentTime = seconds;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user