Trying to use marquee with state_attr

Hello, I’m trying to configure a marquee card with what music I’m playing into my smartphone.
I used the following code into a button-card:

custom_fields:
      media: |
        [[[
          return `<marquee> <ha-icon
            icon="mdi:music"
            style="width: 20px; height: 20px;"></ha-icon
            <span> ${{ state_attr('sensor.m2007j22g_media_session', 'album_com.maxmpz.audioplayer') }}
               </marquee>`
        ]]]

But I get the error:

How to do to get the album title?

custom button card use javascript, not jinja…
use

<span>${states['sensor.m2007j22g_media_session'].attributes['album_com.maxmpz.audioplayer']}</span>