piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily
Apache License 2.0
3.56k stars 330 forks source link

[Feature]: Media Player entity picture aspect ratio #906

Open Ulrar opened 1 year ago

Ulrar commented 1 year ago

Requirements

Is your feature request related to a problem?

When I use Kodi to play TVHeadEnd channels, the entity_picture is set from a picon for the channel. That icon gets squashed a bit by the media player card :

image

Details of that picture :

rireetchansons.png: PNG image data, 400 x 240, 8-bit colormap, non-interlaced

Describe the solution you'd like

It'd be nice to be able to select the fit type when the aspect ratio isn't optimal for the card, in this case I'd probably choose to crop it or make it smaller rather than force it squashed.

Describe alternatives you've considered

No response

Additional context

No response

piitaya commented 1 year ago

How does it looks with the official entities card ?

Ulrar commented 1 year ago

Do you mean type: entity ? I'm not quite sure how to display the entity_picture with that card ? It's an attribute on the media player, not the entity icon

piitaya commented 1 year ago
type: entities
entities:
   - media.player.your_entity

This card should display the picture if there is one.

Ulrar commented 1 year ago

Ah sorry yes, entities.

It looks like this : image Which isn't great either

piitaya commented 1 year ago

I think the best solution is to crop the image to a square format to have better support everywhere (entities card, entity picker, etc...)

Ulrar commented 1 year ago

If you mean the source picture, picons are shipped with TVHeadEnd in the container. They can be overriden but that'd mean having to edit hundreds of pictures, and I'm not sure how that would render in 'normal' use in the htsp clients which are likely expecting that aspect ratio. If we can't get that cropping option in the media player card, I'll just leave it like that or disable the use of the entity_picture I guess