Allow camera engines to signal events to the card.
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user