LESSON 06 · Playback path

Deliver segments near the viewer

The API answers who may watch; the CDN serves media; the player manages buffer and quality.

SYSTEM VIEW

The video path

Diagram view
Link—
Buffer—
Playing—

Watch a player fetch segments from a nearby edge, then keep its buffer full as the connection slows.

  1. The Viewer’s watch page asks the Watch API for video 81. The API checks who may watch and returns metadata and a signed manifest URL, where the player finds its index of short segments. Media bytes take another path.

    Control path
    Watch API
    Media path
    CDN edge

    What changed

    • GET /watch/v81
    • Signed manifest URL
  2. The player asks the nearby CDN edge for its first segment, 720p 0:00. It’s a miss, so the edge fetches it from Video storage, the origin, keeps a copy for later viewers and passes it on. No video bytes pass through the Watch API.

    Edge
    miss, then cached
    Origin
    Video storage

    What changed

    • 720p 0:00 cached at the edge
    • Buffer holds 6 s
  3. A 6-second 720p segment at 3 Mbit/s is 18 megabits. On a 5 Mbit/s link it downloads in 3.6 seconds, less than the 6 seconds it plays, so each segment adds 2.4 seconds until the buffer holds 12.

    720p segment
    18 megabits
    At 5 Mbit/s
    3.6 s to download

    What changed

    • 2.4 s of buffer per segment
    • Buffer full at 12 s
  4. The link drops to 2 Mbit/s. The same 18-megabit segment now takes 9 seconds to download but plays for 6, so each one costs 3 seconds of buffer: 12, 9, 6, 3, then 0. Unless the player steps down, playback stalls.

    At 2 Mbit/s
    9 s per segment
    Each costs
    3 s of buffer
    12 s lasts
    4 segments

    What changed

    • Link drops to 2 Mbit/s
    • 3 s of buffer per segment
    • Buffer empty after 4 segments
  5. Replay from 12 seconds. Segment 0:24 at 720p leaves 9, so the player steps down to 480p at 1.5 Mbit/s: 9 megabits, 4.5 seconds at 2 Mbit/s. Each segment adds 1.5 seconds, back to 12. Stepping up too early risks rebuffering.

    480p segment
    9 megabits
    At 2 Mbit/s
    4.5 s, +1.5 s each

    What changed

    • 720p → 480p after 0:24
    • 1.5 s of buffer per segment
    • Buffer back to 12 s
  6. At a launch, 5,000 viewers ask one edge for a new video’s first segment, not yet cached. Request collapsing makes one origin fetch and shares the result with all of them. An extra cache layer, such as CloudFront Origin Shield, cuts origin load further.

    Requests
    5,000 at once
    Origin fetches
    1

    What changed

    • Launch crowd
    • Origin shield
    • 5,000 misses, 1 origin fetch
  7. The CDN edge checks the signed URL itself, with no Watch API call per segment. Edges hold copies; Video storage is the durable home, so takedowns may need a cache purge or short expiry. A low-traffic internal site may not need a CDN at all.

    Per segment
    no API call
    Takedown
    purge or short expiry

    What changed

    • Launch crowd and Origin shield leave
    • Edge checks the signature
    • Video storage keeps the copy

Space plays · ← → step · Home resets

THE IDEA

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.

DECISION POINT

A new video is requested in a distant region and the edge has no segments. What serves the first viewer?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Separate metadata authorization from bulk media delivery.
  • CDN, origin, and adaptive player behavior form one playback path.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 3
ApplyQUESTION 01

A new video launches, and thousands of viewers in one city ask the same edge for one uncached segment. What protects the origin?

Choose an answer. You’ll see the explanation once you get it right.

Next lesson

0 of 3 checkpoints answered correctly to complete this lesson.