4

My video and webvtt subtitles are not synced. Is there a JavaScript way to manage webvtt subtitle synchronization/delay/offset in html5 native player?

I found this lib (https://github.com/florinn/vtt-shift) but it rewrite the webvtt file on disk. I'd prefer a client side way to resync with the video.

<video>
    <source class="videosource" src="{{media}}?play=true" type="video/mp4"/>
    <track kind="subtitles" label="Default" src="{{subtitle}}" default>
</video>
fnkrm
  • 498
  • 3
  • 12
  • You can use the textTrack API or cueRegions but it's not worth the trouble. You should edit it using [Subtitle Edit](https://github.com/SubtitleEdit/subtitleedit/releases) If a simple VTT file is off, it's not 100% sure thing that you'll successfully resync it on the fly. A correctly formatted and synced VTT is 100% reliable – zer00ne Oct 15 '17 at 20:50

1 Answers1

5

Finally I made a lib to live change subtitles position, style and offset.

https://www.npmjs.com/package/vtt-live-edit

fnkrm
  • 498
  • 3
  • 12