Limych / media_player.linkplay

Deprecated. Please, use https://github.com/nagyrobi/home-assistant-custom-components-linkplay
MIT License
30 stars 56 forks source link

Tunein metadata #17

Open craggyh opened 4 years ago

craggyh commented 4 years ago

Not an issue as such but not quite a feature request either.

If I play media from Tunein on the linkplay speakers via the SmartSonix app on my phone then the correct media metadata is interpreted and homeassistant shows the current radio station name/details and logo.

If I play the same radio station directly from the audio stream link URL from Tunein using mediaplayer.play_media via a script then no media info is shown. Is there a way to get this component to read the metadata from the stream URL or what is the source of the metadata?

smgt commented 4 years ago

This isn't necessarily a error in this component i've noticed the same error when playing a video stream link in the chromecast integration in HA. Do you have copy of the URL you are trying to play from a script so I can test some.

smgt commented 4 years ago

Oh, by the way, do you have libmagic installed where you are running HA? When a media_uri is used this component tries to lookup data about the stream from id3 tag. The lib needs libmagic.

nagyrobi commented 4 years ago

I experience the same, using 2 different types of LinkPlay devices (IEAST AudioCast firmware version 4.2.8230 and Arylic S50 Pro girmware version 4.2.8020). If I call the service media_player.play_media with the following data:

        - data:
            entity_id: media_player.myroom
            media_content_id: 'http://92.61.114.159:7812/slagerfm256.mp3'
            media_content_type: music

I hear the audio well, but no metadata is shown. But not only in Home Assistant! The app on Android also just shows that something is playing, no metadata there either, unless the playback is started from the app. I guess there's something with the way the service starts the playback...

nagyrobi commented 4 years ago

OK. What I've discovered so far is that when you start a radio station from the Android app, the information returned by /httpapi.asp?command=getPlayerStatus gets updated with all the correct Title etc. When you start a radio station with a call from Home Assistant as above, the information returned by /httpapi.asp?command=getPlayerStatus will update only iuri and uri, the Title, Artist etc will remain the same from the previous stream. This is is a bug in the firmware, i guess.

nagyrobi commented 4 years ago

In my fork I've added support to retrieve the metadata directly from icecast's stream.