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();
*The srt file URL must be XMLHTTPREQUESTable