Sure. consider_idle_after checks the media_position_updated_at attribute reported by the media player. It then compares that time with current time and if the time difference is larger than what’s specified in consider_idle_after, the card will render as “idle”.
When player is considered idle, progress/artwork/volume & media controls are hidden
When player is considered idle, media information (if available) is faded and restricted to one row
When player is considered idle and media is available/paused a play button is visible
The following example would render the player idle after 0.5 minutes (30 sec) if media_position_updated_at isn’t updated, given the media player has media_position_updated_at set.
Thanks for explaining it a bit more. Now I understand why this is not working for me. When playing Tunein radio trough my Sonos speaker, there is no “media_position_updated_at:” available. Same goes for selecting TV as a source.
Would love an option “consider paused as idle”
When playing some random mp3, this is working as intended.
Okay I see, that’s unfortunate.
I could really only try this option with my Chromecasts and they seem to report media_position_updated_at for all types of playback.
Unfortunately the backend components differ quite a bit in their implementations.
One thing is still not clear to me: can i delete mini-media-player.js or it must be still used in conjunction with mini-media-player-bundle.js. And in the ui-lovelace which one of the two i must use?
And why this difference between the two screenshots: The card says the audio cast in inactive while the more infos says playing?
You only need the mini-media-player-bundle.js.
That’s also what you should reference in ui-lovelace.yaml.
Did you set name: Audio Cast in the card configuration? Because that will only apply to the card itself. The more info dialog is part of core HA and nothing I can control.
If you want to change the name everywhere I would recommend you to look into Customizing entities.
I have the same issue with other streams, not just TuneIn. Think it’s possibly a HA limitation, which is why I would love to be able to set artist, track and album art data to a media_player…
No, you should use custom:mini-media-player in your card configs. However, you should reference to the mini-media-player-bundle.js file under resources: in ui-lovelace.yaml.
Go through the instructions in the initial post again if you are unsure.
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry
at http://192.168.1.250:8123/local/custom_ui/mini-media-player.js?v=0.9.1:881:16
This mini media card is the only one I use that refuses to update - it copies the js file but can’t update the Lovelace version. Other cards update fine. No idea why.
This seems to be a caching issue that sometimes occur after updates.
Restarting HA and/or clear browser cache should solve it.
If that doesn’t help, make sure you only got one reference to mini-media-player.js or mini-media-player-bundle.js under resources: in ui-lovelace.yaml.
I have that but when there is an update, I click update and it copies the new js file but it doesn’t update lovelave version so I manually edit that and restart and all good. Other custom cards work.