We built the player five times

Last time, the story ended on a rule: the server may never understand the bytes it relays. Clean on a whiteboard, brutal in practice — it means a whole television decode pipeline has to run inside a browser tab. Once the server stops knowing what’s in the stream, the player has to. So we built the player. Then we built it again.

V1 worked on the demo channel and stopped on the second one. V2’s state machine lived in two files that disagreed. V3 was the clean shape — until the browser flatly refused a class of streams, and the only fix was a command-line flag we would never ask you to type. V4 shipped full of features and then silent-failed on live broadcasts: a hundred frames went into the decoder and nothing came out. V5 was a software decoder we’d kept as insurance; we turned it on by default one afternoon and off again the same evening — the same person signed both commits.

VX was the rewrite that stuck, and the release that shipped it deleted every retired engine in one squashed merge. It had exactly one rule, and we still build to it:

The browser’s decoder → Our own decoder.

If the browser can’t decode the bytes, our own decoder takes them in the tab, the tier we added so the picture is never quietly allowed to fail. For video that is MPEG-2 and HEVC today; a codec neither the browser nor our decoder can handle gets a card that says so. You never type a flag into your browser to make television work. That’s the whole point.

None of that was the hard part. The hard part was two bugs.

Next: two bugs that were the whole story →

twiga