Convert .srt (application/x-subrip) into .vtt (text/vtt) for HTML using Javascript
Download the srt2vtt.js or Use these CDN
<script src="https://cdn.jsdelivr.net/gh/faizath/srt2vtt.js@main/srt2vtt.js"></script>
or
<script src="https://faizath.github.io/srt2vtt.js/srt2vtt.js"></script>
srt2vtt.convert(SRT STRING);
Demo: https://faizath.github.io/srt2vtt.js/sample/convert
srt2vtt.url(SRT STRING);
Demo: https://faizath.github.io/srt2vtt.js/sample/url
srt2vtt.run();
- Demo (single video): https://faizath.github.io/srt2vtt.js/sample/autorun
- Demo (multiple videos): https://faizath.github.io/srt2vtt.js/sample/multiple-autorun
*The srt file URL must be XMLHTTPREQUESTable
- Fork it (https://github.com/faizath/srt2vtt.js/fork)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new pull request