Making Markdown/Picture entity show an entity's attribute

Hello! I’m currently trying to have home assistant display a media player’s media_image_url attribute as a markdown or picture card. My card’s current YAML configuration is:

type: markdown
content: |
  ![image]({{ media_player.vlc_telnet_2.media_image_url }})
theme: Catppuccin Latte

And I just can’t get it to work.
I’m assuming I have some sort of problem with getting the attribute’s value or something.

Hi, try this. Replace YOUR_MEDIAPLAYER with the name of your media player and make sure your media player have a entity_picture attribute. If not change it with the correct one.

type: markdown
content: >
  ![image]({{ state_attr("media_player.YOUR_MEDIAPLAYER",
  "entity_picture") }})
theme: Catppuccin Latte

Thanks! Works perfectly!