(Moderator note: This feature request was created on behalf of a customer)
It would be nice if the GraphQL responses for videos also included their available subtitle track URLs, maybe something like this example:
video: {
subtitles: [
{
locale: "en",
trackId: "abcde",
url: "https://stream.mux.com/xyzabc/text/abcde.vtt"
},
{
locale: "fr",
trackId: "fghijk",
url: "https://stream.mux.com/xyzabc/text/fghijk.vtt"
}
]
}
Currently, this information is only available in the UI when you open an individual asset:
It is partially in the CMA REST API too (https://www.datocms.com/docs/content-management-api/resources/upload-track), but that still requires some work because you have to manually:
- Get the video’s Mux Playback ID from your GraphQL response
- Separately fetch its subtitle track IDs from the CMA
- Concat everything into a Mux URL like:
https://stream.mux.com/${muxPlaybackId}/text/${subtitleTrackId}.vtt
It’s a multi-step procedure requiring different APIs and string manipulation. It’d be a lot easier if it were just in the GraphQL responses ![]()
Although the DatoCMS Video Player components handle subtitles automatically, being able to retrieve this information explicitly would help anyone not using that component, like in a regular HTML <video> tag or a third-party video player.
