> ## Documentation index
> Fetch the complete documentation index at: https://developer.rhombus.com/llms.txt
> Use it to discover all available pages before exploring further.

# Recon Video and Audio

> Stream live and recorded video from each of a Recon robot's cameras, and its live audio: get the stream URLs for every camera with getAllMediaUris, pick the camera you want, and play it like any Rhombus camera.

A robot carries one or more cameras and a microphone. Each one is a **facet** of the robot: video facets are named `v0`, `v1`, and so on, and audio facets `a0`. Their streams work the same way as a Rhombus camera's, so the [streaming guides](https://developer.rhombus.com/implementations/streaming-video) and [Media and streams](https://developer.rhombus.com/authentication/media) apply. The examples use the `robot_api` helper from the [overview](https://developer.rhombus.com/robots/overview#conventions).

**You need** a credential with live-only access to the robot for live streams, and read-only access for recorded video.

## Get the stream URLs

[`getAllMediaUris`](https://developer.rhombus.com/api-reference/robot-webservice/get-media-uris-for-every-configured-facet-of-a-robot) returns the URLs for every facet at once:

```python Python
media = robot_api("getAllMediaUris", {"deviceUuid": ROBOT_UUID})
for facet, uris in media["videoFacetUris"].items():
    print(facet, uris.get("wanLiveM3u8Uri"))
for facet, uris in media["audioFacetUris"].items():
    print(facet, uris.get("wanLiveOpusUri"))
```

| Field             | Contains                                                                                                                                                                                                       |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `videoFacetUris`  | For each video facet: `wanLiveM3u8Uri` (HLS), `wanLiveMpdUri` (DASH), `wanLiveH264Uri` (H.264 over WebSocket), `wanVodM3u8UriTemplate` and `wanVodMpdUriTemplate` (recorded video), and the `lan…` equivalents |
| `audioFacetUris`  | For each audio facet: `wanLiveOpusUri` (Opus over WebSocket) and `lanLiveOpusUris`                                                                                                                             |
| `wanLiveRobotUri` | The robot's [live socket](https://developer.rhombus.com/robots/live-socket), for control and telemetry                                                                                                         |
| `lanCheckUrls`    | URLs that answer `204` when your client can reach the robot on the local network                                                                                                                               |

Fetch the URLs again before you reconnect to a stream. The robot's media host can change.

## Choose a camera

[`getFullState`](https://developer.rhombus.com/robots/monitor#fleet-state) says which facets the robot has and which way each camera points:

```python Python
state = robot_api("getFullState", {"deviceUuid": ROBOT_UUID, "force": False})["fullState"]
directions = (state.get("robotPlatformCapability") or {}).get("facetOrientationDegrees") or {}
names = state.get("facetNameMap") or {}
for facet in state.get("supportedFacets", []):
    if facet in media["videoFacetUris"]:
        print(facet, names.get(facet, ""), directions.get(facet), "degrees")
```

- `supportedFacets` lists the facets the robot really has. Use only facets that appear both there and in `getAllMediaUris`.
- `facetOrientationDegrees` gives each camera's direction, counterclockwise from the robot's forward direction: `0` looks forward, `180` looks back.
- `facetNameMap` has each facet's name.

## Play live video

Play a facet's URL like a camera's. In a browser, mint a [federated token](https://developer.rhombus.com/authentication/federated-tokens) on your server and add it to the URL:

```javascript JavaScript
const url = `${videoFacetUris.v0.wanLiveM3u8Uri}?x-auth-scheme=federated-token&x-auth-ft=${encodeURIComponent(token)}`;
if (video.canPlayType("application/vnd.apple.mpegurl")) {
  video.src = url;
} else {
  const hls = new Hls();
  hls.loadSource(url);
  hls.attachMedia(video);
}
```

From a server or native app, send your API key headers on every request instead. DASH and the H.264 WebSocket work as described in [Live and recorded video](https://developer.rhombus.com/authentication/media#live-and-recorded-video).

## Recorded video

The `wanVodM3u8UriTemplate` and `wanVodMpdUriTemplate` of a facet play what that camera recorded. Replace `{START_TIME}` (Unix time in seconds) and `{DURATION}` (seconds) in the template:

```python Python
template = media["videoFacetUris"]["v0"]["wanVodM3u8UriTemplate"]
url = template.replace("{START_TIME}", str(start_seconds)).replace("{DURATION}", "300")
```

To find the moments worth watching, use the robot's [events](https://developer.rhombus.com/robots/monitor#event-history): each arrival at a patrol stop has a `timestampMs`.

## Live audio

`wanLiveOpusUri` is a WebSocket that streams Opus audio from the robot's microphone. Authenticate it like the H.264 WebSocket ([WebSocket (H.264 and audio)](https://developer.rhombus.com/authentication/media#websocket-h264-and-audio)).

## On the local network

When your client is on the robot's network, request one of the `lanCheckUrls`. If it answers `204`, use the `lan…` URLs for lower latency and no internet traffic. [Streaming over LAN](https://developer.rhombus.com/implementations/lan-streaming) covers certificates and authentication on the local network.
