2008-12-04
SRT Subtitles with HTML5 video
j^, the author of many cool open video related projects (including the Theora transcoder ffmpeg2theora) has written a jQuery based library to extract and show subtitles while a <video>
is being played.
The jquery.srt page has details and a demo. Embedding code looks like:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.srt.js"></script>
<video src="http://example.com/video.ogv" id="video" controls>
<div class="srt"
data-video="video"
data-srt="http://example.com/video.srt" />
SRT is a common subtitle format and with this solution you can easily add subtitles to your HTML 5 videos.