mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +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" })
|
@property({ type: Boolean, attribute: "muted" })
|
||||||
public muted = false;
|
public muted = false;
|
||||||
|
|
||||||
|
@property({ type: Boolean, attribute: "allow-exoplayer" })
|
||||||
|
public allowExoPlayer = false;
|
||||||
|
|
||||||
// We keep track if we should force MJPEG with a string
|
// We keep track if we should force MJPEG with a string
|
||||||
// that way it automatically resets if we change entity.
|
// that way it automatically resets if we change entity.
|
||||||
@internalProperty() private _forceMJPEG?: string;
|
@internalProperty() private _forceMJPEG?: string;
|
||||||
@ -61,6 +64,7 @@ class HaCameraStream extends LitElement {
|
|||||||
<ha-hls-player
|
<ha-hls-player
|
||||||
autoplay
|
autoplay
|
||||||
playsinline
|
playsinline
|
||||||
|
.allowExoPlayer=${this.allowExoPlayer}
|
||||||
.muted=${this.muted}
|
.muted=${this.muted}
|
||||||
.controls=${this.controls}
|
.controls=${this.controls}
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
|
@ -35,6 +35,9 @@ class HaHLSPlayer extends LitElement {
|
|||||||
@property({ type: Boolean, attribute: "playsinline" })
|
@property({ type: Boolean, attribute: "playsinline" })
|
||||||
public playsInline = false;
|
public playsInline = false;
|
||||||
|
|
||||||
|
@property({ type: Boolean, attribute: "allow-exoplayer" })
|
||||||
|
public allowExoPlayer = false;
|
||||||
|
|
||||||
@query("video") private _videoEl!: HTMLVideoElement;
|
@query("video") private _videoEl!: HTMLVideoElement;
|
||||||
|
|
||||||
@internalProperty() private _attached = false;
|
@internalProperty() private _attached = false;
|
||||||
@ -91,7 +94,7 @@ class HaHLSPlayer extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _getUseExoPlayer(): Promise<boolean> {
|
private async _getUseExoPlayer(): Promise<boolean> {
|
||||||
if (!this.hass!.auth.external) {
|
if (!this.hass!.auth.external || !this.allowExoPlayer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const externalConfig = await getExternalConfig(this.hass!.auth.external);
|
const externalConfig = await getExternalConfig(this.hass!.auth.external);
|
||||||
|
@ -48,6 +48,7 @@ class MoreInfoCamera extends LitElement {
|
|||||||
<ha-camera-stream
|
<ha-camera-stream
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.stateObj=${this.stateObj}
|
.stateObj=${this.stateObj}
|
||||||
|
allow-exoplayer
|
||||||
controls
|
controls
|
||||||
></ha-camera-stream>
|
></ha-camera-stream>
|
||||||
${this._cameraPrefs
|
${this._cameraPrefs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user