Allow default media controls to be hidden.

This commit is contained in:
Dermot Duffy
2023-05-14 20:00:23 -07:00
parent ffb0e8ac15
commit 972a0999fb
23 changed files with 909 additions and 815 deletions
+6 -3
View File
@@ -17,6 +17,9 @@ export class FrigateCardLiveHA extends LitElement implements FrigateCardMediaPla
@property({ attribute: false })
public cameraConfig?: CameraConfig;
@property({ attribute: true, type: Boolean })
public controls = true;
protected _playerRef: Ref<Element & FrigateCardMediaPlayer> = createRef();
public async play(): Promise<void> {
@@ -43,8 +46,8 @@ export class FrigateCardLiveHA extends LitElement implements FrigateCardMediaPla
this._playerRef.value?.seek(seconds);
}
public async setControls(controls: boolean): Promise<void> {
this._playerRef.value?.setControls(controls);
public async setControls(controls?: boolean): Promise<void> {
this._playerRef.value?.setControls(controls ?? this.controls);
}
public isPaused(): boolean {
@@ -65,7 +68,7 @@ export class FrigateCardLiveHA extends LitElement implements FrigateCardMediaPla
${ref(this._playerRef)}
.hass=${this.hass}
.stateObj=${stateObj}
.controls=${true}
.controls=${this.controls}
.muted=${true}
>
</frigate-card-ha-camera-stream>`;