Subtitles
Upload, normalize, serve, and render WebVTT subtitle tracks.
Upload and normalize captions
Authenticated owners upload SRT or WebVTT with a language, optional label, and default flag. SRT timestamps are converted to WebVTT, cue content is normalized, and one record per language is replaced atomically.
curl -X POST https://play.earnloop.online/api/v1/videos/VIDEO_ID/subtitles \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "subtitle=@captions.srt" \
-F "language=en" \
-F "label=English" \
-F "is_default=1"
Serve and render
Normalized tracks are served from /subtitles/{id}/{lang}.vtt with CORS, cache headers, ETags, conditional requests, and a strict language route pattern. Player pages serialize reduced track metadata into the caption renderer.
- • New defaults clear the prior default in the same video.
- • Replacing a language removes its stale cached file.
- • Deleting a video cleans up every subtitle file.
Local conversion tool
Use the SRT to WebVTT converter when you only need a private browser-side conversion and downloadable VTT file.