diff --git a/src/components/media-grid.ts b/src/components/media-grid.ts index b894f32b..45135747 100644 --- a/src/components/media-grid.ts +++ b/src/components/media-grid.ts @@ -1,4 +1,5 @@ -// TODO: Performance of video scanning (pause/play?) +// TODO: Video scanning not select other camera? +// TODO: Drag from live results in different cameras being shown in timeline in media viewer? import { CSSResultGroup, diff --git a/src/components/viewer.ts b/src/components/viewer.ts index dfcb896f..03480a80 100644 --- a/src/components/viewer.ts +++ b/src/components/viewer.ts @@ -541,24 +541,24 @@ export class FrigateCardViewerCarousel extends LitElement { return; } const selectedMedia = this._media[this.selected]; - if (!selectedMedia) { + const player = this._getPlayer(); + if (!selectedMedia || !player) { return; } const seekTimeInMedia = selectedMedia.includesTime(seek); - setOrRemoveAttribute(this, !seekTimeInMedia, 'unseekable'); - if (!seekTimeInMedia) { - this._getPlayer()?.pause(); - } else { - this._getPlayer()?.play(); + if (!seekTimeInMedia && !player.isPaused()) { + player.pause(); + } else if (seekTimeInMedia && player.isPaused()) { + player.play(); } const seekTime = (await this.cameraManager?.getMediaSeekTime(this.hass, selectedMedia, seek)) ?? null; - const player = this._getPlayer(); - if (player && seekTime !== null) { + + if (seekTime !== null) { player.seek(seekTime); } }