Search code examples
htmlvideohtml5-videosubtitlewebvtt

Is it possible for HTML5 video to play subtitles embedded in mp4 file as a track?


I imported Webvtt file into mp4 file as a track, following the instruction Subtitling with GPAC

,and I checked that subtitles are properly shown when I using GPAC's Osmo4 player.

Now, I'd like to play this video with subtitle through HTML5 video tag, but it seems that HTML media track element is requiring src attribute that designate location of the webvtt file.

Is there any way to play embedded subtitle?


Solution

  • It is now possible with MP4Box.js to extract on-the-fly the subtitles from the MP4 and to play them in the browser. You should check this demo in particular the Audio/Video/WebVTT example.