Skip to content

A pure Javascript based SubRip to WebVtt convertor

Notifications You must be signed in to change notification settings

pascaladriaansen/srt2vtt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

This is a javascript based SubRip to WebVtt convertor.

I share this as MIT license. Everyone is welcomed to share and improve it.

A simple demo is at: http://www.newstudytimes.com/cinema.html . Drag a *.srt file then you will have a *.vtt file downloadable.

This small tool is based on javascript File API. I check it with if(window.File && window.FileList && window.FileReader)

How to use: simply put srt2vtt.js to head place, e.g. &ltscript src="srt2vtt.js"&gt&lt/script&gt. then call srt2vtt.init with an DIV id which you want to place the srt2vtt convertor in. e.g.:

<div id="srt_to_vtt"></div> <script>srt2vtt.init("srt_to_vtt")</script>

That's it. after you select a SubRip file, you will get the Webvtt file. All in Javascript.

I also made a handy bash script to convert the SubRip file to WebVtt format. It shall be useful if someone have a batch of srt files need to be converted.

Hope this small tool can save your time, Enjoy!

About

A pure Javascript based SubRip to WebVtt convertor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published