by using the media_image_url property of media_player entity, the image is stretched beyond its max size when it is not square. Although the requirement is documented to be a square it is quite common to have preview images that are not matching this requirement. If an image is not square the following behavior would be correct in my opinion:
check the aspect ratio
if width > height: stretch the image width to the available space and center it vertically
if height > width: stretch the image height to the available space and center it horizontally
What also needs to be considered is the use case of having the media_title and media_duration controls being visible, because the media player component can be defined to fit the aspect ratio of the image, but then the controls are not visible.
Thanks!
How to Reproduce
provide an image url to media_image_url property that is not square (in my case width > height)
check on the remote how the image is shown (in my case the height is stretched to available space andn width extends available space)
Expected behavior
Also non-square images should be shown correctly and not extend outside of the visible area.
Is there an existing issue for this?
Description
Hi,
by using the media_image_url property of media_player entity, the image is stretched beyond its max size when it is not square. Although the requirement is documented to be a square it is quite common to have preview images that are not matching this requirement. If an image is not square the following behavior would be correct in my opinion:
What also needs to be considered is the use case of having the media_title and media_duration controls being visible, because the media player component can be defined to fit the aspect ratio of the image, but then the controls are not visible.
Thanks!
How to Reproduce
Expected behavior
Also non-square images should be shown correctly and not extend outside of the visible area.
System version
1.7.5
What part of the system affected by the problem?
UI
Additional context
No response