The TV is a web server now
Hedge is a daily calibration trivia game I build solo; the architecture lives in the case study. This one is the second in the Party series, about the day a friend with an Android phone got a way in.
Hedge is an iPhone app. It's also an iPad app, a Mac app, and as of this fall an Apple TV app, which is a lot of Apple and zero of anything else. For the daily game that's fine, it's a solo thing. Party is different. Party happens in a living room, and living rooms have Android phones in them.
The friend on the couch
My friend group is very iPhone. Not entirely though. I have one friend with an Android, and Party's whole pitch is "everyone grabs their phone and plays." Everyone except him, apparently. The best he could do was watch the TV and shout guesses at people, which honestly he'd probably enjoy, but it's not the game.
The obvious answer is an Android app, and someday maybe (I'd like that). But an Android app for one friend is a very expensive way to solve a living-room problem. The cheaper answer is the one Jackbox figured out years ago: if you have a browser, you can play.
Parked for three months
I actually decided this back in August, while Party was still being built. The plan was simple to say: the stage (the TV or Mac or iPad running the party) serves a little web page, a guest scans a QR code, and their browser becomes a controller. Then I parked it. Party had to launch first, and the Apple TV was the important piece. The web guest went on the list as the first thing after launch, with a deadline I picked on purpose: be ready for Thanksgiving.
It sat there for almost three months. Then on November 7th it got built in a day. The spec went in a little before three in the morning and the last of the build commits landed before lunch. That sounds like a brag but the best thing I can say about it is that there wasn't much left to build.
The hard part was already built
Here's why. When I designed how phones talk to the stage, I put all the toughness on the stage side. Phones are flaky. People lock their screens, take calls, walk into the kitchen, lose Wi-Fi for a second. So the stage keeps a heartbeat with every player, marks anyone who goes quiet as stepped away, auto-hedges their bet at 50% if the question ends without them, and seats them right back where they were when they reconnect. Every one of those cases got hammered on real game nights with my family.
A browser tab turns out to be just a very flaky phone. You can close it, refresh it, switch apps and come back, and none of that is new to the stage. The page remembers who you are, says hello when it comes back, and resends your bet if it isn't sure the stage got it. A page reload is just a rejoin, and Hedge already knew how to do rejoins. I was worried about all the ways a web page could fall apart mid-game. The answer was that the stage didn't care how you fell apart, only that you came back.
A web server in the living room
The weird part is where the page comes from. There's no Hedge server anywhere, never has been, Party runs entirely on your own Wi-Fi. So the stage serves the page itself. The Apple TV is a web server now. It answers plain old HTTP on your local network, hands out one self-contained page, and then upgrades the connection to a WebSocket so the browser can talk to the game the same way the app does. As far as the game engine is concerned, a browser player is just another connection.
A couple of choices in there look wrong until you know why. The page uses plain http, not https, on purpose: a secure page isn't allowed to open an insecure connection to a local IP address, and there's no way to get a real certificate for "the TV in Jason's living room." And the page makes no requests to the internet at all (no fonts, no analytics, nothing) except one link at the very end. Everything it needs is baked into a single file that the TV hands over.
Browsers also can't do the local discovery the app uses to find a party, so the door is a QR code. On the stage's lobby screen, inside the little "Get Hedge" card, there's a quiet "No app? Play here" button. Tap it and a QR code pops up with the TV's own address in it. Scan, pick a name and an emoji, and you're seated.
Rules for a player who can't be host
Browser players are guests, not hosts. Hosting is where all the room controls live (advance the reveal, pick the pack, dismiss someone), and I wanted those in the app only. That rule created a fun problem: what happens when the room is ALL browsers? Or when the host's phone dies mid-game and only browser players are left?
The room can't sit there waiting for a host who can't exist. So if nobody in the room has the app, the game quietly runs itself on auto pace. If the host disappears and only browser players are still connected, the stage waits a full minute (maybe they're just refilling a drink), then takes over and runs things itself until an app player comes back. Nobody at the party has to be left holding a drink and watching.
The other thing that changes when anyone with a browser can join is the guest list. There's no cap. Twelve people can scan the code, and every screen that shows players just folds the extras into "+4 more" so the TV stays readable from the couch.
The real test is Thanksgiving
That night we played a full game with the Apple TV as the stage and the web page on a phone, and it worked great. I don't own an Android phone, so the real test is still ahead. My one Android friend gets to be the first person to play Hedge on a phone Apple didn't make, and I'll find out at the same moment he does whether the page holds up.
At the end of the game, browser players see their results and one link out: if you're on an iPhone, here's the app (with your photo, the daily round, all of it). If you're on Android, a line saying it's coming, someday. No signup, no email capture. Just the game, for everybody in the room.