videogular/videogular2

[Question] videogular to show subtitles embedded in a mp4 file?

kumail-raza opened this issue · 2 comments

Is there a way or support for showing the embedded subtitles in a mp4 file, with videogular?

Embedded subtitles are not supported by HTML5 video at the moment.

You have basically two options:

  1. Extract the subtitles into VTT (recommended)

Then you just add each language as a normal html5 video track element.

<video width="640" height="480" controls>
  <source src="video.mp4" type="video/mp4" />
  <source src="video.webm" type="video/webm" />
  <track src="subtitles.vtt" kind="subtitles" srclang="en" label="English" />
</video>
  1. Use an in browser mp4 utility like mp4box.js to extract the embedded subtitles on the fly and dynamically add them.

https://gpac.github.io/mp4box.js/#extraction