mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Allow to cast in HLS format when using WebRTC (#80646)
This commit is contained in:
parent
4da3fb5baa
commit
37cfa3e19b
@ -46,15 +46,17 @@ class CameraMediaSource(MediaSource):
|
||||
f"/api/camera_proxy_stream/{camera.entity_id}", camera.content_type
|
||||
)
|
||||
|
||||
if stream_type != StreamType.HLS:
|
||||
raise Unresolvable("Camera does not support MJPEG or HLS streaming.")
|
||||
|
||||
if "stream" not in self.hass.config.components:
|
||||
raise Unresolvable("Stream integration not loaded")
|
||||
|
||||
try:
|
||||
url = await _async_stream_endpoint_url(self.hass, camera, HLS_PROVIDER)
|
||||
except HomeAssistantError as err:
|
||||
# Handle known error
|
||||
if stream_type != StreamType.HLS:
|
||||
raise Unresolvable(
|
||||
"Camera does not support MJPEG or HLS streaming."
|
||||
) from err
|
||||
raise Unresolvable(str(err)) from err
|
||||
|
||||
return PlayMedia(url, FORMAT_CONTENT_TYPE[HLS_PROVIDER])
|
||||
|
Loading…
x
Reference in New Issue
Block a user