Skip to main content

Hardcode subtitles/captions (.vtt/.ass/.ssa)



  • Bane

    Hi George, I think that there are 2 features in what you mentioned.

    1st - to have subtitles or captions hard coded into video. The Hard coded would be putting the subtitles into the video itself so regardless of what you do, the subtitles are there.

    This is interesting however as per above, there would be no way to turn off the subtitles once they are hardcoded into the video.

    2nd - to add support for .vtt .ass and .ssa subtitle formats. The good thing about this is that we actually do support the .vtt subtitles format. This format itself allows you to specify the styles within the subtitles.vtt file as global style and also per each segment of the subtitle (mark).

    I am going to confirm with my colleague if there are any points from vtt file that might not work, however since we have native support for the .vtt file it should work just fine as is.

    The way you would use the .vtt files with your player would look something like this:

    <div id="video_placeholder"></div>
    ziggeoApp.on("ready", function() {
            var player = new ZiggeoApi.V2.Player({             elementdocument.getElementById("video_placeholder"),             attrs: {                 width640,                 height480,                 theme"modern",                 themecolor"red",                 video"YOUR_TOKEN",
    tracktagsstyled: false,
    tracktags: [{
    "lang": "en",
    "kind": "subtitles",
    "label": "English",
    "src": "your.web/subtitle-en.vtt"
                }         });         player.activate();

    * Parameters can be found here:

    We set the tracktagsstyled to disable our own styling (turned on by default).

    tracktags on the other hand are used for the entire setup. You would set up the language with language label (label) and also with the ISO code (lang) for the language. The label can be anything you want, however the lang has to be 2 letter ISO representation for each language.

    Currently the kind is always the same (subtitle) and the most important part is the src. This is where you would add a link to your own vtt file.

    As soon as you do, things should work just like in the video you have mentioned :)

    Of course, we do not support .ass nor .ssa subtitle file formats.

    Hope this helps.

  • George

    Hard codes subs are "compulsory" for various social networks (and not only) where own embedded players will not display the subs.

    Point being - there are many many situations in which you don't want captions turned off :)

  • Bane

    Good point George, talking with my colleagues on this. I think we already did talk about it being one of the options however that we wanted to add it into the video editor. I might be wrong on this, so I am going to follow up with more details on this :)

    In terms of the subtitles, my colleague confirms the same as I mentioned earlier. The .vtt file can have its own styles and have the text placed as you mentioned (anywhere on the video) :)

    I do have an update about it and that is that the kind can be "subtitles" or it can be "chapters" so if you wanted to add chapters to your video that is how you could do it.

    * Chapters and subtitles are configured in the same way, it is just that the kind parameter is changed.

    Hope this helps :)


Please sign in to leave a comment.