Allow camera engines to signal events to the card.

This commit is contained in:
Dermot Duffy
2024-03-03 15:40:20 -08:00
parent 305a2db573
commit 88bea0ae7d
61 changed files with 7480 additions and 4213 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ export class VideoRTC extends HTMLElement {
pcConfig: RTCConfiguration;
wsState: number;
pcState: number;
video: HTMLVideoElement;
video: HTMLVideoElement | null;
ws: WebSocket | null;
wsURL: string;
pc: RTCPeerConnection | null;
+3 -3
View File
@@ -71,7 +71,7 @@ export class FrigateCardGo2RTC extends LitElement implements FrigateCardMediaPla
}
public isMuted(): boolean {
return this._player?.video.muted ?? true;
return this._player?.video?.muted ?? true;
}
public async seek(seconds: number): Promise<void> {
@@ -87,11 +87,11 @@ export class FrigateCardGo2RTC extends LitElement implements FrigateCardMediaPla
}
public isPaused(): boolean {
return this._player?.video.paused ?? true;
return this._player?.video?.paused ?? true;
}
public async getScreenshotURL(): Promise<string | null> {
return this._player ? screenshotMedia(this._player.video) : null;
return this._player?.video ? screenshotMedia(this._player.video) : null;
}
disconnectedCallback(): void {
+1 -1
View File
@@ -133,7 +133,7 @@ export class FrigateCardSurround extends LitElement {
*/
protected willUpdate(changedProperties: PropertyValues): void {
if (this.timelineConfig?.mode && this.timelineConfig.mode !== 'none') {
import('./timeline.js');
import('./timeline-core.js');
}
// Only reset the timeline cameraIDs when the media or display mode
+3 -1
View File
@@ -139,7 +139,7 @@ export class FrigateCardViewer extends LitElement {
const mediaType = this.view.getDefaultMediaType();
if (!mediaType) {
// Directly render an error message (instead of dispatching it upwards)
// to preserve the mini-timeline if the user scans into an area with no
// to preserve the mini-timeline if the user pans into an area with no
// media.
return renderMessage({
type: 'info',
@@ -157,6 +157,7 @@ export class FrigateCardViewer extends LitElement {
{
allCameras: this.view.isGrid(),
targetView: 'recording',
useCache: false,
},
);
} else {
@@ -169,6 +170,7 @@ export class FrigateCardViewer extends LitElement {
allCameras: this.view.isGrid(),
targetView: 'media',
eventsMediaType: mediaType,
useCache: false,
},
);
}