How it works
The watch page fetches metadata and a manifest location from the API. The player requests the manifest, its index of short video segments, and those segments through a nearby edge server of a content delivery network (CDN). A hit returns from that edge; a miss fetches from origin, the source server backed by encoded object storage, then can populate the edge. Bulk video bytes should not repeatedly pass through the general API tier.
The player estimates bandwidth and buffer health, then chooses the next segment; hls.js and Shaka Player are open-source players that do this. Take a 6-second 720p segment at 3 Mbit/s: 18 megabits. On a 5 Mbit/s link it downloads in 3.6 seconds, so the buffer grows. At 2 Mbit/s it takes 9 seconds, losing 3 seconds of buffer per segment, and a 12-second buffer empties after four segments unless the player steps down. A conservative starting rendition may improve time to first frame; increasing quality too early risks rebuffering.
A launch can send thousands of viewers to one edge for the same uncached segment. Request collapsing lets the edge make one origin fetch and share the result, and an extra cache layer such as CloudFront Origin Shield further reduces origin load.
Private or licensed video still needs playback authorization and origin controls; signed URLs or cookies avoid an API call per segment. The CDN distributes media but is not its durable home; takedowns may require cache purge or short expiry. A low-traffic internal site may not need a CDN at all.
A new video is requested in a distant region and the edge has no segments. What serves the first viewer?
The edge fetches authorized manifest and segments from origin storage, forwards them, and may cache eligible assets for later viewers.
Use this as a guide for self review; written answers are not graded.Keep in mind
- Separate metadata authorization from bulk media delivery.
- CDN, origin, and adaptive player behavior form one playback path.