7.6 Channel picture while the player loads
Show the channel's current picture while the player fills its buffer. Each streaming node keeps a recent picture of every always-on channel it is running, so the request only reads a file: it answers in a few milliseconds, before the player has its first frame.
Build a token with str = channel/<channel id>/jpg (same recipe, 7.2) and
open it (7.4) at the same time as the stream or just before. With the
capability picture_routes, ask a node in the channel's pictures (7.1):
the one you are about to play from if it is listed, otherwise the first;
no pictures, no request. Without the capability, ask the node you are
about to play from:
https://<host>:<port><prefix>/<token>~<session_token>
| Status | Meaning |
|---|---|
200 |
image/jpeg, up to 540 px high, usually 20-60 KB. Last-Modified is when it was taken; If-Modified-Since gives 304 |
404 |
No picture: the channel is not running on this node, starts on demand, or its picture is not ready yet (right after the node restarts, or on a busy node). Show the logo |
403 |
The channel is not in the line's package, or the line cannot play |
- Only ask nodes with
thumbnails: trueinplayback-routes. Never send ajpgtoken to a node without it: it would treat the request as a stream. - The picture is from the last 1-10 minutes, not live. Replace it with the video as soon as the first frame plays.
- It does not count as a screen and never starts a channel.
- You can reuse the same picture token for that channel until it expires (5 minutes).
- Nodes limit requests per IP, and pictures share that limit with the
stream, its playlist and its segments. When the user picks a channel, ask
only for that channel's picture. Preload neighbours in a channel list only
once the channel is playing, with at most 2-3 requests in flight. A
503or429on a picture just means no picture: never retry it, and never move to another node because of it.