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:
Ing. Jaroslav Šafka 2020-10-19 11:16:20 +02:00 committed by GitHub
parent a73754c1b5
commit 3dc6898673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,18 +104,7 @@ class MoreInfoMediaPlayer extends LitElement {
></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>
`
: supportsFeature(stateObj, SUPPORT_VOLUME_BUTTONS)
${supportsFeature(stateObj, SUPPORT_VOLUME_BUTTONS)
? html`
<ha-icon-button
action="volume_down"
@ -129,6 +118,18 @@ class MoreInfoMediaPlayer extends LitElement {
></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>
`
: ""}