Skip to main content

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

  1. List available captions:

/videos/{assetId}/captions

  1. Get a URL for a specific language:

/videos/{assetId}/captions/{lang}

  1. Add the returned url as 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.