Open PolestarWx opened 3 years ago
Would be nice to get that button in general (if the player has SUPPORT_BROWSE_MEDIA) not only for spotiy
Hello, I looked into it when it was initially released in HA but the media browser dialog was locally imported from where it was used throughout HA, so wasn't accessible by custom-cards.
I later read that it's possible to integrate with the media browser from custom-cards iirc. Will look into it further in the future and try to bring you this feature.
Hello, I would also be grateful if I could one day use a MediaBrowser Button Like on Nest Mini Cast Devices Card Otherwise thanks for this work
Would love the ability to add a MediaBrowser button to the card
Hello, any update? Thx
Fake it till he makes it :smile: This is my media player:
and when I switch it on, I have a media library button:
it works like this:
type: 'custom:stack-in-card'
cards:
- type: 'custom:mini-media-player'
entity: media_player.wohnzimmer_squeeze
artwork: none
icon: 'mdi:music'
hide:
volume: true
power: false
source: true
progress: true
info: true
card_mod:
style:
.: |
ha-card div.mmp-player {
padding-bottom: 0px;
}
ha-card div.mmp-player__adds {
margin-left: 48px !important;
}
- type: media-control
entity: media_player.wohnzimmer_squeeze
card_mod:
style: |
paper-progress {
display: none;
}
div.media-info {
display: none;
}
div.top-info {
display: none;
}
div.background {
display: none;
}
ha-icon-button {
display: none;
}
mwc-icon-button {
margin-right: 12px;
}
div.title-controls {
padding: 0 0 0px;
}
.no-progress.player {
padding-bottom: 16px !important;
}
div.player {
color: inherit !important;
}
div.off {
display: none;
}
- type: 'custom:mini-media-player'
entity: media_player.wohnzimmer_squeeze
hide:
volume: true
power: true
source: true
name: true
info: false
controls: true
progress: false
icon: true
state_label: true
card_mod:
style: |
ha-card.--inactive .mmp-player {
padding: 0px !important;
}
ha-card div.mmp-player {
padding-top: 0px;
}
ha-card div.entity__info__media {
color: var(--mmp-active-color);
}
mmp-powerstrip {
display: none;
}
- type: 'custom:mini-media-player'
entity: media_player.wohnzimmer_squeeze
name: Spotify
artwork: full-cover-fit
hide:
volume: true
power: true
source: true
name: true
info: true
controls: true
progress: true
icon: true
state_label: true
card_mod:
style: |
ha-card.--inactive .mmp-player {
padding: 0px !important;
}
ha-card .mmp-player {
padding: 0px;
}
Fake it till he makes it 😄 This is my media player:
and when I switch it on, I have a media library button:
it works like this:
type: 'custom:stack-in-card' cards: - type: 'custom:mini-media-player' entity: media_player.wohnzimmer_squeeze artwork: none icon: 'mdi:music' hide: volume: true power: false source: true progress: true info: true card_mod: style: .: | ha-card div.mmp-player { padding-bottom: 0px; } ha-card div.mmp-player__adds { margin-left: 48px !important; } - type: media-control entity: media_player.wohnzimmer_squeeze card_mod: style: | paper-progress { display: none; } div.media-info { display: none; } div.top-info { display: none; } div.background { display: none; } ha-icon-button { display: none; } mwc-icon-button { margin-right: 12px; } div.title-controls { padding: 0 0 0px; } .no-progress.player { padding-bottom: 16px !important; } div.player { color: inherit !important; } div.off { display: none; } - type: 'custom:mini-media-player' entity: media_player.wohnzimmer_squeeze hide: volume: true power: true source: true name: true info: false controls: true progress: false icon: true state_label: true card_mod: style: | ha-card.--inactive .mmp-player { padding: 0px !important; } ha-card div.mmp-player { padding-top: 0px; } ha-card div.entity__info__media { color: var(--mmp-active-color); } mmp-powerstrip { display: none; } - type: 'custom:mini-media-player' entity: media_player.wohnzimmer_squeeze name: Spotify artwork: full-cover-fit hide: volume: true power: true source: true name: true info: true controls: true progress: true icon: true state_label: true card_mod: style: | ha-card.--inactive .mmp-player { padding: 0px !important; } ha-card .mmp-player { padding: 0px; }
I dont know, what is the problem. I see the source list but the media browser button can not view. But I see media browser button in original media player card.
type: entities
entities:
- type: 'custom:mini-media-player'
entity: media_player.mopidy_kozpont
group: true
artwork: cover
source: icon
info: short
hide:
volume: true
- type: 'custom:mini-media-player'
entity: media_player.snapcast_client_uvlaptop
group: true
hide:
controls: true
power: true
source: true```
![image](https://user-images.githubusercontent.com/80971054/119269818-ebaa7600-bbf9-11eb-8b0d-68e3ff674c5e.png)
Fake it till he makes it 😄 This is my media player:
and when I switch it on, I have a media library button:
it works like this:
type: 'custom:stack-in-card' cards: - type: 'custom:mini-media-player' entity: media_player.wohnzimmer_squeeze artwork: none icon: 'mdi:music' hide: volume: true power: false source: true progress: true info: true card_mod: style: .: | ha-card div.mmp-player { padding-bottom: 0px; } ha-card div.mmp-player__adds { margin-left: 48px !important; } - type: media-control entity: media_player.wohnzimmer_squeeze card_mod: style: | paper-progress { display: none; } div.media-info { display: none; } div.top-info { display: none; } div.background { display: none; } ha-icon-button { display: none; } mwc-icon-button { margin-right: 12px; } div.title-controls { padding: 0 0 0px; } .no-progress.player { padding-bottom: 16px !important; } div.player { color: inherit !important; } div.off { display: none; } - type: 'custom:mini-media-player' entity: media_player.wohnzimmer_squeeze hide: volume: true power: true source: true name: true info: false controls: true progress: false icon: true state_label: true card_mod: style: | ha-card.--inactive .mmp-player { padding: 0px !important; } ha-card div.mmp-player { padding-top: 0px; } ha-card div.entity__info__media { color: var(--mmp-active-color); } mmp-powerstrip { display: none; } - type: 'custom:mini-media-player' entity: media_player.wohnzimmer_squeeze name: Spotify artwork: full-cover-fit hide: volume: true power: true source: true name: true info: true controls: true progress: true icon: true state_label: true card_mod: style: | ha-card.--inactive .mmp-player { padding: 0px !important; } ha-card .mmp-player { padding: 0px; }
@kongo09 great solution, I'm thinking this will be a usable solution until the media browser popup is accessible by custom cards.
Do you know if card mod can be used to center the media browser icon horizontally/vertically within the card? - I'd like to basically put the media player into a grid so it just looks like a square button to access the media browser, but the alignment is off.
I cannot say for sure but trusting the power of card_mod I'd guess it should be possible
Starting from @kongo09 code, thanks!! I came up with this card-mod configuration, by way too much trying and error, I know nothing of css ! 🤦♂️
I tried to make a smaller button, inside a grid or horizontal-stack, but what I have found out is that when the media-control card gets too horizontaly small (< 300px ), it change its class to a .no-controls
type, and the the mediabutton is gone, it's not even there to be repositioned. So, I had to keep my button taking the whole width of a card.
update, my 2.0 version of the 'fake a media library button':
update, my 2.0 version of the 'fake a media library button':
click to expand Yaml
@sdrapha That looks brilliant well done!
Can I ask what 'media player' entity you use for the main card? - eg. Is media_player.yt_music_rapha a 'virtual' device that doesn't physically exist, but is just there to control the listed target speakers?
Essentially, I have a bunch of media players in HomeAssistant (which each represent a real speaker in the house) and I'm struggling to get my head around how I use the one card to control them (hopefully I'm right in thinking that in your screenshot you could click 'Nest Big' for example, and then the buttons control the volume/playback etc. for that speaker, then you could click 'TV Chromecast' and the buttons control that instead.)
I think @sdrapha uses this https://github.com/KoljaWindeler/ytube_music_player
And yes, it does support switching between players and controls will be applied to the active player.
Exactly!
So is this coming to the version of kalkih? Wanting this too...
I had to change my "fake it till we make it" code a bit due to HA frontend changes:
type: custom:stack-in-card
cards:
- type: custom:mini-media-player
entity: media_player.wohnzimmer_squeeze
artwork: none
icon: mdi:music
hide:
volume: true
power: false
source: true
progress: true
info: true
icon_state: false
card_mod:
style:
.: |
ha-card div.mmp-player {
padding-bottom: 0px;
}
ha-card div.mmp-player__adds {
margin-left: 48px !important;
}
- type: media-control
entity: media_player.wohnzimmer_squeeze
card_mod:
style: |
mwc-linear-progress {
display: none;
}
div.media-info {
display: none;
}
div.top-info {
display: none;
}
div.background {
display: none;
}
ha-icon-button {
display: none;
}
ha-icon-button.browse-media {
display: block;
padding-right: 10px;
}
div.title-controls {
padding: 0 0 0px;
}
.no-progress.player {
padding-bottom: 16px !important;
}
div.player {
color: inherit !important;
}
div.off {
display: none;
}
- type: custom:mini-media-player
entity: media_player.wohnzimmer_squeeze
hide:
volume: true
power: true
source: true
name: true
info: false
controls: true
progress: false
icon: true
state_label: true
card_mod:
style: |
ha-card.--inactive .mmp-player {
padding: 0px !important;
}
ha-card div.mmp-player {
padding-top: 0px;
}
ha-card div.entity__info__media {
color: var(--mmp-active-color);
}
mmp-powerstrip {
display: none;
}
- type: custom:mini-media-player
entity: media_player.wohnzimmer_squeeze
name: Spotify
artwork: full-cover-fit
hide:
volume: true
power: true
source: true
name: true
info: true
controls: true
progress: true
icon: true
state_label: true
card_mod:
style: |
ha-card.--inactive .mmp-player {
padding: 0px !important;
}
ha-card .mmp-player {
padding: 0px;
}
@kongo09
Thank you for keeping this up to date, i really appreciate and cannot wait for integrating homeassistant again :)
An update for people wondering; this is unfortunately sitll not possible to implement in custom cards.
Thanks for the update @kalkih.
Unfortunately, this became an even more desirable feature because they decided to remove sonos favorites from the source selection list without a decent workaround.
thanks for that idea here ;-) I wanted to share some improvement. I played with z-index to place the "select" button on top of an empty button:
`type: custom:vertical-stack-in-card cards:
They really should do something to make this source/cast icon available... Indeed the Sonos favorites are gone and only 'TV' is showing there for me... Edit: I created a new feature request topic on the HA side as well, not sure if there was already one. https://community.home-assistant.io/t/give-access-to-the-media-players-source-media-icon-for-mini-media-player/490728
subscribing to this to hopefully hear updates in the future. For now I have to waffle between mini media player and standard media-control while I try to decide if I prefer the functionality of having the media browser or the minimalist looks of the custom card.
I can share an updated version of my "fake it till we make it" yaml later when I get home, it may help someone eventually.
subscribing to this thread, as I would like to see the mini media player have a browse media
button as well.
Thanks!
I can share an updated version of my "fake it till we make it" yaml later when I get home, it may help someone eventually.
Yes Please! Still would so love to have this feature in the excellent mini-media-player!
As hassio introduced support for media Library since 0.115, it is possible to add support for the media library icon of original hassio's media player:![image](https://user-images.githubusercontent.com/16896194/98462121-f3e91980-21b1-11eb-824e-75792b04d379.png)
The code is here : https://github.com/home-assistant/core/commit/c8d49a8adfd6a4587b79f2361ec7d59ffdc575e4#diff-c09babd1295c823387ca3f879688e2135940e0f78f3264ff328c1e0c3a27ca63