Allow to cast in HLS format when using WebRTC (#80646)
This commit is contained in:
parent
4da3fb5baa
commit
37cfa3e19b
1 changed files with 5 additions and 3 deletions
|
@ -46,15 +46,17 @@ class CameraMediaSource(MediaSource):
|
||||||
f"/api/camera_proxy_stream/{camera.entity_id}", camera.content_type
|
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:
|
if "stream" not in self.hass.config.components:
|
||||||
raise Unresolvable("Stream integration not loaded")
|
raise Unresolvable("Stream integration not loaded")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
url = await _async_stream_endpoint_url(self.hass, camera, HLS_PROVIDER)
|
url = await _async_stream_endpoint_url(self.hass, camera, HLS_PROVIDER)
|
||||||
except HomeAssistantError as err:
|
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
|
raise Unresolvable(str(err)) from err
|
||||||
|
|
||||||
return PlayMedia(url, FORMAT_CONTENT_TYPE[HLS_PROVIDER])
|
return PlayMedia(url, FORMAT_CONTENT_TYPE[HLS_PROVIDER])
|
||||||
|
|
Loading…
Add table
Reference in a new issue