Skip to content
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

Streaming the camera to a media player uses internal url #99

Open
michaelwoods opened this issue Sep 27, 2021 · 2 comments
Open

Streaming the camera to a media player uses internal url #99

michaelwoods opened this issue Sep 27, 2021 · 2 comments

Comments

@michaelwoods
Copy link

Version of the custom_component

0.9.23

Configuration

service: camera.play_stream
data:
  media_player: media_player.bedroom_home_hub
target:
  entity_id:
    - camera.front_door_main

Describe the bug

The stream will fail to play and the logs show that an internal_url was used (http://ip_address/...) when I do not have that defined in my configuration. I do have external_url only, to avoid this issue with casting devices.

Debug log

Failed to cast media http://ip_address:8123/api/hls/dd56f293afd20bed8fad30c64b7bde11198bc2d66108f2edc7821a23b354d6b8/master_playlist.m3u8 from internal_url (http://ip_address:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Note that I replaced my real internal address with ip_address above.

@rroller
Copy link
Owner

rroller commented Oct 4, 2021

Hmm, I'm not sure what to do here. I get what you are trying to do, and to cast some of these devices need a public facing URL. But I'm not sure how to make your external_url map to your internal IP address. If you have multiple cameras, how would HA know which one to route to just from the external URL alone?

@michaelwoods
Copy link
Author

For multiple cameras, the internal_url is still the same. It's the Home Assistant http url not camera IPs. The path would be different per camera, essentially HA proxies the stream itself. At least that's my understanding of how HA handles cameras and streaming.

Example:

http://ip_address:8123/api/hls/foo
http://ip_address:8123/api/hls/bar

would become

https://my.external.domain/api/hls/foo
https://my.external.domain/api/hls/bar

The method that this component uses to report its camera's address for the play_stream service would need to reference the external_url for a cast-device to play it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants