htmlgoogle-chromevideo-streamingcaptionswebvtt

How to display HTML captions without a loaded video?


I want to display captions using the HTML5 Text Tracks API (WebVTT) using the native browser implementations -- without loading audio/video.

How can that be achieved ?


Solution

  • There is no way using the native implementation.

    However, the Firefox implementation of WebVTT, vtt.js, is publicly available.

    All you need to do is attach a timer while a video element is playing (or just to any custom event without a video) and apply vtt.js functions to the video / captions container.

    Since the Firefox VTT implementation is derived from it, this is the closest you can come to native without using the default way of attaching to a video.