# If you’ve ever watched a video on YouTube or Instagram, you’ve noticed:
- The video starts fast
- It doesn’t download fully
- It keeps playing even when network fluctuates
- Quality automatically changes
## The Core Idea
> Streaming platforms don’t send you the whole video — they send it in small chunks and adapt those chunks to your internet speed in real time.
## The Old Way (Why Buffering Was Bad)
## The Modern Way: Segmented Streaming
video.mp4
One giant 500MB file.
Segments (.ts)
## What Is HLS?
HLS (HTTP Live Streaming) is a protocol created by Apple. It works like this:
- Video is chopped into small segments.
- A playlist (.m3u8) tells the player what segments exist.
- The player downloads segments one by one.
## Adaptive Bitrate (ABR) in Action
See how the player reacts to your internet speed:
Connection: Excellent (Fiber/5G)
Player detects high bandwidth.
Requesting: segment_001_1080p.ts
Quality: High (1080p/4K)
Result: Crystal clear video
## The Playlist (.m3u8)
#EXTM3U #EXT-X-STREAM-INF:BANDWIDTH=800000 low/index.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2000000 mid/index.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5000000 high/index.m3u8
Use a text editor to open any .m3u8 file and you'll see this.
## The Loop
1. Load Playlist
2. Check Internet Speed
3. Download NEXT Small Segment
4. Play
## HLS vs DASH
| Feature | HLS | DASH |
|---|---|---|
| Created By | Apple | MPEG |
| Segmented? | Yes | Yes |
| Used By | YouTube, Insta, OTTs | YouTube, Netflix |
Both rely on the same core idea: segments + adaptive loading.
## Final Takeaway
Modern streaming works because it is Resilient.
> Without this, YouTube & Netflix would crash.
> Want to build your own video player?
$ Check back later for a tutorial!