Skip to main content

Interactive Live Streaming

Interactive Live Streaming

Interactive Live Streaming (ILS) lets you ask your live audience a question and collect their answers. You can run polls, quizzes and Q&A on top of any AntCDN live stream.

The feature is opt in. A live stream only becomes interactive if you ask for it when you create the stream. Streams that do not opt in behave exactly as they do today.

Why the timing matters

Live viewers are never in the same place in the stream. Buffering, bitrate and distance from the edge leave them several seconds apart. Some viewers are close to the live edge. Others are half a minute behind it.

If you send a question to everyone at the same moment over a websocket, the viewers who are behind get a question about something they have not heard yet. They are being asked to answer a question that, from where they are sitting, has not been asked.

AntCDN puts the question inside the video. The question travels with the frames it belongs to, so each viewer sees it when their own playback reaches the moment you asked. A viewer thirty seconds behind sees the question thirty seconds after a viewer at the live edge, which is exactly right.

What travels where

Two channels do two different jobs.

ChannelCarriesWhy
The video itselfThe question: prompt, options, and whether written answers are allowedSo it arrives at the right moment, with no extra request, even if the socket is down
A websocketAnswers going up, tallies and viewer counts coming downSo results update while the question is open

Because the whole question rides in the media, your player has everything it needs to draw the question the instant playback reaches it. There is nothing to fetch at the one moment that has to feel instant.

The shape of a question

A question has a prompt and between two and six options. Two is the floor because one option is not a question. Six is the ceiling because a poll that a viewer has to scroll through during a live broadcast does not get answered.

You can also let viewers write an answer in their own words. Written answers are counted separately from the options and are never folded into them. A written answer is not a choice between the options, so adding it to any of them would misstate the result.

One question is open at a time. Asking a new question closes the previous one automatically, so there is never any doubt about which question a vote belongs to.

One answer per viewer

Each viewer answers a question once. Identity is a session id: an anonymous, stable string that identifies a playback session. It is not an account. Your viewers do not sign in.

The SDK generates a session id and stores it in the browser if you do not supply one. If you already have a playback session for secure video, pass that id instead so the two agree.

Scale

A live poll does not produce steady traffic. It produces a spike in the few seconds after the question appears, from everybody at once.

A room is therefore spread across many shards. Each shard holds a slice of the audience, counts their votes, and sends one summary per second to a coordinator that merges them. Load on the coordinator grows with the number of shards, not the number of viewers. Shards are added automatically as an audience grows, before the existing ones fill up.

One room carries more than 200,000 concurrent viewers.

After the broadcast

Every question is stored with the second of the broadcast at which it was asked. When someone watches the recording later, the questions appear at the same points, in the same order.

Answers given while watching a recording are recorded separately from the live result and are never merged into it. A broadcast is a record of a moment. A recording collects answers for as long as anyone watches it, and mixing the two would quietly rewrite what the live audience said.

See Recordings.

What it costs to run

Nothing extra to encode. Cues are added while your stream is packaged, so no rendition is encoded a second time.

Where to go next

Tip

New to ILS? Start with the Quickstart. It takes you from creating an interactive stream to seeing a question appear in a player.