Create Subtitles
Ignite uses the WebVTT format for all subtitles. The WebVTT format is used by YouTube, Vimeo, and many more and is widely supported by all browsers and players. You can find out more about the WebVTT format here (opens in a new tab).
Create subtitles object
Creating subtitles is done by sending a PUT
request to the /videos/:videoId/subtitles
endpoint with either an attached VTT file or by passing the VTT content as a string.
Option 1: Provide VTT content as string
curl -X PUT https://app.ignitevideo.cloud/api/videos/[VIDEO_ID]/subtitles \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"language": "en", "content": "[VTT_CONTENT]"}'
Option 2: Provide VTT file
Content-Type has to be multipart/form-data
and not application/json
. The file and language have to be sent as part of the form data.
curl -X PUT https://app.ignitevideo.cloud/api/videos/[VIDEO_ID]/subtitles \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "language=en" \
-F "file=@[PATH_TO_VTT_FILE]"
Response
Full updated Video object including the new subtitles. The subtitles response will provide the URL to the VTT file as well as the VTT content as a string.
{
"videoId": "[VIDEO_ID]",
"title": "Your video title",
"slug": "your-video-slug",
...
"subtitles": [
{
"id": string,
"language": "en" | "de" | "it" | "fr" | "...",
"filename": string,
"url": string,
"content": string
},
...
]
}