-3

I have stream with WebM. My stream have 3 clusters - video, audio, subtitles (build in). How can i embed subtitles in HTML without <track>

Media players (like VLC) pretty well using subtitle cluster but on web in HTML it not working (remind, i dont want extract subtitle track, i want use WebM cluster)

J. Doe
  • 2,651
  • 1
  • 13
  • 31

1 Answers1

2

Short answer: We can't (at the moment, but it's in the draft for 5.2, ref. comment).

The video element will only decode video and audio streams. It only support <track> for subtitles which forces you to extract the subtitle as a separate file (vtt), or use a manual approach pegging onto currentTime which open up for the more common srt files, or json etc.

Another option is to burn-in the subtitles to a separate video file and allow the user to toggle between those. You may have to use Media Source Extensions to properly sync the two.

And although it's theoretically possible to manually parse the file dynamically and on the fly, there are numerous of challenges you need to take into account such as buffering, syncing, overhead on bandwidth, performance overhead and so forth. In the end, not worth it IMO.

  • 1
    I readed a lot about that and we can't cuz webbrowser don't support in-band track (what is included in HTML 5.2 - https://w3c.github.io/html/semantics-embedded-content.html#sourcing-inband-text-tracks) – J. Doe Dec 07 '16 at 12:55