For a video you host yourself, a WebVTT file keeps captions separate from the picture and lets people turn them on in the player. Save the file in UTF-8 and start with the line WEBVTT followed by a blank line. A cue can start with 00:00:03.000 --> 00:00:05.500 and put its text on the next line. Use a blank line between cues.
Connect the English track
<video controls src="demo.mp4">
<track kind="captions" src="demo.en.vtt"
srclang="en" label="English">
</video>The relative paths in this example assume both files are in the same folder as the HTML page. If the captions live in a media folder, set the track path from the page, such as /media/demo.en.vtt. The label is what people can recognize in the player’s track menu. Include relevant sound cues, such as [timer rings], when they explain an action or influence the next line of dialogue.
Open the deployed page, turn on English captions, and seek to the first and last cues. If the menu is missing or blank, check that the caption URL loads and that your server serves it as text/vtt. Serve the track from the page’s origin for the setup above. For a track hosted on another origin, add crossorigin="anonymous" to the video element and configure the media and caption servers to allow cross-origin requests from the page. Check the browser’s network panel if the caption file opens by itself but the player still cannot load it. Watch one pass with muted audio to check whether the captions still convey what happens.
Try a three-cue file before timing the whole video
Start with a spoken introduction, one sound-only cue and the closing line. Give each cue its own time range and confirm the decimal separator is a period. If playback shows the first cue and skips the second, inspect the blank lines around that cue and confirm its end time comes after its start. If none appear, open the caption file URL from the deployed site and check that it returns the file itself. A page saying “not found” or showing the site’s homepage points to a path or deployment problem.
