-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] : Media library button #435
Comments
Would be nice to get that button in general (if the player has SUPPORT_BROWSE_MEDIA) not only for spotiy |
Hello, I later read that it's possible to integrate with the media browser from custom-cards iirc. |
Hello, I would also be grateful if I could one day use a MediaBrowser Button Like on Nest Mini Cast Devices Card |
Would love the ability to add a MediaBrowser button to the card |
Hello, |
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.
|
@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 ! 🤦♂️ click to expand Yamltype: media-control
entity: media_player.yt_music_rapha
title: title
card_mod:
style: |
div.media-info {
display: none;
}
div.top-info {
display: none;
}
div.background {
display: none;
}
ha-icon-button {
display: none;
}
mwc-icon-button {
margin-bottom: 4px;
display: true;
position: relative !important;
left: 47% ;
--mdc-icon-size: 50px !important;
}
div.title-controls {
padding: 0 0 6px;
}
.no-progress.player {
padding-bottom: 16px !important;
}
div.player {
color: inherit !important;
}
div.off {
display: true;
} 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 |
@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? |
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;
} |
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. |
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 |
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:
The code is here : home-assistant/core@c8d49a8#diff-c09babd1295c823387ca3f879688e2135940e0f78f3264ff328c1e0c3a27ca63
The text was updated successfully, but these errors were encountered: