Generate Captions With AntCDN
Caption Playback
Once captions exist for a video, you can either:
- Let the iframe player handle caption UI automatically, or
- Wire captions into your own player (Video.js, Shaka, hls.js, etc).
Iframe Player
If you embed https://player.antcdn.net/v1/{edgeKey}/master.m3u8, the player can surface available caption tracks automatically.
Custom Players
- List available captions:
/videos/{assetId}/captions
- Get a URL for a specific language:
/videos/{assetId}/captions/{lang}
- Add the returned
urlas a text track in your player.
Tip
For private videos, caption URLs require authorization just like playlists/segments. If you’re using jwt=... playback, keep the same token on caption requests as well.