Add controls option to media player playback card feature#30338
Add controls option to media player playback card feature#30338MindFreeze wants to merge 3 commits intodevfrom
Conversation
Allow users to configure which playback controls are shown and in what order. When controls are explicitly configured, each selected control is rendered as its own button in the specified order. When no controls are configured, the original default behavior is preserved. Also adds a configuration editor for the feature and fixes inline feature padding in the tile card container.
|
Would it be possible to have the additional option there for volume + and volume - button? For the time being, if you want to have both media control and volume control, you need two lines, thus you canot have it "inline". To have (on/off) (play/pause) (volume -) and (volume +) on the same line would be very versatile and not completely crazy from UX perspective. This PR allowing to chose the button could make it possible. |
src/panels/lovelace/card-features/hui-media-player-playback-card-feature.ts
Outdated
Show resolved
Hide resolved
I did consider that but it would have to be a separate PR after this one goes through. Adding them to a "playback" feature by default doesn't seem great but as options for customization should be ok |
|
Exactly. As option ( not displayed by default) it would be great ! In this PR or another one, but this pr allowing to chose what to display is an enabler for this option ! |
Reuse the shared computeMediaControls function for the default (no explicit controls) path instead of duplicating the logic. Apply the narrow filter to both paths via a shared _filterNarrow method.
Proposed change
Add a
controlsconfiguration option to the media player playback card feature that allows users to choose which playback controls are displayed and in what order.When controls are explicitly configured, each selected control is rendered as its own button in the specified order. When no controls are configured, the original default behavior is preserved.
Available controls:
turn_on,turn_off,media_play,media_pause,media_play_pause,media_stop,media_previous_track,media_next_track.Also includes a configuration editor for the feature (with multi-select, reorder support)
Screenshots
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
To help with the load of incoming pull requests: