Unify content_type for Media player play_media #766
Replies: 4 comments 7 replies
-
|
How would one distinguish between a playlist of audio vs video (and I can imagine a mix of these could be possible too)? |
Beta Was this translation helpful? Give feedback.
-
|
uniform solution sounds good, as as we speak I filed several Apple TV issues that underline the issue you seek to solve. see home-assistant/core#71569 just so this is tied and referenced. I do believe its not only the playing (content_type) that requires some love. The Controls are also not correctly applied, eg when playing a track on an Apple TV device (HomePod mini), the device is never released, so we can not click Next, or use the tts service... because 'Already streaming to that device' home-assistant/core#71571. |
Beta Was this translation helpful? Give feedback.
-
|
The enum could be simplified a lot if we don't care exactly what the media type is. In that case it's either "audio" or "video" and "playlist_audio", "playlist_video", "playlist_mixed". |
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure this is the best long-term path. Stepping back as we discuss a redesign, is the What if the convention was to (try to) include all necessary identifying information about the media in the Are there going to be situations where the same ID is used with differing types? I can't think of a reasonable scenario where that should occur. If it does, it probably means the ID schema is not unique enough. For example a I guarantee there are exceptions that I haven't considered where the above couldn't apply cleanly, but the current |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Media player entities have a "media_content_type" parameter for the play_media service call.
That parameter is a bit of a mystery and total chaos across all integrations.
I'm developing Music Assistant that utilizes the media players present in Home Assistant for playback and I quickly realized this is a bit of a mess:
I think this should be consolidated into a more uniform solution.
My proposal (open for debate):
Parameters for play_media service call:
Enum MediaType:
ARTIST
ALBUM
TRACK
EPISODE
MOVIE
GENERIC_AUDIO
GENERIC_VIDEO
PLAYLIST_AUDIO
PLAYLIST_VIDEO
PLAYLIST_MIXED
BONUS: Additional attribute on media_player entity what content_types it supports. Based on that a play media request can be denied or in case of Music Assistant, transcoded to another format.
Beta Was this translation helpful? Give feedback.
All reactions