fnkrm
fnkrm

Reputation: 498

How to add delay or offset to sync webvtt subtitles in html5 native video player?

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>

Upvotes: 4

Views: 3363

Answers (1)

fnkrm
fnkrm

Reputation: 498

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

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

Upvotes: 5

Related Questions