News · New this week
Server-side ad insertion: how Hotstar shows different ads
Hotstar doesn't pause the match for an ad. It stitches the ad into your own playlist, and that's why your friend sees different ads.
Most people think Hotstar pauses the match to play an ad. It doesn't. The ad is stitched into the stream before it reaches you, which is why your friend can watch the same over and see different ads.
This pattern is called server-side ad insertion. Three pieces do the work: an encoder, a stitcher and a CDN.
The encoder cuts the match into chunks
The encoder takes the live match and chops it into chunks. A chunk is a tiny two-second clip of video, and the player plays them back to back.
The encoder also flags the end of each over. That flag is the signal that it's ad time. Nothing about a specific viewer is decided here. It just marks where a break can go.
The stitcher writes your playlist
Next comes the ad stitcher. Think of it as a live editor that writes each viewer's playlist. The playlist is a to-do list for the player: match, ad, match.
When the over flag shows up, the stitcher slots an ad into that viewer's list. Your list and your friend's list point at the same match chunks. They only differ in which ad sits in the gap.
That's the whole trick behind different ads mid-match. The player never switches to a separate ad system. It just follows the list it was given, and the ad is part of the stream.
The CDN keeps ads from exploding
There's an obvious problem. Ten million viewers could mean ten million ad videos, one per person.
The CDN avoids that. A CDN is a set of nearby servers keeping copies of videos so they load fast. The reel compares it to a Swiggy dark store, stocked close to you instead of fetched from far away. Each ad is saved once, and everyone who needs it shares that copy.
So the only personal thing is the playlist. The ad videos are shared. The Hotstar app plays one stream, and millions of playlists decide what goes into it.
What to take from it
If you're designing a live stream, notice where the personalization lives. It sits in a small list of pointers, not in the video itself. That keeps the heavy files cacheable and the per-viewer part cheap.
Next time you watch a match, remember the flow: encoder flags the over, stitcher writes your playlist, CDN serves the shared ad. Then ask yourself the reel's question. Would you insert ads on the server or in the app?



