Lovelace: Mini Media Player

Ok, so now i hope my issue will be considered, but till now none care of it…
Can you do something about it?

Hi tom, when I do that I get:

Error: Custom element not found: mini-media-player

What I did:

resources:
  - url: /local/mini-media-player-bundle.js?v=1.10.1
    type: module
  • through the ‘Raw Configuration Editor’ & saved
  • restarted HA.

That’s not what the instructions say to do. They say this:

  1. Add a reference to mini-media-player-bundle.js inside your configuration.yaml or through the Home Assistant UI from the resource tab.

resources: - url: /local/mini-media-player-bundle.js?v=1.10.1 type: module

Cut the entry you made in the raw editor and paste it into your configuration.yaml file. Then config check and restart.

Or go to the configuration / dashboards / resources menu and add it to the list there.

1 Like

If you see the issue while using a core media player component I would suggest opening an issue in the Home Assistant GitHub repo.

This is what and where i opened:

Is it ok?

Tried at first in configuration.yaml but that gave an error too and bumped on this thread: Component error: resources - Integration 'resources' not found but didn’t read that last post :blush: (it was late)

So now added through the resources tab (had to dig deep to find that again, and this time with that last post from the above mentioned thread… EUREKA!) :ok_hand: :clap:

Thanks A LOT tom (again)

1 Like

It really is much easier to use HACS, it does all that for you.

How do I remove the state text?

state_text

That is not mini-media-player is it?

Yes, it is of “type: custom:mini-media-player” that I have in a browser_mod.popup.

Then I think the support thread for that is what you want.

Ok, posted in browser_mod support. Thanks.

That looks strange, mini-media-player does not display the state, so I guess the media player state is not off and the media information is reported as off? What integration is the media player using?

You could try the idle_view options I guess when_paused might work?

How do I integrate stateful switches as shortcuts?

E.g. I would like to integrate the buttons inside the media player card but can’t figure out how to show their states

Below are 3 renderings:

  1. Left is right on the view.yaml
  2. Middle is via a browser_mod.popup
  3. Right is via a browser_mod.popup and lovelace_gen macro

Left - observe that “Off” does not show under the “Nook Speaker” media player.

Middle - again, observe that “Off” does not show under the “Nook Speaker” media player.

Right - now, observe that “Off” shows under the “Nook Speaker” media player.

How do I remove the state text? I tried the media_player idle_view options but no luck.

I will post in lovelace_gen.

Maybe you should post your yaml code instead of posting pictures on different threads. That way people can see your actual code an help you. Your card looks a lot more like entity card, not mini-media-player. Please post your code of that card.

Here is the code:

# lovelace_gen

{% macro tap_action_entities(entity) -%}
                    - entity: {{ entity }}
{% if media_player %}
                      type: 'custom:mini-media-player'
                      group: true
{% else %}
                      tap_action:
                        action: none
{% endif %}
{%- endmacro %}

title: Test
path: test
panel: true
icon: ''

cards:

  - type: custom:layout-card
    layout: vertical
    cards:

      - type: entities
        entities:
          - entity: 'switch.gosund_dc4f229cc629_relay_2'
            name: "Cat Water"
          - entity: 'media_player.nook_speaker'
            name: "Nook Speaker"
            group: true
            type: 'custom:mini-media-player'

      - break

      - type: entities
        entities:
          - type: 'custom:button-card'
            name: "via browser_mod.popup"
            tap_action:
              action: call-service
              service: browser_mod.popup
              service_data:
                title: " "
                card:
                  type: entities
                  show_header_toggle: false
                  entities:
                    - entity: 'switch.gosund_dc4f229cc629_relay_2'
                      name: "Cat Water"
                    - entity: 'media_player.nook_speaker'
                      name: "Nook Speaker"
                      group: true
                      type: 'custom:mini-media-player'
                deviceID:
                  - this

      - break

      - type: entities
        entities:
          - type: 'custom:button-card'
            name: "via browser_mod.popup and lovelace_gen macro"
            tap_action:
              action: call-service
              service: browser_mod.popup
              service_data:
                title: " "
                card:
                  type: entities
                  show_header_toggle: false
                  entities:
                    {{ tap_action_entities('switch.gosund_dc4f229cc629_relay_2') }}
                      name: "Cat Water"
                    {{ tap_action_entities('media_player.nook_speaker') }}
                      name: "Nook Speaker"
                deviceID:
                  - this
1 Like

Ok, I’ve never used lovelace_gen but just from looking at the screenshots and code I’m pretty confident in saying this is a lovelace_gen configuration issue and would recommend continuing this discussion in the lovelace_gen thread.

You’re most likely not rendering a mini-media-player card but instead just a normal entity row of the media player, that would explain the look of the card. You can pretty easily confirm this by inspecting the card in the browser developer tools (right click, inspect element) and look for the element name.
Or manually by specifying some specific mini-media-player options to the card and see if they are applied in the card or not.

First of all,

Thank you for this awesome media player.

If have add one for my sonos speakers and using the grouping ability, i’m able to add my other speakers to what’s currently playing.
But with one speaker being the master, i need a card for each sonos speaker, in order to play the other speakers individually. Is there a way to change the cards entity (master speaker) using a media shortcut button?

I’m sure this is somewhere in the posts above but there are so many and basic terms are hard to search for and narrow down. I have two questions.

first one. Is there a way for me to show which source is currently playing. I see the music song/artist, but I’d like to show which source is playing.

Here is what I’m working on
image

I’d like to know which of these stations is playing. My preference would be to highlight the button of the station playing,but I suspect that might be a bit tricky. I’d still be happy if it could show somewhere in the player.

Second question. In idle view can I display an image, or just a backround color of my choice. I cannot see the settings for what to add to idle_view, just how to turn it on.