# `MobWebrtc.Video`
[🔗](https://github.com/GenericJam/mob_webrtc/blob/main/lib/mob_webrtc/video.ex#L1)

Shows a remote H264 track in a `MobWebrtc.VideoView`.

    {:ok, _} = MobWebrtc.Video.start_link(peer: peer, track: track_id, view: :remote)

    # in render/1
    MobWebrtc.video_view(id: :remote, width: 320, height: 568)

It takes the track's RTP from the peer (`MobWebrtc.route/3`), rebuilds
Annex-B access units (`MobWebrtc.H264.depayload/3`, a frame per marker bit)
and hands each to the view's native decoder. When the decoder needs a
keyframe (it joined mid-stream, or a frame failed) it asks the sender for one
over RTCP, at most once a second.

`stats/1` is the decoder's own readback: frames in, decoded and dropped, the
decoded size, decode errors.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

# `stats`

```elixir
@spec stats(pid()) :: map() | {:error, term()}
```

The native decoder's counters for the view (`mob_webrtc_video_nif:video_stats/1`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
