Allow default media controls to be hidden.
This commit is contained in:
@@ -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>`;
|
||||
|
||||
Reference in New Issue
Block a user