I love this custom media player card ! It looks really great.
I have just installed the custom ps4 media player component (https://github.com/hmn/home-assistant-config/wiki/media_player_ps4), which displays a local image for each game (the online file does not seem to work).
The image displays properly with the “state UI view” (which does not use the mini-media player card), but nothing shows up in the lovelace UI view as you can see on the screenshot below. Still, when I click on the card to display more info, I can see a small thumbnail.
Hello, I’ve been excited to try this project for some time. Unfortunately, I am getting the error “custom element doesn’t exist: mini-media-player”
I am running the latest version of Home Assistant which is using the Lovelace GUI mode. Following earlier instructions, I edited my /config/.storage/lovelace file to:
The bundle is in the correct www folder. I have the latest version and I’ve tried clearing the browser cache and restarting Home Assistant several times.
Is there something else that I’m missing? Thank you for any help
Can you post the state attributes of the media player, can be found by accessing /dev-state.
Also, please check the /dev-info log an the browser developer console for errors.
Just double checking, from the resource url it looks like you put the bundle in a folder named mini-media-player inside the www folder, is that correct?
Please check the browser developer console for errors.
However, the image does not show up when used in a media-control card. There must be a problem with the custom ps4 component. The developer presents a screenshot of a media player with a game cover in this post, that’s why I thought the issue came from the media player configuration. I’ll seek help on this page. Thanks for your help in the troubleshooting !
Okay, that’s interesting.
The reason It works inside the entities card is probably because the image isn’t fetched from the WebSocket API, the image is rendered in a state-badge element which just refers to the location of the image file on disk and applies that url as the background image, I believe.
I’m not sure if it’s supposed to work through the WS API like it’s implemented now or if something need to be changed in the custom PS4 component to make it work.
I realise i’m probably doing something completely stupid here, but i’ve had this issue a couple of times with the custom cards as bundle.js files now.
So i’ve downloaded the bundle.js file, and then in configurator i’m uploading the file to the www folder, but each time i do when i look in the js file all of the code has been copied to the first line, and so the code doesn’t work.
Please help an idiot out!!?
What do you mean by uploading the file in the configurator?
As far as the bundle goes (at least for my cards mini-graph-card and mini-media-player) the code is minified before release to take up as little space as possible, so it’s basically made into a single really long line of code.
Sorry for not explaining myself properly.
Using Configurator in Hassio i’m going to my www folder and using the “upload file” option to upload the bundle.js i’ve downloaded. When i click in to the file though the entire code is on line 1 of the js file. I’ve added the reference to the raw config file as i have for other custom files.
I’m getting the “custom element doesn’t exist” error when i try and add the card.
I do genuinely always try and solve the errors i get before asking but as i can’t find anything similar makes me think i’m just being a bit dumb on this.
edit. So i went back and downloaded the zip folder instead, created a new folder and dropped the 9 files from the zip in there, then changed the reference path, and that seems to have solved it.
Okay, I’ve never used hassio myself so I wasn’t aware that you upload files through the configurator.
As described above the code should indeed be on a single line, so that’s most likely not the issue.
Would you mind posting the resource reference code you got and also the card configuration?
No Problem (I have ninja edited above after you posted with a way that’s worked for me)
I basically copied directly from github for the resource and then a simple two line card to check if it was working.
resources:
- url: /local/mini-media-player-bundle.js?v=0.9.8
type: module
Ok, I think I have tried everything now… But I’m an amateur in Home Assistant and have just installed it so im still learning.
Probably some easy fault but I really cant figure it out…
Im using the latest Hassio install with Lovelace UI. When trying to add a card with mediaplayer, I get this error: YAML Error: TypeError: Cannot read property ‘startsWith’ of undefined
Im using this code:
type: custom:mini-media-player
entity: media_player.spotify
name: Spotify Player
artwork: cover
power_color: true
hide_volume: true
show_progress: true
If I try to add only:
type: custom:mini-media-player
entity: media_player.spotify
I get: Custom element doesn’t exist: mini-media-player.
I have downloaded the bundle and created a directory “www” within the “config” folder and put it there.
I also have set the frontend parameter in configuration.yaml:
frontend:
javascript_version: latest
Also resources in ui-lovelace.yaml (also tried adding it to storage/lovelace):
resources:
If you just created the www folder I believe you need to restart your Home Assistant for it to work.
If you still get Custom element doesn’t exist: mini-media-player , check if you can access the file manually by navigating to http://192.168.1.5:8123/local/mini-media-player-bundle.js (change ip:port to match your HA setup obviously).
The update includes new TTS options, new Sonos option, ability to seek though media & much more.
Important for existing users
This is a major release and many configuration options have been either reworked, renamed or changed in order to streamline future card configurations but also to make certain new features possible. This does introduce quite a few breaking changes that could effect existing card configurations.
Check the updated option list and the changelog and update your configurations accordingly.
If you have issues, questions or need help migrating to the new options, please open an issue on GitHub or let me know here.
Changelog
NEW: Ability to seek through media by pressing on the progress bar