mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Allow ExoPlayer only from more-info-camera (#6974)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
858196ab53
commit
4392d78ff6
@ -32,6 +32,9 @@ class HaCameraStream extends LitElement {
|
||||
@property({ type: Boolean, attribute: "muted" })
|
||||
public muted = false;
|
||||
|
||||
@property({ type: Boolean, attribute: "allow-exoplayer" })
|
||||
public allowExoPlayer = false;
|
||||
|
||||
// We keep track if we should force MJPEG with a string
|
||||
// that way it automatically resets if we change entity.
|
||||
@internalProperty() private _forceMJPEG?: string;
|
||||
@ -61,6 +64,7 @@ class HaCameraStream extends LitElement {
|
||||
<ha-hls-player
|
||||
autoplay
|
||||
playsinline
|
||||
.allowExoPlayer=${this.allowExoPlayer}
|
||||
.muted=${this.muted}
|
||||
.controls=${this.controls}
|
||||
.hass=${this.hass}
|
||||
|
@ -35,6 +35,9 @@ class HaHLSPlayer extends LitElement {
|
||||
@property({ type: Boolean, attribute: "playsinline" })
|
||||
public playsInline = false;
|
||||
|
||||
@property({ type: Boolean, attribute: "allow-exoplayer" })
|
||||
public allowExoPlayer = false;
|
||||
|
||||
@query("video") private _videoEl!: HTMLVideoElement;
|
||||
|
||||
@internalProperty() private _attached = false;
|
||||
@ -91,7 +94,7 @@ class HaHLSPlayer extends LitElement {
|
||||
}
|
||||
|
||||
private async _getUseExoPlayer(): Promise<boolean> {
|
||||
if (!this.hass!.auth.external) {
|
||||
if (!this.hass!.auth.external || !this.allowExoPlayer) {
|
||||
return false;
|
||||
}
|
||||
const externalConfig = await getExternalConfig(this.hass!.auth.external);
|
||||
|
@ -48,6 +48,7 @@ class MoreInfoCamera extends LitElement {
|
||||
<ha-camera-stream
|
||||
.hass=${this.hass}
|
||||
.stateObj=${this.stateObj}
|
||||
allow-exoplayer
|
||||
controls
|
||||
></ha-camera-stream>
|
||||
${this._cameraPrefs
|
||||
|
Loading…
x
Reference in New Issue
Block a user