Configuring Players (Cost Control)
You usually control cost by controlling what qualities a viewer is allowed to play.
AntCDN gives you two layers:
- Per-request caps (URL query params on the HLS playlist URL)
- Per-audience defaults (Edge Keys)
Prefer Edge Keys for “tiered” audiences
If you have multiple audiences (free vs paid, internal vs external), create separate Edge Keys and configure quality defaults on each one. Then embed the Edge Key that matches the viewer’s tier.
- This is the safest option because it’s centralized and consistent.
- You can also prevent client-side overrides by enforcing caps on the Edge Key.
See: Asset ID vs Edge Key
Use query params for quick experiments
For HLS playback via the worker URL:
https://worker.antcdn.net/v1/{edgeKey}/master.m3u8
You can add:
| Query param | Allowed values |
|---|---|
min-quality | ld, sd, hd, 4k |
max-quality | ld, sd, hd, 4k |
start-quality | ld, sd, hd, 4k |
Examples:
- Cap to 480p (LD):
https://worker.antcdn.net/v1/{edgeKey}/master.m3u8?max-quality=ld
- Only allow 1080p+ (HD/4K):
https://worker.antcdn.net/v1/{edgeKey}/master.m3u8?min-quality=hd
- Start at 1080p, allow fallback to 720p:
https://worker.antcdn.net/v1/{edgeKey}/master.m3u8?min-quality=sd&max-quality=hd&start-quality=hd
If the video is private, keep the same JWT:
https://worker.antcdn.net/v1/{edgeKey}/master.m3u8?jwt={jwt}&max-quality=sd
Where this applies
- Custom players (hls.js / Shaka / Video.js / Mux Player): use the worker playlist URL directly.
- Iframe embed: use the AntCDN iframe URL (and configure tiering via the Edge Key you embed).