mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 13:07:49 +00:00
Enable volume up/down for media player (#7376)
Always show volume up/down buttons in media player if SUPPORT_VOLUME_BUTTONS is supported. And slider if supported Previous impl. shows slider or up/down buttons.
This commit is contained in:
parent
a73754c1b5
commit
3dc6898673
@ -104,18 +104,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${supportsFeature(stateObj, SUPPORT_VOLUME_SET)
|
${supportsFeature(stateObj, SUPPORT_VOLUME_BUTTONS)
|
||||||
? html`
|
|
||||||
<ha-slider
|
|
||||||
id="input"
|
|
||||||
pin
|
|
||||||
ignore-bar-touch
|
|
||||||
.dir=${computeRTLDirection(this.hass!)}
|
|
||||||
.value=${Number(stateObj.attributes.volume_level) * 100}
|
|
||||||
@change=${this._selectedValueChanged}
|
|
||||||
></ha-slider>
|
|
||||||
`
|
|
||||||
: supportsFeature(stateObj, SUPPORT_VOLUME_BUTTONS)
|
|
||||||
? html`
|
? html`
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
action="volume_down"
|
action="volume_down"
|
||||||
@ -129,6 +118,18 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
|
${supportsFeature(stateObj, SUPPORT_VOLUME_SET)
|
||||||
|
? html`
|
||||||
|
<ha-slider
|
||||||
|
id="input"
|
||||||
|
pin
|
||||||
|
ignore-bar-touch
|
||||||
|
.dir=${computeRTLDirection(this.hass!)}
|
||||||
|
.value=${Number(stateObj.attributes.volume_level) * 100}
|
||||||
|
@change=${this._selectedValueChanged}
|
||||||
|
></ha-slider>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
@ -196,8 +197,8 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
)}
|
)}
|
||||||
@keydown=${this._ttsCheckForEnter}
|
@keydown=${this._ttsCheckForEnter}
|
||||||
></paper-input>
|
></paper-input>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
icon="hass:send"
|
icon="hass:send"
|
||||||
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state)}
|
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state)}
|
||||||
@click=${this._sendTTS}
|
@click=${this._sendTTS}
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user