Lovelace: Mini Media Player

This is up to the individual integration to handle, I believe Chromecast will show artwork when playing from youtube, not sure if it’s the real thumbnail though or just a frame from the video.

Thanks - I use card mod but haven’t figured out how to change the icon size.

Hello guys!

Can I fix the card dimension (Heigh) in order to have both my cards always allineated?

Best bet would be card-mod, possibly by setting padding-bottom: 40px to .mmp-player__core

Set --mdc-icon-size: 80px; on .entity__icon for example.

Thanks!!!

1 Like

Thank you!
I achieved it with this coding:

        style: |
          ha-card {
            height: 300px;
            width: 374px;
          }   
1 Like

Can you give an example of using scale? I looked on the Github page but did not see one.
Thanks.

I am trying to build a music player media card as part of my tablet UI. Here is the general layout of the card.

Here is my code:

cards:
      - cards:
          - cards:
              - entities:
                  - entity: input_select.media_player
                show_header_toggle: false
                type: entities
            type: 'custom:layout-card'
          - cards:
              - cards:
                  - artwork: full-cover
                    entity: media_player.family_room
                    hide:
                      icon: true
                      mute: true
                      power_state: true
                      volume: true
                    info: scroll
                    show_source: false
                    show_tts: true
                    type: 'custom:mini-media-player'
                  - entities:
                      - vacuum.roberta
                    type: entities
                type: horizontal-stack
            colunm-num: 2
            layout: horizontal
            max_width:
              - 70%
              - 30%
            min_height: 200
            type: 'custom:layout-card'
          - cards:
              - entity: media_player.family_room
                full_row: true
                type: 'custom:slider-entity-row'
              - cards:
                  - color_type: icon
                    hold_action:
                      action: call-service
                      repeat: 300
                      service: media_player.volume_down
                      service_data:
                        entity_id: media_player.family_room
                    icon: 'mdi:volume-minus'
                    tap_action:
                      action: call-service
                      service: media_player.volume_down
                      service_data:
                        entity_id: media_player.family_room
                    type: 'custom:button-card'
                  - color_type: icon
                    hold_action:
                      action: call-service
                      repeat: 300
                      service: media_player.volume_down
                      service_data:
                        entity_id: media_player.family_room
                    icon: 'mdi:volume-mute'
                    tap_action:
                      action: call-service
                      service: media_player.volume_down
                      service_data:
                        entity_id: media_player.family_room
                    type: 'custom:button-card'
                  - color_type: icon
                    hold_action:
                      action: call-service
                      repeat: 300
                      service: media_player.up
                      service_data:
                        entity_id: media_player.family_room
                    icon: 'mdi:volume-plus'
                    tap_action:
                      action: call-service
                      service: media_player.up
                      service_data:
                        entity_id: media_player.family_room
                    type: 'custom:button-card'
                type: horizontal-stack
            layout: vertical
            type: 'custom:layout-card'
        max_width: 100%
        type: vertical-stack

Here are the features that I am trying to integrate and implement. These features are color code to the media player layout card

MediaPalyer: Sonos Kitchen

  • able to select various sonos systems via input select
  • If more than one sonos system is playing then card would change to show every 15 seconds to display other “playing “ mediaplayers”
  • Join
  • Unjoin
    MediaPlayer Page features

Now Playing:

  • No controls visible
  • Reacts to above media player information
  • Artwork: full_cover_fit
  • should take about 70% of screen
  • Scroll music information
  • If no media is playing card must maintain size
    MediaPlayer Page features 2

Source:

  • Source_list as possible drop down. I prefer to use attributes rather than input selects as I may at time change my sources in the SONOS APP
  • example:
  •     source_list: 
    
  • 20th Century Radio,
  • Air1 Radio, Alternative Beats,
  • Alternative Hits,
  • Amy Grant Radio,
  • Bachata 2015 Radio,
    MediaPlayer Page features 3

Controls:

  • Vol +
  • Vol %
  • Vol -
  • Mute
  • On/off
  • 30 sec Jump back (if media player source supports this)
  • previous
  • Play/pause
  • Next
  • 30 sec Jump forward (if media player source supports this)
    MediaPlayer Page features 4

Lol, I actually thought I had shared everything. Here is my current layout: https://i.imgur.com/5GZTZ71.png. This is far from the intended mockup. I am having a few issue with the layout that I can not solve
1- the first section won’t extend the length of the page even when I use max_width. What am I doing wrong?

2- the mid section of is supposed to be a 70/30 split , but unfortunately it only will go to 50/50. I have tried to rearrage the number and still no change .

Did you have a question?

@kalkih Hi, do you know how I can change this code with card-mod styling?

ha-card[artwork*="full-cover"].--has-artwork .mmp-player {
    background: linear-gradient(to top, var(--mmp-overlay-color) var(--mmp-overlay-color-stop), transparent 100%);
}

I have succesfully tested this with inspector and it changes the background of the controller area (and also changed the radius).

ha-card[artwork*="full-cover"].--has-artwork .mmp-player {
    background: rgba(0, 0, 0, 0.8);
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

But I can’t seem to make it work with card-mod. Do you know how I can use this with card-mod? Is there a chance you can make this a variable we can set ourself? Both background and radius of the corners. I am trying to create a modified media player card, using your mini media player within picture elements. Or if you can point me how to change this is your card .js file, I’ll do a hardcode.

This is the result :slight_smile:
Playing:
qhbwxlbH7F

Paused:
msedge_TxSBqIqjhd

I only need those card-mod settings to make it permanent.

3 Likes

With the new 0.115 media player capabilities (but not yet upgraded) I was just wondering will mini media player support the media browser, etc.? Will that work out of the box, or does it need development?

2 Likes

How to set up a TUNEIN Radio station inside a button? I mean not using the url of the station but directly inside TUNEIN.
I tried using ‘type: TUNEIN’ but it seems not working…

I’d also love to have this feature!

It does not work out-of-the-box, but indeed very nice functionality to have. I wondering about moving back to the standard media-player. I’ve tried the new media browser, it would be really nice to have it in mini media player.

It does work out-of-the-box, just press the card to bring up the more-info popup and you’ll have the media browser feature button right there.
But maybe you had something else in mind, perhaps you want the button directly on the card?

1 Like

An option for that would be nice if it is not too much trouble.

1 Like

Will look into it :wink:

3 Likes

Yes it works out of the box and only one MP3 stored in the media folder can be played, but how to force all stored MP3s to be played

Hey guys, I am back and I think that I now have a better grip on my earlier ask. I am trying to create a custom media player card ( should work for both audio and video) that display information based on the input_select card.

  • List item

Can my input_select card shown in the image be used to change the Now playing card that is only showing the music information?

Is there a way to have a cord that list all the sources based on the input_select? This would aslo allow you to play that source to the specific input selected.

So in essence all 3 cards ( Now Playing/ Source List/ Controls status) the are part of my media player react to theinput_select card.

Here is my code for those that may be interested https://paste.ubuntu.com/p/z9Q3NXw6kC/ .