mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 14:56:37 +00:00
Add fix to more-info for media players without play/pause state (#7608)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
21a3dcf06c
commit
2e289cd152
@ -309,16 +309,21 @@ class MoreInfoMediaPlayer extends LitElement {
|
|||||||
(state === "playing" &&
|
(state === "playing" &&
|
||||||
(supportsFeature(stateObj, SUPPORT_PAUSE) ||
|
(supportsFeature(stateObj, SUPPORT_PAUSE) ||
|
||||||
supportsFeature(stateObj, SUPPORT_STOP))) ||
|
supportsFeature(stateObj, SUPPORT_STOP))) ||
|
||||||
(state === "paused" && supportsFeature(stateObj, SUPPORTS_PLAY))
|
(state === "paused" && supportsFeature(stateObj, SUPPORTS_PLAY)) ||
|
||||||
|
(state === "on" &&
|
||||||
|
supportsFeature(stateObj, SUPPORTS_PLAY) ||
|
||||||
|
supportsFeature(stateObj, SUPPORT_PAUSE))
|
||||||
) {
|
) {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
icon:
|
icon:
|
||||||
state !== "playing"
|
state === "on"
|
||||||
|
? "hass:play-pause"
|
||||||
|
: state !== "playing"
|
||||||
? "hass:play"
|
? "hass:play"
|
||||||
: supportsFeature(stateObj, SUPPORT_PAUSE)
|
: supportsFeature(stateObj, SUPPORT_PAUSE)
|
||||||
? "hass:pause"
|
? "hass:pause"
|
||||||
: "hass:stop",
|
: "hass:stop",
|
||||||
action: "media_play_pause",
|
action: state === "playing" && !supportsFeature(stateObj, SUPPORT_PAUSE) ? "media_stop" : "media_play_pause",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user