Youtube Music - Media Browser

Hi @JKW, first of all thank you for this awesome integration. Its my most used integration and one i’m spending the most time trying to get perfect in my current Lovelace redesign.

This question probably isn’t related to this integration specifically, however thought i would ask here incase there is some sort of magic in the player that could help achieve what I’m looking for.

Does anyone know if its possible to embed the Media browser library from home assistant be used as a card within love lace, or as a pop up?

my use case is i currently have a “media” view which has multiple mini-media player cards that i have on some tablets around the house & using the mini-media player shortcuts i can select the players and have a conditional card for individual google cast audio players volumes.

Where i am having issues is with my “playlist” section in the screenshot below. My current solution has been to get the ID for every playlist i have in my library and use a grid of picture cards within a custom swiper card and tap to call a service to the media player to change the playlist.


while this works, its a lot of coding and if i add a new playlist i need to go and this new playlist to the list of cards and maintain.

What i would love to be able to achieve is have the dynamic nature of the media library be usable as a card, so i dont have to hard code my inputs. I’m also using the playlist select drop downs in a popup to help with this, however having the cards would be taking it to another level.

Particularly now there is a “search” service in the player, the use case is even more valuable. Ideally i would love to have a text input field to call the search service and then have the results available in the pop-up or card even better just show the grid of results the same way as the current media browser.

I’ve tried to use an imbedded “iframe” card (see below), however this isn’t great as i cant seem to hide the header with kiosk mode, and the iframe doesn’t like working on some of my devices.

image

If anyone has been able to come up with something similar that i could try that would be amazing.

2 Likes

just to give you feedback (although it isn’t the feedback you want): no :smiley:
I agree that a media_browser card would be awesome but I didn’t find one.

Or maybe something like a card that just needs the ID and loads the Icon and provides the call service … but again … nothing found and I’m really no javascript/frontend programmer

JKW

edit: very very nice interface …

1 Like

iframe was my first thought which I come up with and with some fiddling around via browser dev tools it seems like it should be possible to get rid of it. So iframe and card-mod is probably one possible route. :thinking:

Love your dashboard as well :heart_eyes:

Thanks for responding. I did see you ask a similar question back in 2020 on the media_browser community thread, so thought this was the case :smiley: . I’m in no way any form of coder, but have slowly been learning by unpicking a lot of others integrations and dashboards.

I was thinking if its possible to leverage the API which returns the images from youtube for album art and and also pick up the playlist ID like you said, but this is way over my limited understanding of whats possible.

For now im going to play around with Card-mod and a pop-up as @Nath recomends below. Not sure how to hide elements using cardmod just yet, but im sure some googling will prevail :slight_smile:

Hi, I’ve released a new version that might help to enhance your playlists with new music

3 Likes

New released version of today Release Added: Moods & Genres · KoljaWindeler/ytube_music_player · GitHub now supports moods & genres in the media_browser

Cheers JKW

1 Like

@JKW did you see that 2021.7 now has official support for select basically input_select for integrations.

I saw that, yes. But didn’t really get the point. It was already possible to fill an input_select from a component, which is what I do for the playlists. So where is the benefit?
Jkw

New release of today Release Further Media_browser enhancements · KoljaWindeler/ytube_music_player · GitHub which enhances the media_browser by adding two new buttons:

  1. Playback device → directly select the output device (alternativ to the input_select)
  2. Current playlist → shows current list with the option to directly jump to another track (keeps the playlist)

Now we really need a lovelace card to show the content of the media_browser embedded on the frontend :nerd_face:

JKW

3 Likes

We are getting so close! Amazing work as always JKW.

Do you think this would become an official integration in the future?

1 Like

Hello, thank you for your work and efforts to support this integration.
This integration really becomes very user-friendly. I have one question.

I only listen to my uploaded music. I am not using a subscription, because the subscription does not have the content I need.

Please tell me, many of my youtube music playlists usually have more than 100 tracks. Many albums also contain over 100 tracks. But I only have 100 tracks displayed. And there is no way to go beyond this line.
If I select, for example, the 118th track in the media browser, then the player plays only this track and cannot go to the next one.
The rewind and forward buttons also stop working.

Is there any way to get around this limitation?

sure
go to configuration → integrations → ytube_music_player, click configure → check “show advance configuration” → change “limit of simultaneously loaded tracks” to your desired value
JKW

1 Like

Actually today’s release is a bit related to the last question: Limits!

20210720.01 adds two limits: A request limit and a user limit.

??:confused:??

The request limit can be configured as discuessed above:
go to configuration → integrations → ytube_music_player, click configure → check “show advance configuration” → change “limit of simultaneously loaded tracks” to your desired value

This request limit is now used for all api calls and will likely make request slower for most of you :frowning:
The reason is that the request limit had a default value of 99 and all previously release versions ignored the limit for most calls and simply called the api with the default value 25.

So you should either go to the configuration and adjust your default value from 99 to 25 or be happy about longer playlists. :smiley:

The user limit is another animal. This is disabled by default, but can be set by calling

service: ytube_music_player.limit_count
data:
  entity_id: media_player.ytube_music_player
  limit: 3

This will limit the amount of tracks that will be loaded into your playlist.

??:confused:?? still confused because both limits sound the same?

Actually that is true for a straight playlist / album.

But not for a shuffled playlist: Setting the request limit to 3 will always give you the first 3 items of your playlist in shuffled order. But leaving the request limit higher and set the user limit to 3 will give you 3 random tracks of your playlist.

Thats actually the reason why I needed that feature. My kids are allow to listen to 2 good-night-stories, picked randomly out of a longer playlist. As of now I had to stop playback after the 2nd track (and frequently missed that). Now my automation will simply enable the limit function ahead of playing the tracks.

JKW

Hi,

If i play to a group of speakers and any of them go unavailable the player just stops. Any way to ignore a speaker unavailable status and continue to play to the others?

hmm could you enable debugging (GitHub - KoljaWindeler/ytube_music_player: YouTube music player for homeassistant) and copy a log snipped once one device disconnected?
I’m not sure how homeassistant reacts on disconnected parts of a group and what the new group state would be
JKW

Hey Kolja,

Great app, I use it all the time.

Do you know is there a way to exclude speakers from the speakers list? I have some universal media players I created for volume control and don’t need them showing up in the pull down.

Thanks!

1 Like

Hmm yes, sort of.
You can select multiple players in the configuration of the integration. That should reduce the list from all media players down to those selected.

The drawback is that you’d have to select your output after a restart (I think it’ll take the first of the list as default after start)

Jkw

1 Like

That works, just what I was looking for, thanks!

1 Like

Hello,

Tanks for this add-on.

I have a question, this add-on is supported Alexa media player?

I read this topic, is not support but it was a year ago.

Thanks again.

Hi, no it doesn’t … Well the Alexa integration in Homeassistent does play from url so sadly there is nothing I can do about it
Jkw