I am trying to figure out how to calculate the streaming URL to provide to an external device in order to play streaming media off from the Home Assistant’s local media collection. Does anyone have any pointers on whether this is surfaced somewhere? or where in the code the method to calculate the URL currently exists?
When I play media via the Home Assistant built in Play Media feature, it sends the device a URL that looks like:
https://[my HA machine]:8123/media/local/Alarm.mp3?authSig=[authkey]
But when I use the Media Selector in HA to choose a piece of media, it give me a media_content_id that contains a something like:
media-source://media_source/local/Alarm.mp3
I am trying to write a something that takes in the media URL as a parameter the same way the media_player.start would, but I can’t figure out how to get the local media_source URL converted into a remote URL with an auth token on it for the device.
Is this buried within the HA code in a way that one can’t get at it? Or is there another way to get this accomplished?