Skip to content

Convert .srt (application/x-subrip) into .vtt (text/vtt) for HTML using Javascript

License

Notifications You must be signed in to change notification settings

faizath/srt2vtt.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

srt2vtt.js

Convert .srt (application/x-subrip) into .vtt (text/vtt) for HTML using Javascript

Installation

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>

Usage

Convert srt string to webvtt string

srt2vtt.convert(SRT STRING);

Demo: https://faizath.github.io/srt2vtt.js/sample/convert

Create URL of webvtt file

srt2vtt.url(SRT STRING);

Demo: https://faizath.github.io/srt2vtt.js/sample/url

Automatically replace srt with webvtt URL*

srt2vtt.run();

*The srt file URL must be XMLHTTPREQUESTable

Contributing

  1. Fork it (https://github.com/faizath/srt2vtt.js/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new pull request

About

Convert .srt (application/x-subrip) into .vtt (text/vtt) for HTML using Javascript

Topics

Resources

License

Stars

Watchers

Forks