Skip to content

Commit 4bd68db

Browse files
authored
Update WebRTC provider documentation to reference new APIs (#2410)
1 parent 6d6ec9d commit 4bd68db

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

docs/core/entity/camera.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,10 @@ class MyCamera(Camera):
104104
"""Handle the WebRTC offer and return an answer."""
105105
```
106106

107-
### RTSP to WebRTC
107+
### WebRTC Providers
108108

109-
An integration may provide a WebRTC stream for any RTSP camera using `async_register_rtsp_to_web_rtc_provider`. The current best practice is for an integration to provide the actual stream manipulation with an Add-on or external service.
110-
111-
```python
112-
async def handle_offer(stream_source: str, offer_sdp: str) -> str:
113-
"""Handle the signal path for a WebRTC stream and return an answer."""
114-
try:
115-
return await client.offer(offer_sdp, stream_source)
116-
except ClientError as err:
117-
raise HomeAssistantError from err
118-
119-
# Call unsub() when integration unloads
120-
unsub = camera.async_register_rtsp_to_web_rtc_provider(
121-
hass, DOMAIN, handle_offer
122-
)
123-
```
109+
An integration may provide a WebRTC stream from an existing camera's stream source using the libraries in `homeassistant.components.camera.webrtc`. An
110+
integration may implement `CameraWebRTCProvider` and register it with `async_register_webrtc_provider`.
124111

125112
### Turn on
126113

0 commit comments

Comments
 (0)